- Nov 16, 2019
- 19
- 6
- 3
I am struggling to resolve this but my knowledge of php is very limited..
I will appreciate a little help
i have a acf field with name logo1 and is textarea.
inside this field is some lines with text.
I need a php function to use it on oxygen builder to return this values as <li>
i have the bellow code but not working i get error 500.
any help?
I will appreciate a little help
i have a acf field with name logo1 and is textarea.
inside this field is some lines with text.
I need a php function to use it on oxygen builder to return this values as <li>
i have the bellow code but not working i get error 500.
any help?
PHP:
<?php
function my_acf_format_value( $value, $post_id, $field ) {
$items_as_array = explode("\n", $value);
$output = "<ul style='list-style-type: circle;'><li>" . implode("</li><li>", $items_as_array) . "</li></ul>";
return $output;
}
add_filter('acf/format_value/key=logo1', 'my_acf_format_value', 10, 3);
?>