wp_create_tag

Advertisement

Summery Summery

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

Syntax Syntax

wp_create_tag( int|string $tag_name )

Parameters Parameters

$tag_name

(int|string) (Required)

Return Return

(array|WP_Error)

Source Source

File: wp-admin/includes/taxonomy.php

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

Advertisement

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.