$request =
wp_get_user_request( $request_id );
if ( !
$request ) { return;
} if ( !
in_array( $request->status, array
( 'request-pending', 'request-failed'
), true
) ) { return;
} update_post_meta( $request_id, '_wp_user_request_confirmed_timestamp',
time() );
wp_update_post( array
( 'ID' =>
$request_id,
'post_status' => 'request-confirmed',
) );
}/**
* Notifies the site administrator via email when a request is confirmed.
*
* Without this, the admin would have to manually check the site to see if any
* action was needed on their part yet.
*
* @since 4.9.6
*
* @param int $request_id The ID of the request.
*/