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:
parent
56dd6e86a3
commit
962a3ff664
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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']);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user