has_term_meta()

最后更新于:2021-11-27 05:23:09

has_term_meta( int$term_id)

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

参数

$term_id

(int) (Required) Term ID.

响应

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

源文件

文件: gc-includes/taxonomy.php

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

	global $gcdb;

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