Skip to content

Instantly share code, notes, and snippets.

@garvs
Last active December 12, 2015 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garvs/f3bb9cd9e3be028a9bc8 to your computer and use it in GitHub Desktop.
Save garvs/f3bb9cd9e3be028a9bc8 to your computer and use it in GitHub Desktop.
Hide Virtue theme options page sections for WordPress user role
<?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()
@garvs
Copy link
Author

garvs commented Dec 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment