mirror of
https://github.com/YahnisElsts/plugin-update-checker.git
synced 2025-10-04 02:02:05 +08:00
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:<command>` hook takes one argument and acts as a filter.
This commit is contained in:
parent
36efab0022
commit
a1445bb8dc
1 changed files with 4 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue