Ticket #10543: wp-includes-taxonomy.php.2.patch
File wp-includes-taxonomy.php.2.patch, 1.2 KB (added by , 15 years ago) |
---|
-
wp-includes/taxonomy.php
1001 1001 else 1002 1002 $value = esc_attr($value); 1003 1003 } else if ( 'db' == $context ) { 1004 $value = wp_check_invalid_utf8($value, TRUE); 1004 1005 $value = apply_filters("pre_term_$field", $value, $taxonomy); 1005 1006 $value = apply_filters("pre_${taxonomy}_$field", $value); 1006 1007 // Back compat filters … … 1361 1362 if ( is_int($term) && 0 == $term ) 1362 1363 return new WP_Error('invalid_term_id', __('Invalid term ID')); 1363 1364 1364 if ( '' == trim($term) )1365 return new WP_Error('empty_term_name', __('A name is required for this term'));1366 1367 1365 $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); 1368 1366 $args = wp_parse_args($args, $defaults); 1369 1367 $args['name'] = $term; … … 1375 1373 $name = stripslashes($name); 1376 1374 $description = stripslashes($description); 1377 1375 1376 if ( '' == trim($name) ) 1377 return new WP_Error('empty_term_name', __('A name is required for this term')); 1378 1378 1379 if ( empty($slug) ) 1379 1380 $slug = sanitize_title($name); 1380 1381