has_meta() – Get meta data for the given post ID.

You appear to be a bot. Output may be restricted

Description

Returns meta data for the given post ID.

Usage

$array[] = has_meta( $postid );

Parameters

$postid
( int ) required – A post ID.
…$0
( array ) required – { Associative array of meta data.
$meta_key
( string ) required – Meta key.
$meta_value
( mixed ) required – Meta value.
$meta_id
( string ) required – Meta ID as a numeric string.
$post_id
( string ) required – Post ID as a numeric string. } }

Returns

array[] { Array of meta data arrays for the given post ID.

Source

File name: wordpress/wp-admin/includes/post.php
Lines:

1 to 13 of 13
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
  );
}
 

 View on GitHub View on Trac