Support

Account

Home Forums Add-ons Flexible Content Field Is it possible to load all layouts on default? Reply To: Is it possible to load all layouts on default?

  • Hey Elliot,

    Thanks for the reply, but I dont fully understand (yet). Adding dummy data like this is different from adding a default value to a field right? Because when I do that, I still have to manually add every item.

    I read the docs but they are very unclear to me. This is the code I added to see what would happen, and I got a whole bunch of errors.

    function my_acf_load_value( $value, $post_id, $field )
    {
        // run the_content filter on all textarea values
        $value = apply_filters('the_content',$value); 
     
        return $value;
    }
      
    // acf/load_value/type={$field_type} - filter for a value load based on it's field type
    add_filter('acf/load_value/type=checkbox', 'my_acf_load_value', 10, 3);
    

    This is the most of the errors I get

    preg_split() expects parameter 2 to be string, array given in on line : Invalid argument supplied for foreach() in on line : implode() []: Invalid arguments passed in on line : 
    
    Warning
    : implode() [
    function.implode
    ]: Invalid arguments passed in
    /home/rapport/domains/rapport.pro/public_html/wp-includes/formatting.php
    on line
    130
    

    Almost all fields are checkboxes or text-fields. I cant seem to understand the function, in the docs it declares $value as $value (??) and the $field is never used in the code?

    I’m kinda newbie to all this :$