Make WordPress Core

Changeset 29724


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

Avoid PHP notices in media modal caused by orphaned attachments.

fixes #29566 for trunk.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r29723 r29724  
    395395                    <span class="value">{{ data.authorName }}</span>
    396396                </label>
    397                 <# if ( data.uploadedTo ) { #>
     397                <# if ( data.uploadedToTitle ) { #>
    398398                    <label class="setting">
    399399                        <span class="name"><?php _e( 'Uploaded To' ); ?></span>
  • 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.