add_term_meta

Advertisement

Summery Summery

Adds metadata to a term.

Syntax Syntax

add_term_meta( int $term_id, string $meta_key, mixed $meta_value, bool $unique = false )

Parameters Parameters

$term_id

(Required) Term ID.

$meta_key

(Required) Metadata name.

$meta_value

(Required) Metadata value.

$unique

(Optional) Whether to bail if an entry with the same key is found for the term.

Default value: false

Return Return

(int|WP_Error|bool) Meta ID on success. WP_Error when term_id is ambiguous between taxonomies. False on failure.

Source Source

File: wp-includes/taxonomy.php

	$terms = $term_query->query( $args );

	// Count queries are not filtered, for legacy reasons.
	if ( ! is_array( $terms ) ) {
		return $terms;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Advertisement

Leave a Reply