Tag Info

New answers tagged

0

I found the solution for this issue and I'm going to post it here maybe someone else needs to add custom fields to the backend menu themselves. The best way of doing this as i found out is to call a different walker class for each backend menu. This will be a long answer and i couldn't post all the code because of characters limitations but if you follow it ...


0

wp_get_nav_menu_object( $menu ); Returns nav menu object when given a menu id, slug, or name. This is particularly useful for retrieving the name assigned to the custom menu. http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_object


1

You don't have the data you need in the start_lvl() method to do this. That data is available in the start_el() method in the $item variable, so you will have to cook up a way to pass that data along: class my_extended_walker extends Walker_Nav_Menu { var $prnt = 0; var $pdepth = false; public function start_lvl( &$output, $depth = 0, $args = ...


1

this can be done with the "add_menu_page" function you can see example of use on this page : http://codex.wordpress.org/Function_Reference/add_menu_page


0

I'm trying to make my logic like this: calling below code inside function start_el( &$output, $item, $depth, $args ) { $this->sub_items = 0; // declared variable as private $sub_items = 0 above inside class if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) { ...



Top 50 recent answers are included