A WordPress-centric search engine for devs and theme authors



wp_add_post_tags ›

Since2.3.0
Deprecatedn/a
wp_add_post_tags ( $post_id = 0, $tags = '' )
Parameters: (2)
  • (int) $post_id Optional. The Post ID. Does not default to the ID of the global $post.
    Required: No
    Default:
  • (string|array) $tags Optional. An array of tags to set for the post, or a string of tags separated by commas. Default empty.
    Required: No
    Default: (empty)
See:
Returns:
  • (array|false|WP_Error) Array of affected term IDs. WP_Error or false on failure.
Defined at:
Codex:

Add tags to a post.



Source

function wp_add_post_tags( $post_id = 0, $tags = '' ) {
	return wp_set_post_tags($post_id, $tags, true);
}