Code Duplication    Length = 4-4 lines in 2 locations

wp-includes/post.php 1 location

@@ 1026-1029 (lines=4) @@
1023
	// Sanitize post type name
1024
	$post_type = sanitize_key( $post_type );
1025
1026
	if ( empty( $post_type ) || strlen( $post_type ) > 20 ) {
1027
		_doing_it_wrong( __FUNCTION__, __( 'Post type names must be between 1 and 20 characters in length.' ), '4.2.0' );
1028
		return new WP_Error( 'post_type_length_invalid', __( 'Post type names must be between 1 and 20 characters in length.' ) );
1029
	}
1030
1031
	$post_type_object = new WP_Post_Type( $post_type, $args );
1032
	$post_type_object->add_supports();

wp-includes/taxonomy.php 1 location

@@ 391-394 (lines=4) @@
388
	);
389
	$args = array_merge( $defaults, $args );
390
391
	if ( empty( $taxonomy ) || strlen( $taxonomy ) > 32 ) {
392
		_doing_it_wrong( __FUNCTION__, __( 'Taxonomy names must be between 1 and 32 characters in length.' ), '4.2.0' );
393
		return new WP_Error( 'taxonomy_length_invalid', __( 'Taxonomy names must be between 1 and 32 characters in length.' ) );
394
	}
395
396
	// If not set, default to the setting for public.
397
	if ( null === $args['publicly_queryable'] ) {