stats_jetpack_dashboard_widget

Jetpack Stats Dashboard Widget.

Description

stats_jetpack_dashboard_widget(); 

Usage

  1. if ( !function_exists( 'stats_jetpack_dashboard_widget' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/stats.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = stats_jetpack_dashboard_widget(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/modules/stats.php  
  1. function stats_jetpack_dashboard_widget() { 
  2. ?> 
  3. <h3> 
  4. <span class="js-toggle-stats_dashboard_widget_control"> 
  5. <?php esc_html_e( 'Configure', jetpack ); ?> 
  6. </span> 
  7. <?php esc_html_e( 'Site Stats', jetpack ); ?> 
  8. </h3> 
  9. <form id="stats_dashboard_widget_control" action="<?php esc_url( admin_url() ); ?>" method="post"> 
  10. <?php wp_nonce_field( 'edit-dashboard-widget_dashboard_stats', 'dashboard-widget-nonce' ); ?> 
  11. <input type="hidden" name="widget_id" value="dashboard_stats" /> 
  12. <?php submit_button( __( 'Submit', jetpack ) ); ?> 
  13. </form> 
  14. <div id="dashboard_stats"> 
  15. <div class="inside"> 
  16. <div style="height: 250px;"></div> 
  17. </div> 
  18. </div> 
  19. <script> 
  20. jQuery(document).ready(function($) { 
  21. $('.js-toggle-stats_dashboard_widget_control').click(function(e) { 
  22. e.preventDefault(); 
  23. $(this).parent().toggleClass('controlVisible'); 
  24. $('#stats_dashboard_widget_control').slideToggle(); 
  25. }); 
  26. }); 
  27. </script> 
  28. <style> 
  29. .js-toggle-stats_dashboard_widget_control { 
  30. float: right; 
  31. font-weight: 400; 
  32. color: #444; 
  33. font-size: .8em; 
  34. text-decoration: underline; 
  35. cursor: pointer; 
  36. #stats_dashboard_widget_control { 
  37. display: none; 
  38. padding: 0 10px; 
  39. overflow: hidden; 
  40. #stats_dashboard_widget_control .button-primary { 
  41. float: right; 
  42. #dashboard_stats { 
  43. box-sizing: border-box; 
  44. width: 100%; 
  45. padding: 0 10px; 
  46. </style> 
  47. <?php