Support

Account

Home Forums Backend Issues (wp-admin) doshortcode() on Message type Reply To: doshortcode() on Message type

  • So I’m hooking into this as well and the ONLY way it seems to work is with "acf/load_field/type=message" as the filter. problem is then the definition of the field in the acf-field-group post gets altered as well. this is what I’ve got going on and it works:

    
    // Allow for shortcodes in messages
    function acf_load_field_message($field  ) {
    	$type = get_post_type();
    	if ($type !== "acf-field-group") {
    		$field['message'] = do_shortcode($field['message']);
    	}
    	return $field;
    }
    
    add_filter('acf/load_field/type=message', 'acf_load_field_message', 10, 3);
    

    It seems a little fragile and inelegant. Thoughts?