git-svn-id: https://develop.svn.wordpress.org/trunk@5659 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
09c96b4292
commit
4feb85438d
@ -80,7 +80,7 @@ function wp_insert_category($catarr) {
|
|||||||
$name = apply_filters('pre_category_name', $name);
|
$name = apply_filters('pre_category_name', $name);
|
||||||
|
|
||||||
if ( empty ($slug) )
|
if ( empty ($slug) )
|
||||||
$slug = sanitize_title($slug);
|
$slug = sanitize_title($name);
|
||||||
else
|
else
|
||||||
$slug = sanitize_title($slug);
|
$slug = sanitize_title($slug);
|
||||||
$slug = apply_filters('pre_category_nicename', $slug);
|
$slug = apply_filters('pre_category_nicename', $slug);
|
||||||
@ -93,7 +93,7 @@ function wp_insert_category($catarr) {
|
|||||||
if ( empty($parent) || !get_category( $parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $parent) ) )
|
if ( empty($parent) || !get_category( $parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $parent) ) )
|
||||||
$parent = 0;
|
$parent = 0;
|
||||||
|
|
||||||
$args = compact('slug', 'parent', 'description');
|
$args = compact('name', 'slug', 'parent', 'description');
|
||||||
|
|
||||||
if ( $update )
|
if ( $update )
|
||||||
$cat_ID = wp_update_term($cat_ID, 'category', $args);
|
$cat_ID = wp_update_term($cat_ID, 'category', $args);
|
||||||
|
Loading…
Reference in New Issue
Block a user