描述:
创建一个小工具/侧边栏的描述
参数:
$id
(integer/string) (必填) 小工具 ID.
默认值: None
返回值:
小工具描述(如果可用)。检索描述失败时为空。
源文件:
/**
* Retrieve description for widget.
*
* When registering widgets, the options can also include 'description' that
* describes the widget for display on the widget administration panel or
* in the theme.
*
* @since 2.5.0
*
* @global array $wp_registered_widgets
*
* @param int|string $id Widget ID.
* @return string|void Widget description, if available.
*/
function wp_widget_description( $id ) {
if ( !is_scalar($id) )
return;
global $wp_registered_widgets;
if ( isset($wp_registered_widgets[$id]['description']) )
return esc_html( $wp_registered_widgets[$id]['description'] );
}