WordPress.org

Make WordPress Core

Changeset 30259


Ignore:
Timestamp:
11/06/2014 08:15:51 AM (6 years ago)
Author:
nacin
Message:

Avoid PHP notices in media modal caused by orphaned attachments.

Merges [29724] to the 4.0 branch.

props SergeyBiryukov.
fixes #29566.

Location:
branches/4.0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

  • branches/4.0/src/wp-includes/media-template.php

    r29704 r30259  
    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>
  • branches/4.0/src/wp-includes/media.php

    r29678 r30259  
    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.