mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 22:54:03 +09:00
- fixed PHP notices when there aren't UM custom roles and we get bool variable from get_option( 'um_roles' );
This commit is contained in:
@@ -173,7 +173,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
||||
*/
|
||||
function load_role_wrapper() {
|
||||
wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', array( 'jquery' ), ultimatemember_version, true );
|
||||
$localize_roles_data = get_option( 'um_roles' );
|
||||
$localize_roles_data = get_option( 'um_roles', array() );
|
||||
wp_localize_script( 'um_admin_role_wrapper', 'um_roles', (array) $localize_roles_data );
|
||||
wp_enqueue_script( 'um_admin_role_wrapper' );
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
um_js_redirect( $redirect );
|
||||
}
|
||||
|
||||
$um_roles = get_option( 'um_roles' );
|
||||
$um_roles = get_option( 'um_roles', array() );
|
||||
|
||||
$um_custom_roles = array();
|
||||
foreach ( $role_keys as $k => $role_key ) {
|
||||
@@ -426,7 +426,7 @@ $ListTable->set_sortable_columns( array(
|
||||
$users_count = count_users();
|
||||
|
||||
$roles = array();
|
||||
$role_keys = get_option( 'um_roles' );
|
||||
$role_keys = get_option( 'um_roles', array() );
|
||||
|
||||
if ( $role_keys ) {
|
||||
foreach ( $role_keys as $role_key ) {
|
||||
|
||||
@@ -117,7 +117,7 @@ if ( ! empty( $_POST['role'] ) ) {
|
||||
if ( '' == $error ) {
|
||||
|
||||
if ( 'add' == sanitize_key( $_GET['tab'] ) ) {
|
||||
$roles = get_option( 'um_roles' );
|
||||
$roles = get_option( 'um_roles', array() );
|
||||
$roles[] = $id;
|
||||
|
||||
update_option( 'um_roles', $roles );
|
||||
|
||||
Reference in New Issue
Block a user