Make WordPress Core


Ignore:
Timestamp:
09/09/2014 10:02:36 AM (11 years ago)
Author:
SergeyBiryukov
Message:

Avoid PHP notices in media modal caused by orphaned attachments.

fixes #29566 for trunk.

File:
1 edited

Legend:

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

    r29678 r29724  
    26442644    if ( $attachment->post_parent ) {
    26452645        $post_parent = get_post( $attachment->post_parent );
     2646    } else {
     2647        $post_parent = false;
     2648    }
     2649
     2650    if ( $post_parent ) {
    26462651        $parent_type = get_post_type_object( $post_parent->post_type );
    26472652        if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $attachment->post_parent ) ) {
Note: See TracChangeset for help on using the changeset viewer.