Support » Fixing WordPress » get_post_meta to check for 0 meta value

Viewing 2 replies - 1 through 2 (of 2 total)
  • setting $single to true returns the value as a string, not an array

    $meta_values = get_post_meta($post->ID, 'keyname', false);

    will return as array.

    You should also check meta_values after the fact with is_array()

    if (is_array($meta_values)) {

    thank you got it sorted. it was custom post type $meta_key problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_post_meta to check for 0 meta value’ is closed to new replies.