【问题标题】:hide plugins menu wordpress dashboard隐藏插件菜单 wordpress 仪表板
【发布时间】:2014-09-29 06:23:29
【问题描述】:

我正在尝试为客户制作自定义仪表板。

我想隐藏仪表板中出现的每个插件菜单。到目前为止,我可以只隐藏 wordpress seo,将此代码添加到 functions.php:

function hide_yoastseo() {
    remove_action('admin_bar_menu', 'wpseo_admin_bar_menu',95);
    remove_menu_page('wpseo_dashboard');
}
add_action( 'admin_init', 'hide_yoastseo');

但是我不明白这里应用其他插件的逻辑。

【问题讨论】:

    标签: wordpress menu dashboard


    【解决方案1】:

    我认为以下功能可能对您有所帮助。

    function chetz_remove_admin_menus(){
    
    // Check that the built-in WordPress function remove_menu_page() exists in the current installation
    if ( function_exists('remove_menu_page') ) { 
    
        remove_menu_page( 'plugins.php' ); // Remove the Links tab by providing its slug
    }}add_action('admin_menu', 'chetz_remove_admin_menus'); // Add our function to the admin_menu action
    

    【讨论】:

      猜你喜欢
      • 2013-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-11
      • 1970-01-01
      • 2019-08-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多