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. Default 0.
    Required: No
    Default:
  • (string) $tags Optional. The tags to set for the post, separated by commas. Default empty.
    Required: No
    Default: (empty)
See:
Returns:
  • (bool|null) Will return false if $post_id is not an integer or is 0. Will return null otherwise.
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);
}