-
Notifications
You must be signed in to change notification settings - Fork 27
Delete multiple events at once #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete multiple events at once #81
Conversation
General improvements to the build process
Escape prefix when listing all tables with prefix
Display correct error when plugin update fails to update plugins
```
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing symfony/finder (v2.8.16)
- Installing symfony/finder (v2.8.17)
Loading from cache
- Removing symfony/yaml (v2.8.16)
- Installing symfony/yaml (v2.8.17)
Downloading: 100%
- Removing symfony/filesystem (v2.8.16)
- Installing symfony/filesystem (v2.8.17)
Loading from cache
- Removing symfony/config (v2.8.16)
- Installing symfony/config (v2.8.17)
Downloading: 100%
- Removing symfony/debug (v2.8.16)
- Installing symfony/debug (v2.8.17)
Downloading: 100%
- Removing symfony/console (v2.8.16)
- Installing symfony/console (v2.8.17)
Downloading: 100%
- Removing symfony/dependency-injection (v2.8.16)
- Installing symfony/dependency-injection (v2.8.17)
Downloading: 100%
- Removing symfony/event-dispatcher (v2.8.16)
- Installing symfony/event-dispatcher (v2.8.17)
Loading from cache
- Removing symfony/process (v2.8.16)
- Installing symfony/process (v2.8.17)
Downloading: 100%
- Removing symfony/translation (v2.8.16)
- Installing symfony/translation (v2.8.17)
Downloading: 100%
- Removing wp-cli/php-cli-tools (v0.11.1)
- Installing wp-cli/php-cli-tools (v0.11.2)
Downloading: 100%
Writing lock file
Generating autoload files
```
Update Composer dependencies (2/15/2017)
Uses the snippet from the Travis CI Docs found here: [https://docs.travis-ci.com/user/languages/php#Disabling-preinstalled-PHP-extensions](https://docs.travis-ci.com/user/languages/php#Disabling-preinstalled-PHP-extensions) Fixes #3812
Remove XDebug from PHP runtime within Travis CI environment.
Cache Composer in scaffolded plugin `.travis.yml`
Issues 3817 Existing PDF previews not deleted on media regenerate.
By default, disable auto-commit and (unique and forefin) key checks. Introduce skip-optimization flag to force old behavior.
This reverts commit 7c8dbb9.
janw-me
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the refactor.
The tests need a bit more work.
|
@Mike-Hermans @janw-me How's this pull request coming along? Anything I can help with? |
|
I was waiting on a response from @janw-me on the cron.feature test from the conversation above, and a new review based on the changes made. |
|
Sorry, I didn't see the notification. |
src/Cron_Event_Command.php
Outdated
| if ( empty( $args ) && ! Utils\get_flag_value( $assoc_args, 'due-now' ) && ! Utils\get_flag_value( $assoc_args, 'all' ) ) { | ||
| WP_CLI::error( 'Please specify one or more cron events, or use --due-now/--all.' ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs safeguards for flag combinations that don't make sense.
- If you provide hooks, the addition of
--due-nowor--allshould throw an error. - Providing both
--due-nowand--allat the same time should throw an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: these should also have there seperate test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. I will fix this soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @schlessera
After seeing other tests break I realized it should be possible to select hooks and combine them with the --due-now parameter. Only hooks + --all and --due-now --all should be invalid.
|
Hi @schlessera I've updated the code and tests. Hooks are now valid in combination with --due-now, as this was already possible on the 'run' command as well. |
|
Proceeding with wp-cli/wp-cli#5594 for this repository. I've captured this PR to https://gist.github.com/danielbachhuber/09504e7a7cdb1144c2e6162950d2f594 in case this PR is auto-closed or broken in some way. |
406abbd to
20e7367
Compare
Fixes #39 by making the command more consistent with the
wp cron event runcommand.It is now possible to delete multiple cron events at once by either:
Since the selection process of the
runanddeletecommand is now the same, a separate function has been added to filter the required hooks (::get_selected_cron_events()).