wp_sidebar_description() WordPress Function

The wp_sidebar_description() function allows you to display a sidebar description. This is useful for providing additional information about the sidebar's widgets.

wp_sidebar_description( string $id ) #

Retrieve description for a sidebar.


Description

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


Top ↑

Parameters

$id

(string)(Required)sidebar ID.


Top ↑

Return

(string|void) Sidebar description, if available.


Top ↑

Source

File: wp-includes/widgets.php

function wp_sidebar_description( $id ) {
	if ( ! is_scalar( $id ) ) {
		return;
	}

	global $wp_registered_sidebars;

	if ( isset( $wp_registered_sidebars[ $id ]['description'] ) ) {
		return wp_kses( $wp_registered_sidebars[ $id ]['description'], 'sidebar_description' );
	}
}


Top ↑

Changelog

Changelog
VersionDescription
2.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.