Post meta as post object method

Thanks Erick Hitter for presenting this at WCPHX

In WP >=3.5


global $post
$meta = get_post_meta( '$post->ID, 'my_key', true );

… is the same as …


global $post
$meta = $post->mey_key;

Leave a Reply

Your email address will not be published. Required fields are marked *