Have a very quick question, and i presume simple, but as its late in the day, i can’t seem to solve it…
I have a wordpress menu floated to the right. To correct the order, i need to display the menu in reverse. I am using this function to do this, and placing it just before the menu is called in header:
<?php add_filter( 'wp_nav_menu_objects', create_function( '$menu', 'return array_reverse( $menu );' ) ); ?>
As i only want to reverse one menu, i need to put a remove_filter after the menu… and can’t figure it out… or maybe the add_filter function is wrong in the first place.
Any ideas?
Thanks in advanced!
WordPressâ plugin API offers no simple access to anonymous functions or closures.
Use a regular function as callback instead:
Never use
create_function()
. It is slow, hard to debug, and it doesnât work well with opcaches.