-
Notifications
You must be signed in to change notification settings - Fork 0
/
command.php
51 lines (45 loc) · 907 Bytes
/
command.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* wp-cli boilerplate
*
* @version 0.0.1
* @author Paolo Tresso <plugins@swergroup.com>
*/
if ( true === class_exists( 'WP_CLI_Command' ) ){
/**
* Do something.
*/
class WP_CLI_Boilerplate_Command extends WP_CLI_Command{
private $version = '0.1.3';
/**
* Do something.
*
* ## OPTIONS
*
* [--flags=<flags>]
* : additional commandline flags
*
* ## EXAMPLES
*
* wp boilerplate
*
* @since 0.0.1
* @when before_wp_load
* @synopsis [--flags=<flags>]
*/
public function __invoke( $args = null, $assoc_args = null ){
print_r( $args );
print_r( $assoc_args );
}
/**
* Return command version
*
* @since 0.0.1
* @when before_wp_load
*/
public function version(){
WP_CLI::line( 'wp-cli boilerplate command ' . $this->version );
}
}
WP_CLI::add_command( 'boilerplate', 'WP_CLI_Boilerplate_Command' );
}