JR
Forum Replies Created
-
Is there anyone that can help?
A followup question. If I can hide edit profile for cashier role. Will the edit profile from directory will also be hidden as well as shown in the screenshot?
function um_custom_admin_user_actions_hook( $actions, $user_id ) {
if ( isset( $actions['resend_user_activation'] )) {
unset( $actions['resend_user_activation'] );
}
if ( isset( $actions['deactivate_user'] )) {
unset( $actions['deactivate_user'] );
}
if ( isset( $actions['switch_user'] )) {
unset( $actions['switch_user'] );
}
if ( isset( $actions['delete'] )) {
unset( $actions['delete'] );
}
return $actions;
}
add_filter( 'um_admin_user_actions_hook', 'um_custom_admin_user_actions_hook', 10, 2 );I was able to hide the menu.
What is left is how can I put the role ‘Cashier’ so The Edit profile will be hidden from that role.
$priority_role = UM()->roles()->get_priority_user_role( get_current_user_id() );I think I figure it how to hide it. But my question is how to get ‘resend_user_activation’. Where can I get the other values for ‘delete this user’ , ‘login as this user’, ‘deactivate this account’, ‘ edit profile’.
I tried this code i found from this forum as well.
/ UNSET USER PROFILE MENU ITEMS /
function unset_profile_menu_items($action, $user_id){
um_fetch_user( $user_id );
$role = get_role( UM()->roles()->get_priority_user_role( get_current_user_id() ) );
$can_edit_users = current_user_can( 'edit_users' ) && $role->has_cap( 'edit_users' );
if ( $can_edit_users ){
if ( um_user( 'account_status' ) == 'awaiting_admin_review' ) {
$actions['um_approve_membership'] = array( 'label' => __( 'Approve Membership', 'ultimate-member' ) );
$actions['um_reject_membership'] = array( 'label' => __( 'Reject Membership', 'ultimate-member' ) );
}
if ( um_user( 'account_status' ) == 'rejected' ) {
$actions['um_approve_membership'] = array( 'label' => __( 'Approve Membership', 'ultimate-member' ) );
}
if ( um_user( 'account_status' ) == 'approved' ) {
$actions['um_put_as_pending'] = array( 'label' => __( 'Put as Pending Review', 'ultimate-member' ) );
}
if ( um_user( 'account_status' ) == 'awaiting_email_confirmation' ) {
$actions['um_resend_activation'] = array( 'label' => __( 'Resend Activation E-mail', 'ultimate-member' ) );
}
}
return $actions;
}
add_filter( 'um_admin_user_actions_hook', 'unset_profile_menu_items', 10, 2 );I got this reference from this link https://wordpress.org/support/topic/unset-login-as-this-user-and-deactivate-this-account-menu-items/
But when I try to approve or put as Pending to review, it seems like nothings happening
Im sorry for asking too much. but how can I access the UM coding. Im just new with wordpress and ultimate member plugin. Thank you