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

git-svn-id: https://develop.svn.wordpress.org/trunk@21553 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-08-20 17:25:06 +00:00
parent 56dd6e86a3
commit 962a3ff664
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']);
}