I would like that each widget set in my sidebar gets an id based on the user-entered widget title.

For instance, if the user drags a Text widget, puts some advertisment html code in it, then put "sponsored link", the html output has class="widget sponsored-link"

Right now, i register my sidebar with this bit, and set the class using %2s (why i don't know what it is the second part of). Any idea how to tweak that into what i need?

register_sidebar(array('name'=>__('First Sidebar'),
                    'id'=>'sidebar-1',
                    'description'=>__('sidebar 1'),
                    'before_widget' => '<li id="%1$s" class="widget %2$s">',
                    'after_widget' => '</li>',
                    'before_title' => '<h3 class="widget-title">',
                    'after_title' => '</h3>',
                ));
link|improve this question

feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.