Make WordPress Core


Ignore:
Timestamp:
09/19/2013 04:08:30 PM (11 years ago)
Author:
DrewAPicture
Message:

Clarify error handling and special cases in the wp_insert_term() phpdoc block.

props lgedeon, SergeyBiryukov. See #22801.

File:
1 edited

Legend:

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

    r25489 r25498  
    20312031 * 6. An array is returned containing the term_id and term_taxonomy_id.
    20322032 *
    2033  * If the 'slug' argument is not empty, then it will be checked to see if the term
    2034  * is invalid. If it is not a valid, existing term, it is added and the term_id is given.
    2035  * If the taxonomy is hierarchical, and the 'parent' argument is not empty, the term
    2036  * will be inserted and the term_id will be given.
     2033 * If the 'slug' argument is not empty, then it is checked to see if the term
     2034 * is invalid. If it is not a valid, existing term, it is added and the term_id
     2035 * is given.
     2036 *
     2037 * If the taxonomy is hierarchical, and the 'parent' argument is not empty,
     2038 * the term is inserted and the term_id will be given.
    20372039
    20382040 * Error handling:
    2039  * If $taxonomy does not exist -- or $term is numeric or empty,
     2041 * If $taxonomy does not exist or $term is empty,
    20402042 * a WP_Error object will be returned.
    20412043 *
    2042  * If the term already exists, the term slug is not unique, or both the term id and taxonomy
    2043  * already exist, a WP_Error object will be returned.
     2044 * If the term already exists on the same hierarchical level,
     2045 * or the term slug and name are not unique, a WP_Error object will be returned.
    20442046 *
    20452047 * @global wpdb $wpdb The WordPress database object.
Note: See TracChangeset for help on using the changeset viewer.