Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r17071 r15220  
    1414 * {@internal Missing Short Description}}
    1515 *
    16  * @since 2.0.0
     16 * @since unknown
    1717 *
    1818 * @param unknown_type $cat_name
     
    2929 * {@internal Missing Short Description}}
    3030 *
    31  * @since 2.0.0
     31 * @since unknown
    3232 *
    3333 * @param unknown_type $id
     
    4242 * {@internal Missing Short Description}}
    4343 *
    44  * @since 2.0.0
     44 * @since unknown
    4545 *
    4646 * @param unknown_type $cat_name
     
    5858 * {@internal Missing Short Description}}
    5959 *
    60  * @since 2.0.0
     60 * @since unknown
    6161 *
    6262 * @param unknown_type $categories
     
    8181
    8282/**
     83 * Deletes one existing category.
     84 *
     85 * @since 2.0.0
     86 *
     87 * @param int $cat_ID
     88 * @return mixed Returns true if completes delete action; false if term doesnt exist; Zero on attempted deletion of default Category; WP_Error object is also a possibility.
     89 */
     90function wp_delete_category($cat_ID) {
     91    $cat_ID = (int) $cat_ID;
     92    $default = get_option('default_category');
     93
     94    // Don't delete the default cat
     95    if ( $cat_ID == $default )
     96        return 0;
     97
     98    return wp_delete_term($cat_ID, 'category', array('default' => $default));
     99}
     100
     101/**
    83102 * Updates an existing Category or creates a new Category.
    84103 *
     
    174193 * {@internal Missing Short Description}}
    175194 *
    176  * @since 2.3.0
    177  *
    178  * @param unknown_type $tag_name
    179  * @return unknown
    180  */
    181 function tag_exists($tag_name) {
    182     return term_exists($tag_name, 'post_tag');
    183 }
    184 
    185 /**
    186  * {@internal Missing Short Description}}
    187  *
    188  * @since 2.3.0
    189  *
    190  * @param unknown_type $tag_name
    191  * @return unknown
    192  */
    193 function wp_create_tag($tag_name) {
    194     return wp_create_term( $tag_name, 'post_tag');
    195 }
    196 
    197 /**
    198  * {@internal Missing Short Description}}
    199  *
    200  * @since 2.3.0
     195 * @since unknown
    201196 *
    202197 * @param unknown_type $post_id
     
    210205 * {@internal Missing Short Description}}
    211206 *
    212  * @since 2.8.0
     207 * @since unknown
    213208 *
    214209 * @param unknown_type $post_id
     
    240235 * {@internal Missing Short Description}}
    241236 *
    242  * @since 2.8.0
     237 * @since unknown
     238 *
     239 * @param unknown_type $tag_name
     240 * @return unknown
     241 */
     242function tag_exists($tag_name) {
     243    return term_exists($tag_name, 'post_tag');
     244}
     245
     246/**
     247 * {@internal Missing Short Description}}
     248 *
     249 * @since unknown
     250 *
     251 * @param unknown_type $tag_name
     252 * @return unknown
     253 */
     254function wp_create_tag($tag_name) {
     255    return wp_create_term( $tag_name, 'post_tag');
     256}
     257
     258/**
     259 * {@internal Missing Short Description}}
     260 *
     261 * @since unknown
    243262 *
    244263 * @param unknown_type $tag_name
Note: See TracChangeset for help on using the changeset viewer.