chriscct1

Reinstall Jigoshop Order Types

Mar 13th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Reinstall Jigoshop Order Types
  4. Plugin URI: http://www.futuregencode.com
  5. Description: Reinstalls the order statuses
  6. Version: 0.8
  7. Author: Chris Christoff
  8. Author URI: http://www.futuregencode.com
  9. */
  10. class ReinstallJigoshopOrderStatuses {
  11.      static function install() {
  12.             $order_status = array(
  13.         'pending',
  14.         'on-hold',
  15.         'processing',
  16.         'completed',
  17.         'refunded',
  18.         'cancelled'
  19.          );
  20.  
  21.     foreach($order_status as $status) {
  22.         if (!$status_id = get_term_by( 'slug', sanitize_title($status), 'shop_order_status')) {
  23.             wp_insert_term($status, 'shop_order_status');
  24.         }
  25.     }
  26.      }
  27. }
  28. register_activation_hook( __FILE__, array('ReinstallJigoshopOrderStatuses', 'install') );
Advertisement
Add Comment
Please, Sign In to add comment