wp_get_sidebars_widgets()
wp_get_sidebars_widgets( bool $deprecated = true ) 检索侧栏…
wp_get_sidebars_widgets( bool $deprecated = true )
检索侧栏及其小部件实例ID的完整列表。
Retrieve full list of sidebars and their widget instance IDs.
检索侧栏及其小部件实例ID的完整列表。
Retrieve full list of sidebars and their widget instance IDs.
目录锚点:#说明#参数#源码
说明(Description)
将升级边栏小部件列表,如果需要。如果需要,还将保存更新的列表。
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $deprecated | (bool) | 未使用(参数已弃用)。 |
源码(Source)
/**
* Retrieve full list of sidebars and their widget instance IDs.
*
* Will upgrade sidebar widget list, if needed. Will also save updated list, if
* needed.
*
* @since 2.2.0
* @access private
*
* @global array $_wp_sidebars_widgets
* @global array $sidebars_widgets
*
* @param bool $deprecated Not used (argument deprecated).
* @return array Upgraded list of widgets to version 3 array format when called from the admin.
*/
function wp_get_sidebars_widgets( $deprecated = true ) {
if ( $deprecated !== true )
_deprecated_argument( __FUNCTION__, '2.8.1' );
global $_wp_sidebars_widgets, $sidebars_widgets;
// If loading from front page, consult $_wp_sidebars_widgets rather than options
// to see if wp_convert_widget_settings() has made manipulations in memory.
if ( !is_admin() ) {
if ( empty($_wp_sidebars_widgets) )
$_wp_sidebars_widgets = get_option('sidebars_widgets', array());
$sidebars_widgets = $_wp_sidebars_widgets;
} else {
$sidebars_widgets = get_option('sidebars_widgets', array());
}
if ( is_array( $sidebars_widgets ) && isset($sidebars_widgets['array_version']) )
unset($sidebars_widgets['array_version']);
/**
* Filter the list of sidebars and their widgets.
*
* @since 2.7.0
*
* @param array $sidebars_widgets An associative array of sidebars and their widgets.
*/
return apply_filters( 'sidebars_widgets', $sidebars_widgets );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.2.0 | wp-includes/widgets.php | 17 | 3 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!