Support

Account

Home Forums Bug Reports Flexible Content data still in wp_postmeta after layout removed Reply To: Flexible Content data still in wp_postmeta after layout removed

  • When you display the data for flex fields you shouldn’t be trying to get fields that aren’t associated with that particular layout.

    
    $layout = get_row_layout();
    if ($layout == 'layout_1') {
        // show fields associated with layout 1 
    } elseif ($layout == 'layout_2') {
        // show fields associated with layout 2
    }
    

    Just a basic example, could be far more complicated depending on what you’re doing. For example if 2 layouts have some fields in common then there might be function calls for those groups of fields.