Advertisements

post_custom

Definition:
function post_custom( $key = '' ) {}

Retrieve post custom meta data field.

Parameters

  • string $key: Meta data key name.

Return values

returns:Array of values or single value, if only one element exists. False will be returned if key does not exist.

Source code

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];

}

2565

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: