has_meta( int $postid ): array[]
Returns meta data for the given post ID.
Parameters
-
$postid
int Required -
A post ID.
Return
array[] Array of meta data arrays for the given post ID.
...$0
arrayAssociative array of meta data.meta_key
stringMeta key.meta_value
mixedMeta value.meta_id
stringMeta ID as a numeric string.post_id
stringPost ID as a numeric string.
Source
File:
wp-admin/includes/post.php
. View all referencesfunction 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 ); }
Changelog
Changelog Version Description 1.2.0 Introduced.
User Contributed Notes