mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Add option to force display name to be capitlized
This commit is contained in:
@@ -1334,14 +1334,18 @@ function um_fetch_user( $user_id ) {
|
||||
|
||||
if ( um_user('first_name') && um_user('last_name') ) {
|
||||
$initial = um_user('last_name');
|
||||
$f_and_l_initial = strtolower( um_user('first_name') ).' '. strtoupper( $initial[0]);
|
||||
$f_and_l_initial = um_user('first_name').' '. $initial[0];
|
||||
}else{
|
||||
$f_and_l_initial = um_profile( $data );
|
||||
}
|
||||
|
||||
$f_and_l_initial = $ultimatemember->validation->safe_name_in_url( $f_and_l_initial );
|
||||
|
||||
$name = ucwords( strtolower( $f_and_l_initial ) );
|
||||
if( um_get_option('force_display_name_capitlized') ){
|
||||
$name = ucwords( strtolower( $f_and_l_initial ) );
|
||||
}else{
|
||||
$name = $f_and_l_initial;
|
||||
}
|
||||
|
||||
return $name;
|
||||
|
||||
@@ -1426,7 +1430,9 @@ function um_fetch_user( $user_id ) {
|
||||
}
|
||||
}
|
||||
|
||||
$name = ucwords( strtolower( $name ) );
|
||||
if( um_get_option('force_display_name_capitlized') ){
|
||||
$name = ucwords( strtolower( $name ) );
|
||||
}
|
||||
|
||||
return apply_filters('um_user_display_name_filter', $name, um_user('ID'), ( $attrs == 'html' ) ? 1 : 0 );
|
||||
|
||||
|
||||
@@ -151,6 +151,15 @@ $this->sections[] = array(
|
||||
'required' => array( 'display_name', '=', 'field' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'force_display_name_capitlized',
|
||||
'type' => 'switch',
|
||||
'title' => __( 'Force display name to be capitalized?','ultimatemember'),
|
||||
'default' => 1,
|
||||
'on' => __('Yes','ultimatemember'),
|
||||
'off' => __('No','ultimatemember'),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'author_redirect',
|
||||
'type' => 'switch',
|
||||
|
||||
Reference in New Issue
Block a user