mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 14:43:49 +09:00
- added filter for making 3rd-party roles editable through Ultimate Member interfaces. Use 'um_extend_editable_roles' and pass there an array of role keys( e.g. 'editor', 'administrator', etc. );
- reviewed and closed #1151;
This commit is contained in:
@@ -493,13 +493,7 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
}
|
||||
|
||||
global $wp_roles;
|
||||
$role_keys = array_map(
|
||||
function( $item ) {
|
||||
return 'um_' . $item;
|
||||
},
|
||||
get_option( 'um_roles', array() )
|
||||
);
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), UM()->roles()->get_editable_user_roles() );
|
||||
|
||||
if ( ! empty( $role ) &&
|
||||
( ! in_array( $role, $custom_field_roles, true ) || in_array( $role, $exclude_roles, true ) ) ) {
|
||||
@@ -840,13 +834,7 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
|
||||
// role field
|
||||
global $wp_roles;
|
||||
$role_keys = array_map(
|
||||
function( $item ) {
|
||||
return 'um_' . $item;
|
||||
},
|
||||
get_option( 'um_roles', array() )
|
||||
);
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), UM()->roles()->get_editable_user_roles() );
|
||||
|
||||
$roles = UM()->roles()->get_roles( false, $exclude_roles );
|
||||
$roles = array_map(
|
||||
|
||||
Reference in New Issue
Block a user