Last active
December 20, 2017 21:07
-
-
Save coderkevin/50eed1e4923428e51ece4fcfd45d0107 to your computer and use it in GitHub Desktop.
WooCommerce Data Store Demo - Product Inventory - Plugin hook
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
class WC_Product_Inventory_Data_Store_Plugin { | |
public function __construct() { | |
add_filter( 'woocommerce_data_stores', array( $this, 'install_data_store' ) ); | |
} | |
public function install_data_store( $stores ) { | |
include_once dirname( __FILE__ ) . '/class-product-inventory-data-store.php'; | |
$instance = new WC_Product_Inventory_Data_Store( $stores[ 'product' ] ); | |
$stores[ 'product' ] = $instance; | |
return $stores; | |
} | |
} | |
new WC_Product_Inventory_Data_Store_Plugin(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment