W3cubDocs

/WordPress

register_term_meta( string $taxonomy, string $meta_key, array $args ): bool

Registers a meta key for terms.

Parameters

$taxonomystringrequired
Taxonomy to register a meta key for. Pass an empty string to register the meta key across all existing taxonomies.
$meta_keystringrequired
The meta key to register.
$argsarrayrequired
Data used to describe the meta key when registered. See register_meta() for a list of supported arguments.

Return

bool True if the meta key was successfully registered, false if not.

Source

function register_term_meta( $taxonomy, $meta_key, array $args ) {
	$args['object_subtype'] = $taxonomy;

	return register_meta( 'term', $meta_key, $args );
}

Changelog

Version Description
4.9.8 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/register_term_meta