public static function add_dashboard_widget($tag, $title, $capability, $force_top = false) { if (!is_object(self::$_dashboard)) { self::$_dashboard_widgets = array(); // Init variable. self::_init_core_controller('dashboard'); if (is_network_admin()) { // Network admin. add_action('wp_network_dashboard_setup', array(&self::$_dashboard, 'register_widgets')); } else { // Normal admin. add_action('wp_dashboard_setup', array(&self::$_dashboard, 'register_widgets')); } } self::$_dashboard_widgets[] = array('tag' => $tag, 'title' => $title, 'capability' => $capability, 'force_top' => $force_top); // Push into array to be later registered via dashboard controller's register_widgets function. }
public static function add_dashboard_widget($tag, $title, $force_top = false) { if (!is_object(self::$_dashboard)) { self::$_dashboard_widgets = array(); // Init variable. self::_init_core_controller('dashboard'); add_action('wp_dashboard_setup', array(&self::$_dashboard, 'register_widgets')); } self::$_dashboard_widgets[] = array('tag' => $tag, 'title' => $title, 'force_top' => $force_top); // Push into array to be later registered via dashboard controller's register_widgets function. }