From 94439555f379148065d622e8cb2cd74bf4ad7bc6 Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Wed, 16 Oct 2024 22:16:11 -0300 Subject: [PATCH] Restore incorrect change where a `push` could be sent synchronously --- admin/apple-actions/index/class-push.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/apple-actions/index/class-push.php b/admin/apple-actions/index/class-push.php index 2f7782a0..6bed4414 100644 --- a/admin/apple-actions/index/class-push.php +++ b/admin/apple-actions/index/class-push.php @@ -78,7 +78,7 @@ public function __construct( $settings, $id ) { * @param boolean $doing_async Optional. Whether the action is being performed asynchronously. * @param int $user_id Optional. The ID of the user performing the action. Defaults to the current user ID. * - * @return boolean + * @return false|null * @throws Action_Exception If the push fails. */ public function perform( $doing_async = false, $user_id = null ) { @@ -95,9 +95,9 @@ public function perform( $doing_async = false, $user_id = null ) { update_post_meta( $this->id, 'apple_news_api_pending', time() ); wp_schedule_single_event( time(), Admin_Apple_Async::ASYNC_PUSH_HOOK, [ $this->id, get_current_user_id() ] ); + } else { + return $this->push( $user_id ); } - - return $this->push( $user_id ); } /**