Skip to content

Instantly share code, notes, and snippets.

@Oceas
Last active September 19, 2019 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oceas/bd4ad24fa1e7d8ba8623de3eb038ac4e to your computer and use it in GitHub Desktop.
Save Oceas/bd4ad24fa1e7d8ba8623de3eb038ac4e to your computer and use it in GitHub Desktop.
<?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