コード例 #1
0
 /**
  * Construct.
  */
 public function __construct()
 {
     self::$plugin_slug = basename(dirname(__FILE__));
     self::$plugin_basename = plugin_basename(__FILE__);
     $this->options = get_option('wpmenucart');
     // load the localisation & classes
     add_action('plugins_loaded', array(&$this, 'languages'), 0);
     // or use init?
     add_action('init', array(&$this, 'wpml'), 0);
     add_action('init', array($this, 'load_classes'));
     // enqueue scripts & ajax
     add_action('wp_enqueue_scripts', array(&$this, 'load_scripts_styles'));
     // Load scripts
     add_action('wp_ajax_wpmenucart_ajax', array(&$this, 'wpmenucart_ajax'), 0);
     add_action('wp_ajax_nopriv_wpmenucart_ajax', array(&$this, 'wpmenucart_ajax'), 0);
     // add filters to selected menus to add cart item <li>
     add_action('init', array($this, 'filter_nav_menus'));
     // $this->filter_nav_menus();
 }