<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15220] trunk: Deprecate is_term, is_taxonomy, is_post_type for *_exists().</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15220">15220</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-06-11 15:53:41 +0000 (Fri, 11 Jun 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Deprecate is_term, is_taxonomy, is_post_type for *_exists(). Props nacin. fixes <a href="http://trac.wordpress.org/ticket/13747">#13747</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadminedittagsphp">trunk/wp-admin/edit-tags.php</a></li>
<li><a href="#trunkwpadminincludesnavmenuphp">trunk/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunkwpadminincludestaxonomyphp">trunk/wp-admin/includes/taxonomy.php</a></li>
<li><a href="#trunkwpincludescategorytemplatephp">trunk/wp-includes/category-template.php</a></li>
<li><a href="#trunkwpincludesdefaultwidgetsphp">trunk/wp-includes/default-widgets.php</a></li>
<li><a href="#trunkwpincludesdeprecatedphp">trunk/wp-includes/deprecated.php</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
<li><a href="#trunkwpincludestaxonomyphp">trunk/wp-includes/taxonomy.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-admin/admin-ajax.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -237,7 +237,7 @@
</span><span class="cx">                 $category_nicename = sanitize_title($cat_name);
</span><span class="cx">                 if ( '' === $category_nicename )
</span><span class="cx">                         continue;
</span><del>-                if ( !($cat_id = is_term($cat_name, $taxonomy-&gt;name, $parent)) ) {
</del><ins>+                if ( !($cat_id = term_exists($cat_name, $taxonomy-&gt;name, $parent)) ) {
</ins><span class="cx">                         $new_term = wp_insert_term($cat_name, $taxonomy-&gt;name, array('parent' =&gt; $parent));
</span><span class="cx">                         $cat_id = $new_term['term_id'];
</span><span class="cx">                 }
</span><span class="lines">@@ -501,7 +501,7 @@
</span><span class="cx">                 $slug = sanitize_title($cat_name);
</span><span class="cx">                 if ( '' === $slug )
</span><span class="cx">                         continue;
</span><del>-                if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) {
</del><ins>+                if ( !$cat_id = term_exists( $cat_name, 'link_category' ) ) {
</ins><span class="cx">                         $cat_id = wp_insert_term( $cat_name, 'link_category' );
</span><span class="cx">                 }
</span><span class="cx">                 $cat_id = $cat_id['term_id'];
</span></span></pre></div>
<a id="trunkwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tags.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tags.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-admin/edit-tags.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> if ( empty($taxonomy) )
</span><span class="cx">         $taxonomy = 'post_tag';
</span><span class="cx"> 
</span><del>-if ( !is_taxonomy($taxonomy) )
</del><ins>+if ( !taxonomy_exists($taxonomy) )
</ins><span class="cx">         wp_die(__('Invalid taxonomy'));
</span><span class="cx"> 
</span><span class="cx"> $tax = get_taxonomy($taxonomy);
</span></span></pre></div>
<a id="trunkwpadminincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/nav-menu.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/nav-menu.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-admin/includes/nav-menu.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -279,7 +279,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ( 'get-post-item' == $type ) {
</span><del>-                if ( get_post_type_object( $object_type ) ) {
</del><ins>+                if ( post_type_exists( $object_type ) ) {
</ins><span class="cx">                         if ( isset( $request['ID'] ) ) {
</span><span class="cx">                                 $object_id = (int) $request['ID'];
</span><span class="cx">                                 if ( 'markup' == $response_format ) {
</span><span class="lines">@@ -296,7 +296,7 @@
</span><span class="cx">                                         echo &quot;\n&quot;;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-                } elseif ( is_taxonomy( $object_type ) ) {
</del><ins>+                } elseif ( taxonomy_exists( $object_type ) ) {
</ins><span class="cx">                         if ( isset( $request['ID'] ) ) {
</span><span class="cx">                                 $object_id = (int) $request['ID'];
</span><span class="cx">                                 if ( 'markup' == $response_format ) {
</span></span></pre></div>
<a id="trunkwpadminincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/taxonomy.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/taxonomy.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-admin/includes/taxonomy.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx">  * @return unknown
</span><span class="cx">  */
</span><span class="cx"> function category_exists($cat_name, $parent = 0) {
</span><del>-        $id = is_term($cat_name, 'category', $parent);
</del><ins>+        $id = term_exists($cat_name, 'category', $parent);
</ins><span class="cx">         if ( is_array($id) )
</span><span class="cx">                 $id = $id['term_id'];
</span><span class="cx">         return $id;
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">  * @return unknown
</span><span class="cx">  */
</span><span class="cx"> function tag_exists($tag_name) {
</span><del>-        return is_term($tag_name, 'post_tag');
</del><ins>+        return term_exists($tag_name, 'post_tag');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -264,7 +264,7 @@
</span><span class="cx">  * @return unknown
</span><span class="cx">  */
</span><span class="cx"> function wp_create_term($tag_name, $taxonomy = 'post_tag') {
</span><del>-        if ( $id = is_term($tag_name, $taxonomy) )
</del><ins>+        if ( $id = term_exists($tag_name, $taxonomy) )
</ins><span class="cx">                 return $id;
</span><span class="cx"> 
</span><span class="cx">         return wp_insert_term($tag_name, $taxonomy);
</span></span></pre></div>
<a id="trunkwpincludescategorytemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/category-template.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/category-template.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-includes/category-template.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -482,7 +482,7 @@
</span><span class="cx"> 
</span><span class="cx">         extract( $r );
</span><span class="cx"> 
</span><del>-        if ( !is_taxonomy($taxonomy) )
</del><ins>+        if ( !taxonomy_exists($taxonomy) )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         $categories = get_categories( $r );
</span></span></pre></div>
<a id="trunkwpincludesdefaultwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/default-widgets.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/default-widgets.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-includes/default-widgets.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -1041,7 +1041,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function _get_current_taxonomy($instance) {
</span><del>-                if ( !empty($instance['taxonomy']) &amp;&amp; is_taxonomy($instance['taxonomy']) )
</del><ins>+                if ( !empty($instance['taxonomy']) &amp;&amp; taxonomy_exists($instance['taxonomy']) )
</ins><span class="cx">                         return $instance['taxonomy'];
</span><span class="cx"> 
</span><span class="cx">                 return 'post_tag';
</span></span></pre></div>
<a id="trunkwpincludesdeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/deprecated.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/deprecated.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-includes/deprecated.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -2513,3 +2513,53 @@
</span><span class="cx">         _deprecated_function( __FUNCTION__, '3.0' );
</span><span class="cx">         return '';
</span><span class="cx"> }
</span><ins>+
+/**
+ * Checks if a post type is registered.
+ *
+ * @since 3.0.0
+ * @deprecated 3.0.0
+ * @deprecated Use post_type_exists()
+ * @see post_type_exists()
+ *
+ * @param string Post type name
+ * @return bool Whether post type is registered.
+ */
+function is_post_type( $post_type ) {
+        _deprecated_function( __FUNCTION__, '3.0', 'post_type_exists()' );
+        return post_type_exists( $post_type );
+}
+
+/**
+ * Checks that the taxonomy name exists.
+ *
+ * @since 2.3.0
+ * @deprecated 3.0.0
+ * @deprecated Use taxonomy_exists()
+ * @see taxonomy_exists()
+ *
+ * @param string $taxonomy Name of taxonomy object
+ * @return bool Whether the taxonomy exists.
+ */
+function is_taxonomy( $taxonomy ) {
+        _deprecated_function( __FUNCTION__, '3.0', 'taxonomy_exists()' );
+        return taxonomy_exists( $post_type );
+}
+
+/**
+ * Check if Term exists.
+ *
+ * @since 2.3.0
+ * @deprecated 3.0.0
+ * @deprecated Use term_exists()
+ * @see term_exists()
+ *
+ * @param int|string $term The term to check
+ * @param string $taxonomy The taxonomy name to use
+ * @param int $parent ID of parent term under which to confine the exists search.
+ * @return mixed Get the term id or Term Object, if exists.
+ */
+function is_term( $term, $taxonomy = '', $parent = 0 ) {
+        _deprecated_function( __FUNCTION__, '3.0', 'term_exists()' );
+        return term_exists( $term, $taxonomy, $parent );
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-includes/post.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -673,7 +673,7 @@
</span><span class="cx">  * @return bool Whether post type is hierarchical.
</span><span class="cx">  */
</span><span class="cx"> function is_post_type_hierarchical( $post_type ) {
</span><del>-        if ( ! is_post_type( $post_type ) )
</del><ins>+        if ( ! post_type_exists( $post_type ) )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         $post_type = get_post_type_object( $post_type );
</span><span class="lines">@@ -684,12 +684,12 @@
</span><span class="cx">  * Checks if a post type is registered.
</span><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span><del>- * @uses get_post_type()
</del><ins>+ * @uses get_post_type_object()
</ins><span class="cx">  *
</span><span class="cx">  * @param string Post type name
</span><span class="cx">  * @return bool Whether post type is registered.
</span><span class="cx">  */
</span><del>-function is_post_type( $post_type ) {
</del><ins>+function post_type_exists( $post_type ) {
</ins><span class="cx">         return (bool) get_post_type_object( $post_type );
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/taxonomy.php (15219 => 15220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/taxonomy.php        2010-06-11 15:34:32 UTC (rev 15219)
+++ trunk/wp-includes/taxonomy.php        2010-06-11 15:53:41 UTC (rev 15220)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">  * @since 2.3.0
</span><span class="cx">  *
</span><span class="cx">  * @uses $wp_taxonomies
</span><del>- * @uses is_taxonomy() Checks whether taxonomy exists
</del><ins>+ * @uses taxonomy_exists() Checks whether taxonomy exists
</ins><span class="cx">  *
</span><span class="cx">  * @param string $taxonomy Name of taxonomy object to return
</span><span class="cx">  * @return object|bool The Taxonomy Object or false if $taxonomy doesn't exist
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx"> function get_taxonomy( $taxonomy ) {
</span><span class="cx">         global $wp_taxonomies;
</span><span class="cx"> 
</span><del>-        if ( ! is_taxonomy($taxonomy) )
</del><ins>+        if ( ! taxonomy_exists( $taxonomy ) )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         return $wp_taxonomies[$taxonomy];
</span><span class="lines">@@ -159,19 +159,21 @@
</span><span class="cx"> /**
</span><span class="cx">  * Checks that the taxonomy name exists.
</span><span class="cx">  *
</span><ins>+ * Formerly is_taxonomy(), introduced in 2.3.0.
+ *
</ins><span class="cx">  * @package WordPress
</span><span class="cx">  * @subpackage Taxonomy
</span><del>- * @since 2.3.0
</del><ins>+ * @since 3.0.0
</ins><span class="cx">  *
</span><span class="cx">  * @uses $wp_taxonomies
</span><span class="cx">  *
</span><span class="cx">  * @param string $taxonomy Name of taxonomy object
</span><span class="cx">  * @return bool Whether the taxonomy exists.
</span><span class="cx">  */
</span><del>-function is_taxonomy( $taxonomy ) {
</del><ins>+function taxonomy_exists( $taxonomy ) {
</ins><span class="cx">         global $wp_taxonomies;
</span><span class="cx"> 
</span><del>-        return isset($wp_taxonomies[$taxonomy]);
</del><ins>+        return isset( $wp_taxonomies[$taxonomy] );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -186,14 +188,14 @@
</span><span class="cx">  * @subpackage Taxonomy
</span><span class="cx">  * @since 2.3.0
</span><span class="cx">  *
</span><del>- * @uses is_taxonomy() Checks whether taxonomy exists
</del><ins>+ * @uses taxonomy_exists() Checks whether taxonomy exists
</ins><span class="cx">  * @uses get_taxonomy() Used to get the taxonomy object
</span><span class="cx">  *
</span><span class="cx">  * @param string $taxonomy Name of taxonomy object
</span><span class="cx">  * @return bool Whether the taxonomy is hierarchical
</span><span class="cx">  */
</span><span class="cx"> function is_taxonomy_hierarchical($taxonomy) {
</span><del>-        if ( ! is_taxonomy($taxonomy) )
</del><ins>+        if ( ! taxonomy_exists($taxonomy) )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         $taxonomy = get_taxonomy($taxonomy);
</span><span class="lines">@@ -208,7 +210,7 @@
</span><span class="cx">  * parameter), along with strings for the taxonomy name and another string for
</span><span class="cx">  * the object type.
</span><span class="cx">  *
</span><del>- * Nothing is returned, so expect error maybe or use is_taxonomy() to check
</del><ins>+ * Nothing is returned, so expect error maybe or use taxonomy_exists() to check
</ins><span class="cx">  * whether taxonomy exists.
</span><span class="cx">  *
</span><span class="cx">  * Optional $args contents:
</span><span class="lines">@@ -437,7 +439,7 @@
</span><span class="cx">                 $taxonomies = array( $taxonomies );
</span><span class="cx"> 
</span><span class="cx">         foreach ( (array) $taxonomies as $taxonomy ) {
</span><del>-                if ( ! is_taxonomy( $taxonomy ) )
</del><ins>+                if ( ! taxonomy_exists( $taxonomy ) )
</ins><span class="cx">                         return new WP_Error( 'invalid_taxonomy', __( 'Invalid Taxonomy' ) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -509,7 +511,7 @@
</span><span class="cx">                 return $error;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ( ! is_taxonomy($taxonomy) ) {
</del><ins>+        if ( ! taxonomy_exists($taxonomy) ) {
</ins><span class="cx">                 $error = new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
</span><span class="cx">                 return $error;
</span><span class="cx">         }
</span><span class="lines">@@ -576,7 +578,7 @@
</span><span class="cx"> function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw') {
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><del>-        if ( ! is_taxonomy($taxonomy) )
</del><ins>+        if ( ! taxonomy_exists($taxonomy) )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         if ( 'slug' == $field ) {
</span><span class="lines">@@ -634,7 +636,7 @@
</span><span class="cx">  * @return array|WP_Error List of Term Objects. WP_Error returned if $taxonomy does not exist
</span><span class="cx">  */
</span><span class="cx"> function get_term_children( $term_id, $taxonomy ) {
</span><del>-        if ( ! is_taxonomy($taxonomy) )
</del><ins>+        if ( ! taxonomy_exists($taxonomy) )
</ins><span class="cx">                 return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
</span><span class="cx"> 
</span><span class="cx">         $term_id = intval( $term_id );
</span><span class="lines">@@ -819,7 +821,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         foreach ( (array) $taxonomies as $taxonomy ) {
</span><del>-                if ( ! is_taxonomy($taxonomy) ) {
</del><ins>+                if ( ! taxonomy_exists($taxonomy) ) {
</ins><span class="cx">                         $error = &amp; new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
</span><span class="cx">                         return $error;
</span><span class="cx">                 }
</span><span class="lines">@@ -1071,9 +1073,11 @@
</span><span class="cx">  *
</span><span class="cx">  * Returns the index of a defined term, or 0 (false) if the term doesn't exist.
</span><span class="cx">  *
</span><ins>+ * Formerly is_term(), introduced in 2.3.0.
+ *
</ins><span class="cx">  * @package WordPress
</span><span class="cx">  * @subpackage Taxonomy
</span><del>- * @since 2.3.0
</del><ins>+ * @since 3.0.0
</ins><span class="cx">  *
</span><span class="cx">  * @uses $wpdb
</span><span class="cx">  *
</span><span class="lines">@@ -1082,7 +1086,7 @@
</span><span class="cx">  * @param int $parent ID of parent term under which to confine the exists search.
</span><span class="cx">  * @return mixed Get the term id or Term Object, if exists.
</span><span class="cx">  */
</span><del>-function is_term($term, $taxonomy = '', $parent = 0) {
</del><ins>+function term_exists($term, $taxonomy = '', $parent = 0) {
</ins><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><span class="cx">         $select = &quot;SELECT term_id FROM $wpdb-&gt;terms as t WHERE &quot;;
</span><span class="lines">@@ -1343,7 +1347,7 @@
</span><span class="cx"> 
</span><span class="cx">         $term = (int) $term;
</span><span class="cx"> 
</span><del>-        if ( ! $ids = is_term($term, $taxonomy) )
</del><ins>+        if ( ! $ids = term_exists($term, $taxonomy) )
</ins><span class="cx">                 return false;
</span><span class="cx">         if ( is_wp_error( $ids ) )
</span><span class="cx">                 return $ids;
</span><span class="lines">@@ -1356,7 +1360,7 @@
</span><span class="cx"> 
</span><span class="cx">         if ( isset($default) ) {
</span><span class="cx">                 $default = (int) $default;
</span><del>-                if ( ! is_term($default, $taxonomy) )
</del><ins>+                if ( ! term_exists($default, $taxonomy) )
</ins><span class="cx">                         unset($default);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1443,7 +1447,7 @@
</span><span class="cx">                 $taxonomies = array($taxonomies);
</span><span class="cx"> 
</span><span class="cx">         foreach ( (array) $taxonomies as $taxonomy ) {
</span><del>-                if ( ! is_taxonomy($taxonomy) )
</del><ins>+                if ( ! taxonomy_exists($taxonomy) )
</ins><span class="cx">                         return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1581,7 +1585,7 @@
</span><span class="cx"> function wp_insert_term( $term, $taxonomy, $args = array() ) {
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><del>-        if ( ! is_taxonomy($taxonomy) )
</del><ins>+        if ( ! taxonomy_exists($taxonomy) )
</ins><span class="cx">                 return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
</span><span class="cx"> 
</span><span class="cx">         $term = apply_filters( 'pre_insert_term', $term, $taxonomy );
</span><span class="lines">@@ -1623,10 +1627,10 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ( $term_id = is_term($slug) ) {
</del><ins>+        if ( $term_id = term_exists($slug) ) {
</ins><span class="cx">                 $existing_term = $wpdb-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT name FROM $wpdb-&gt;terms WHERE term_id = %d&quot;, $term_id), ARRAY_A );
</span><span class="cx">                 // We've got an existing term in the same taxonomy, which matches the name of the new term:
</span><del>-                if ( is_taxonomy_hierarchical($taxonomy) &amp;&amp; $existing_term['name'] == $name &amp;&amp; is_term( (int) $term_id, $taxonomy ) ) {
</del><ins>+                if ( is_taxonomy_hierarchical($taxonomy) &amp;&amp; $existing_term['name'] == $name &amp;&amp; term_exists( (int) $term_id, $taxonomy ) ) {
</ins><span class="cx">                         // Hierarchical, and it matches an existing term, Do not allow same &quot;name&quot; in the same level.
</span><span class="cx">                         $siblings = get_terms($taxonomy, array('fields' =&gt; 'names', 'get' =&gt; 'all', 'parent' =&gt; (int)$parent) );
</span><span class="cx">                         if ( in_array($name, $siblings) ) {
</span><span class="lines">@@ -1643,7 +1647,7 @@
</span><span class="cx">                         if ( false === $wpdb-&gt;insert( $wpdb-&gt;terms, compact( 'name', 'slug', 'term_group' ) ) )
</span><span class="cx">                                 return new WP_Error('db_insert_error', __('Could not insert term into the database'), $wpdb-&gt;last_error);
</span><span class="cx">                         $term_id = (int) $wpdb-&gt;insert_id;
</span><del>-                } elseif ( is_term( (int) $term_id, $taxonomy ) )  {
</del><ins>+                } elseif ( term_exists( (int) $term_id, $taxonomy ) )  {
</ins><span class="cx">                         // Same name, same slug.
</span><span class="cx">                         return new WP_Error('term_exists', __('A term with the name provided already exists.'));
</span><span class="cx">                 }
</span><span class="lines">@@ -1712,7 +1716,7 @@
</span><span class="cx"> 
</span><span class="cx">         $object_id = (int) $object_id;
</span><span class="cx"> 
</span><del>-        if ( ! is_taxonomy($taxonomy) )
</del><ins>+        if ( ! taxonomy_exists($taxonomy) )
</ins><span class="cx">                 return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
</span><span class="cx"> 
</span><span class="cx">         if ( !is_array($terms) )
</span><span class="lines">@@ -1730,7 +1734,7 @@
</span><span class="cx">                 if ( !strlen(trim($term)) )
</span><span class="cx">                         continue;
</span><span class="cx"> 
</span><del>-                if ( !$term_info = is_term($term, $taxonomy) ) {
</del><ins>+                if ( !$term_info = term_exists($term, $taxonomy) ) {
</ins><span class="cx">                         // Skip if a non-existent term ID is passed.
</span><span class="cx">                         if ( is_int($term) )
</span><span class="cx">                                 continue;
</span><span class="lines">@@ -1805,7 +1809,7 @@
</span><span class="cx"> function wp_unique_term_slug($slug, $term) {
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><del>-        if ( ! is_term( $slug ) )
</del><ins>+        if ( ! term_exists( $slug ) )
</ins><span class="cx">                 return $slug;
</span><span class="cx"> 
</span><span class="cx">         // If the taxonomy supports hierarchy and the term has a parent, make the slug unique
</span><span class="lines">@@ -1817,7 +1821,7 @@
</span><span class="cx">                         if ( is_wp_error($parent_term) || empty($parent_term) )
</span><span class="cx">                                 break;
</span><span class="cx">                         $slug .= '-' . $parent_term-&gt;slug;
</span><del>-                        if ( ! is_term( $slug ) )
</del><ins>+                        if ( ! term_exists( $slug ) )
</ins><span class="cx">                                 return $slug;
</span><span class="cx"> 
</span><span class="cx">                         if ( empty($parent_term-&gt;parent) )
</span><span class="lines">@@ -1883,7 +1887,7 @@
</span><span class="cx"> function wp_update_term( $term_id, $taxonomy, $args = array() ) {
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><del>-        if ( ! is_taxonomy($taxonomy) )
</del><ins>+        if ( ! taxonomy_exists($taxonomy) )
</ins><span class="cx">                 return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
</span><span class="cx"> 
</span><span class="cx">         $term_id = (int) $term_id;
</span></span></pre>
</div>
</div>

</body>
</html>