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 :$
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!
The most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.