wpseek.com
WordPress开发者和主题制作者的搜索引擎



has_term_meta › WordPress Function

Since4.9.0
已弃用n/a
has_term_meta ( $term_id )
参数:
  • (int) $term_id Term ID.
    Required: Yes
返回:
  • (array|false) Array with meta data, or false when the meta table is not installed.
定义在:
文档:

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



源码

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 );
}