A WordPress-centric search engine for devs and theme authors



wp_create_tag ›

Since2.3.0
Deprecatedn/a
wp_create_tag ( $tag_name )
Parameters:
  • (int|string) $tag_name
    Required: Yes
Returns:
  • (array|WP_Error)
Defined at:
Codex:

Add a new tag to the database if it does not already exist.



Source

function wp_create_tag($tag_name) {
	return wp_create_term( $tag_name, 'post_tag');
}