WordPress.org

Make WordPress Core

Changeset 39893


Ignore:
Timestamp:
01/12/2017 06:53:21 AM (17 months ago)
Author:
SergeyBiryukov
Message:

Docs: In wp_set_object_terms(), add a note that passing an empty value as $terms argument will remove all related terms.

Props barryceelen.
Fixes #36690.

File:
1 edited

Legend:

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

    r39639 r39893  
    22142214 *
    22152215 * @param int              $object_id The object to relate to.
    2216  * @param array|int|string $terms     A single term slug, single term id, or array of either term slugs or ids.
    2217  *                                    Will replace all existing related terms in this taxonomy.
     2216 * @param string|int|array $terms     A single term slug, single term id, or array of either term slugs or ids.
     2217 *                                    Will replace all existing related terms in this taxonomy. Passing an
     2218 *                                    empty value will remove all related terms.
    22182219 * @param string           $taxonomy  The context in which to relate the term to the object.
    22192220 * @param bool             $append    Optional. If false will delete difference of terms. Default false.
     
    23422343 *
    23432344 * @param int              $object_id The ID of the object to which the terms will be added.
    2344  * @param array|int|string $terms     The slug(s) or ID(s) of the term(s) to add.
     2345 * @param string|int|array $terms     The slug(s) or ID(s) of the term(s) to add.
    23452346 * @param array|string     $taxonomy  Taxonomy name.
    23462347 * @return array|WP_Error Term taxonomy IDs of the affected terms.
     
    23582359 *
    23592360 * @param int              $object_id The ID of the object from which the terms will be removed.
    2360  * @param array|int|string $terms     The slug(s) or ID(s) of the term(s) to remove.
     2361 * @param string|int|array $terms     The slug(s) or ID(s) of the term(s) to remove.
    23612362 * @param array|string     $taxonomy  Taxonomy name.
    23622363 * @return bool|WP_Error True on success, false or WP_Error on failure.
Note: See TracChangeset for help on using the changeset viewer.