PluginProbe
Autoptimize / 2.7.0
Autoptimize v2.7.0
2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 All 107 releases
autoptimize / classes / autoptimizeCLI.php

autoptimizeCLI.php in Autoptimize 2.7.0, at classes/autoptimizeCLI.php

35 lines 743 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WP-CLI commands for Autoptimize.
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit;
8 }
9
10 // This is a WP-CLI command, so bail if it's not available.
11 if ( ! defined( 'WP_CLI' ) ) {
12 return;
13 }
14
15 class autoptimizeCLI extends \WP_CLI_Command
16 {
17 /**
18 * Clears the cache.
19 *
20 * @subcommand clear
21 *
22 * @param array $args Args.
23 * @param array $args_assoc Associative args.
24 *
25 * @return void
26 */
27 public function clear( $args, $args_assoc ) {
28 WP_CLI::line( esc_html__( 'Flushing the cache...', 'autoptimize' ) );
29 autoptimizeCache::clearall();
30 WP_CLI::success( esc_html__( 'Cache flushed.', 'autoptimize' ) );
31 }
32 }
33
34 WP_CLI::add_command( 'autoptimize', 'autoptimizeCLI' );
35