Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

register_sidebar()

3 tags 1 category

register_sidebar() — 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.

Inputs: $args (array|string): Optional. Array or string of arguments for the sidebar being registered. Field $name (string): The name or title of the sidebar displayed in the Widgets interface. Default ‘Sidebar $instance’. Field $id (string): The unique identifier by which the sidebar will be called. Default ‘sidebar-$instance’. Field $description (string): Description of the sidebar, displayed in the Widgets interface. Default empty string. Field $class (string): Extra CSS class to assign to the sidebar in the Widgets interface. Default empty. Field $before_widget (string): HTML content to prepend to each widget’s HTML output when assigned to this sidebar. Receives the widget’s ID attribute as %1$s and class name as %2$s.

Returns string: Sidebar ID added to $wp_registered_sidebars global.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…