stats_admin_menu

Admin Pages.

Description

stats_admin_menu(); 

Usage

  1. if ( !function_exists( 'stats_admin_menu' ) ) { 
  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_admin_menu(); 
  7.  

Defined (1)

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

/modules/stats.php  
  1. function stats_admin_menu() { 
  2. global $pagenow; 
  3.  
  4. // If we're at an old Stats URL, redirect to the new one. 
  5. // Don't even bother with caps, menu_page_url(), etc. Just do it. 
  6. if ( 'index.php' == $pagenow && isset( $_GET['page'] ) && 'stats' == $_GET['page'] ) { 
  7. $redirect_url = str_replace( array( '/wp-admin/index.php?', '/wp-admin/?' ), '/wp-admin/admin.php?', $_SERVER['REQUEST_URI'] ); 
  8. $relative_pos = strpos( $redirect_url, '/wp-admin/' ); 
  9. if ( false !== $relative_pos ) { 
  10. wp_safe_redirect( admin_url( substr( $redirect_url, $relative_pos + 10 ) ) ); 
  11. exit; 
  12.  
  13. $hook = add_submenu_page( jetpack, __( 'Site Stats', jetpack ), __( 'Site Stats', jetpack ), 'view_stats', 'stats', 'stats_reports_page' ); 
  14. add_action( "load-$hook", 'stats_reports_load' );