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('bulk_actions-edit-comments', 'ure_remove_comments_actions'); | |
add_action('comment_row_actions', 'ure_remove_comments_actions'); | |
function ure_remove_comments_actions($actions) { | |
if (current_user_can('editor')) { | |
if (isset($actions['delete'])) { | |
unset($actions['delete']); |
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 | |
function remove_product_editor() { | |
remove_post_type_support( 'product', 'editor' ); | |
} | |
add_action( 'init', 'remove_product_editor' ); |
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
/** | |
* Replace 'customer' role (WooCommerce use by default) with your own one. | |
**/ | |
add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1); | |
function wc_assign_custom_role($args) { | |
$args['role'] = 'subscriber'; | |
return $args; | |
} |
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_restrict_edit_post_type', 'exclude_posts_from_edit_restrictions' ); | |
function exclude_posts_from_edit_restrictions( $post_type ) { | |
$restrict_it = $post_type; | |
$user = wp_get_current_user(); | |
if ( empty( $user) || !is_array( $user->roles ) ) { | |
return $restrict_it; | |
} |
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('map_meta_cap', 'not_edit_pending_for_review', 10, 4); | |
function not_edit_pending_for_review($caps, $cap, $user_id, $args) { | |
if ($cap!=='edit_post' && $cap!=='delete_post') { | |
return $caps; | |
} | |
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
add_filter('ure_edit_posts_access_id_list', 'ure_edit_posts_access_set_id_list'); | |
function ure_edit_posts_access_set_id_list($list) { | |
$list .= ',1584'; | |
return $list; | |
} |
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; | |
} |
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; |