Support

Account

Home Forums Front-end Issues Post Object Field – Set selected value programatically Reply To: Post Object Field – Set selected value programatically

  • You can use the update_field function to put the post ID in outside of anything related to the ACF form:

    <?php update_field($selector, $value, $post_id); ?>

    $selector would be the field ID: field_57319b21314aa

    Depending on the rest of the setup I think would depend on how would be most effective to get that information into the form, whether it’s populated before or after you submit. It could be possible to use the WP pre_get_posts() hook or the acf/save_post hook, grab the post ID and then update the field with it in the relevant place.