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?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.