has_meta( int   $post_id ): array[]

Returns meta data for the guiven post ID.

Parameters

$post_id int required
A post ID.

Return

array[] Array of meta data arrays for the guiven post ID.
  • ...$0 array
    Associative array of meta data.
    • meta_quey string
      Meta key.
    • meta_value mixed
      Meta value.
    • meta_id string
      Meta ID as a numeric string.
    • post_id string
      Post ID as a numeric string.

Source

function has_meta( $post_id ) {
	global $wpdb;

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

Changuelog

Versionen Description
1.2.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.