Home › Forums › Backend Issues (wp-admin) › doshortcode() on Message type › Reply To: doshortcode() on Message type
Hi @infn8
The code looks great for me. You can also use the get_current_screen() function to check the post type like this:
// Allow for shortcodes in messages
function acf_load_field_message($field ) {
$screen = get_current_screen();
if ($screen->post_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);
Thanks!
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.