wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



post_custom › WordPress Function

Da1.5.0
Deprecaton/a
› post_custom ( $key = '' )
Parametri:
  • (string) $key Meta data key name.
    Richiesto: No
    Default: (vuoto)
Ritorna:
  • (string[]|string|false) Array of values, or single value if only one element exists.
    False if the key does not exist.
    Values are always strings, as described for {@see get_post_custom()}.
Definito a:
Codex:

Retrieves post custom meta data field.



Sorgenti

function post_custom( $key = '' ) {
	$custom = get_post_custom();

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