According to the docs of get_post_meta()
, you could try
- relying on the return value of the
get_post_meta()
function, or - use the
get_post_custom_keys()
function.
N.B. If you’re going for the first option, you could use the object operator ->
to get the meta value from the post, and circumvent having to call get_post_meta()
yourself. View it on Trac here.