wp_create_tag( int|string $tag_name )

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

Parameters Parameters


(int|string) (Required)

Top ↑

Return Return


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

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.