Update Post Author After Claim

Use the following hook implementation to update post author after claim.


add_action( "owf_claim_action", "update_post_author", 10, 2 );


$action_histories : array of action histories for the claim action.
$new_history_id : new history id created after the claim action.


add_action( "owf_claim_action", "update_post_author", 10, 2 );

function update_post_author( $action_histories, $new_history_id ) {
   global $wpdb;   
   $ow_history_service = new OW_History_Service();
   $claimed_post_history = $ow_history_service->get_action_history_by_id( $new_history_id );

   // Get post id and assigned task user.
   $post_id = $claimed_post_history->post_id;
   $post_claimed_user = $claimed_post_history->assign_actor_id;

   // update the post author here

Source Code

The filter is located in class-ow-process-flow.php.