has_term_meta( int $term_id )

Get all meta data, including meta IDs, for the given term ID.


Parameters Parameters

$term_id

(int) (Required) Term ID.


Top ↑

Return Return

(array|false) Array with meta data, or false when the meta table is not installed.



Top ↑

Source Source

File: wp-includes/taxonomy.php

function has_term_meta( $term_id ) {
	$check = wp_check_term_meta_support_prefilter( null );
	if ( null !== $check ) {
		return $check;
	}

	global $wpdb;

	return $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value, meta_id, term_id FROM $wpdb->termmeta WHERE term_id = %d ORDER BY meta_key,meta_id", $term_id ), ARRAY_A );
}

Top ↑

Changelog Changelog

Changelog
Version Description
4.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.