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.
Built from https://develop.svn.wordpress.org/trunk@39893


git-svn-id: http://core.svn.wordpress.org/trunk@39830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-01-12 06:54:42 +00:00
parent a1319d63a0
commit 36cb41145e
2 changed files with 6 additions and 5 deletions

View File

@ -2213,8 +2213,9 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
* @global wpdb $wpdb The WordPress database abstraction object. * @global wpdb $wpdb The WordPress database abstraction object.
* *
* @param int $object_id The object to relate to. * @param int $object_id The object to relate to.
* @param array|int|string $terms A single term slug, single term id, or array of either term slugs or ids. * @param string|int|array $terms A single term slug, single term id, or array of either term slugs or ids.
* Will replace all existing related terms in this taxonomy. * Will replace all existing related terms in this taxonomy. Passing an
* empty value will remove all related terms.
* @param string $taxonomy The context in which to relate the term to the object. * @param string $taxonomy The context in which to relate the term to the object.
* @param bool $append Optional. If false will delete difference of terms. Default false. * @param bool $append Optional. If false will delete difference of terms. Default false.
* @return array|WP_Error Term taxonomy IDs of the affected terms. * @return array|WP_Error Term taxonomy IDs of the affected terms.
@ -2341,7 +2342,7 @@ function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) {
* @since 3.6.0 * @since 3.6.0
* *
* @param int $object_id The ID of the object to which the terms will be added. * @param int $object_id The ID of the object to which the terms will be added.
* @param array|int|string $terms The slug(s) or ID(s) of the term(s) to add. * @param string|int|array $terms The slug(s) or ID(s) of the term(s) to add.
* @param array|string $taxonomy Taxonomy name. * @param array|string $taxonomy Taxonomy name.
* @return array|WP_Error Term taxonomy IDs of the affected terms. * @return array|WP_Error Term taxonomy IDs of the affected terms.
*/ */
@ -2357,7 +2358,7 @@ function wp_add_object_terms( $object_id, $terms, $taxonomy ) {
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param int $object_id The ID of the object from which the terms will be removed. * @param int $object_id The ID of the object from which the terms will be removed.
* @param array|int|string $terms The slug(s) or ID(s) of the term(s) to remove. * @param string|int|array $terms The slug(s) or ID(s) of the term(s) to remove.
* @param array|string $taxonomy Taxonomy name. * @param array|string $taxonomy Taxonomy name.
* @return bool|WP_Error True on success, false or WP_Error on failure. * @return bool|WP_Error True on success, false or WP_Error on failure.
*/ */

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.8-alpha-39892'; $wp_version = '4.8-alpha-39893';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.