Home › Forums › General Issues › Custom Text Field Won't Output Shortcode Data › Reply To: Custom Text Field Won't Output Shortcode Data
You won’t be able to use the ACF shortcode. ACF shortcodes are meant for showing simple fields that are always the same. The ACF shortcode that you add to the page must have the field name and the post_id to use for the user. If the user ID is always the same then it will work but if you want it to be dynamic based on the user that’s logged in then the ACF shortcode will not work. You will need to build your own code the create a custom shortcode that will get the current users id and get the correct field and display it. I would suggest looking at https://codex.wordpress.org/Function_Reference/add_shortcode and https://codex.wordpress.org/Function_Reference/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.