WordPress.org

Make WordPress Core

Ticket #13957: 13957.diff

File 13957.diff, 1.1 KB (added by nacin, 5 years ago)
  • wp-includes/taxonomy.php

     
    281281                $wp->add_query_var($args['query_var']); 
    282282        } 
    283283 
    284         if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) { 
     284        if ( !empty( $wp_rewrite ) && false !== $args['rewrite'] && '' != get_option('permalink_structure') ) { 
    285285                $args['rewrite'] = wp_parse_args($args['rewrite'], array( 
    286286                        'slug' => sanitize_title_with_dashes($taxonomy), 
    287287                        'with_front' => true, 
  • wp-includes/post.php

     
    859859                $wp->add_query_var($args->query_var); 
    860860        } 
    861861 
    862         if ( false !== $args->rewrite && '' != get_option('permalink_structure') ) { 
     862        if ( !empty( $wp_rewrite ) && false !== $args->rewrite && '' != get_option('permalink_structure') ) { 
    863863                if ( !is_array($args->rewrite) ) 
    864864                        $args->rewrite = array(); 
    865865                if ( !isset($args->rewrite['slug']) )