WordPress at a glance

get_post_custom() WP 1.0

Retrieve post meta fields, based on post ID.

The post meta fields are retrieved from the cache where possible, so the function is optimized to be called more than once.

Works based on: get_post_meta()

No Hooks.


Array. Post meta for the given post.


get_post_custom( $post_id );
Post ID.
Default: ID of the global $post

Code of get_post_custom: wp-includes/post.php VER 5.0.1

function get_post_custom( $post_id = 0 ) {
	$post_id = absint( $post_id );
	if ( ! $post_id )
		$post_id = get_the_ID();

	return get_post_meta( $post_id );

Related Functions

From tag: Metadatas (any)

No comments
    Hello, !     Log In . Register