/**
  * Definition the constructor function, which is called
  * at the time of the creation of an instance of this class
  */
 function __construct()
 {
     // Checking if I have to insert the tracking code
     // for google analytics in wordpress admin panel
     $SZ_ANALYTICS_OBJECT_ADMIN = new SZGoogleModuleAnalytics();
     $SZ_ANALYTICS_OPTION_ADMIN = $SZ_ANALYTICS_OBJECT_ADMIN->getOptions();
     // If you are the admin panel I need to check the activation
     // of the option to enable the module on administration
     if (is_admin() and $SZ_ANALYTICS_OPTION_ADMIN['ga_enable_admin'] == '1') {
         if ($SZ_ANALYTICS_OPTION_ADMIN['ga_position'] == 'H') {
             add_action('admin_head', array(new SZGoogleActionAnalytics($this), 'action'));
         }
         if ($SZ_ANALYTICS_OPTION_ADMIN['ga_position'] == 'F') {
             add_action('admin_footer', array(new SZGoogleActionAnalytics($this), 'action'));
         }
     }
     // Calling up the function of the parent class to process
     // variables containing the values ​​of configuration section
     parent::__construct();
 }
Пример #2
0
 /**
  * Definizione della funzione costruttore che viene richiamata
  * nel momento della creazione di un'istanza con questa classe
  */
 function __construct()
 {
     // Controllo se devo inserire il codice di monitoraggio
     // di google analytics nel pannello di amministrazione
     $SZ_ANALYTICS_OBJECT_ADMIN = new SZGoogleModuleAnalytics();
     $SZ_ANALYTICS_OPTION_ADMIN = $SZ_ANALYTICS_OBJECT_ADMIN->getOptions();
     // Se sono sul pannello di amministrazione devo controllare se è stata
     // attivata l'opzione per abilitare il modulo su amministrazione
     if (is_admin() and $SZ_ANALYTICS_OPTION_ADMIN['ga_enable_admin'] == '1') {
         if ($SZ_ANALYTICS_OPTION_ADMIN['ga_position'] == 'H') {
             add_action('admin_head', array(new SZGoogleActionAnalytics($this), 'action'));
         }
         if ($SZ_ANALYTICS_OPTION_ADMIN['ga_position'] == 'F') {
             add_action('admin_footer', array(new SZGoogleActionAnalytics($this), 'action'));
         }
     }
     // Richiamo la funzione della classe padre per elaborare le
     // variabili contenenti i valori di configurazione sezione
     parent::__construct();
 }