Professional Documents
Culture Documents
Dynamic sidebar
if ( is_int( $index ) ) {
$index = "sidebar-$index";
} else {
$index = $key;
break;
$sidebars_widgets = wp_get_sidebars_widgets();
}
/**
* Note: The action also fires for empty sidebars, and on both the front-end
* and back-end, including the Inactive Widgets sidebar on the Widgets screen.
* @since 3.9.0
* Default true.
*/
$sidebar = $wp_registered_sidebars[$index];
$did_one = false;
if ( !isset($wp_registered_widgets[$id]) ) continue;
$params = array_merge(
(array) $wp_registered_widgets[$id]['params']
);
$classname_ = '';
foreach ( (array) $wp_registered_widgets[$id]['classname'] as $cn ) {
if ( is_string($cn) )
elseif ( is_object($cn) )
/**
* @since 2.5.0
* @see register_sidebar()
* @type string $name Name of the sidebar the widget is assigned to.
* @type string $before_title HTML markup to prepend to the widget title when
displayed.
* @type string $after_title HTML markup to append to the widget title when
displayed.
* }
* @type int $number Number increment used for multiples of the same widget.
* }
*}
*/
$callback = $wp_registered_widgets[$id]['callback'];
/**
* Note: The action fires on both the front-end and back-end, including
* @since 3.0.0
*
* @param array $widget_id {
* @type array|callable $callback When the hook is fired on the front-end, $callback
is an array
* @type array $_callback When the hook is fired on the back-end, $_callback is
populated
*}
*/
if ( is_callable($callback) ) {
call_user_func_array($callback, $params);
$did_one = true;
/**
* Note: The action also fires for empty sidebars, and on both the front-end
* and back-end, including the Inactive Widgets sidebar on the Widgets screen.
* @since 3.9.0
* Default true.
*/
/**
* Note: The filter is also evaluated for empty sidebars, and on both the front-end
* and back-end, including the Inactive Widgets sidebar on the Widgets screen.
* @since 3.9.0
* @param bool $did_one Whether at least one widget was rendered in the sidebar.
* Default false.
*/