自定义wordpress管理面板隐藏功能

问题描述 投票:0回答:2

我想隐藏wordpress管理面板中的当前主题功能,我在function.php中使用此代码

 function remove_menus(){
 remove_menu_page( 'index.php' );                  //Dashboard
 remove_menu_page( 'jetpack' );                    //Jetpack*
 //  remove_menu_page( 'edit.php' );                   //Posts
 //  remove_menu_page( 'upload.php' );                 //Media
 //  remove_menu_page( 'edit.php?post_type=page' );    //Pages
 remove_menu_page( 'edit-comments.php' );          //Comments
 //  remove_menu_page( 'options-general.php' );        //Settings
 remove_menu_page( 'admin.php?page=themify' );    //swpakistan

}
add_action( 'admin_menu', 'remove_menus' );

但主题包含function.php有以下代码,以防止我这样做,

$theme_includes = apply_filters( 'themify_theme_includes',
array(  'themify/themify-database.php',
                        'themify/class-themify-config.php',
                        'themify/themify-utils.php',
                        'themify/themify-config.php',
                        'themify/themify-modules.php',
                        'theme-options.php',
                        'theme-modules.php',
                        'theme-functions.php',
                        'custom-modules.php',
                        'custom-functions.php',
                        'theme-class.php',
                        'themify/themify-widgets.php' ));

foreach ( $theme_includes as $include ) { locate_template( $include, true ); }

谁能帮忙。

php wordpress
2个回答
0
投票

您可以安装一个插件,该插件为您提供设置为每个用户角色的权限,并限制对后端某些部分的访问


0
投票

您是否尝试删除过滤器? 类似于:remove_filter('hook_name','themify_theme_includes');

© www.soinside.com 2019 - 2024. All rights reserved.