Home › Forums › General Issues › Custom Text Field Won't Output Shortcode Data › Reply To: Custom Text Field Won't Output Shortcode Data
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!
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.