Esempio n. 1
0
 /**
  * Check options and dispatch hooks
  * 
  * @param  array $options
  * @return void
  */
 public function __construct($options)
 {
     $this->params = $options;
     $welcome = !empty($this->params['dashboard_remove']) ? in_array('welcome', $this->params['dashboard_remove']) : false;
     if ($welcome) {
         add_action('admin_head-index.php', array($this, 'remove_welcome'));
     }
     if (!empty($this->params['dashboard_remove_footer_rightnow'])) {
         add_action('admin_head-index.php', array($this, 'right_now_footer'));
     }
     if (!empty($this->params['dashboard_add_cpt_enable'])) {
         add_action('right_now_content_table_end', array($this, 'right_now_cpt'));
     }
     if (!empty($this->params['dashboard_remove'])) {
         add_action('wp_dashboard_setup', array($this, 'remove_widgets'), 0);
     }
     if (isset($this->params['dashboard_add_widgets'])) {
         add_action('wp_dashboard_setup', array($this, 'add_widgets'), 0);
     }
     if (!empty($this->params['dashboard_folder_size'])) {
         require_once 'class-widget-folder-size.php';
         B5F_Folder_Size_Widgets::init($this->params['dashboard_folder_size']);
     }
 }