A WordPress-centric search engine for devs and theme authors



has_meta ›

Since1.2.0
Deprecatedn/a
has_meta ( $postid )
Parameters:
  • (int) $postid
    Required: Yes
Returns:
  • (mixed)
Defined at:
Codex:

Get meta data for the given post ID.



Source

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