Make WordPress Core

Changeset 32675


Ignore:
Timestamp:
05/31/2015 09:53:35 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Avoid a PHP notice in wp_enqueue_media() if $post is null.

see #19257.

File:
1 edited

Legend:

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

    r32674 r32675  
    30093009    $hier = $post && is_post_type_hierarchical( $post->post_type );
    30103010
    3011     $post_type_object = get_post_type_object( $post->post_type );
     3011    if ( $post ) {
     3012        $post_type_object = get_post_type_object( $post->post_type );
     3013    } else {
     3014        $post_type_object = get_post_type_object( 'post' );
     3015    }
    30123016
    30133017    $strings = array(
Note: See TracChangeset for help on using the changeset viewer.