unregister_sidebar()注销指定的主题侧边栏

目录

描述

De-registers a previously registered sidebar.

unregister_sidebar() 描述

用法

 <?php unregister_sidebar$id ); ?> 

unregister_sidebar() 用法

参数

$id

(string) (必填) The ID of the sidebar when it was added.

默认值: None

unregister_sidebar() 参数

注意

In the example, note that we assign a priority of 11 when registering the widgets_init hook. This is because a child theme's functions.php file is called before the parent theme's, which means that our call to unregister_sidebar() would accomplish nothing since the sidebar has not yet been registered.

By lowering the priority of our 动作, we ensure that it is called after the parent theme's functions.php file is loaded.

unregister_sidebar() 注意

历史

添加于 版本: 2.2.0

unregister_sidebar() 历史

源文件

unregister_sidebar() 函数的代码位于 wp-includes/widgets.php.

unregister_sidebar() 源文件

相关