Clarify the docs and add more unit tests for wp_set_object_terms().

props DrewAPicture.
fixes #26570.

git-svn-id: https://develop.svn.wordpress.org/trunk@28951 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2014-07-02 01:27:07 +00:00
parent c6b8bae1e8
commit 2ce93f915d
2 changed files with 95 additions and 7 deletions
+7 -7
View File
@@ -2617,14 +2617,14 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
* @since 2.3.0
* @uses wp_remove_object_terms()
*
* @param int $object_id The object to relate to.
* @param array|int|string $terms The slug or id of the term, will replace all existing
* related terms in this taxonomy.
* @param array|string $taxonomy The context in which to relate the term to the object.
* @param bool $append If false will delete difference of terms.
* @return array|WP_Error Affected Term IDs
* @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.
* Will replace all existing related terms in this taxonomy.
* @param array|string $taxonomy The context in which to relate the term to the object.
* @param bool $append If false will delete difference of terms.
* @return array|WP_Error Affected Term IDs.
*/
function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) {
global $wpdb;
$object_id = (int) $object_id;