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
This commit is contained in:
John Blackbourn
2026-03-10 12:37:40 +00:00
parent 0f3e3dbd75
commit b2f104f406
2 changed files with 2 additions and 2 deletions

View File

@@ -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' );
}

View File

@@ -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.