That depends on where you want it to appear. Most of the time when using shortcodes it because you’re putting them in the middle of content in the wysiwyg editor. If it will appear in a specific place, either before or after the content, then I would use PHP. On the other hand, if you need it to be in the middle of the content somewhere then building a shortcode is pretty much the only option.
If you can do it with simple php then this is all you should need and you can even remove the filter to run shortcodes on textarea fields.
echo do_shortcode(get_field('field_name', 'user_'.get_current_user_id()));
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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.