mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- fixed role predefined fields values;
This commit is contained in:
@@ -543,9 +543,15 @@ if ( ! class_exists( 'Builtin' ) ) {
|
||||
function set_predefined_fields() {
|
||||
|
||||
global $wp_roles;
|
||||
$role_keys = array_map( function( $item ) {
|
||||
return 'um_' . $item;
|
||||
}, get_option( 'um_roles' ) );
|
||||
$role_keys = get_option( 'um_roles' );
|
||||
if ( ! empty( $role_keys ) && is_array( $role_keys ) ) {
|
||||
$role_keys = array_map( function( $item ) {
|
||||
return 'um_' . $item;
|
||||
}, $role_keys );
|
||||
} else {
|
||||
$role_keys = array();
|
||||
}
|
||||
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
|
||||
|
||||
$um_roles = UM()->roles()->get_roles( false, $exclude_roles );
|
||||
|
||||
Reference in New Issue
Block a user