Support

Account

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.