本文整理汇总了PHP中wp_add_dashboard_widget函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_add_dashboard_widget函数的具体用法?PHP wp_add_dashboard_widget怎么用?PHP wp_add_dashboard_widget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_add_dashboard_widget函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mgm_add_dashboard_widgets
/**
* 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');
}
}
示例2: __construct
/**
* __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'));
}
示例3: stream_activity
/**
* 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'));
}
示例4: action_wp_dashboard_setup
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'));
}
示例5: wds_add_sitemaps_dashboard_widget
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');
}
示例6: bones_custom_dashboard_widgets
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');
}
示例7: wpse_67876_wp_dashboard_setup
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');
}
}
示例8: replace_recent_comments_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';
}
示例9: init
/**
* 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'));
}
示例10: _dashboard_widget_setup
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;
}
}
}
示例11: add_dashboard_widgets
}
}
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']);
示例12: init
/**
* 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'));
}
示例13: addDashboardWidget
/**
* 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'));
}
}
示例14: woo_vl_dashboard_setup
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');
}
}
示例15: add_tc_dashboard_widgets
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'));
}