Make WordPress Core

Ticket #36188: 36188.3.diff

File 36188.3.diff, 2.0 KB (added by dlh, 8 years ago)
  • src/wp-includes/class-wp-post-type.php

     
    470470                        }
    471471                }
    472472
    473                 if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
     473                if ( false !== $args['rewrite'] && ( is_admin() || wp_installing() || '' != get_option( 'permalink_structure' ) ) ) {
    474474                        if ( ! is_array( $args['rewrite'] ) ) {
    475475                                $args['rewrite'] = array();
    476476                        }
     
    535535                        $wp->add_query_var( $this->query_var );
    536536                }
    537537
    538                 if ( false !== $this->rewrite && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
     538                if ( false !== $this->rewrite && ( is_admin() || wp_installing() || '' != get_option( 'permalink_structure' ) ) ) {
    539539                        if ( $this->hierarchical ) {
    540540                                add_rewrite_tag( "%$this->name%", '(.+?)', $this->query_var ? "{$this->query_var}=" : "post_type=$this->name&pagename=" );
    541541                        } else {
  • src/wp-includes/class-wp-taxonomy.php

     
    275275                        $args['query_var'] = false;
    276276                }
    277277
    278                 if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
     278                if ( false !== $args['rewrite'] && ( is_admin() || wp_installing() || '' != get_option( 'permalink_structure' ) ) ) {
    279279                        $args['rewrite'] = wp_parse_args( $args['rewrite'], array(
    280280                                'with_front'   => true,
    281281                                'hierarchical' => false,
     
    360360                        $wp->add_query_var( $this->query_var );
    361361                }
    362362
    363                 if ( false !== $this->rewrite && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
     363                if ( false !== $this->rewrite && ( is_admin() || wp_installing() || '' != get_option( 'permalink_structure' ) ) ) {
    364364                        if ( $this->hierarchical && $this->rewrite['hierarchical'] ) {
    365365                                $tag = '(.+?)';
    366366                        } else {