mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
More custom taxonomy support for edit-tags.php
git-svn-id: https://develop.svn.wordpress.org/trunk@10555 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+14
-4
@@ -212,11 +212,16 @@ case 'delete-tag' :
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
$tag = get_term( $id, 'post_tag' );
|
||||
if ( !empty($_POST['taxonomy']) )
|
||||
$taxonomy = $_POST['taxonomy'];
|
||||
else
|
||||
$taxonomy = 'post_tag';
|
||||
|
||||
$tag = get_term( $id, $taxonomy );
|
||||
if ( !$tag || is_wp_error( $tag ) )
|
||||
die('1');
|
||||
|
||||
if ( wp_delete_term($id, 'post_tag'))
|
||||
if ( wp_delete_term($id, $taxonomy))
|
||||
die('1');
|
||||
else
|
||||
die('0');
|
||||
@@ -511,7 +516,12 @@ case 'add-tag' : // From Manage->Tags
|
||||
$x->send();
|
||||
}
|
||||
|
||||
$tag = wp_insert_term($_POST['name'], 'post_tag', $_POST );
|
||||
if ( !empty($_POST['taxonomy']) )
|
||||
$taxonomy = $_POST['taxonomy'];
|
||||
else
|
||||
$taxonomy = 'post_tag';
|
||||
|
||||
$tag = wp_insert_term($_POST['name'], $taxonomy, $_POST );
|
||||
|
||||
if ( is_wp_error($tag) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
@@ -521,7 +531,7 @@ case 'add-tag' : // From Manage->Tags
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( !$tag || (!$tag = get_term( $tag['term_id'], 'post_tag' )) )
|
||||
if ( !$tag || (!$tag = get_term( $tag['term_id'], $taxonomy )) )
|
||||
die('0');
|
||||
|
||||
$tag_full_name = $tag->name;
|
||||
|
||||
Reference in New Issue
Block a user