Home Forums ACF PRO Get the $post_id in render_field method Reply To: Get the $post_id in render_field method

  • @emrl

    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!