From 4fb57210cd007e1edf3c9d563e256e004020613e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 6 Sep 2015 00:11:56 +0000 Subject: [PATCH] Update the parameter docs for `wp_add_post_tags()`, `wp_set_post_tags()`, and `wp_set_post_terms()`. Props johnbillion. Fixes #33749. git-svn-id: https://develop.svn.wordpress.org/trunk@33931 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-functions.php | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/wp-includes/post-functions.php b/src/wp-includes/post-functions.php index 9897c81494..1b6af735e5 100644 --- a/src/wp-includes/post-functions.php +++ b/src/wp-includes/post-functions.php @@ -3608,10 +3608,10 @@ function _truncate_post_slug( $slug, $length = 200 ) { * * @since 2.3.0 * - * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. - * Default 0. - * @param string $tags Optional. The tags to set for the post, separated by commas. Default empty. - * @return array|false|WP_Error Will return false if $post_id is not an integer or is 0. + * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. + * @param string|array $tags Optional. An array of tags to set for the post, or a string of tags + * separated by commas. Default empty. + * @return array|false|WP_Error Array of affected term IDs. WP_Error or false on failure. */ function wp_add_post_tags( $post_id = 0, $tags = '' ) { return wp_set_post_tags($post_id, $tags, true); @@ -3624,11 +3624,11 @@ function wp_add_post_tags( $post_id = 0, $tags = '' ) { * * @see wp_set_object_terms() * - * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. - * @param string $tags Optional. The tags to set for the post, separated by commas. - * Default empty. - * @param bool $append Optional. If true, don't delete existing tags, just add on. If false, - * replace the tags with the new tags. Default false. + * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. + * @param string|array $tags Optional. An array of tags to set for the post, or a string of tags + * separated by commas. Default empty. + * @param bool $append Optional. If true, don't delete existing tags, just add on. If false, + * replace the tags with the new tags. Default false. * @return array|false|WP_Error Array of affected term IDs. WP_Error or false on failure. */ function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { @@ -3642,11 +3642,12 @@ function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { * * @see wp_set_object_terms() * - * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. - * @param string $tags Optional. The tags to set for the post, separated by commas. Default empty. - * @param string $taxonomy Optional. Taxonomy name. Default 'post_tag'. - * @param bool $append Optional. If true, don't delete existing tags, just add on. If false, - * replace the tags with the new tags. Default false. + * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. + * @param string|array $tags Optional. An array of terms to set for the post, or a string of terms + * separated by commas. Default empty. + * @param string $taxonomy Optional. Taxonomy name. Default 'post_tag'. + * @param bool $append Optional. If true, don't delete existing terms, just add on. If false, + * replace the terms with the new terms. Default false. * @return array|false|WP_Error Array of affected term IDs. WP_Error or false on failure. */ function wp_set_post_terms( $post_id = 0, $tags = '', $taxonomy = 'post_tag', $append = false ) {