Skip to content

Instantly share code, notes, and snippets.

@ashfame
Last active August 29, 2015 14:19
Show Gist options
  • Save ashfame/b21c223e904da83bedab to your computer and use it in GitHub Desktop.
Save ashfame/b21c223e904da83bedab to your computer and use it in GitHub Desktop.
Example of how to override a WP-CLI command
<?php
if ( defined('WP_CLI') && WP_CLI ) {
class Transient_Mod_Command extends Transient_Command {
public function delete_all() {
// new definition of delete-all subcommand
}
}
WP_CLI::add_command( 'transient', 'Transient_Mod_Command' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment