Пример #1
0
 /**
  * Let's start Pressin' Apps!
  * @since  1.0.0
  */
 function __construct()
 {
     $pg_version = appp_get_setting('appp_pg_version') ? appp_get_setting('appp_pg_version') : '3.5.0';
     // Define plugin constants
     self::$dir_path = trailingslashit(plugin_dir_path(__FILE__));
     self::$dir_url = trailingslashit(plugins_url(dirname(plugin_basename(__FILE__))));
     self::$inc_path = self::$dir_path . 'inc/';
     self::$inc_url = self::$dir_url . 'inc/';
     self::$css_url = self::$dir_url . 'css/';
     self::$img_url = self::$dir_url . 'images/';
     self::$js_url = self::$dir_url . 'js/';
     self::$pg_url = self::$dir_url . 'pg/' . $pg_version . '/';
     self::$l10n = array('ajaxurl' => admin_url('admin-ajax.php'), 'debug' => defined('WP_DEBUG') && WP_DEBUG || defined('SCRIPT_DEBUG') && SCRIPT_DEBUG, 'home_url' => home_url(), 'mobile_browser_theme_switch' => appp_get_setting('mobile_browser_theme_switch'), 'admin_theme_switch' => appp_get_setting('admin_theme_switch'), 'is_appp_true' => self::is_app());
     // Load translations
     load_plugin_textdomain('apppresser', false, dirname(plugin_basename(__FILE__)) . '/languages');
     // Setup our activation and deactivation hooks
     register_activation_hook(__FILE__, array($this, 'activate'));
     register_deactivation_hook(__FILE__, array($this, 'deactivate'));
     // Hook in all our important pieces
     add_action('plugins_loaded', array($this, 'includes'));
     add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'), 8);
     add_action('wp_head', array($this, 'do_appp_script'), 1);
     // remove wp version param from cordova enqueued scripts (so script loading doesn't break)
     // This will mean that it's harder to break caching on the cordova script
     add_filter('script_loader_src', array($this, 'remove_query_arg'), 9999);
     require_once self::$inc_path . 'AppPresser_Admin_Settings.php';
     require_once self::$inc_path . 'plugin-updater.php';
     require_once self::$inc_path . 'AppPresser_Theme_Customizer.php';
     require_once self::$inc_path . 'AppPresser_Ajax_Extras.php';
     $this->theme_customizer = new AppPresser_Theme_Customizer();
 }