From bb42ed68932ab385918472c38ee8a5caf802319b Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Thu, 19 Sep 2013 16:08:30 +0000 Subject: [PATCH] Clarify error handling and special cases in the `wp_insert_term()` phpdoc block. props lgedeon, SergeyBiryukov. See #22801. git-svn-id: https://develop.svn.wordpress.org/trunk@25498 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 52f6c865d1..9ae219f688 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -2030,17 +2030,19 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { * 5. Several more actions are fired. * 6. An array is returned containing the term_id and term_taxonomy_id. * - * If the 'slug' argument is not empty, then it will be checked to see if the term - * is invalid. If it is not a valid, existing term, it is added and the term_id is given. - * If the taxonomy is hierarchical, and the 'parent' argument is not empty, the term - * will be inserted and the term_id will be given. + * If the 'slug' argument is not empty, then it is checked to see if the term + * is invalid. If it is not a valid, existing term, it is added and the term_id + * is given. + * + * If the taxonomy is hierarchical, and the 'parent' argument is not empty, + * the term is inserted and the term_id will be given. * Error handling: - * If $taxonomy does not exist -- or $term is numeric or empty, + * If $taxonomy does not exist or $term is empty, * a WP_Error object will be returned. * - * If the term already exists, the term slug is not unique, or both the term id and taxonomy - * already exist, a WP_Error object will be returned. + * If the term already exists on the same hierarchical level, + * or the term slug and name are not unique, a WP_Error object will be returned. * * @global wpdb $wpdb The WordPress database object.