mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- remove looping in case if set 'display_name' as custom fields for display name setting;
This commit is contained in:
@@ -363,12 +363,13 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
|
||||
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
|
||||
$args['lock_text'] = $this->convert_locker_tags( $args['lock_text'] );
|
||||
|
||||
|
||||
if ( ! is_user_logged_in() ) {
|
||||
if ( $args['show_lock'] == 'no' ) {
|
||||
echo '';
|
||||
} else {
|
||||
$args['lock_text'] = $this->convert_locker_tags( $args['lock_text'] );
|
||||
$this->set_args = $args;
|
||||
$this->load_template( 'login-to-view' );
|
||||
}
|
||||
|
||||
@@ -2179,17 +2179,16 @@ function um_user( $data, $attrs = null ) {
|
||||
}
|
||||
|
||||
|
||||
if ($op == 'field' && UM()->options()->get( 'display_name_field' ) != '') {
|
||||
if ( $op == 'field' && UM()->options()->get( 'display_name_field' ) != '' ) {
|
||||
$fields = array_filter( preg_split( '/[,\s]+/', UM()->options()->get( 'display_name_field' ) ) );
|
||||
$name = '';
|
||||
|
||||
foreach ($fields as $field) {
|
||||
if (um_profile( $field )) {
|
||||
foreach ( $fields as $field ) {
|
||||
if ( um_profile( $field ) ) {
|
||||
$name .= um_profile( $field ) . ' ';
|
||||
} else if (um_user( $field )) {
|
||||
} elseif ( um_user( $field ) && $field != 'display_name' ) {
|
||||
$name .= um_user( $field ) . ' ';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user