Hello,
I have a shortcode for display year
the shortcode works well on WYSIWYG but on ACF field it shows me [year].
function year() {
$year = date(‘Y’);
return $year;
}
add_shortcode(‘year’, ‘year’);
this is the function I wrote for the shortcode.
to call the shortcode I write [year] and everything works except on the ACF fields.
what is the problem?
Thank you.
ACF only runs shortcodes when “the_content” hook is run, this only happens for WYSIWYG fields. See this https://www.advancedcustomfields.com/resources/acf-format_value/
I didn’t understand what I need to do with this filter.
You need to put it in your functions.php file