Ticket #31135: 31135.3.patch
File 31135.3.patch, 1.4 KB (added by , 10 years ago) |
---|
-
src/wp-includes/taxonomy.php
341 341 ); 342 342 $args = wp_parse_args( $args, $defaults ); 343 343 344 if ( strlen( $taxonomy ) > 32 ) { 345 _doing_it_wrong( __FUNCTION__, __( 'Taxonomies cannot exceed 32 characters in length' ), '4.0' ); 346 return new WP_Error( 'taxonomy_too_long', __( 'Taxonomies cannot exceed 32 characters in length' ) ); 344 $taxonomy_length = strlen( $taxonomy ); 345 if ( $taxonomy_length < 1 || $taxonomy_length > 32 ) { 346 _doing_it_wrong( __FUNCTION__, __( 'Taxonomies must be between 1 and 32 characters in length.' ), '4.2' ); 347 return new WP_Error( 'taxonomy_length_invalid', __( 'Taxonomies must be between 1 and 32 characters in length.' ) ); 347 348 } 348 349 349 350 if ( false !== $args['query_var'] && ! empty( $wp ) ) { -
tests/phpunit/tests/taxonomy.php
154 154 } 155 155 156 156 /** 157 * @ticket 31135 158 * 159 * @expectedIncorrectUsage register_taxonomy 160 */ 161 function test_register_short_taxonomy() { 162 $this->assertInstanceOf( 'WP_Error', register_taxonomy( '', 'post', array() ) ); 163 } 164 165 /** 157 166 * @ticket 21593 158 167 * 159 168 * @expectedIncorrectUsage register_taxonomy