Home › Forums › ACF PRO › Get the $post_id in render_field method › Reply To: Get the $post_id in render_field method
Oops! Don’t worry about it, I just realised I can access the post ID from my previous AJAX call via $_POST.
I still agree with @emrl and think it’d be good to include the post ID somehow. As an example, my application is a task manager. When clicking on a task a modal pop-up opens with the acf_form. I have registered a custom ACF field that lets you add subtasks, so when adding one I’m calling wp_insert_post() and I need the task post ID to set the post_parent on the subtask.
I’m sure there are many more scenarios where the post ID would be useful 🙂
Cheers guys, keep up the good work!
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.