Exemple #1
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;
 }
Exemple #2
0
 /**
  * Initialize the plugin by setting localization and loading public scripts
  * and styles.
  *
  * @since     1.0.0
  */
 private function __construct()
 {
     define('WPC_INSERT_CODE_IS_ACTIVATED', true);
     $this->helper = WPC_Insert_Code_Helper::get_instance();
     $this->helper->plugin_slug = $this->plugin_slug;
     $this->helper->plugin_prefix = $this->plugin_prefix;
     // Load plugin text domain
     add_action('init', array($this, 'load_plugin_textdomain'));
     // Load public-facing style sheet and JavaScript.
     // add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
     // add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
     add_action('wp_head', array($this, 'insert_code_head'), 9999);
     add_action('wp_footer', array($this, 'insert_code_footer'), 9999);
     add_action('wpc_insert_code_top_of_page', array($this, 'insert_code_top_of_page'));
     add_action('wpc_insert_code_above_header', array($this, 'insert_code_above_header'));
     add_action('wpc_insert_code_below_header', array($this, 'insert_code_below_header'));
     add_action('wpc_insert_code_above_content', array($this, 'insert_code_above_content'));
     add_action('wpc_insert_code_below_content', array($this, 'insert_code_below_content'));
     add_filter('wpc_insert_code_value', array($this, 'wrap_code_value'), 10, 2);
 }