Make WordPress Core

Ticket #25234: 25234.2.diff

File 25234.2.diff, 1.6 KB (added by wonderboymusic, 13 years ago)
  • src/wp-admin/includes/taxonomy.php

     
    237237
    238238        return $tags_to_edit;
    239239}
    240 
    241 /**
    242  * {@internal Missing Short Description}}
    243  *
    244  * @since 2.8.0
    245  *
    246  * @param unknown_type $tag_name
    247  * @return unknown
    248  */
    249 function wp_create_term($tag_name, $taxonomy = 'post_tag') {
    250         if ( $id = term_exists($tag_name, $taxonomy) )
    251                 return $id;
    252 
    253         return wp_insert_term($tag_name, $taxonomy);
    254 }
  • src/wp-includes/taxonomy.php

     
    22352235}
    22362236
    22372237/**
     2238 * Wrapper function that attempts to create a term by name in
     2239 *   the passed taxonomy.
     2240 *
     2241 * @since 2.8.0
     2242 *
     2243 * @param string $tag_name The name of the term.
     2244 * @return int|array If the term exists, returns the term_id. If not, returns
     2245 *    the result of wp_insert_term(), which
     2246 *    is array( 'term_id' => , 'term_taxonomy_id' => )
     2247 */
     2248function wp_create_term( $tag_name, $taxonomy = 'post_tag' ) {
     2249        if ( $id = term_exists( $tag_name, $taxonomy ) ) {
     2250                return $id;
     2251        }
     2252        return wp_insert_term( $tag_name, $taxonomy );
     2253}
     2254
     2255/**
    22382256 * Create Term and Taxonomy Relationships.
    22392257 *
    22402258 * Relates an object (post, link etc) to a term and taxonomy type. Creates the
     
    35243542/**
    35253543 * Determine if a post's cache for the passed taxonomy
    35263544 *  is in sync.
    3527  * 
     3545 *
    35283546 * @since 3.9.0
    35293547 *
    35303548 * @param int $id