Home › Forums › Backend Issues (wp-admin) › ACF Field using WYSIWYG Editor › Reply To: ACF Field using WYSIWYG Editor
I tried using the field key but I must have something incorrect. I tried name= type= and key= without success. I also tried all combos using the field key for the actual textarea field and the flex field key. The textarea field name is definitely ‘ingredients’.
add_filter ('acf/format_value/name=field_5bc60b64aa3bd', 'format_ingredients', 20, 3);
function format_ingredients($value, $post_id, $field) {
if (!$value) {
return $value;
}
$array = acf_decode_choices($value);
if (!is_array($array) || empty($array)) {
return $value;
}
ob_start();
?>
<ul>
<?php
foreach ($array as $line) {
?><li><?php echo $line; ?></li><?php
}
?>
</ul>
<?php
$value = ob_get_clean();
return $value;
}
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.