Switch language

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




post_custom [ WordPress Function ]

post_custom ( $key = '' )
Parameters:
  • (string) $key Meta data key name.
Returns:
  • (bool|string|array) Array of values or single value, if only one element exists. False will be returned if key does not exist.
Defined at:



Retrieve post custom meta data field.

Source


<?php
function post_custom$key '' ) {
    
$custom get_post_custom();

    if ( !isset( 
$custom[$key] ) )
        return 
false;
    elseif ( 
== count($custom[$key]) )
        return 
$custom[$key][0];
    else
        return 
$custom[$key];
}
?>

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