Created
December 13, 2015 02:50
-
-
Save garvs/a1256f5a912dadc8cd71 to your computer and use it in GitHub Desktop.
Hide Virtue Premium 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('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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related post:
https://www.role-editor.com/hide-virtue-theme-sections-for-user-role/