Add widget description

I keep seeing authors leave description as-is (empty) and believe that it wouldn't hurt to add something in by default. This is a general description taken from https://github.com/WordPress/twentysixteen/blob/master/functions.php#L150

At the same time it shows good practice how to escape the content and translate the string too.
This commit is contained in:
Emil Uzelac 2016-03-22 16:42:46 -05:00
parent 019bd2408e
commit debdbd5c6e
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ function _s_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', '_s' ),
'id' => 'sidebar-1',
'description' => '',
'description' => esc_html__( 'Add widgets here to appear in your sidebar', '_s' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',