Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Jason_9
    Participant

    Hi Aakash

    First let me say a big thank you for creating one of the most professional and useful WordPress plugins on the planet.

    Just wondering if you could clarify something for me:

    I created a shortcode with Shortcoder and put it within an ACF field. By default, shortcodes cannot run within ACF fields, it just displays as text.

    After looking for an easy solution to add via functions.php, I found that this works perfectly:

    add_filter('acf/format_value/type=textarea', 'do_shortcode');

    Can you please let me know if this is the way you would do it? Is it safe to do it this way? I need to do it via functions.php and not edit any template files.

    Any thoughts are appreciated. Thanks.

    Hi Jason,

    Thanks for using Shortcoder. Happy that you like it.

    Shortcodes are executed in most places by default by WordPress using the function do_shortcode

    But sometimes, certain fields/text of other plugins do not evaluate the shortcode. We must use the same do_shortcode function to do that.

    In your case yes, the code you have used is correct.
    Cheers!

    Thanks,
    Aakash

    Jason_9
    Participant

    Excellent, thank you very much Aakash. Just wanted to be sure it didn’t open up any security holes by enabling that….Thanks again.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms