Make WordPress Core


Ignore:
Timestamp:
09/15/2015 06:53:12 PM (10 years ago)
Author:
wonderboymusic
Message:

In WP::parse_request(), don't add query vars of non-viewable post types to WP::public_query_vars. In register_post_type(), don't add query vars of non-viewable post types to WP::public_query_vars.
In _unregister_post_type() (unit tests), don't add query vars of non-viewable post types to WP::public_query_vars.

Adds unit test.

Fixes #30018.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/utils.php

    r33123 r34215  
    363363
    364364    foreach ( get_post_types( array() , 'objects' ) as $t ) {
    365         if ( ! empty( $t->query_var ) )
     365        if ( is_post_type_viewable( $t ) && ! empty( $t->query_var ) )
    366366            $GLOBALS['wp']->add_query_var( $t->query_var );
    367367    }
Note: See TracChangeset for help on using the changeset viewer.