WooCommerce_Flespakket_Export

The WooCommerce Flespakket WooCommerce Flespakket Export class.

Defined (1)

The class is defined in the following location(s).

/woocommerce-flespakket.php  
  1. class WooCommerce_Flespakket_Export { 
  2.  
  3. /** 
  4. * Construct. 
  5. */ 
  6.  
  7. public function __construct() { 
  8.  
  9. // Load textdomain 
  10. add_action( 'plugins_loaded', array( &$this, 'languages' ), 0 ); 
  11.  
  12. // Load custom styles & scripts 
  13. add_action( 'admin_enqueue_scripts', array( &$this, 'add_admin_styles_scripts' ) ); 
  14.  
  15. $this->includes(); 
  16. register_activation_hook( __FILE__, array( 'WC_Flespakket_Settings', 'default_settings' ) ); 
  17.  
  18. // Load plugin classes 
  19. add_action( 'init', array( &$this, 'load_hooks' ) ); 
  20.  
  21. /** 
  22. * Load the main plugin classes and functions 
  23. */ 
  24. public function includes() { 
  25. include_once( 'includes/wcflespakket-settings.php' ); 
  26. include_once( 'includes/wcflespakket-export.php' ); 
  27. include_once( 'includes/wcflespakket-writepanel.php' ); 
  28. include_once( 'includes/wcflespakket-nlpostcode-fields.php' ); 
  29.  
  30. public function load_hooks() { 
  31. $this->settings = new WC_Flespakket_Settings(); 
  32. $this->export = new WC_Flespakket_Export(); 
  33. $this->writepanel = new WC_Flespakket_Writepanel(); 
  34. $this->nlpostcodefields = new WC_NLPostcode_Fields(); 
  35.  
  36. /** 
  37. * Load translations. 
  38. */ 
  39. public function languages() { 
  40. load_plugin_textdomain( 'wcflespakket', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 
  41.  
  42. /** 
  43. * Load admin styles & scripts. 
  44. */ 
  45. function add_admin_styles_scripts() { 
  46. global $post_type; 
  47. if( $post_type == 'shop_order' ) { 
  48. wp_enqueue_script( 'thickbox' ); 
  49. wp_enqueue_style( 'thickbox' ); 
  50. wp_enqueue_script( 'wcflespakket-export', plugin_dir_url(__FILE__) . 'js/wcflespakket-script.js', array( 'jquery', 'thickbox' ) ); 
  51.  
  52. if ( version_compare( WOOCOMMERCE_VERSION, '2.1', '<=' ) ) { 
  53. // Old versions 
  54. wp_register_style( 'wcflespakket-admin-styles', plugins_url( '/css/wcflespakket-admin-styles.css', __FILE__ ), array(), '', 'all' ); 
  55. } else { 
  56. // WC 2.1+, MP6 style with larger buttons 
  57. wp_register_style( 'wcflespakket-admin-styles', plugins_url( '/css/wcflespakket-admin-styles-wc21.css', __FILE__ ), array(), '', 'all' ); 
  58. }  
  59.  
  60. wp_enqueue_style( 'wcflespakket-admin-styles' );  
  61.