close

Make WordPress Core

Changeset 61884


Ignore:
Timestamp:
03/10/2026 12:36:43 PM (3 days ago)
Author:
johnbillion
Message:

Media: Ensure the attachment parent is accessible to the user before showing a link to it in the media manager.

Props johnbillion, peterwilsoncc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r61844 r61884  
    45694569    if ( $attachment->post_parent ) {
    45704570        $post_parent = get_post( $attachment->post_parent );
    4571         if ( $post_parent ) {
     4571        if ( $post_parent && current_user_can( 'read_post', $attachment->post_parent ) ) {
    45724572            $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' );
    45734573            $response['uploadedToLink']  = get_edit_post_link( $attachment->post_parent, 'raw' );
Note: See TracChangeset for help on using the changeset viewer.