WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/11/2010 03:53:41 PM (11 years ago)
Author:
ryan
Message:

Deprecate is_term, is_taxonomy, is_post_type for *_exists(). Props nacin. fixes #13747

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/taxonomy.php

    r13482 r15220  
    2020 */
    2121function category_exists($cat_name, $parent = 0) {
    22     $id = is_term($cat_name, 'category', $parent);
     22    $id = term_exists($cat_name, 'category', $parent);
    2323    if ( is_array($id) )
    2424        $id = $id['term_id'];
     
    241241 */
    242242function tag_exists($tag_name) {
    243     return is_term($tag_name, 'post_tag');
     243    return term_exists($tag_name, 'post_tag');
    244244}
    245245
     
    265265 */
    266266function wp_create_term($tag_name, $taxonomy = 'post_tag') {
    267     if ( $id = is_term($tag_name, $taxonomy) )
     267    if ( $id = term_exists($tag_name, $taxonomy) )
    268268        return $id;
    269269
Note: See TracChangeset for help on using the changeset viewer.