Skip to content

Instantly share code, notes, and snippets.

@wischli
Created June 5, 2019 10:58
Show Gist options
  • Save wischli/9db791f2069ca4713e49cd4db752a0e4 to your computer and use it in GitHub Desktop.
Save wischli/9db791f2069ca4713e49cd4db752a0e4 to your computer and use it in GitHub Desktop.
Wordpress enable shortcode rendering for AFC values
// enable shortcode rendering for values of types text and textarea (type array or object would lead to an error)
// more information: https://www.advancedcustomfields.com/resources/#filters
add_filter('acf/format_value/type=textarea', 'do_shortcode');
add_filter('acf/format_value/type=text', 'do_shortcode');
// if you wish to also enable shortcode rendering for the title add these two lines
add_filter('get_the_title', 'do_shortcode');
add_filter('the_title', 'do_shortcode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment