Can you shortly explain me or lead me to the answer about how to access those variables with %#… ???
I'd like to get widget number inside a sidebar (or TEXT widget instance inside that sidebar, since that sidebar will only contain text widgets), but I haven't found info about those in the codex and the whole internet.
WP codex uses this example, but both the id and class give me the basename plus the widget number. I only need the widget number, which I think is very useful.
I tried $i, but it doesn't do a thing.
<?php $args = array(
'name' => sprintf(__('Sidebar %d'), $i ),
'id' => 'sidebar-$i',
'description' => ''
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>' ); ?>