diff --git a/admin/assets/css/um-admin-misc.css b/admin/assets/css/um-admin-misc.css index 2c720bf8..0a248070 100644 --- a/admin/assets/css/um-admin-misc.css +++ b/admin/assets/css/um-admin-misc.css @@ -127,8 +127,12 @@ body.um-admin-modal-open { color: #aaa !important; } +.um-admin-metabox input[type=text] { + height: auto !important; +} + .um-admin-metabox input[type=text], -.um-admin-metabox textarea{ +.um-admin-metabox textarea { width: 100%; max-width: 100%; display: block; @@ -139,13 +143,17 @@ body.um-admin-modal-open { outline: none !important; box-sizing: border-box !important; box-shadow: none !important; - font-size: 13px !important; - height: auto !important; line-height: 1.4em !important; padding: 4px 10px !important; } +.um-admin-metabox textarea { + padding: 8px !important; + line-height: 1.6em; + color: #888 !important; +} + .um-admin-metabox input[type=text].um-admin-error, .um-admin-metabox textarea.um-admin-error {border-color: #C74A4A!important} diff --git a/admin/core/um-admin-metabox.php b/admin/core/um-admin-metabox.php index 09e8e2dd..71910d8e 100644 --- a/admin/core/um-admin-metabox.php +++ b/admin/core/um-admin-metabox.php @@ -327,7 +327,11 @@ class UM_Admin_Metabox { delete_post_meta( $post_id, '_um_reveal_fields' ); delete_post_meta( $post_id, '_um_search_fields' ); delete_post_meta( $post_id, '_um_roles_can_search' ); + delete_post_meta( $post_id, '_um_show_these_users' ); foreach( $_POST as $k => $v ) { + if ( $k == '_um_show_these_users' && trim( $_POST[ $k ] ) ) { + $v = preg_split('/[\r\n]+/', $v, -1, PREG_SPLIT_NO_EMPTY); + } if (strstr($k, '_um_')){ update_post_meta( $post_id, $k, $v); } diff --git a/admin/templates/directory/general.php b/admin/templates/directory/general.php index d01d9df2..feec18f6 100644 --- a/admin/templates/directory/general.php +++ b/admin/templates/directory/general.php @@ -7,6 +7,11 @@ } } + $show_these_users = get_post_meta( get_the_ID(), '_um_show_these_users', true ); + if ( $show_these_users ) { + $show_these_users = implode("\n", str_replace("\r", "", $show_these_users)); + } + ?>
diff --git a/core/um-filters-members.php b/core/um-filters-members.php index ee6691e3..6473146b 100644 --- a/core/um-filters-members.php +++ b/core/um-filters-members.php @@ -143,6 +143,14 @@ ); } + // show specific usernames + if ( isset( $show_these_users ) && $show_these_users && is_array( $show_these_users ) ) { + foreach( $show_these_users as $username ) { + $users_array[] = username_exists( $username ); + } + $query_args['include'] = $users_array; + } + // add roles to appear in directory if ( !empty( $roles ) ) { diff --git a/core/um-short-functions.php b/core/um-short-functions.php index 6d94373c..1df68aad 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -1168,7 +1168,7 @@ function um_user( $data, $attrs = null ) { case 'display_name': $op = um_get_option('display_name'); - + if ( $op == 'default' ) { $name = um_profile('display_name'); } @@ -1183,6 +1183,9 @@ function um_user( $data, $attrs = null ) { } else { $name = um_profile( $data ); } + if ( ! $name ) { + $name = um_user('user_login'); + } } if ( $op == 'sur_name' ) {