Home › Forums › Add-ons › Flexible Content Field › Check if two row layouts are used › Reply To: Check if two row layouts are used
The value stored in the database for a flex field is an array. The array contains a list, in order of the layouts that exist in the flex field. You can get this by using get_post_meta()
$layouts = get_post_mata($post->ID, 'flex_field_name', true);
if (is_array($layouts) &&
in_array('property_specs', $layouts) &&
in_array('property_overview', $layouts)) {
// both exist
}
that will tell you if both exist, but not tell you if one follows the other.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.