Ticket #25234: 25234.2.diff
| File 25234.2.diff, 1.6 KB (added by , 13 years ago) |
|---|
-
src/wp-admin/includes/taxonomy.php
237 237 238 238 return $tags_to_edit; 239 239 } 240 241 /**242 * {@internal Missing Short Description}}243 *244 * @since 2.8.0245 *246 * @param unknown_type $tag_name247 * @return unknown248 */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
2235 2235 } 2236 2236 2237 2237 /** 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 */ 2248 function 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 /** 2238 2256 * Create Term and Taxonomy Relationships. 2239 2257 * 2240 2258 * Relates an object (post, link etc) to a term and taxonomy type. Creates the … … 3524 3542 /** 3525 3543 * Determine if a post's cache for the passed taxonomy 3526 3544 * is in sync. 3527 * 3545 * 3528 3546 * @since 3.9.0 3529 3547 * 3530 3548 * @param int $id
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)