/** * add dashboard widgets */ function mgm_add_dashboard_widgets() { // check dashboard is enabled if (mgm_is_mgm_menu_enabled('primary', 'mgm_widget_dashboard_statistics')) { wp_add_dashboard_widget('mgm_dashboard_widget_statistics', __('Magic Members Statistics', 'mgm'), 'mgm_dashboard_widget_statistics'); } }
/** * __construct function. * * @access public * @return void */ public function __construct() { if (!current_user_can('manage_options')) { return; } wp_add_dashboard_widget('dlm_popular_downloads', __('Popular Downloads', 'download_monitor'), array($this, 'popular_downloads')); }
/** * Add Stream Activity widget to the dashboard * * @action wp_dashboard_setup */ public static function stream_activity() { if (!current_user_can(WP_Stream_Admin::VIEW_CAP)) { return; } wp_add_dashboard_widget('dashboard_stream_activity', esc_html__('Stream Activity', 'stream'), array(__CLASS__, 'stream_activity_initial_contents'), array(__CLASS__, 'stream_activity_options')); }
public function action_wp_dashboard_setup() { if (!current_user_can('edit_others_un_feedback_items')) { return; } wp_add_dashboard_widget('dashboard_usernoise', __('New feedback', 'usernoise'), array($this, 'widget_callback')); }
function wds_add_sitemaps_dashboard_widget() { if (!current_user_can('edit_posts')) { return false; } wp_add_dashboard_widget('wds_sitemaps_dashboard_widget', __('Sitemaps', 'wds'), 'wds_sitemaps_dashboard_widget'); }
function bones_custom_dashboard_widgets() { wp_add_dashboard_widget('act-intro', __('Thomas Vaughan Website by AmberCouch', 'act'), 'actDashboardIntro'); add_meta_box('act-video-overview', __('Website Video Overview', 'act'), 'actVideoOverview', 'dashboard', 'side'); add_meta_box('act-video-tutorials', __('Website Video Tutorials', 'act'), 'actVideoTutorials', 'dashboard', 'side'); add_meta_box('act-short-codes', __('Website Short Codes', 'act'), 'actShortCodeHelp', 'dashboard', 'side'); }
function wpse_67876_wp_dashboard_setup() { // Admins only if (current_user_can('install_plugins')) { wp_add_dashboard_widget('wpse_67876_folder_sizes', __('Folder Sizes'), 'wpse_67876_wp_add_dashboard_widget'); } }
function replace_recent_comments_dashboard_widget() { global $wp_meta_boxes; // Find the recent comments widget foreach ($wp_meta_boxes['dashboard'] as $context => $widgets) { if (!empty($widgets) && !empty($widgets['core']) && is_array($widgets['core']) && array_key_exists('dashboard_recent_comments', $widgets['core'])) { // Take note of the context for when we add our widget $drc_widget_context = $context; // Store the widget so that we have access to its information $drc_widget = $widgets['core']['dashboard_recent_comments']; // Store the array keys, so that we can reorder things later $widget_order = array_keys($widgets['core']); // Remove the core widget remove_meta_box('dashboard_recent_comments', 'dashboard', $drc_widget_context); // No need to continue the loop break; } } // If we couldn't find the recent comments widget, it must have been removed. We'll // assume this means we shouldn't add our own if (empty($drc_widget)) { return; } // Set up and add our widget $recent_comments_title = __('Recent Comments'); // Add our widget in the same location wp_add_dashboard_widget('dashboard_recent_comments_bp_docs', $recent_comments_title, array($this, 'wp_dashboard_recent_comments'), 'wp_dashboard_recent_comments_control'); // Restore the previous widget order. File this under "good citizenship" $wp_meta_boxes['dashboard'][$context]['core']['dashboard_recent_comments'] = $wp_meta_boxes['dashboard'][$context]['core']['dashboard_recent_comments_bp_docs']; unset($wp_meta_boxes['dashboard'][$context]['core']['dashboard_recent_comments_bp_docs']); // In order to inherit the styles, we're going to spoof the widget ID. Sadness $wp_meta_boxes['dashboard'][$context]['core']['dashboard_recent_comments']['id'] = 'dashboard_recent_comments'; }
/** * Hook to wp_dashboard_setup to add the widget. */ public static function init() { //Register widget settings... self::update_dashboard_widget_options(self::wid, array('example_number' => 42), true); //Register the widget... wp_add_dashboard_widget(self::wid, __('Việt Ngân Site 2015 - Bảng điều hướng', 'nouveau'), array('My_Dashboard_Widget_2', 'widget'), array('My_Dashboard_Widget_2', 'config')); }
function _dashboard_widget_setup() { global $zendesk_support; $agents = Zendesk_Wordpress_Agents::get_instance(); $widget_options = $this->_get_current_user_dashboard_widget(); // If the plugin hasn't been configured yet. if (!isset($zendesk_support->settings['account']) || empty($zendesk_support->settings['account']) && $widget_options != 'none') { wp_add_dashboard_widget('zendesk-dashboard-widget', __('Zendesk Support', 'zendesk'), array(&$this, '_dashboard_widget_config')); return; } if (!$zendesk_support->zendesk_user && $widget_options == 'contact-form' && $zendesk_support->settings['contact_form_anonymous'] && $agents->_is_agent($zendesk_support->settings['contact_form_anonymous_user'])) { wp_add_dashboard_widget('zendesk-dashboard-widget', $zendesk_support->settings['contact_form_title'], array(&$this, '_dashboard_widget_contact_form')); return; } if (!$zendesk_support->zendesk_user && $widget_options != 'none') { wp_add_dashboard_widget('zendesk-dashboard-widget', __('Zendesk Support Login', 'zendesk'), array(&$this, '_dashboard_widget_login')); } else { // Based on user role and the plugin settings. switch ($widget_options) { case 'contact-form': wp_add_dashboard_widget('zendesk-dashboard-widget', $zendesk_support->settings['contact_form_title'], array(&$this, '_dashboard_widget_contact_form')); break; case 'tickets-widget': wp_add_dashboard_widget('zendesk-dashboard-widget', __('Zendesk for WordPress', 'zendesk'), array(&$this, '_dashboard_widget_tickets')); break; } } }
} } static function add_dashboard_widgets() { $custom_dashboard_widgets = array('wp-lead-stats' => array('title' => 'Lead Stats', 'callback' => 'wp_lead_dashboard_stats'), 'wp-lead-dashboard-list' => array('title' => 'Lead Lists', 'callback' => 'wp_lead_dashboard_list')); foreach ($custom_dashboard_widgets as $widget_id => $options) { wp_add_dashboard_widget($widget_id, $options['title'], $options['callback']);
/** * Hook to wp_dashboard_setup to add the widget. */ public static function init() { // register the widget settings self::update_dashboard_widget_options(self::wid, array('example_setting' => 1), true); // register the widget wp_add_dashboard_widget(self::wid, __('Next Level Cache', 'nlc'), array('NLC_Dashboard_Widget', 'widget'), array('NLC_Dashboard_Widget', 'config')); }
/** * Add the widget to the dashboard **/ function addDashboardWidget() { # Check if the user is an admin if (ga_current_user_is(get_option(key_ga_dashboard_role))) { wp_add_dashboard_widget('google-analytics-summary', __('Google Analytics Summary', 'google-analyticator'), array($this, 'widget')); } }
function woo_vl_dashboard_setup() { // Limit the Dashboard widget to Users with the Manage Options capability if (current_user_can('manage_options')) { wp_add_dashboard_widget('woo_vl_news_widget', __('Plugin News - by Visser Labs', 'woocommerce-exporter'), 'woo_vl_news_widget'); } }
function add_tc_dashboard_widgets() { if (!current_user_can(apply_filters('tc_can_view_dashboard_widgets_capability', 'manage_options'))) { return; } wp_add_dashboard_widget('tc_store_report', $this->title, array(&$this, 'tc_store_report_display')); }
/** * Hook to wp_dashboard_setup to add the widget. * * @since 2.2.3 */ public static function init() { if (!current_user_can('manage_options')) { return; } wp_add_dashboard_widget(self::wid, __('Upcoming Tweets', 'ppp-tweets'), array('PPP_Dashboard_Tweets', 'widget'), array('PPP_Dashboard_Tweets', 'config')); }
/** * Hook to wp_dashboard_setup to add the widget. */ public static function init() { //Register widget settings... self::update_dashboard_widget_options(self::wid, array('example_number' => 42), true); //Register the widget... wp_add_dashboard_widget(self::wid, 'Próximos Eventos', array('Dashboard_Widget', 'widget'), array('Dashboard_Widget', 'config')); }
/** * Register Dashboard Widgets * * Register the dashboard widgets * * @package Social Deals Engine * @since 1.0.0 */ function wps_deals_register_dashboard_sales_widgets() { if (current_user_can('manage_options')) { //if user is admin user then only show dashboard widget wp_add_dashboard_widget('wps_deals_sales_dashboard_widget', __('Social Deals Sales Summary', 'wpsdeals'), 'wps_deals_sales_summary_widget'); } }
public function load_dashboard() { global $wpdb; $sql = "SELECT * FROM {$this->table} WHERE id={$this->countyID}"; $data = $wpdb->get_row($sql, ARRAY_A); wp_add_dashboard_widget('county_dashboard_' . $this->countyID, $data['name'], array($this, 'load_dashboard_widget')); }
/** * Add Dashboard widget */ public function add_dashboard_widget() { if (!$this->dashboard_allowed()) { return; } wp_add_dashboard_widget($this->id, __('Frosty Media', CUSTOM_LOGIN_DIRNAME), array($this, 'widget')); }
/** * * Set up the dashboard widgets with the appropriate callback functions. */ public function setup_widgets() { global $wp_roles; global $current_user; global $current_month_offset, $the_month_num, $the_year; $current_month_offset = 0; if (isset($_GET['wc_sales_month'])) { $current_month_offset = (int) $_GET['wc_sales_month']; } $the_month_num = date('n', strtotime('NOW ' . $current_month_offset . ' MONTH')); $the_year = date('Y', strtotime('NOW ' . $current_month_offset . ' MONTH')); $cart_heading = ''; $tooltip = ''; if ($the_month_num != date('m')) { $cart_heading .= '<a href="index.php?wc_cart_month=' . ($current_month_offset + 1) . '" class="next">' . date_i18n('F', strtotime('01-' . ($the_month_num + 1) . '-2011')) . ' →</a>'; } $cart_heading .= '<a href="index.php?wc_cart_month=' . ($current_month_offset - 1) . '" class="previous">← ' . date_i18n('F', strtotime('01-' . ($the_month_num - 1) . '-2011')) . '</a><span>' . __('Monthly Carts', 'woocommerce') . $tooltip . '</span>'; if (function_exists('WC')) { if (current_user_can('edit_shop_orders')) { wp_add_dashboard_widget('woocommerce_dashboard_carts_right_now', __('Recent Cart Activity', 'woocommerce'), array($this, 'woocommerce_recent_cart_activity')); } } else { if (current_user_can('edit_shop_orders')) { wp_add_dashboard_widget('woocommerce_dashboard_carts_right_now', __('Recent Cart Activity', 'woocommerce'), array($this, 'woocommerce_recent_cart_activity_legacy')); } if (current_user_can('view_woocommerce_reports') && current_user_can('edit_shop_orders')) { wp_add_dashboard_widget('woocommerce_dashboard_carts', $cart_heading, array($this, 'woocommerce_dashboard_carts')); } } }
function wds_add_seomoz_dashboard_widget() { if (!current_user_can('edit_posts')) { return false; } wp_add_dashboard_widget('wds_seomoz_dashboard_widget', 'Moz', 'wds_seomoz_dashboard_widget'); }
public function add_presale_metabox() { wp_add_dashboard_widget('wcds-woocommerce-dashboard-geographic', __('Geographical stats', 'woocommerce-dashboard-stats'), array(&$this, 'render_geographic_metabox')); wp_add_dashboard_widget('wcds-woocommerce-dashboard-customers', __('Customers stats', 'woocommerce-dashboard-stats'), array(&$this, 'render_customers_metabox')); wp_add_dashboard_widget('wcds-woocommerce-dashboard-products', __('Products stats', 'woocommerce-dashboard-stats'), array(&$this, 'render_products_metabox')); wp_add_dashboard_widget('wcds-woocommerce-dashboard-earnings', __('Earnings stats', 'woocommerce-dashboard-stats'), array(&$this, 'render_earnings_metabox')); }
/** * Add a widget to the dashboard. * * This function is hooked into the 'wp_dashboard_setup' action below. */ function yks_mc_add_chimp_chatter_dashboard_widget() { /* List Stats Dashboard Widget */ wp_add_dashboard_widget('yikes_easy_mc_list_stats_widget', __('MailChimp List Stats', 'yikes-inc-easy-mailchimp-extender'), array($this, 'list_stats_dashboard_widget')); /* Chimp Chatter Dashboard Widget */ wp_add_dashboard_widget('yikes_easy_mc_account_activity_widget', __('MailChimp Account Activity', 'yikes-inc-easy-mailchimp-extender'), array($this, 'account_activity_dashboard_widget')); }
function add_dashboard_widgets() { global $custom_dashboard_widgets; foreach ($custom_dashboard_widgets as $widget_id => $options) { wp_add_dashboard_widget($widget_id, $options['title'], $options['callback']); } }
/** * Hook to wp_dashboard_setup to add the widget. */ public static function init() { //Register widget settings... self::update_dashboard_widget_options(self::wid, array('example_number' => 42), true); //Register the widget... wp_add_dashboard_widget(self::wid, __('QD PLUGINS INFO', 'nouveau'), array('QdmvcNativeWidget_Plugins_Info', 'widget'), array('QdmvcNativeWidget_Plugins_Info', 'config')); }
/** * Init dashboard widgets */ public function init() { if (current_user_can('publish_shop_orders')) { wp_add_dashboard_widget('woocommerce_dashboard_recent_reviews', __('WooCommerce Recent Reviews', 'woocommerce'), array($this, 'recent_reviews')); } wp_add_dashboard_widget('woocommerce_dashboard_status', __('WooCommerce Status', 'woocommerce'), array($this, 'status_widget')); }
/** * Create class object. * * @access public * @since 1.2.0 */ public static function register() { if (!current_user_can('view_charitable_sensitive_data')) { return; } wp_add_dashboard_widget(self::ID, __('Charitable Donation Statistics', 'charitable'), array('Charitable_Donations_Dashboard_Widget', 'display')); }
/** * Hook to wp_dashboard_setup to add the widget. */ public static function init() { //Register widget settings... self::update_dashboard_widget_options(self::wid, array('example_number' => 42), true); //Register the widget... wp_add_dashboard_widget(self::wid, __('OpenStack Shell Instruction', 'nouveau'), array('OpenStack_Shell_Widget', 'widget'), array('OpenStack_Shell_Widget', 'config')); }
function BBPMC_dashboard_bbpress_mod() { global $wp_meta_boxes; wp_add_dashboard_widget('BBPMC_bbpressModDash', 'Moderation Dashboard', 'BBPMC_dashboard_bbpress_mod_worker'); wp_enqueue_style('BBPMC_modconsoleCSS', plugins_url('/mod-console.css', __FILE__)); wp_enqueue_script('BBPMC_modconsoleJS', plugins_url('/mod-console.js', __FILE__), array('jquery'), '1', true); }