diff --git a/wp-includes/post.php b/wp-includes/post.php index 4c2a32e77c..2bdd51ba1f 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1027,7 +1027,7 @@ function register_post_type($post_type, $args = array()) { $wp_rewrite->add_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' ); } - $wp_rewrite->add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'], $args->rewrite['ep_mask'] ); + $wp_rewrite->add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite ); } if ( $args->register_meta_box_cb ) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 7d2abad7b2..82f1114a6b 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1913,6 +1913,7 @@ class WP_Rewrite { 'walk_dirs' => true, 'endpoints' => true, ); + $args = array_intersect_key( $args, $defaults ); $args = wp_parse_args( $args, $defaults ); if ( $args['with_front'] ) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index f04892619b..5f377f6748 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -344,7 +344,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { $tag = '([^/]+)'; $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); - $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front'], $args['rewrite']['ep_mask'] ); + $wp_rewrite->add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite'] ); } if ( is_null($args['show_ui']) )