On this page
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_nameint|string Required
Return
array|WP_Error
Source
File: wp-admin/includes/taxonomy.php. View all references
function wp_create_tag( $tag_name ) {
return wp_create_term( $tag_name, 'post_tag' );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_create_term() wp-admin/includes/taxonomy.php | Adds a new term to the database if it does not already exist. |
Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_create_tag