Title: register_sidebar wordpress function before_widget
Last modified: August 21, 2016

---

# register_sidebar wordpress function before_widget

 *  [E01T](https://wordpress.org/support/users/e01t/)
 * (@e01t)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/register_sidebar-wordpress-function-before_widget/)
 * The register sidebar wordpress function has one parameter called “before_widget–
   HTML to place before every widget(default:'<li id=”%1$s” class=”widget %2$s”>’)”
   At the end it adds “Note: uses sprintf for variable substitution”(in wp codex).
   I test it on a site, and depending on the widget that I supply/activate it takes
   the name of the widget: an id plus a class e.g. for a search box widget it will
   became id=”search-2″ class=”widget widget_search” Where is this sprintf and where
   are these variables? Where is this function that manipulates this parameter and
   does the sprintf variable substitution? I checked the register_sidebar() function
   in wp-includes/widgets.php file but I could not find it.

The topic ‘register_sidebar wordpress function before_widget’ is closed to new replies.

## Tags

 * [register_sidebar](https://wordpress.org/support/topic-tag/register_sidebar/)

 * 0 replies
 * 1 participant
 * Last reply from: [E01T](https://wordpress.org/support/users/e01t/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/register_sidebar-wordpress-function-before_widget/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
