Last active
September 19, 2019 18:55
-
-
Save Oceas/bd4ad24fa1e7d8ba8623de3eb038ac4e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WDS Hello World | |
Plugin URI: https://webdevstudios.com/ | |
Description: Teaching the basics of WP-CLI | |
Author: Web Dev Studios | |
Version: 1.0.0 | |
Author URI: https://webdevstudios.com/ | |
*/ | |
class WDS_CLI { | |
/** | |
* Returns 'Hello World' | |
* | |
* @since 0.0.1 | |
* @author Scott Anderson | |
*/ | |
public function hello_world() { | |
WP_CLI::line( 'Hello World!' ); | |
} | |
} | |
/** | |
* Registers our command when cli get's initialized. | |
* | |
* @since 1.0.0 | |
* @author Scott Anderson | |
*/ | |
function wds_cli_register_commands() { | |
WP_CLI::add_command( 'wds', 'WDS_CLI' ); | |
} | |
add_action( 'cli_init', 'wds_cli_register_commands' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment