Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Reinstall Jigoshop Order Types
- Plugin URI: http://www.futuregencode.com
- Description: Reinstalls the order statuses
- Version: 0.8
- Author: Chris Christoff
- Author URI: http://www.futuregencode.com
- */
- class ReinstallJigoshopOrderStatuses {
- static function install() {
- $order_status = array(
- 'pending',
- 'on-hold',
- 'processing',
- 'completed',
- 'refunded',
- 'cancelled'
- );
- foreach($order_status as $status) {
- if (!$status_id = get_term_by( 'slug', sanitize_title($status), 'shop_order_status')) {
- wp_insert_term($status, 'shop_order_status');
- }
- }
- }
- }
- register_activation_hook( __FILE__, array('ReinstallJigoshopOrderStatuses', 'install') );
Advertisement
Add Comment
Please, Sign In to add comment