wp_create_tag( int|string $tag_name )

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


Parameters Parameters

$tag_name

(int|string) (Required)


Top ↑

Return Return

(array|WP_Error)


Top ↑

Source Source

File: wp-admin/includes/taxonomy.php

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


Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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