删除插件添加的管理标题栏中的某些链接

时间:2017-05-02 10:48:01

标签: wordpress

我已经安装了几个插件,他们倾向于在管理栏上添加链接

我有最终的联盟专业人士,它已经添加了新的和推荐联盟会员和其他插件,如ithemes安全管理栏上有一个链接,现在我的管理栏看起来像在下面的图像中加入

enter image description here

我如何编辑这是一个插件,可以删除管理仪表板栏上的某些链接,而无需禁用插件

我试过了:

checking on the screen options but there is no way to uncheck links

1 个答案:

答案 0 :(得分:1)

以下是如何从admin_bar中删除不需要的链接的示例。

function remove_admin_bar_links() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('wporg');            // Remove the WordPress.org link
    $wp_admin_bar->remove_menu('documentation');    // Remove the WordPress documentation link
    $wp_admin_bar->remove_menu('support-forums');   // Remove the support forums link
    $wp_admin_bar->remove_menu('feedback');         // Remove the feedback link
    $wp_admin_bar->remove_menu('w3tc');             // If you use w3 total cache remove the performance link
    $wp_admin_bar->remove_menu('my-account');       // Remove the user details tab
}
add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );

您需要检查菜单名称并通过add_action将其添加到函数调用中。