WordPress.org

Forums

Category checklist hierarchy is broken (11 posts)

  1. ralphonz
    Member
    Posted 1 year ago #

    I'm making this post for a few reasons:

    1. It took me a long time to search for a solution
    2. I have a solution that may help others
    3. I believe it requires serious attention from wordpress developers

    I'm a long-time and very grateful user of wordpress. I've built a great many websites using it as a platform for all sorts of clients. However, this issue has been around as long as I've been using wordpress and needs to be taken seriously by the core developers.

    If you create a lot of hierarchal taxonomies, they are not displayed correctly in the checklist on either the post/page or add to menu screen. This is really, really really confusing if some of the sub taxonomies have the same title as you can't distinguish one from the other.

    It also makes most people think that they haven't nested their taxonomies correctly.

    The thing is the fix is very very desirable, and also very very easy! It's just one little number:

    //fix the display of catalog categories in appearance->menu
    add_filter( 'get_terms_args', 'checklist_args', 10, 2 );
      function checklist_args( $args, $taxonomies )
      {
        $menu_taxonomies = array('shopp_category', 'page', 'category','post');
        if(in_array($taxonomies[0], $menu_taxonomies))
        {
          $args['number'] = 1000;
        }
        return $args;
      }

    Where this problem is at it's worst is on e-commerce sites with a lot of categories.

    WordPress, please fix it! For the life of me I cannot see why you'd want it the way it is at the moment.

  2. Krauthaus
    Member
    Posted 6 months ago #

    I am @ this point. Since i am a bloody worpress noob i have a question. It looks like i have to insert this code into the function.php?
    Do i have to simply copy it in there?

  3. DrLightman
    Member
    Posted 4 months ago #

    Man, I love you. I experienced this annoying bug just now, and your code fixed it instantly.

    @Krauthaus:
    yes, put it in theme's functions.php file.

  4. ralphonz
    Member
    Posted 4 months ago #

    Glad it helped :-)

    You can change the taxonomies if you have custom ones on this line:

    $menu_taxonomies = array('custom_taxonomy', 'page', 'category','post');

  5. rosso711
    Member
    Posted 3 months ago #

    hey everyone,

    i have tried this in my installation and i still get pagination in my product categories under appearance>menus.

    I have even increased the number to 5000

    //fix the display of catalog categories in appearance->menu
    add_filter( 'get_terms_args', 'checklist_args', 10, 2 );
      function checklist_args( $args, $taxonomies )
      {
        $menu_taxonomies = array('shopp_category', 'page', 'category','post');
        if(in_array($taxonomies[0], $menu_taxonomies))
        {
          $args['number'] = 5000;
        }
        return $args;
      }

    can anyone suggest something?

  6. ralphonz
    Member
    Posted 3 months ago #

    i have tried this in my installation and i still get pagination in my product categories under appearance>menus.

    rosso711, what e-commerce plugin are you using for products and their categories?

    You need to enter the correct taxonomy into the $menu_taxonomies array like this:

    $menu_taxonomies = array('my_product_category_taxonomy');

    In my case above I added support for the shopp plugin categories, pages, post categories and posts.

  7. rosso711
    Member
    Posted 3 months ago #

    i am using woocommerce

  8. ralphonz
    Member
    Posted 3 months ago #

    then you need to add the taxonomy "product_cat" to the array.

    Here is a list of woo commerce taxonomies:
    http://docs.woothemes.com/document/installed-taxonomies-post-types/

  9. rosso711
    Member
    Posted 3 months ago #

    changed it but still pagination

    //fix the display of catalog categories in appearance->menu
    add_filter( 'get_terms_args', 'checklist_args', 10, 2 );
      function checklist_args( $args, $taxonomies )
      {
        $menu_taxonomies = array('product_cat', 'page', 'category','post');
        if(in_array($taxonomies[0], $menu_taxonomies))
        {
          $args['number'] = 5000;
        }
        return $args;
      }
  10. ralphonz
    Member
    Posted 3 months ago #

    hey rosso711,

    Not sure why that wouldn't work, maybe try woo commerce support?

  11. rosso711
    Member
    Posted 3 months ago #

    OK i will thanks for the help

Topic Closed

This topic has been closed to new replies.

About this Topic