• Resolved cartpauj

    (@cartpauj)


    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 2 years, 5 months ago by cartpauj. Reason: Fixing indentation
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Plamen M

    (@plamenm)

    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.com

    Thread Starter cartpauj

    (@cartpauj)

    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

    (@gpetrova)

    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

    Thread Starter cartpauj

    (@cartpauj)

    @gpetrova thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Order Menu function breaking other plugins’ is closed to new replies.