fdm_menu_item_classes filter
-
So, I’m trying to add_filter to the fdm_menu_item_classes filter.
In addition to the classes already defined in array, I’d like to add one of my own. That class is dependent on whether or not there is content for that menu item.
I added this to my functions.php file:
function does_menu_item_have_content($classes, $this) { $content = $this->content; if (empty($content)) { $classes[] = 'fdm-item-no-content'; } return $classes; } add_filter('fdm_menu_item_classes', 'does_menu_item_have_content', 11, 2);
However, it does not work. I also passed by reference and that did not work either. Perhaps I’m missing something?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘fdm_menu_item_classes filter’ is closed to new replies.