Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to add a custom class to the UL tag on start_lvl if the user writes "full" on the title area of the menu. Something like this:

public function start_lvl( &$output, $depth = 0, $args = array() )    

    if ( user writes "full" )
        $output .= "\n$indent<ul role=\"menu\" class=\" my-menu custom-class\">\n";
    } else {
        $output .= "\n$indent<ul role=\"menu\" class=\" my-menu\">\n";
    }
}

Looking for other sources I've found a way to include what I want on LI tags using $item->attr_title but doesn't seems to work on start_lvl.

share|improve this question
    
What is "the title area of the menu"? –  s_ha_dum Mar 19 at 9:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.