Customize: Simplify condition for returning `nav_menus_invalid_post_type` error.
Props swissspidy. See #16075. git-svn-id: https://develop.svn.wordpress.org/trunk@35501 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5084a0b28a
commit
46778fe2b0
|
@ -107,10 +107,9 @@ final class WP_Customize_Nav_Menus {
|
|||
$items = array();
|
||||
|
||||
if ( 'post_type' === $type ) {
|
||||
if ( ! get_post_type_object( $object ) ) {
|
||||
$post_type = get_post_type_object( $object );
|
||||
if ( ! $post_type ) {
|
||||
return new WP_Error( 'nav_menus_invalid_post_type' );
|
||||
} else {
|
||||
$post_type = get_post_type_object( $object );
|
||||
}
|
||||
|
||||
if ( 0 === $page && 'page' === $object ) {
|
||||
|
|
Loading…
Reference in New Issue