Title: CSS classes generated before calling wp_nav_menu_objects
Last modified: August 21, 2016

---

# CSS classes generated before calling wp_nav_menu_objects

 *  Resolved [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/css-classes-generated-before-calling-wp_nav_menu_objects/)
 * I’ve received a support issue for my plugin (at [http://wordpress.org/support/topic/issue-with-default-wordpress-sidebar-menu?replies=5](http://wordpress.org/support/topic/issue-with-default-wordpress-sidebar-menu?replies=5)).
   I’ve searched Walker_Nav_Menu class and found that the CSS classes are generated
   before the wp_nav_menu_objects hook is called.
 * I haven’t looked into it in detail yet, but it seems to me from the comments 
   that this hook is assumed to yield a filtered set of menu items, and the code
   is not prepared for handling cases where the hook actually yields more menu items,
   as I’ve used it.
 * What would be the best way to re-add the .current-post-ancestor, .current-menu-
   parent, .current-post-parent CSS classes to the menu items? Should I correct 
   for this, or should I report it elsewhere?
 * Thank you kindly in advance.
 * Kind regards,
    Diana

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/css-classes-generated-before-calling-wp_nav_menu_objects/#post-4409777)
 * Should I file a bug report for this?
 *  Thread Starter [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/css-classes-generated-before-calling-wp_nav_menu_objects/#post-4409785)
 * I’ve found out why the aforementioned classes were not generated, an extra call
   to _wp_menu_item_classes_by_context did the trick.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘CSS classes generated before calling wp_nav_menu_objects’ is closed to
new replies.

 * 2 replies
 * 1 participant
 * Last reply from: [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/css-classes-generated-before-calling-wp_nav_menu_objects/#post-4409785)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
