init_hooks(); } } /** * Initialize the hooks. */ public function init_hooks() { self::$initialized = true; // Jetpack uses 998 and 'Admin_Menu' uses 1000. add_action( 'admin_menu', array( $this, 'add_wp_admin_submenu' ), $this->menu_priority ); } /** * The page to be added to submenu */ public function add_wp_admin_submenu() { $page_suffix = Admin_Menu::add_menu( __( 'Stats', 'jetpack-stats-admin' ), _x( 'Stats', 'product name shown in menu', 'jetpack-stats-admin' ), 'manage_options', 'stats', array( $this, 'render' ) ); if ( $page_suffix ) { add_action( 'load-' . $page_suffix, array( $this, 'admin_init' ) ); } } /** * Override render funtion */ public function render() { // Record the number of views of the stats dashboard on the initial several loads for the purpose of showing feedback notice. $views = intval( Stats_Options::get_option( 'views' ) ) + 1; if ( $views <= Notices::VIEWS_TO_SHOW_FEEDBACK ) { Stats_Options::set_option( 'views', $views ); } ?>
src="//en.wordpress.com/i/loading/loading-64.gif" />
load_admin_scripts( 'jp-stats-dashboard', 'build.min', array( 'config_variable_name' => 'jetpackStatsOdysseyAppConfigData' ) ); } }