Support

Account

Home Forums Backend Issues (wp-admin) update_field is not working in action hook Reply To: update_field is not working in action hook

  • There is another thing I just thought of that could also be a problem. Try supplying the post ID.

    
    add_action('draft_to_publish', 'your_function_name');
    function your_function_name($post) {
      update_field('your field key', $post->ID);
    }