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')) { |
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_filter('page_attributes_dropdown_pages_args', 'restrict_parent_pages_for_role', 10, 2); | |
function restrict_parent_pages_for_role($args, $post) { | |
if (current_user_can('editor')) { | |
// list of pages to include into the parent pages dropdown menu. Do not use with 'exclude' together. | |
$args['include'] = array(2, 763); | |
// list of pages to exclude from the parent pages dropdown menu. Do not use with 'include' together. |
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')) { |
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_filter( 'ure_role_additional_options', 'add_prohibit_access_to_admin_option', 10, 1 ); | |
function add_prohibit_access_to_admin_option($items) { | |
$item = URE_Role_Additional_Options::create_item( 'prohibit_admin_access', esc_html__('Prohibit access to admin', 'user-role-editor'), 'init', 'prohibit_access_to_admin' ); | |
$items[$item->id] = $item; | |
return $items; | |
} |
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_filter('ure_role_additional_options', 'add_remove_adminbar_from_backend_admin_option', 10, 1); | |
function add_remove_adminbar_from_backend_admin_option($items) { | |
$item = URE_Role_Additional_Options::create_item('prohibit_admin_access', esc_html__('Remove admin bar from backend', 'user-role-editor'), 'admin_init', 'remove_adminbar_from_backend'); | |
$items[$item->id] = $item; | |
return $items; |
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 | |
/** | |
* Bulk update posts by ID list to set User Role Editor Pro content view restrictions | |
* | |
*/ | |
add_action('admin_init', 'URE_Content_View_Restrictons_Bulk::update'); | |
class URE_Content_View_Restrictons_Bulk { | |
const prohibit_allow_flag = 2; // Allow |
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_filter('ure_role_additional_options', 'ure_add_block_admin_notices_option', 10, 1); | |
function ure_add_block_admin_notices_option($items) { | |
$item = URE_Role_Additional_Options::create_item('block_admin_notices', esc_html__('Block admin notices', 'user-role-editor'), 'admin_init', 'ure_block_admin_notices'); | |
$items[$item->id] = $item; | |
return $items; | |
} |
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_filter('woocommerce_duplicate_product_capability', 'my_woocommerce_duplicate_product_capability'); | |
function my_woocommerce_duplicate_product_capability($cap) { | |
return 'duplicate_products'; | |
} |
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 | |
/* | |
* Hide permalink 'Edit' button for 'author' role | |
*/ | |
add_action('edit_form_before_permalink', 'ure_block_edit_slug'); | |
function ure_block_edit_slug() { | |
if (!current_user_can('author')) { | |
return; |
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_filter('ure_role_additional_options', 'ure_add_block_admin_notices_option', 10, 1); | |
function ure_add_block_admin_notices_option($items) { | |
$item = URE_Role_Additional_Options::create_item('block_admin_notices', esc_html__('Block admin notices', 'user-role-editor'), 'admin_init', 'ure_block_admin_notices'); | |
$items[$item->id] = $item; | |
return $items; | |
} |
OlderNewer