Hide Virtue theme options page sections

Free version

Virtue theme (free version 2.5.2) options page consists of 14 sections. You may wish to delegate some limited set of options to another user. Is it possible to hide Virtue theme options page sections for the selected user role with access to the ‘edit_theme_options’ capability? The answer is “Yes”.

Restrict Virtue options page sections
Restrict Virtue options page sections

Use this code snippet as an addition to the theme’s functions.php file or as standalone must-use plugin. Just comment/uncomment section which you wish to hide/show to the user and replace role ID ‘tester’ with your own one:

Premium version

Options page for Premium version of Virtue theme (v. 3.3.5) contains 20 items.

Virtue Premium: hide options page section
Virtue Premium: hide options page section

It uses different identifiers for some similar sections and finally requires another version of the code to hide its sections for the role:

P.S. Do not forget to remove ‘<?php’ at 1st row if you insert this code to the functions.php file.

Share