Title: Order Menu function breaking other plugins
Last modified: June 6, 2022

---

# Order Menu function breaking other plugins

 *  Resolved [cartpauj](https://wordpress.org/support/users/cartpauj/)
 * (@cartpauj)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-menu-function-breaking-other-plugins/)
 * core/Loader/Loader.php
 * custom_menu_order should return a bool, not a function.
 * Change to:
 *     ```
       			add_filter( 'custom_menu_order', '__return_true' );
       			add_filter( 'menu_order', array( $this->admin, 'reorder_submenu_pages' ) );
       ```
   
 * core/Admin/Admin.php
    when returning or exiting function, $menu_order needs to
   be returned.
 * Change to:
 *     ```
       	/**
       	 * Reorder the submenu pages.
       	 *
       	 * @since  1.0.0
       	 *
       	 * @param   array $menu_order The WP menu order.
       	 */
       	public function reorder_submenu_pages( $menu_order ) {
       		// Load the global submenu.
       		global $submenu;
   
       		if ( empty( $submenu['sg-cachepress'] ) ) {
       			return $menu_order;
       		}
   
       		// Hide the dashboard page on Multisite applications.
       		if ( is_multisite() ) {
       			unset( $submenu['sg-cachepress'][0] );
       			return $menu_order;
       		}
   
       		$submenu['sg-cachepress'][0][0] = __( 'Dashboard', 'sg-cachepress' );
   
       		return $menu_order;
       	}
       ```
   
    -  This topic was modified 3 years, 11 months ago by [cartpauj](https://wordpress.org/support/users/cartpauj/).
      Reason: Fixing indentation

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-menu-function-breaking-other-plugins/#post-15714314)
 * Hello [@cartpauj](https://wordpress.org/support/users/cartpauj/) ,
 * Thank you for your suggestion. Can you explain the particular issue which you
   faced? Please, help us recreate the issue , so that we can check it further. 
   For this, please provide instructions in the format: click here, type this, click
   there.
 * We look forward to your reply.
 * Regards,
    Plamen.M tech support team SiteGround.com
 *  Thread Starter [cartpauj](https://wordpress.org/support/users/cartpauj/)
 * (@cartpauj)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-menu-function-breaking-other-plugins/#post-15714340)
 * It would affect any plug-in using the menu_order filters downstream of the optimizer
   because it’s not properly returning the $menu_order var in the function above.
 * It’s affecting our MemberPress plug-in for sure, not certain about others.
 * Contact our support if you need a development copy of our plug-in to test against
   but our developer has already provided the fix which I mentioned above and we
   have tested. It works great.
 * Steps to Reproduce Issue
    1. Deactivate SG Optimizer 2. Install MemberPress 3.
   See MemberPress submenu order (Memberships, Groups, Rules, Courses, etc) 4. Activate
   SG Optimizer 5. See MemberPress submenu order is mixed up
 * Thanks!
 *  Plugin Support [Gergana Petrova](https://wordpress.org/support/users/gpetrova/)
 * (@gpetrova)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-menu-function-breaking-other-plugins/#post-15718799)
 * Hello [@cartpauj](https://wordpress.org/support/users/cartpauj/),
 * Thank you for the additional details. I have forwarded all of the information
   and suggested fix to our Developers.
 * While I cannot provide an ETA and confirm that the suggested fix will be implemented
   as is, we appreciate the feedback and will keep you informed when there’s any
   progress.
 * Best Regards,
    Gergana Petrova
 *  Thread Starter [cartpauj](https://wordpress.org/support/users/cartpauj/)
 * (@cartpauj)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-menu-function-breaking-other-plugins/#post-15720460)
 * [@gpetrova](https://wordpress.org/support/users/gpetrova/) thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Order Menu function breaking other plugins’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

 * [breaking](https://wordpress.org/support/topic-tag/breaking/)
 * [menu order](https://wordpress.org/support/topic-tag/menu-order/)

 * 4 replies
 * 3 participants
 * Last reply from: [cartpauj](https://wordpress.org/support/users/cartpauj/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/order-menu-function-breaking-other-plugins/#post-15720460)
 * Status: resolved