register_sidebar ( $args = array() )

  • (array|string) $args { Optional. Array or string of arguments for the sidebar being registered.
  • (string) Sidebar ID added to $wp_registered_sidebars global.
Defined at:


Builds the definition for a single sidebar and returns the ID.

Accepts either a string or an array and then parses that against a set of default arguments for the new sidebar. WordPress will automatically generate a sidebar ID and name based on the current number of registered sidebars if those arguments are not included.

When allowing for automatic generation of the name and ID parameters, keep in mind that the incrementor for your sidebar can change over time depending on what other plugins and themes are installed.

If theme support for 'widgets' has not yet been added when this function is called, it will be automatically enabled through the use of add_theme_support()

Related Functions

register_sidebars, unregister_sidebar, is_registered_sidebar, register_sidebar_widget, unregister_sidebar_widget

Top Google Results

User discussions

wpseek mobile