Skip to content

Instantly share code, notes, and snippets.

@garvs
Created December 13, 2015 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save garvs/a1256f5a912dadc8cd71 to your computer and use it in GitHub Desktop.
Save garvs/a1256f5a912dadc8cd71 to your computer and use it in GitHub Desktop.
Hide Virtue Premium 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('test_copy')) {
return;
}
$opt_name = "virtue_premium";
Redux::hideSection($opt_name, 'main_settings'); // Main Settings
Redux::hideSection($opt_name, 'topbar_settings'); // Topbar Settings
//Redux::hideSection($opt_name, 'footer'); // Footer
Redux::hideSection($opt_name, 'home_slider'); // Home Slider
Redux::hideSection($opt_name, 'home_mobile_slider'); // Home Mobile Slider
//Redux::hideSection($opt_name, 'home_layout'); // Home Layout
Redux::hideSection($opt_name, 'shop_settings'); // Shop Settings
Redux::hideSection($opt_name, 'product_settings'); // Product Settings
Redux::hideSection($opt_name, 'portfolio_options'); // Portfolio Options
Redux::hideSection($opt_name, 'blog_options'); // Blog Options
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, 'language_settings'); // Language Settings
Redux::hideSection($opt_name, 'breadcrumbs'); // Breadcrumbs
Redux::hideSection($opt_name, 'misc_settings'); // Misc Settings
Redux::hideSection($opt_name, 'advanced_settings'); // Advanced Settings
Redux::hideSection($opt_name, 'header_footer_scripts'); // Header and Footer Scripts
Redux::hideSection($opt_name, 'theme_extensions'); // Theme Extensions
Redux::hideSection($opt_name, 'import_export'); // Import / Export
}
// end of hide_virtue_sections()
@garvs
Copy link
Author

garvs commented Dec 13, 2015

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