diff --git a/includes/core/class-access.php b/includes/core/class-access.php index ea7fa596..5317fa7d 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -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(); } diff --git a/readme.txt b/readme.txt index 3a71c776..79bfb992 100644 --- a/readme.txt +++ b/readme.txt @@ -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: diff --git a/ultimate-member.php b/ultimate-member.php index 9056e6f8..6abe8418 100644 --- a/ultimate-member.php +++ b/ultimate-member.php @@ -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