Beispiel #1
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     wp_enqueue_style('w3tc-widget');
     wp_enqueue_script('w3tc-metadata');
     wp_enqueue_script('w3tc-widget');
     w3tc_add_dashboard_widget('w3tc_latest', __('Forums', 'w3-total-cache'), array(&$this, 'widget_latest'), array(&$this, 'widget_latest_control'), 'side');
 }
Beispiel #2
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     wp_enqueue_style('w3tc-widget');
     wp_enqueue_script('w3tc-metadata');
     wp_enqueue_script('w3tc-widget');
     w3tc_add_dashboard_widget('w3tc_services', __('Premium Services', 'w3-total-cache'), array(&$this, 'widget_form'), null, 'normal', 'div');
 }
Beispiel #3
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     wp_enqueue_style('w3tc-widget');
     wp_enqueue_script('w3tc-metadata');
     wp_enqueue_script('w3tc-widget');
     w3tc_add_dashboard_widget('w3tc_spreadtheword', __('Spread The Word', 'w3-total-cache'), array(&$this, 'widget_form'), null, 'normal', 'div');
 }
Beispiel #4
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     w3_require_once(W3TC_LIB_NEWRELIC_DIR . '/NewRelicWrapper.php');
     /**
      * @var $nerser W3_NewRelicService
      */
     $nerser = w3_instance('W3_NewRelicService');
     $new_relic_enabled = $this->_config->get_boolean('newrelic.enabled');
     if ($new_relic_enabled && $nerser->verify_running()) {
         $view_vis = sprintf("https://rpm.newrelic.com/accounts/%d/applications/%d", $this->_account_id, $this->_application_id);
         $view = '<a href="' . $view_vis . '">' . __('view visualizations', 'w3-total-cache') . '</a>';
     } else {
         $view = '<span> </span>';
     }
     w3tc_add_dashboard_widget('w3tc_new_relic', $view, array(&$this, 'widget_new_relic'), null, 'normal');
 }
Beispiel #5
0
/**
 * Registers dashboard widgets.
 *
 * Handles POST data, sets up filters.
 *
 * @since 0.9.2.6
 */
function w3tc_dashboard_setup()
{
    global $w3tc_registered_widgets, $w3tc_registered_widget_controls, $w3tc_dashboard_control_callbacks;
    $w3tc_dashboard_control_callbacks = array();
    $screen = get_current_screen();
    $update = false;
    $widget_options = get_option('w3tc_dashboard_widget_options');
    if (!$widget_options || !is_array($widget_options)) {
        $widget_options = array();
    }
    // Hook to register new widgets
    // Filter widget order
    if (is_network_admin()) {
        do_action('w3tc_network_dashboard_setup');
        $dashboard_widgets = apply_filters('w3tc_network_dashboard_widgets', array());
    } else {
        do_action('w3tc_dashboard_setup');
        $dashboard_widgets = apply_filters('w3tc_dashboard_widgets', array());
    }
    foreach ($dashboard_widgets as $widget_id) {
        $name = empty($w3tc_registered_widgets[$widget_id]['all_link']) ? $w3tc_registered_widgets[$widget_id]['name'] : $w3tc_registered_widgets[$widget_id]['name'] . " <a href='{$w3tc_registered_widgets[$widget_id]['all_link']}' class='edit-box open-box'>" . __('View all') . '</a>';
        w3tc_add_dashboard_widget($widget_id, $name, $w3tc_registered_widgets[$widget_id]['callback'], $w3tc_registered_widget_controls[$widget_id]['callback']);
    }
    if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id'])) {
        check_admin_referer('edit-dashboard-widget_' . $_POST['widget_id'], 'dashboard-widget-nonce');
        ob_start();
        // hack - but the same hack wp-admin/widgets.php uses
        w3tc_dashboard_trigger_widget_control($_POST['widget_id']);
        ob_end_clean();
    }
    if ($update) {
        update_option('w3tc_dashboard_widget_options', $widget_options);
    }
    do_action('do_meta_boxes', $screen->id, 'normal', '');
    do_action('do_meta_boxes', $screen->id, 'side', '');
}
Beispiel #6
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     wp_enqueue_style('w3tc-widget');
     wp_enqueue_script('w3tc-metadata');
     wp_enqueue_script('w3tc-widget');
     $view = '<span> </span>';
     w3tc_add_dashboard_widget('w3tc_maxcdn', $view, array(&$this, 'widget_maxcdn'), null, 'normal');
 }
Beispiel #7
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     w3tc_add_dashboard_widget('w3tc_pagespeed', __('Page Speed Report', 'w3-total-cache'), array(&$this, 'widget_pagespeed'), array(&$this, 'widget_pagespeed_control'), 'normal', 'div');
 }
Beispiel #8
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     w3tc_add_dashboard_widget('w3tc_spreadtheword', __('Spread The Word', 'w3-total-cache'), array(&$this, 'widget_form'), null, 'normal', 'div');
 }
Beispiel #9
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     $view = '<span> </span>';
     w3tc_add_dashboard_widget('w3tc_netdna', $view, array(&$this, 'widget_netdna'), null, 'normal');
 }
Beispiel #10
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     w3tc_add_dashboard_widget('w3tc_services', __('Premium Services', 'w3-total-cache'), array(&$this, 'widget_form'), null, 'normal', 'div');
 }
Beispiel #11
0
 /**
  * Dashboard setup action
  *
  * @return void
  */
 function wp_dashboard_setup()
 {
     w3tc_add_dashboard_widget('w3tc_latest', __('Forums', 'w3-total-cache'), array(&$this, 'widget_latest'), array(&$this, 'widget_latest_control'), 'side');
 }