- fixed members directory search by multiselect;

This commit is contained in:
nikitozzzzzzz
2018-07-05 11:24:42 +03:00
parent a776ff27bf
commit d5c10829b2
4 changed files with 40 additions and 18 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ Ultimate Member is the #1 user profile & membership plugin for WordPress. The pl
| Latest Version |Requires at least|Stable Tag|
| :------------: |:------------:|:------------:|
| 2.0.18 | WordPress 4.9 or higher| 2.0.18 |
| 2.0.19 | WordPress 4.9 or higher| 2.0.19 |
Features of the plugin include:
@@ -48,7 +48,7 @@ GNU Version 2 or Any Later Version
Releases
====================
[Official Release Version: 2.0.18](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.18).
[Official Release Version: 2.0.19](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.19).
[Official Release Version: 1.3.88](https://github.com/ultimatemember/ultimatemember/releases).
+29 -13
View File
@@ -124,7 +124,7 @@ function um_add_search_to_query( $query_args, $args ){
if ( in_array( $field, array( 'members_page' ) ) ) continue;
$serialize_value = serialize( strval( $value ) );
if ( $value && $field != 'um_search' && $field != 'page_id' ) {
if ( strstr( $field, 'role_' ) )
@@ -135,18 +135,33 @@ function um_add_search_to_query( $query_args, $args ){
if ( 'role' == $field ) {
$query_args['role__in'] = trim( $value );
} else {
$field_query = array(
array(
'key' => $field,
'value' => trim( $value ),
'compare' => '=',
),
'relation' => 'OR',
);
$filter_data = UM()->members()->prepare_filter( $field );
if( $filter_data['type'] != 'select' ) {
$field_query = array_merge( $field_query, array(
if ( $filter_data['type'] == 'select' ) {
$field_query = array(
array(
'key' => $field,
'value' => trim( $value ),
'compare' => '=',
),
'relation' => 'OR',
);
if ( $filter_data['attrs']['type'] == 'multiselect' ) {
$field_query = array_merge( $field_query, array(
array(
'key' => $field,
'value' => '"' . trim( $value ) . '"',
'compare' => 'LIKE',
),
) );
}
} else {
$field_query = array(
array(
'key' => $field,
'value' => trim( $value ),
'compare' => '=',
),
array(
'key' => $field,
'value' => trim( $value ),
@@ -158,8 +173,9 @@ function um_add_search_to_query( $query_args, $args ){
'compare' => 'LIKE',
),
'relation' => 'OR',
) );
);
}
/**
* UM hook
*
+8 -2
View File
@@ -6,7 +6,7 @@ Donate link:
Tags: community, member, membership, user-profile, user-registration
Requires at least: 4.1
Tested up to: 4.9
Stable tag: 2.0.17
Stable tag: 2.0.19
License: GNU Version 2 or Any Later Version
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -131,7 +131,13 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
= Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
= 2.0.18: July 3, 2018 =
= 2.0.19: July 5, 2018 =
* Bugfixes:
- Fixed few JS file's full versions
- Fixed search in members directory by multiselect field
= 2.0.18: July 4, 2018 =
* Enhancements:
- Added an ability to create different email templates for each site on multisites installs
+1 -1
View File
@@ -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.0.18
Version: 2.0.19
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member