Adds tags to a post.
Description
See also
Parameters
$post_id
intoptional- The Post ID. Does not default to the ID of the global $post.
$tags
string|arrayoptional- An array of tags to set for the post, or a string of tags separated by commas.
Default:
''
Source
function wp_add_post_tags( $post_id = 0, $tags = '' ) {
return wp_set_post_tags( $post_id, $tags, true );
}
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |
For single tag insert,
For multiple tag insert,