From a1445bb8dcfd88108d3b681076f89f89cfccd231 Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Fri, 2 Feb 2024 16:07:07 +0200 Subject: [PATCH] Minor: Fix misleading doc-comment and argument name. Previously, triggerUpdateCheckOnce() was attached to a transient filter, but that's no longer the case. Now it's passed directly to WP_CLI::add_hook(). However, it still takes and returns a value. WP-CLI documentation says that the `before_invoke:` hook takes one argument and acts as a filter. --- Puc/v5p3/WpCliCheckTrigger.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Puc/v5p3/WpCliCheckTrigger.php b/Puc/v5p3/WpCliCheckTrigger.php index 7607090..df5028c 100644 --- a/Puc/v5p3/WpCliCheckTrigger.php +++ b/Puc/v5p3/WpCliCheckTrigger.php @@ -65,23 +65,20 @@ class WpCliCheckTrigger { /** * Trigger a potential update check once. * - * The update transient can be read multiple times during a single WP-CLI command execution. - * For performance, we only want to trigger an update check once. - * - * @param mixed $transient + * @param mixed $input * @return mixed The input value, unchanged. * @internal This method is public so that it can be used as a WP-CLI hook callback. * It should not be called directly. * */ - public function triggerUpdateCheckOnce($transient) { + public function triggerUpdateCheckOnce($input = null) { if ( $this->wasCheckTriggered ) { - return $transient; + return $input; } $this->wasCheckTriggered = true; $this->scheduler->maybeCheckForUpdates(); - return $transient; + return $input; } } \ No newline at end of file