1
我想使用$ wp_registered_sidebars獲得所有註冊側邊欄列表,但它返回一個空數組。WordPress的 - 側邊欄列表
這裏是我的代碼:
foreach ($GLOBALS['wp_registered_sidebars'] as $sidebar)
{
$sidebar_options[$sidebar['id']] = $sidebar['name'];
}
它返回陣列()
在它的工作原理頁面模板,但不是在我的functions.php
任何想法? 感謝