Home › Forums › ACF PRO › ACF Custom Field Type › Reply To: ACF Custom Field Type
What does your render field method look like?
Given the example in the field type template it should probably look something like
?>
<input type="text" name="<?php echo esc_attr($field['name']) ?>[field1]" value="<?php echo esc_attr($field['value']['field1']) ?>" style="font-size:<?php echo $field['font_size'] ?>px;" />
<input type="text" name="<?php echo esc_attr($field['name']) ?>[field2]" value="<?php echo esc_attr($field['value']['field2']) ?>" style="font-size:<?php echo $field['font_size'] ?>px;" />
<?php
You should notice that I turned the value into a nested array and I’m also echoing out each of the values of this array independently.
I’m not 100% sure that this is all you’d need to do. You may need to also do some work on the save_field and load_field methods and you’ll certainly want to do some work on the format_value method.
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.