From b2f104f406486bf0b49f8b9296126544fd7fcd5e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 10 Mar 2026 12:37:40 +0000 Subject: [PATCH] Media: Ensure the attachment parent is accessible to the user before showing a link to it in the media manager. Props johnbillion, peterwilsoncc. Built from https://develop.svn.wordpress.org/trunk@61884 git-svn-id: http://core.svn.wordpress.org/trunk@61166 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index bfd2e58487..3464fbf632 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -4568,7 +4568,7 @@ function wp_prepare_attachment_for_js( $attachment ) { if ( $attachment->post_parent ) { $post_parent = get_post( $attachment->post_parent ); - if ( $post_parent ) { + if ( $post_parent && current_user_can( 'read_post', $attachment->post_parent ) ) { $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' ); $response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index bf0d22f0f2..e1af8259c0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '7.0-beta3-61883'; +$wp_version = '7.0-beta3-61884'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.