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 | |
// Additional options for URE | |
// Hide parts of front-end page for selected role | |
add_filter( 'ure_role_additional_options', 'ure_add_front_end_js_option', 10, 1 ); | |
function ure_add_front_end_js_option( $items ) { | |
$item = URE_Role_Additional_Options::create_item( 'change_front_end_css', esc_html__('Change Front-end CSS', 'user-role-editor'), 'init', 'ure_add_front_end_js_init' ); | |
$items[$item->id] = $item; |
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_admin_reports', 'restricts_wc_reports_tabs', 10, 1 ); | |
function restricts_wc_reports_tabs( $reports ) { | |
if ( current_user_can( 'manage_woocommerce' ) ) { | |
// do not restrict WooCommerce admin | |
return $reports; | |
} |
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 additional option "Hide Screen Options" for every role at Users->User Role Editor | |
add_filter('ure_role_additional_options', 'add_hide_screen_options', 10, 1); | |
function add_hide_screen_options( $items ) { | |
$item = URE_Role_Additional_Options::create_item( | |
'hide_screen_options', | |
esc_html__('Hide Screen Options', 'user-role-editor'), | |
'screen_options_show_screen', |
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 | |
/* Project: User Role Editor WordPress plugin | |
* Adds admin menu item "Tools->Export roles (CSV)" and allows to export all user roles to CSV file with one click | |
* Setup: Install as a Must Use plugin: https://codex.wordpress.org/Must_Use_Plugins | |
* Author: Vladimir Garagulia | |
* Email: [email protected] | |
* Site: https://role-editor.com | |
* License: GPL v.3 | |
*/ | |
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_widgets_edit_access_user', 'ure_restrict_widgets_edit_access_for_user', 10, 2); | |
/* | |
* $blocked - array of widgets and sidebars which should be unavailable for editing to the current user. | |
* $blocked['widgets'] - array with list of widgets | |
* $blocked['sidebars'] - array with list of sidebars | |
* $user - WP_User object with data about the current user | |
* |
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_show_processing_orders_only_to_admin_option', 10, 1); | |
function add_show_processing_orders_only_to_admin_option($items) { | |
$item = URE_Role_Additional_Options::create_item('show_processing_orders_only', esc_html__('Show orders with =Processing= status only', 'user-role-editor'), 'init', 'show_processing_orders_only'); | |
$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_supress_administrators_protection', 'switch_off_ure_administrators_protection', 10, 1); | |
function switch_off_ure_administrators_protection($supress_protection) { | |
$supress_protection = true; | |
return $supress_protection; | |
} |
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_addons_to_copy_for_new_blog', 'ure_addons_to_copy_for_new_blog', 10, 1); | |
function ure_addons_to_copy_for_new_blog($addons) { | |
$addons['admin_menu']->copy = true; | |
$addons['widgets_admin']->copy = true; | |
$addons['widgets_show']->copy = true; | |
$addons['meta_boxes']->copy = true; |
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('admin_head', 'hide_wc_refund_button'); | |
function hide_wc_refund_button() { | |
global $post; | |
if (!current_user_can('sales')) { | |
return; | |
} |
NewerOlder