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. Reason: Fixing indentation
-
This topic was modified 3 years, 11 months ago by
-
Hello @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.comIt 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 upThanks!
Hello @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@gpetrova thanks!
The topic ‘Order Menu function breaking other plugins’ is closed to new replies.