WordPress at a glance
function is not described

wp_add_post_tags() WP 2.3.0

Add tags to a post.

No Hooks.

Return

Array/false/WP_Error. Array of affected term IDs. WP_Error or false on failure.

Usage

wp_add_post_tags( $post_id, $tags );
$post_id(int)
The Post ID. Does not default to the ID of the global $post.
Default: 0
$tags(string/array)
An array of tags to set for the post, or a string of tags separated by commas.
Default: ''

Notes

  • See: wp_set_post_tags()

Changelog

Since 2.3.0 Introduced.

Code of wp add post tags: wp-includes/post.php WP 5.2.2

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