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



has_meta ›

Since1.2.0
已弃用n/a
has_meta ( $postid )
参数:
  • (int) $postid
    Required: Yes
返回:
  • (mixed)
定义在:
文档:

Get meta data for the given post ID.



源码

function has_meta( $postid ) {
	global $wpdb;

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