Make WordPress Core


Ignore:
Timestamp:
02/13/2015 04:26:37 PM (10 years ago)
Author:
johnbillion
Message:

Return a WP_Error if an empty name is provided when registering a taxonomy.

Fixes #31135
Props tyxla, MikeHansenMe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r31418 r31449  
    346346    $args = wp_parse_args( $args, $defaults );
    347347
    348     if ( strlen( $taxonomy ) > 32 ) {
    349         _doing_it_wrong( __FUNCTION__, __( 'Taxonomies cannot exceed 32 characters in length' ), '4.0' );
    350         return new WP_Error( 'taxonomy_too_long', __( 'Taxonomies cannot exceed 32 characters in length' ) );
     348    if ( empty( $taxonomy ) || strlen( $taxonomy ) > 32 ) {
     349        _doing_it_wrong( __FUNCTION__, __( 'Taxonomy names must be between 1 and 32 characters in length.' ), '4.2' );
     350        return new WP_Error( 'taxonomy_length_invalid', __( 'Taxonomy names must be between 1 and 32 characters in length.' ) );
    351351    }
    352352
Note: See TracChangeset for help on using the changeset viewer.