如何在WordPress管理栏中添加主题编辑器
在过去,我们向您展示了如何将短链接菜单,草稿帖子和其他内容添加到WordPress管理栏。在本文中,我们将向您展示如何在WordPress管理栏中添加主题编辑器。
您需要做的就是打开特定于站点的插件或主题的functions.php文件并粘贴以下代码:
// Add Theme Editor to Admin Bar (to save time!)
function admin_bar_theme_editor_option() {
global $wp_admin_bar;
if ( !is_super_admin() || !is_admin_bar_showing() )
return;
$wp_admin_bar->add_menu(
array( "id" => "edit-theme",
"title" => __("Edit Theme"),
"href" => admin_url( "theme-editor.php")
)
);
}
add_action( "admin_bar_menu", "admin_bar_theme_editor_option", 100 );
评论被关闭。