Reduce calls to sanitize_title_with_dashes in register_(post_type|taxonomy). Props ocean90. fixes #21600

git-svn-id: http://core.svn.wordpress.org/trunk@21553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-08-20 17:25:06 +00:00
parent 9eeccc2230
commit 9dbb6a34f6
2 changed files with 4 additions and 2 deletions

View File

@ -1042,7 +1042,8 @@ function register_post_type( $post_type, $args = array() ) {
if ( false !== $args->query_var && !empty($wp) ) {
if ( true === $args->query_var )
$args->query_var = $post_type;
$args->query_var = sanitize_title_with_dashes($args->query_var);
else
$args->query_var = sanitize_title_with_dashes($args->query_var);
$wp->add_query_var($args->query_var);
}

View File

@ -331,7 +331,8 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
if ( false !== $args['query_var'] && !empty($wp) ) {
if ( true === $args['query_var'] )
$args['query_var'] = $taxonomy;
$args['query_var'] = sanitize_title_with_dashes($args['query_var']);
else
$args['query_var'] = sanitize_title_with_dashes($args['query_var']);
$wp->add_query_var($args['query_var']);
}