Last active
December 12, 2015 05:23
-
-
Save garvs/f3bb9cd9e3be028a9bc8 to your computer and use it in GitHub Desktop.
Hide Virtue theme options page sections for WordPress user role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('after_setup_theme', 'hide_virtue_sections'); | |
function hide_virtue_sections() { | |
if (!class_exists('Redux')) { | |
return; | |
} | |
if (current_user_can('administrator')) { | |
return; | |
} | |
if (!current_user_can('tester')) { | |
return; | |
} | |
$opt_name = "virtue"; | |
Redux::hideSection($opt_name, 'main_settings'); // Main Settings | |
Redux::hideSection($opt_name, 'topbar_settings'); // Topbar Settings | |
Redux::hideSection($opt_name, 'home_slider_settings'); // Home Slider Settings | |
Redux::hideSection($opt_name, 'home_mobile_slider_settings'); // Home Mobile Slider | |
//Redux::hideSection($opt_name, 'home_layout'); // Home Layout | |
Redux::hideSection($opt_name, 'shop_settings'); // Shop Settings | |
//Redux::hideSection($opt_name, 'basic_styling'); // Basic Styling | |
Redux::hideSection($opt_name, 'advanced_styling'); // Advanced Styling | |
Redux::hideSection($opt_name, 'typography'); // Typography | |
Redux::hideSection($opt_name, 'menu_settings'); // Menu Settings | |
//Redux::hideSection($opt_name, 'pagepost_settings'); // Page/Post Settings | |
Redux::hideSection($opt_name, 'misc_settings'); // Misc Settings | |
Redux::hideSection($opt_name, 'advanced_settings'); // Advanced Settings | |
Redux::hideSection($opt_name, 'inportexport_settings'); // Import / Export | |
} | |
// end of hide_virtue_sections() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related post with short description:
https://www.role-editor.com/hide-virtue-theme-sections-for-user-role/