stats_jetpack_dashboard_widget
Jetpack Stats Dashboard Widget.
Description
stats_jetpack_dashboard_widget();
Usage
if ( !function_exists( 'stats_jetpack_dashboard_widget' ) ) { require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/stats.php'; } // NOTICE! Understand what this does before running. $result = stats_jetpack_dashboard_widget();
Defined (1)
The function is defined in the following location(s).
- /modules/stats.php
- function stats_jetpack_dashboard_widget() {
- ?>
- <form id="stats_dashboard_widget_control" action="<?php esc_url( admin_url() ); ?>" method="post">
- <?php stats_dashboard_widget_control(); ?>
- <?php wp_nonce_field( 'edit-dashboard-widget_dashboard_stats', 'dashboard-widget-nonce' ); ?>
- <input type="hidden" name="widget_id" value="dashboard_stats" />
- <?php submit_button( __( 'Submit', jetpack ) ); ?>
- </form>
- <span id="js-toggle-stats_dashboard_widget_control">
- <?php esc_html_e( 'Configure', jetpack ); ?>
- </span>
- <div id="dashboard_stats">
- <div class="inside">
- <div style="height: 250px;"></div>
- </div>
- </div>
- <script>
- jQuery(document).ready(function($) {
- var $toggle = $('#js-toggle-stats_dashboard_widget_control');
- $toggle.parent().prev().append( $toggle );
- $toggle.show().click(function(e) {
- e.preventDefault();
- e.stopImmediatePropagation();
- $(this).parent().toggleClass('controlVisible');
- $('#stats_dashboard_widget_control').slideToggle();
- });
- });
- </script>
- <style>
- #js-toggle-stats_dashboard_widget_control {
- display: none;
- float: right;
- margin-top: 0.2em;
- font-weight: 400;
- color: #444;
- font-size: .8em;
- text-decoration: underline;
- cursor: pointer;
- }
- #stats_dashboard_widget_control {
- display: none;
- padding: 0 10px;
- overflow: hidden;
- }
- #stats_dashboard_widget_control .button-primary {
- float: right;
- }
- #dashboard_stats {
- box-sizing: border-box;
- width: 100%;
- padding: 0 10px;
- }
- </style>
- <?php