Support

Account

Home Forums Front-end Issues Execute shortcode on text area Instructions Reply To: Execute shortcode on text area Instructions

  • Are you trying to make the shortcode work when editing the field in ACF or when someone else is editing a post and adding content to the field?

    I tested this and it works perfectly on my test field named “some_shortcode” when I added [some_shortcode] to the acf instuctions field.

    
    add_filter('acf/prepare_field/name=some_shortcode', 'do_sortcode_in_field_instructions');
    function do_sortcode_in_field_instructions($field) {
    	$field['instructions'] = do_shortcode($field['instructions']);
      return $field;
    }
    
    add_shortcode('some_shortcode', 'do_some_shortcode');
    function do_some_shortcode() {
    	return 'this is result from the shortcode';
    }