wp_widget_description

The timeline below displays how wordpress function wp_widget_description has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * 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 The 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']);
    }
}

WordPress Version: 4.3

/**
 * 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']);
    }
}

WordPress Version: 3.7

/**
 * 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
 *
 * @param int|string $id Widget ID.
 * @return string Widget description, if available. Null on failure to retrieve description.
 */
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']);
    }
}