Make WordPress Core

Changeset 35501


Ignore:
Timestamp:
11/04/2015 07:28:36 AM (9 years ago)
Author:
westonruter
Message:

Customize: Simplify condition for returning nav_menus_invalid_post_type error.

Props swissspidy.
See #16075.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r35500 r35501  
    108108
    109109        if ( 'post_type' === $type ) {
    110             if ( ! get_post_type_object( $object ) ) {
     110            $post_type = get_post_type_object( $object );
     111            if ( ! $post_type ) {
    111112                return new WP_Error( 'nav_menus_invalid_post_type' );
    112             } else {
    113                 $post_type = get_post_type_object( $object );
    114113            }
    115114
Note: See TracChangeset for help on using the changeset viewer.