mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 18:13:00 +01:00
Reassign links to default cat when deleting link cats via ajax. fixes #9869
git-svn-id: https://develop.svn.wordpress.org/trunk@11401 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
506192e771
commit
cdcfa08686
@ -242,8 +242,10 @@ case 'delete-link-cat' :
|
||||
|
||||
$cat_name = get_term_field('name', $id, 'link_category');
|
||||
|
||||
$default = get_option('default_link_category');
|
||||
|
||||
// Don't delete the default cats.
|
||||
if ( $id == get_option('default_link_category') ) {
|
||||
if ( $id == $default ) {
|
||||
$x = new WP_AJAX_Response( array(
|
||||
'what' => 'link-cat',
|
||||
'id' => $id,
|
||||
@ -252,7 +254,7 @@ case 'delete-link-cat' :
|
||||
$x->send();
|
||||
}
|
||||
|
||||
$r = wp_delete_term($id, 'link_category');
|
||||
$r = wp_delete_term($id, 'link_category', array('default' => $default));
|
||||
if ( !$r )
|
||||
die('0');
|
||||
if ( is_wp_error($r) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user