What is the use case for the “Class” parameter in register_sidebar?

If you fill class parameter to register_sidebar function then the class sidebar-{class name} gets added to the div of that sidebar in the back end.

For example if you register the sidebar using following code :

register_sidebar(
    array(
        'name'  => __('Footer Widget One', 'wpbs-framework'),
        'id'    => 'footer-01',
        'class' => 'testing',
        'description'   => __('The first footer area', 'wpbs-framework'),
        'before_widget' => '<div class="footer-sidebar-widget">',
        'after_widget'  => '</div> <!-- end footer-sidebar-widget -->',
        'before_title'  => '<h4>',
        'after_title'  => '</h4>'
    )
);

then in back end you will see the sidebar div having class ‘sidebar-testing’ as following

<div class="widgets-holder-wrap sidebar-testing">

Leave a Comment