wp_create_tag( int|string $tag_name ): array|WP_Error

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


Parameters

$tag_name int|string Required

Top ↑

Return

array|WP_Error


Top ↑

Source

File: wp-admin/includes/taxonomy.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.