Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Assigned] Check if exists repeating field

$
0
0

Hi octavioP,

If a repeating field does not exists, get_post_meta($post->ID, 'wpcf-xxxx') will return an empty array: array();
You can try this:

 
...
if (!get_post_meta($post->ID, 'wpcf-xxxx'))
{
...exists repeating field ...
}

More help: http://codex.wordpress.org/Function_Reference/get_post_meta
get_post_meta($post_id, $key, $single);
If $single is set to false, or left blank, the function returns an array containing all values of the specified key.


Viewing all articles
Browse latest Browse all 20145

Trending Articles