WordPress at Your Fingertips
function is not described

has_meta() WP 1.2.0

Get meta data for the given post ID.

No Hooks.

Return

Mixed.

Usage

has_meta( $postid );
$postid(int) (required)
-

Notes

  • Global. wpdb. $wpdb WordPress database abstraction object.

Changelog

Since 1.2.0 Introduced.

Code of has_meta() WP 5.8.2

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