mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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:
parent
9eeccc2230
commit
9dbb6a34f6
@ -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…
x
Reference in New Issue
Block a user