コード例 #1
0
 /**
  * Initialize the plugin by loading admin scripts & styles and adding a
  * settings page and menu.
  *
  * @since     0.1.0
  */
 private function __construct()
 {
     /*
      * Call $plugin_slug from public plugin class.
      *
      */
     $plugin = AH_O2::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     load_plugin_textdomain('adminhelp', false, dirname(plugin_basename(__FILE__)) . 'languages/');
     add_action('admin_init', array($this, 'init'));
     // Load admin style sheet and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     // user profile stuff, added by trishasalas & cleaned up by jazzs3quence
     add_action('personal_options', array($this, 'AH_O2_show_profile_fields'));
     add_action('personal_options_update', array($this, 'AH_O2_save_profile_fields'));
     add_action('edit_user_profile_update', array($this, 'AH_O2_save_profile_fields'));
     // hook into in_admin_header action to overwrite wp_screen object
     add_action('in_admin_header', array($this, 'modify_wp_screen'));
 }
コード例 #2
0
 /**
  * Return an instance of this class.
  *
  * @since     0.1.0
  *
  * @return    object    A single instance of this class.
  */
 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;
 }