Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_post_custom_values [ WordPress Function ]

get_post_custom_values ( $key = '', $post_id = 0 )
Parameters:
  • (string) $key Meta field key.
  • (int) $post_id Post ID
Links:
Returns:
  • (array) Meta field values.
Defined at:



Retrieve values for a custom post field.

The parameters must not be considered optional. All of the post meta fields will be retrieved and only the meta field key values returned.

Source


<?php
function get_post_custom_values$key ''$post_id ) {
    if ( !
$key )
        return 
null;

    
$custom get_post_custom($post_id);

    return isset(
$custom[$key]) ? $custom[$key] : null;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics