wp_sidebar_description

Retrieve description for a sidebar.

Description

(string|void) wp_sidebar_description( (string) $id ); 

When registering sidebars a description parameter can be included that describes the sidebar for display on the widget administration panel.

Returns (string|void)

Sidebar description, if available.

Parameters (1)

0. $id (string)
Sidebar ID.

Usage

  1. if ( !function_exists( 'wp_sidebar_description' ) ) { 
  2. require_once ABSPATH . WPINC . '/widgets.php'; 
  3.  
  4. // sidebar ID. 
  5. $id = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_sidebar_description($id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/widgets.php  
  1. function wp_sidebar_description( $id ) { 
  2. if ( !is_scalar($id) ) 
  3. return; 
  4.  
  5. global $wp_registered_sidebars; 
  6.  
  7. if ( isset($wp_registered_sidebars[$id]['description']) ) 
  8. return esc_html( $wp_registered_sidebars[$id]['description'] );