WPCLI get the name of command
-
Hello,
Using the built-in wpcli hookbefore_run_command
I’d like to be able to check to see if the command being run is search-replace. But for the life of me I can’t figure out how to get this. code:function nrd_before_any_command_run() { // // need to replace COMMAND with the actual command being run. if( 'search-replace' == COMMAND ) { WP_CLI::confirm( "Are you sure?" ); } } WP_CLI::add_hook( 'before_run_command', 'nrd_before_any_command_run' );
Thanks for any help!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WPCLI get the name of command’ is closed to new replies.