From 69526ca9c442ad85cb2d1329b62650df5aa56356 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 8 Sep 2011 11:03:02 +0100 Subject: [PATCH] Menu position fixes --- admin/admin-init.php | 14 +++++++++----- woocommerce_taxonomy.php | 1 - 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/admin/admin-init.php b/admin/admin-init.php index 38f96b493b5..c64721733fe 100644 --- a/admin/admin-init.php +++ b/admin/admin-init.php @@ -39,9 +39,9 @@ add_action('admin_print_scripts', 'woocommerce_admin_scripts'); function woocommerce_admin_menu() { global $menu, $woocommerce; - $menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator' ); + $menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator woocommerce' ); - add_menu_page(__('WooCommerce'), __('WooCommerce'), 'manage_woocommerce', 'woocommerce' , 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/images/icons/menu_icons.png', 56); + add_menu_page(__('WooCommerce'), __('WooCommerce'), 'manage_woocommerce', 'woocommerce' , 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/images/icons/menu_icons.png', 55); add_submenu_page('woocommerce', __('General Settings', 'woothemes'), __('Settings', 'woothemes') , 'manage_woocommerce', 'woocommerce', 'woocommerce_settings'); add_submenu_page('edit.php?post_type=product', __('Attributes', 'woothemes'), __('Attributes', 'woothemes'), 'manage_woocommerce', 'attributes', 'woocommerce_attributes'); } @@ -53,16 +53,20 @@ function woocommerce_admin_menu_order( $menu_order ) { // Get the index of our custom separator $woocommerce_separator = array_search( 'separator-woocommerce', $menu_order ); + + // Get index of product menu + $woocommerce_product = array_search( 'edit.php?post_type=product', $menu_order ); // Loop through menu order and do some rearranging foreach ( $menu_order as $index => $item ) : if ( ( ( 'woocommerce' ) == $item ) ) : $woocommerce_menu_order[] = 'separator-woocommerce'; + $woocommerce_menu_order[] = $item; + $woocommerce_menu_order[] = 'edit.php?post_type=product'; unset( $menu_order[$woocommerce_separator] ); - endif; - - if ( !in_array( $item, array( 'separator-woocommerce' ) ) ) : + unset( $menu_order[$woocommerce_product] ); + elseif ( !in_array( $item, array( 'separator-woocommerce' ) ) ) : $woocommerce_menu_order[] = $item; endif; diff --git a/woocommerce_taxonomy.php b/woocommerce_taxonomy.php index 2256685b507..e64dc9ef2ff 100644 --- a/woocommerce_taxonomy.php +++ b/woocommerce_taxonomy.php @@ -131,7 +131,6 @@ function woocommerce_post_type() { 'capability_type' => 'post', 'publicly_queryable' => true, 'exclude_from_search' => false, - 'menu_position' => 57, 'hierarchical' => true, 'rewrite' => array( 'slug' => $base_slug, 'with_front' => false ), 'query_var' => true,