Esempio n. 1
0
 /**
  * Return an instance of Advanced_Ads_Ad_Blocker
  *
  * @since   1.0.0
  * @return  Advanced_Ads_Ad_Blocker_Admin
  */
 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;
 }
 /**
  * rebuild assets for ad-blocker module
  *
  */
 public function adblock_rebuild_assets()
 {
     Advanced_Ads_Ad_Blocker_Admin::get_instance()->add_asset_rebuild_form();
     exit;
 }
Esempio n. 3
0
<?php

if (class_exists('Advanced_Ads', false)) {
    // only load if not already existing (maybe included from another plugin)
    if (defined('ADVADS_AB_BASE_PATH')) {
        return;
    }
    // load basic path to the plugin
    define('ADVADS_AB_BASE_PATH', plugin_dir_path(__FILE__));
    // general and global slug, e.g. to store options in WP, textdomain
    define('ADVADS_AB_SLUG', 'advanced-ads-ab-module');
    Advanced_Ads_Ad_Blocker::get_instance();
    $is_ajax = defined('DOING_AJAX') && DOING_AJAX;
    $is_main_blog = is_main_site(get_current_blog_id());
    if (is_admin() && !$is_ajax && $is_main_blog) {
        Advanced_Ads_Ad_Blocker_Admin::get_instance();
    }
}