Support » Plugin: Custom Taxonomy Order » Taxonomy list always on wp-admin

  • Hi
    I have a lot of taxonomy’s in woocommerce.
    Plugin funtions are working fine in the front-end, but a list of taxonomys is constantly visible against the left list in the WP-admin interface. Hard to describe without a screenshot.
    The list generated by the plugin, is always visible on every wp-admin page.
    I had to disable the plugin to work properly.

    Thanks,
    Wannes

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Marcel Pol

    (@mpol)

    Hi Wannes,
    I am not sure what is going on.
    This plugin adds a menu to your admin-menu with the name Term Order. If you have a lot of taxonomies, there will be a lot of subpages, but they should not be open by default.

    Is there a way for you to find out what is going on, like maybe CSS that is going wrong?

    Thread Starter omegait

    (@omegait)

    Hi Marcel,
    I disabled the extra CSS’s on my site, but no success.
    When inspecting the admin page, removing the element <ul class=”wp-submenu wp-submenu-wrap” style> removed the menu untill refreshed.
    I also found out that when i am in the customtaxorder page, the menu is also gone.
    Reinstalling the plugin did not work as well.

    Plugin Author Marcel Pol

    (@mpol)

    Strange πŸ™‚

    When I look at that submenu in the inspector, I only see CSS targeting that ul element with CSS defined in admin-menu.css.
    When you look in the inspector, do you see more CSS being applied to that <ul class=”wp-submenu wp-submenu-wrap”? Is there a CSS file from a plugin or theme involved? Or maybe inline CSS, possibly set by JavaScript?

    Thread Starter omegait

    (@omegait)

    Hi Marcel,

    I just tried some basic troubleshooting.
    – All plugins disabled, except Woocommerce and custom taxonomy order. –> Menu still visible.
    – Removing extra CSS –> Menu still visible.

    I’m not an expert in CSS codes.
    Here is a screenshot with the element inspector:
    https://ibb.co/BwV8F1j
    If you would like an admin login, let me know, i will share one private.

    otomakan

    (@otomakan)

    @omegait, here’s something we use as a temporary workaround.

    /* Workaround for Custom Taxonomy Order Menu Issues */
    function remove_menu_items(){
    remove_menu_page( ‘customtaxorder’ );
    }
    add_action( ‘admin_menu’, ‘remove_menu_items’, 999 );
    add_action( ‘admin_menu’, ‘linked_url’ );
    function linked_url() {
    add_menu_page( ‘linked_url’, ‘Custom Taxonomy Order’, ‘read’, ‘customtaxonomyorder’, ”, ‘dashicons-text’, 1 );
    }
    add_action( ‘admin_menu’ , ‘linkedurl_function’ );
    function linkedurl_function() {
    global $menu;
    $menu[1][2] = “../wp-admin/admin.php?page=customtaxorder”;
    }

    • This reply was modified 11 months ago by otomakan.
    • This reply was modified 11 months ago by otomakan.
    Thread Starter omegait

    (@omegait)

    Hi Marcel,

    I’m glad you’ve found something.
    I’ve added the provided code in extra css and functions.php, but it did not remove the menu.
    Maybe I do something wrong πŸ˜‰

    Plugin Author Marcel Pol

    (@mpol)

    Hi omegait, I didn’t provide that code.

    I have no idea what is going on as well, I haven’t seen this problem myself. If there is some way that I can reproduce this, I would like to know. That way I could look into providing a solution.

    Plugin Author Marcel Pol

    (@mpol)

    Does this CSS do anything for you as workaround?

    li#toplevel_page_customtaxorder ul {
        display: none;
        visibility: hidden;
        height: 0;
    }
    Thread Starter omegait

    (@omegait)

    Hi Marcel,

    Now i see that otomakan provided that code.
    That code gave me a site crash.

    The CSS you provided did not work.
    I’ve found a workaround by removing the “customtaxorder” menu.
    adding this code to my functions.php removed the menu, and the submenu as well:

    /* Workaround for Custom Taxonomy Order Menu Issues */
    function wpdocs_remove_menus(){
    
      remove_menu_page( 'customtaxorder' );
    
    }
    add_action( 'admin_init', 'wpdocs_remove_menus' );
    

    I have 569 attributes in Woocommerce.
    So i guess to reproduce this problem, install the Woocommerce plugin, adding 569 attributes and after that activating the Taxonomy order plugin will trigger the submenu to be visible.

    Plugin Author Marcel Pol

    (@mpol)

    Hi,
    This might be what you are looking for:

    function customtaxorder_menu_remove_woo_pa() {
    
    	if ( function_exists('wc_get_attribute_taxonomies') ) {
    		$wc_taxonomies = wc_get_attribute_taxonomies();
    
    		foreach ( $wc_taxonomies as $taxonomy ) {
    
    			$page = remove_submenu_page( 'customtaxorder', 'customtaxorder-pa_' . $taxonomy->attribute_name );
    
    		}
    	}
    
    }
    add_action( 'admin_menu', 'customtaxorder_menu_remove_woo_pa', 999 );

    I don’t think this code should be in the main plugin, since attributes can be color or size, and you might want to sort those terms.

    Plugin Author Marcel Pol

    (@mpol)

    Ah, I found the issue, it is CSS πŸ™‚
    The submenu that is not visible gets a top: -1000em;
    This fixes it too πŸ™‚

    #adminmenu ul.wp-submenu {
        top: -10000em;
    }
    Thread Starter omegait

    (@omegait)

    Hi Marcel,

    Glad you have found the issue.
    Added the funtion to my funtion.php file, and everything looks normal again.

    Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Taxonomy list always on wp-admin’ is closed to new replies.