mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fix default value for role metadata retrieval
Ensure `get_option` returns an empty array as a fallback to prevent errors when metadata for a role does not exist. This resolves potential issues with undefined or unexpected data during role editing.
This commit is contained in:
@@ -55,7 +55,7 @@ if ( ! empty( $_GET['id'] ) ) {
|
||||
// roles e.g. "潜水艦subs" with both latin + not-UTB-8 symbols had invalid role ID
|
||||
$role_id = sanitize_title( $_GET['id'] );
|
||||
|
||||
$data = get_option( "um_role_{$role_id}_meta" );
|
||||
$data = get_option( "um_role_{$role_id}_meta", array() );
|
||||
|
||||
if ( empty( $data['_um_is_custom'] ) ) {
|
||||
$data['name'] = $wp_roles->roles[ $role_id ]['name'];
|
||||
|
||||
Reference in New Issue
Block a user