WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/04/2015 04:29:39 AM (5 years ago)
Author:
westonruter
Message:

Customize: Add support for post_type_archive nav menu items.

Props celloexpressions, westonruter.
Fixes #16075.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php

    r35385 r35500  
    325325        }
    326326
     327        if ( ! isset( $this->value['title'] ) ) {
     328            $this->value['title'] = '';
     329        }
     330
    327331        if ( ! isset( $this->value['_invalid'] ) ) {
    328             $this->value['_invalid'] = (
    329                 ( 'post_type' === $this->value['type'] && ! post_type_exists( $this->value['object'] ) )
     332            $this->value['_invalid'] = false;
     333            $is_known_invalid = (
     334                ( ( 'post_type' === $this->value['type'] || 'post_type_archive' === $this->value['type'] ) && ! post_type_exists( $this->value['object'] ) )
    330335                ||
    331336                ( 'taxonomy' === $this->value['type'] && ! taxonomy_exists( $this->value['object'] ) )
    332337            );
     338            if ( $is_known_invalid ) {
     339                $this->value['_invalid'] = true;
     340            }
    333341        }
    334342
Note: See TracChangeset for help on using the changeset viewer.