Created
June 10, 2013 00:54
-
-
Save rmccue/5745916 to your computer and use it in GitHub Desktop.
Example of state management via Puppet for WooCommerce
This file contains 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 | |
class Tyuratam_CLI_WooCommerce extends WP_CLI_Command { | |
/** | |
* Installs the default WooCommerce pages | |
*/ | |
public function install_pages() { | |
if ( ! get_option( 'skip_install_woocommerce_pages', 0 ) ) { | |
require_once( $GLOBALS['woocommerce']->plugin_path() . '/admin/woocommerce-admin-install.php' ); | |
woocommerce_create_pages(); | |
update_option('skip_install_woocommerce_pages', 1); | |
} | |
} | |
public function hide_notice() { | |
update_option('woocommerce_installed', 0); | |
} | |
} | |
WP_CLI::add_command( 'ty_woo', 'Tyuratam_CLI_WooCommerce' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment