这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jorgeatorres
Copy link
Member

@jorgeatorres jorgeatorres commented Oct 23, 2025

This PR addresses a possible warning when an error occurs while processing the wp action-scheduler action cancel --all command.

Closes #1268.

Testing Instructions

  1. Temporarily enable the following snippet on your site to simulate an error occurring while bulk-canceling actions:
    <?php
    add_action(
        'action_scheduler_bulk_cancel_actions',
        function() {
            throw new \Exception( 'Some error' );
        }
    );
  2. Run the following commands:
    $ wp action-scheduler action create myhook async
    $ wp action-scheduler action cancel myhook --all
    
  3. Confirm no new PHP warning is logged.
  4. (Optional) Repeat the above on trunk and confirm that the following error appears in your logs:

    PHP Warning: Undefined variable $multiple in /[...]/action-scheduler/classes/WP_CLI/Action/Cancel_Command.php on line 82

@jorgeatorres jorgeatorres changed the title Fix possible undefined variable in cancel_all CLI command Fix possible undefined variable in action cancel --all CLI command Oct 23, 2025
@jorgeatorres jorgeatorres marked this pull request as ready for review October 23, 2025 18:06
@jorgeatorres jorgeatorres requested review from a team and Konamiman and removed request for a team October 23, 2025 18:06
@jorgeatorres jorgeatorres merged commit f5550b2 into trunk Oct 24, 2025
104 checks passed
@jorgeatorres jorgeatorres deleted the fix/1268 branch October 24, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cancel_all exception uses undefined variable $multiple

3 participants