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

时间:2018-01-02 00:33:59

标签: php wordpress

我想隐藏worpress管理面板中的当前主题功能 我在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 ); }

任何人都可以提供帮助。

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

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