Simplify sanitize_key() and use it in more places. see #14910

git-svn-id: https://develop.svn.wordpress.org/trunk@15635 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-09-20 15:28:58 +00:00
parent a6d9954621
commit df6d5550db
3 changed files with 4 additions and 8 deletions

View File

@@ -571,7 +571,7 @@ function register_post_status($post_status, $args = array()) {
$args = wp_parse_args($args, $defaults);
$args = (object) $args;
$post_status = sanitize_user($post_status, true);
$post_status = sanitize_key($post_status);
$args->name = $post_status;
if ( null === $args->public && null === $args->internal && null === $args->protected && null === $args->private )
@@ -819,7 +819,7 @@ function register_post_type($post_type, $args = array()) {
$args = wp_parse_args($args, $defaults);
$args = (object) $args;
$post_type = sanitize_user($post_type, true);
$post_type = sanitize_key($post_type);
$args->name = $post_type;
// If not set, default to the setting for public.