Anyone know why my categories stop being nested in the product categories widget within appearance > menus? They begin nested, but stop after Age 4 to 6.

I have a set of woocommerce product categories that follow a parent child structure. In the image below, I have a parent category of English Workbooks with child categories of Grammar, Spelling etc. I want to build a menu from my woocommerce categories. To do this, i have created a menu and want to now select woocommerce product categories from the left under “Appearance > Menus”. Because i have them all organised in a parent -> child format, when i open the product categories list, the parent > child structure stops working after “Age 4 to 6” and turn into a flat list start “English, Maths, English, Maths etc,etc”. This makes it impossible to select the correct categories as i dont know which ones to select.

How do i make the product categories selector in appearance > menus match the parent > child structure i have defined in my product categories?

Appearance > Menus Product Categories

1 Answer
1

Seems to be a long-standing issue. This plugin seems to do the trick.

I’ve also found an alternative solution (which I’ve posted in the thread). Reproduced below:

<?php
  add_filter( 'nav_menu_meta_box_object', 'disable_pagination_in_menu_meta_box', 9 );

  function disable_pagination_in_menu_meta_box($obj) {
    $obj->_default_query = array(
      'posts_per_page' => -1
    );
    return $obj;
  }
?>

Update: Needs to be added with priority 9 to work well with the default filter _wp_nav_menu_meta_box_object

Leave a Reply

Your email address will not be published. Required fields are marked *