Support

Account

Home Forums ACF PRO has_shortcode not detected? Reply To: has_shortcode not detected?

  • When you use an ACF field and get the value of the field it is already formatted and any shortcodes are already run when you get the value.

    If you want to test for the shortcode in the content then you need to get the unformatted value get_field('field_name', false, false) The 2nd parameter is the post ID, setting to false uses the current post ID and the 3rd parameter tells ACF to not format the value.

    Another option would be to test the formatted content to see if it contains a form.