1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
function __construct(){
//Language Setup
$locale = get_locale();
$mo = dirname(__FILE__) . "/languages/" . $this->localizationDomain . "-".$locale.".mo";
load_textdomain($this->localizationDomain, $mo);
//"Constants" setup
$this->thispluginurl = WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)).'/';
$this->thispluginpath = WP_PLUGIN_DIR . '/' . dirname(plugin_basename(__FILE__)).'/';
//Initialize the options
//This is REQUIRED to initialize the options when the plugin is loaded!
$this->getOptions();
//Load the list of fonts from the Google API or local cache
$this->gf_fonts = get_option($this->gf_data_option_name);
//Convert the options from pre v3.0 array
$this->gf_convert_fonts();
//Actions
add_action( 'admin_init', [ $this, 'gf_admin_init' ] );
add_action("admin_menu", array(&$this,"admin_menu_link"));
add_action('admin_enqueue_scripts',array(&$this,'gf_admin_scripts'));
add_action('wp_enqueue_scripts',array(&$this, 'googlefontsstart'));
add_action("wp_head", array(&$this,"addgooglefontscss"));
add_action('wp_ajax_googlefont_action', array($this, 'googlefont_action_callback'));
add_action( 'admin_notices', array(&$this, 'global_notice') );
add_option('wp_google_fonts_global_notification', 1);
register_deactivation_hook( __FILE__, array(&$this, 'gf_plugin_deactivate') );
add_action( 'wp_ajax_'.'appsumo_email_capture_form_submit', 'appsumo_email_capture_form_submit' );
add_action( 'wp_ajax_nopriv_'.'appsumo_email_capture_form_submit', 'appsumo_email_capture_form_submit' );
} |
Partager