$submenu_item ) { if ( 'wc-admin' === $submenu_item[2] ) { $wc_admin_key = $submenu_key; break; } } if ( ! $wc_admin_key ) { return; } $menu = $submenu['woocommerce'][ $wc_admin_key ]; $menu[2] = 'admin.php?page=wc-admin#/'; unset( $submenu['woocommerce'][ $wc_admin_key ] ); array_unshift( $submenu['woocommerce'], $menu ); $submenu['wc-admin#/analytics'][0][0] = __( 'Overview', 'wc-admin' ); } // priority is 20 to run after https://github.com/woocommerce/woocommerce/blob/a55ae325306fc2179149ba9b97e66f32f84fdd9c/includes/admin/class-wc-admin-menus.php#L165 add_action( 'admin_head', 'wc_admin_link_structure', 20 ); /** * Load the assets on the admin pages */ function wc_admin_enqueue_script(){ if ( ! wc_admin_is_admin_page() && ! wc_admin_is_embed_enabled_wc_page() ) { return; } wp_enqueue_script( WC_ADMIN_APP ); wp_enqueue_style( WC_ADMIN_APP ); } add_action( 'admin_enqueue_scripts', 'wc_admin_enqueue_script' ); function wc_admin_admin_body_class( $admin_body_class = '' ) { global $hook_suffix; if ( ! wc_admin_is_admin_page() && ! wc_admin_is_embed_enabled_wc_page() ) { return $admin_body_class; } $classes = explode( ' ', trim( $admin_body_class ) ); $classes[] = 'woocommerce-page'; if ( wc_admin_is_embed_enabled_wc_page() ) { $classes[] = 'woocommerce-embed-page'; } $admin_body_class = implode( ' ', array_unique( $classes ) ); return " $admin_body_class "; } add_filter( 'admin_body_class', 'wc_admin_admin_body_class' ); function wc_admin_admin_before_notices() { if ( ! wc_admin_is_admin_page() && ! wc_admin_is_embed_enabled_wc_page() ) { return; } echo '