Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
dfdfd924
Commit
dfdfd924
authored
Dec 05, 2016
by
Erick Hitter
Committed by
GitHub
Dec 05, 2016
Browse files
Merge pull request #34 from Automattic/add/cli-for-cpt
Introduce command to flush plugin's cache
parents
462e1c50
7e005f30
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/wp-cli.php
View file @
dfdfd924
...
...
@@ -30,4 +30,5 @@ function stop_the_insanity() {
/**
* Load commands
*/
require
__DIR__
.
'/wp-cli/class-data.php'
;
require
__DIR__
.
'/wp-cli/class-one-time-fixers.php'
;
includes/wp-cli/class-data.php
0 → 100644
View file @
dfdfd924
<?php
namespace
Automattic\WP\Cron_Control\CLI
;
/**
* Manage Cron Control's data, including internal caches
*/
class
Data
extends
\
WP_CLI_Command
{
/**
* Flush Cron Control's internal caches
*
* eg.: `wp --allow-root cron-control-data flush-cache`
*
* @subcommand flush-cache
*/
public
function
flush_internal_cache
(
$args
,
$assoc_args
)
{
$flushed
=
wp_cache_delete
(
\
Automattic\WP\Cron_Control\Cron_Options_CPT
::
CACHE_KEY
);
if
(
$flushed
)
{
\
WP_CLI
::
success
(
__
(
'Internal caches cleared'
,
'automattic-cron-control'
)
);
}
else
{
\
WP_CLI
::
warning
(
__
(
'No caches to clear'
,
'automattic-cron-control'
)
);
}
}
}
\
WP_CLI
::
add_command
(
'cron-control-data'
,
'Automattic\WP\Cron_Control\CLI\Data'
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment