WordPress.org

Make WordPress Core

Ticket #18263: tax-doin-wrong-2.patch

File tax-doin-wrong-2.patch, 753 bytes (added by WraithKenny, 3 years ago)
  • wp-includes/taxonomy.php

     
    311311                                        ); 
    312312        $args = wp_parse_args($args, $defaults); 
    313313 
     314        if ( false === $args['_builtin'] && ! empty( $wp ) ) { 
     315                global $reserved; 
     316                if ( empty( $reserved ) ) 
     317                        $reserved = array_merge( $wp->public_query_vars, $wp->private_query_vars ); 
     318                if ( in_array( $taxonomy, $reserved ) ) 
     319                        _doing_it_wrong( __FUNCTION__, __( 'You should not use a reserved term when registering a taxonomy.' ), '3.3' ); 
     320        } 
     321         
    314322        if ( false !== $args['query_var'] && !empty($wp) ) { 
    315323                if ( true === $args['query_var'] ) 
    316324                        $args['query_var'] = $taxonomy;