mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Deprecate is_term, is_taxonomy, is_post_type for *_exists(). Props nacin. fixes #13747
git-svn-id: https://develop.svn.wordpress.org/trunk@15220 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -237,7 +237,7 @@ function _wp_ajax_add_hierarchical_term() {
|
||||
$category_nicename = sanitize_title($cat_name);
|
||||
if ( '' === $category_nicename )
|
||||
continue;
|
||||
if ( !($cat_id = is_term($cat_name, $taxonomy->name, $parent)) ) {
|
||||
if ( !($cat_id = term_exists($cat_name, $taxonomy->name, $parent)) ) {
|
||||
$new_term = wp_insert_term($cat_name, $taxonomy->name, array('parent' => $parent));
|
||||
$cat_id = $new_term['term_id'];
|
||||
}
|
||||
@@ -501,7 +501,7 @@ case 'add-link-category' : // On the Fly
|
||||
$slug = sanitize_title($cat_name);
|
||||
if ( '' === $slug )
|
||||
continue;
|
||||
if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) {
|
||||
if ( !$cat_id = term_exists( $cat_name, 'link_category' ) ) {
|
||||
$cat_id = wp_insert_term( $cat_name, 'link_category' );
|
||||
}
|
||||
$cat_id = $cat_id['term_id'];
|
||||
|
||||
Reference in New Issue
Block a user