- fixed terms query;

This commit is contained in:
Nikita Sinelnikov
2021-08-04 11:51:17 +03:00
parent 49cf1d7f8d
commit a715660469
3 changed files with 20 additions and 9 deletions
+13 -8
View File
@@ -125,16 +125,21 @@ if ( ! class_exists( 'um\core\Access' ) ) {
return array();
}
global $wpdb;
$term_ids = $wpdb->get_col(
"SELECT tm.term_id
FROM {$wpdb->termmeta} tm
LEFT JOIN {$wpdb->term_taxonomy} tt ON tt.term_id = tm.term_id
WHERE tm.meta_key = 'um_content_restriction' AND
tt.taxonomy IN('" . implode( "','", array_keys( $restricted_taxonomies ) ) . "')"
$this->ignore_terms_exclude = true;
$term_ids = get_terms(
array(
'taxonomy' => array_keys( $restricted_taxonomies ),
'hide_empty' => false,
'fields' => 'ids',
'meta_query' => array(
'key' => 'um_content_restriction',
'compare' => 'EXISTS',
),
)
);
$this->ignore_terms_exclude = false;
if ( empty( $term_ids ) ) {
if ( empty( $term_ids ) || is_wp_error( $term_ids ) ) {
$cache = array();
return array();
}
+6
View File
@@ -155,6 +155,12 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
* To learn more about version 2.1 please see this [docs](https://docs.ultimatemember.com/article/1512-upgrade-2-1-0)
* UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
= 2.2.3: August 4, 2021 =
* Bugfixes:
- Fixed: `pre_get_terms` callback to avoid the conflicts with other terms queries
= 2.2.2: August 3, 2021 =
* Bugfixes:
+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.2.2
Version: 2.2.3-beta
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member