mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- added ability to customize custom key sorting type (CHAR, NUMERIC, etc.)
- added ability to customize 'bio' key at the profile header; - 2.1.3 pre-release;
This commit is contained in:
@@ -41,10 +41,7 @@ Support requests in issues on this repository will be closed on sight.
|
||||
GNU Version 2 or Any Later Version
|
||||
|
||||
## Releases
|
||||
[Official Release Version: 2.1.2](https://github.com/ultimatemember/ultimatemember/releases/tag/2.1.2).
|
||||
|
||||
## Release Candidate
|
||||
[Official Release Version: 2.1.3-RC.1](https://github.com/ultimatemember/ultimatemember/releases/tag/2.1.3-rc.1).
|
||||
[Official Release Version: 2.1.3](https://github.com/ultimatemember/ultimatemember/releases/tag/2.1.3).
|
||||
|
||||
## Changelog
|
||||
[ From v1.0.0 to latest version ](https://wordpress.org/plugins/ultimate-member/changelog/).
|
||||
|
||||
@@ -608,7 +608,9 @@ if ( ! class_exists( 'um\core\Member_Directory_Meta' ) ) {
|
||||
|
||||
$this->joins[] = "LEFT JOIN {$wpdb->prefix}um_metadata umm_sort ON ( umm_sort.user_id = u.ID AND umm_sort.um_key = '{$sortby}' )";
|
||||
|
||||
$this->sql_order = " ORDER BY CAST( umm_sort.um_value AS CHAR ) {$order} ";
|
||||
$custom_sort_type = apply_filters( 'um_member_directory_custom_sorting_type', 'CHAR', $sortby, $directory_data );
|
||||
|
||||
$this->sql_order = " ORDER BY CAST( umm_sort.um_value AS {$custom_sort_type} ) {$order} ";
|
||||
|
||||
} elseif ( 'display_name' == $sortby ) {
|
||||
|
||||
|
||||
@@ -1178,20 +1178,22 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
|
||||
if ( $sortby == $directory_data['sortby_custom'] || in_array( $sortby, $custom_sort ) ) {
|
||||
|
||||
$custom_sort_type = apply_filters( 'um_member_directory_custom_sorting_type', 'CHAR', $sortby, $directory_data );
|
||||
|
||||
$this->query_args['meta_query'][] = array(
|
||||
'relation' => 'OR',
|
||||
$directory_data['sortby_custom'] => array(
|
||||
$sortby . '_cs' => array(
|
||||
'key' => $sortby,
|
||||
'compare' => 'EXISTS'
|
||||
'compare' => 'EXISTS',
|
||||
'type' => $custom_sort_type,
|
||||
),
|
||||
array(
|
||||
'key' => $sortby,
|
||||
'compare' => 'NOT EXISTS'
|
||||
'compare' => 'NOT EXISTS',
|
||||
)
|
||||
);
|
||||
|
||||
$this->query_args['orderby'] = $sortby;
|
||||
$this->query_args['order'] = 'ASC';
|
||||
$this->query_args['orderby'] = array( $sortby . '_cs' => 'ASC', 'user_login' => 'ASC' );
|
||||
|
||||
} elseif ( 'display_name' == $sortby ) {
|
||||
|
||||
|
||||
@@ -41,6 +41,17 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_show_bio_key( $args ) {
|
||||
$key = apply_filters( 'um_profile_bio_key', 'description', $args );
|
||||
return $key;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete profile avatar AJAX handler
|
||||
*/
|
||||
|
||||
@@ -362,9 +362,9 @@ function um_user_edit_profile( $args ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( isset( $args['submitted']['description'] ) ) {
|
||||
$to_update['description'] = $args['submitted']['description'];
|
||||
$description_key = UM()->profile()->get_show_bio_key( $args );
|
||||
if ( isset( $args['submitted'][ $description_key ] ) ) {
|
||||
$to_update[ $description_key ] = $args['submitted'][ $description_key ];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['submitted']['role'] ) ) {
|
||||
@@ -1047,10 +1047,12 @@ function um_profile_header( $args ) {
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
if ( UM()->fields()->viewing == true && um_user( 'description' ) && $args['show_bio'] ) { ?>
|
||||
$description_key = UM()->profile()->get_show_bio_key( $args );
|
||||
|
||||
if ( UM()->fields()->viewing == true && um_user( $description_key ) && $args['show_bio'] ) { ?>
|
||||
|
||||
<div class="um-meta-text">
|
||||
<?php $description = get_user_meta( um_user( 'ID' ), 'description', true );
|
||||
<?php $description = get_user_meta( um_user( 'ID' ), $description_key, true );
|
||||
|
||||
if ( UM()->options()->get( 'profile_show_html_bio' ) ) {
|
||||
echo make_clickable( wpautop( wp_kses_post( $description ) ) );
|
||||
@@ -1065,13 +1067,13 @@ function um_profile_header( $args ) {
|
||||
<textarea id="um-meta-bio"
|
||||
data-character-limit="<?php echo esc_attr( UM()->options()->get( 'profile_bio_maxchars' ) ); ?>"
|
||||
placeholder="<?php esc_attr_e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
|
||||
name="<?php echo esc_attr( 'description-' . $args['form_id'] ); ?>"
|
||||
id="<?php echo esc_attr( 'description-' . $args['form_id'] ); ?>"><?php echo UM()->fields()->field_value( 'description' ) ?></textarea>
|
||||
name="<?php echo esc_attr( $description_key . '-' . $args['form_id'] ); ?>"
|
||||
id="<?php echo esc_attr( $description_key . '-' . $args['form_id'] ); ?>"><?php echo UM()->fields()->field_value( $description_key ) ?></textarea>
|
||||
<span class="um-meta-bio-character um-right"><span
|
||||
class="um-bio-limit"><?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?></span></span>
|
||||
|
||||
<?php if ( UM()->fields()->is_error( 'description' ) ) {
|
||||
echo UM()->fields()->field_error( UM()->fields()->show_error( 'description' ), true );
|
||||
<?php if ( UM()->fields()->is_error( $description_key ) ) {
|
||||
echo UM()->fields()->field_error( UM()->fields()->show_error( $description_key ), true );
|
||||
} ?>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Ultimate Member\n"
|
||||
"POT-Creation-Date: 2020-01-16 10:58+0200\n"
|
||||
"PO-Revision-Date: 2020-01-16 10:58+0200\n"
|
||||
"POT-Creation-Date: 2020-01-20 10:38+0200\n"
|
||||
"PO-Revision-Date: 2020-01-20 10:38+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: en_US\n"
|
||||
@@ -4293,8 +4293,8 @@ msgstr ""
|
||||
#: includes/core/um-actions-profile.php:686
|
||||
#: includes/core/um-actions-profile.php:874
|
||||
#: includes/core/um-actions-profile.php:907
|
||||
#: includes/core/um-actions-profile.php:1252
|
||||
#: includes/core/um-actions-profile.php:1259
|
||||
#: includes/core/um-actions-profile.php:1254
|
||||
#: includes/core/um-actions-profile.php:1261
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
@@ -4658,8 +4658,8 @@ msgid "Register"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class-config.php:135 includes/class-config.php:792
|
||||
#: includes/core/class-member-directory.php:2108
|
||||
#: includes/core/um-actions-profile.php:1258
|
||||
#: includes/core/class-member-directory.php:2110
|
||||
#: includes/core/um-actions-profile.php:1260
|
||||
#: includes/core/um-actions-user.php:19
|
||||
msgid "Logout"
|
||||
msgstr ""
|
||||
@@ -7172,13 +7172,13 @@ msgstr ""
|
||||
msgid "Original size"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-form.php:62 includes/core/class-profile.php:56
|
||||
#: includes/core/class-profile.php:75
|
||||
#: includes/core/class-form.php:62 includes/core/class-profile.php:67
|
||||
#: includes/core/class-profile.php:86
|
||||
msgid "You can not edit this user"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-mail.php:615 includes/core/class-password.php:703
|
||||
#: includes/core/class-profile.php:470
|
||||
#: includes/core/class-profile.php:481
|
||||
msgid "Your set password"
|
||||
msgstr ""
|
||||
|
||||
@@ -7243,15 +7243,15 @@ msgstr ""
|
||||
msgid "<strong>Age:</strong> {min_range} - {max_range} years old"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-member-directory.php:2053
|
||||
#: includes/core/class-member-directory.php:2097
|
||||
#: includes/core/um-actions-profile.php:1225
|
||||
#: includes/core/um-actions-profile.php:1256
|
||||
#: includes/core/class-member-directory.php:2055
|
||||
#: includes/core/class-member-directory.php:2099
|
||||
#: includes/core/um-actions-profile.php:1227
|
||||
#: includes/core/um-actions-profile.php:1258
|
||||
msgid "Edit Profile"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-member-directory.php:2103
|
||||
#: includes/core/um-actions-profile.php:1257
|
||||
#: includes/core/class-member-directory.php:2105
|
||||
#: includes/core/um-actions-profile.php:1259
|
||||
msgid "My Account"
|
||||
msgstr ""
|
||||
|
||||
@@ -7313,35 +7313,35 @@ msgstr ""
|
||||
msgid "https://wordpress.org/support/"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-profile.php:89
|
||||
#: includes/core/class-profile.php:100
|
||||
msgid "Anyone"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-profile.php:90
|
||||
#: includes/core/class-profile.php:101
|
||||
msgid "Guests only"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-profile.php:91
|
||||
#: includes/core/class-profile.php:102
|
||||
msgid "Members only"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-profile.php:92
|
||||
#: includes/core/class-profile.php:103
|
||||
msgid "Only the owner"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-profile.php:93
|
||||
#: includes/core/class-profile.php:104
|
||||
msgid "Specific roles"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-profile.php:130
|
||||
#: includes/core/class-profile.php:141
|
||||
msgid "About"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-profile.php:134
|
||||
#: includes/core/class-profile.php:145
|
||||
msgid "Posts"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/class-profile.php:138
|
||||
#: includes/core/class-profile.php:149
|
||||
msgid "Comments"
|
||||
msgstr ""
|
||||
|
||||
@@ -7831,11 +7831,11 @@ msgstr ""
|
||||
msgid "Remove photo"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/um-actions-profile.php:1067
|
||||
#: includes/core/um-actions-profile.php:1069
|
||||
msgid "Tell us a bit about yourself..."
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/um-actions-profile.php:1082
|
||||
#: includes/core/um-actions-profile.php:1084
|
||||
#, php-format
|
||||
msgid "This user account status is %s"
|
||||
msgstr ""
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ Tags: community, member, membership, user-profile, user-registration
|
||||
Requires PHP: 5.6
|
||||
Requires at least: 5.0
|
||||
Tested up to: 5.3
|
||||
Stable tag: 2.1.2
|
||||
Stable tag: 2.1.3
|
||||
License: GNU Version 2 or Any Later Version
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
Plugin Name: Ultimate Member
|
||||
Plugin URI: http://ultimatemember.com/
|
||||
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
|
||||
Version: 2.1.3-rc.2
|
||||
Version: 2.1.3
|
||||
Author: Ultimate Member
|
||||
Author URI: http://ultimatemember.com/
|
||||
Text Domain: ultimate-member
|
||||
|
||||
Reference in New Issue
Block a user