diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 921a5d97e4..861c625a56 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -309,6 +309,7 @@ function is_taxonomy_hierarchical($taxonomy) { * @param string $taxonomy Name of taxonomy object * @param array|string $object_type Name of the object type for the taxonomy object. * @param array|string $args See above description for the two keys values. + * @return null|WP_Error WP_Erorr if errors, otherwise null. */ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { global $wp_taxonomies, $wp; @@ -330,6 +331,9 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { ); $args = wp_parse_args($args, $defaults); + if ( strlen( $taxonomy ) > 32 ) + return new WP_Error( 'taxonomy_too_long', __( 'Taxonomies cannot exceed 32 characters in length' ) ); + if ( false !== $args['query_var'] && !empty($wp) ) { if ( true === $args['query_var'] ) $args['query_var'] = $taxonomy;