Ejemplo n.º 1
0
 private function __construct()
 {
     $plugin = Welcart2::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     //Initial processing.
     $this->_set_table();
 }
Ejemplo n.º 2
0
	/**
	 * Initialize the plugin by setting localization and loading public scripts
	 * and styles.
	 *
	 * @since     1.0.0
	 */
	private function __construct() {

		global $wc2_order, $wc2_cart, $wc2_member, $wc2_options;

		/*
		 * Call $plugin_slug from public plugin class.
		 *
		 * @TODO:
		 *
		 * - Rename "Plugin_Name" to the name of your initial plugin class
		 *
		 */
		$plugin = Welcart2::get_instance();
		$this->plugin_slug = $plugin->get_plugin_slug();
		$this->version = Welcart2::VERSION;

		//session_name( $wc2_options['session_name'] );
		$session_name = wc2_get_option( 'session_name' );
		session_name( $session_name );
		session_set_cookie_params ( 0, COOKIEPATH, $_SERVER['SERVER_NAME'], false, true );
		if ( !session_id() ) {
			session_start();
		}

		$this->page = new WC2_Page();

		$this->control();
	}
Ejemplo n.º 3
0
 /**
  * Initialize the plugin by loading admin scripts & styles and adding a
  * settings page and menu.
  *
  * @since     1.0.0
  */
 private function __construct()
 {
     /*
      * @TODO :
      *
      * - Uncomment following lines if the admin class should only be available for super admins
      */
     /* if( ! is_super_admin() ) {
     			return;
     		} */
     /*
      * Call $plugin_slug from public plugin class.
      *
      * @TODO:
      *
      * - Rename "Plugin_Name" to the name of your initial plugin class
      *
      */
     $plugin = Welcart2::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     $this->version = Welcart2::VERSION;
     // Set the Top-level menu slug.
     $this->menu_slug['management'] = $this->plugin_slug . '_order';
     $this->menu_slug['setting'] = $this->plugin_slug . '_setting';
     // Load admin style sheet and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     // Add the options page and menu item.
     add_action('admin_menu', array($this, 'add_plugin_admin_menu'));
     add_action('admin_menu', array($this, 'add_item_submenu'));
     // Add an action link pointing to the options page.
     //		$plugin_basename = plugin_basename( plugin_dir_path( realpath( dirname( __FILE__ ) ) ) . $this->plugin_slug . '.php' );
     //		add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );
 }
Ejemplo n.º 4
0
 private function __construct()
 {
     $plugin = Welcart2::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     if ('html' == $this->content_type) {
         add_filter('wp_mail_content_type', create_function('', 'return "text/html"; '));
     }
     //Initial processing.
     //$this->_set_table();
 }
Ejemplo n.º 5
0
 public function __construct()
 {
     $this->init();
     $plugin = Welcart2::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     $admin = WC2_Admin::get_instance();
     $this->menu_slug = $admin->get_toplevel_menu_slug();
     $this->clear_action_status();
     /*******************************************/
     add_action('admin_head', array($this, 'add_admin_head'));
     // Load admin style sheet and JavaScript.
     add_action('admin_print_styles', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     // Add the options page and menu item.
     add_action('admin_menu', array($this, 'add_admin_menu'));
     //スクリーン自体の表示・非表示
     add_filter('screen_options_show_screen', array($this, 'admin_show_screen'), 10, 2);
     //スクリーンの表示件数取得
     add_filter('set-screen-option', array($this, 'admin_set_screen_options'), 10, 3);
     add_filter('contextual_help', array($this, 'admin_help_setting'), 900, 3);
     add_action('admin_print_footer_scripts', array($this, 'admin_scripts'));
     add_action('admin_print_footer_scripts', array($this, 'admin_page_scripts'));
     add_action('admin_footer', array($this, 'clear_action_status'));
 }
Ejemplo n.º 6
0
 /**
  * Return an instance of this class.
  *
  * @since     1.0.0
  *
  * @return    object    A single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Ejemplo n.º 7
0
 private function __construct()
 {
     $plugin = Welcart2::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
 }
Ejemplo n.º 8
0
 private function __construct()
 {
     $plugin = Welcart2::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     //Initial processing.
     $this->_set_table();
     $this->_set_item_label_init();
     $this->_set_item_column_init();
     add_action('the_post', array($this, 'item_post_action'));
 }