the_field()
echos the content of the field, the same way that the WP function the_title()
echos the title. You need to use get_field()
when you don’t want the value echoed where the function is called.
function DisclaimerShortcode() {
return get_field(‘gpo_disclaimer’, ‘option’);
}
add_shortcode(‘disclaimer’, ‘DisclaimerShortcode’);