/**
  * Class constructor
  */
 public function __construct()
 {
     if (gd_is_mt() || gd_is_reseller() || !gd_has_used_wpem()) {
         return;
     }
     add_action('wp_dashboard_setup', array($this, 'init'));
 }
コード例 #2
0
 /**
  * Register tabs
  *
  * @action init
  */
 public function init()
 {
     $this->tabs = array('help' => __('FAQ & Support', 'gd_system'), 'hire' => __('Hire A Pro', 'gd_system'), 'plugins' => __('Plugin Partners', 'gd_system'));
     /**
      * Only display the `Hire A Pro` tab to customers that:
      *
      * 1. Have completed WPEM
      * 2. Speak English
      * 3. Are located in the United States
      */
     if (!gd_has_used_wpem() || !gd_is_english() || 'US' !== gd_wpem_country_code()) {
         unset($this->tabs['hire']);
     }
     $tab = filter_input(INPUT_GET, 'tab');
     $this->tab = !empty($tab) ? sanitize_key($tab) : $this->tab;
 }