mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Avoid a PHP notice in wp_enqueue_media() if $post is null.
see #19257. git-svn-id: https://develop.svn.wordpress.org/trunk@32675 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3008,7 +3008,11 @@ function wp_enqueue_media( $args = array() ) {
|
||||
|
||||
$hier = $post && is_post_type_hierarchical( $post->post_type );
|
||||
|
||||
$post_type_object = get_post_type_object( $post->post_type );
|
||||
if ( $post ) {
|
||||
$post_type_object = get_post_type_object( $post->post_type );
|
||||
} else {
|
||||
$post_type_object = get_post_type_object( 'post' );
|
||||
}
|
||||
|
||||
$strings = array(
|
||||
// Generic
|
||||
|
||||
Reference in New Issue
Block a user