Switch language

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




get_post_custom [ WordPress Function ]

get_post_custom ( $post_id = 0 )
Parameters:
  • (int) $post_id Post ID.
Links:
Returns:
  • (array)
Defined at:



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.

Source


<?php
function get_post_custom$post_id ) {
    
$post_id absint$post_id );
    if ( ! 
$post_id )
        
$post_id get_the_ID();

    return 
get_post_meta$post_id );
}
?>

Examples [ wp-snippets.com ]

Top Google Search Results

More ...

0 User Note(s)

None yet. Be the first!

Add New ...



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