Changeset 3490458
- Timestamp:
- 03/25/2026 02:36:34 AM (9 days ago)
- Location:
- groups/trunk
- Files:
-
- 6 edited
-
changelog.txt (modified) (1 diff)
-
groups.php (modified) (2 diffs)
-
lib/access/class-groups-post-access.php (modified) (1 diff)
-
lib/extra/class-groups-extra.php (modified) (3 diffs)
-
lib/views/class-groups-uie.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
groups/trunk/changelog.txt
r3473982 r3490458 1 1 == Groups by itthinx - changelog.txt 2 3 2026-03-24 - version 4.1.0 4 * Update - WordPress 6.9 compatible. 5 * Update - WooCommerce 10.6 compatible. 6 * Update - Resolves an issue that would render wrong post counts and all post statuses under Forums > All Forums with bbPress due to it altering the post_status of a query indiscriminately during the pre_get_posts action. 7 * Update - Using unlimited options for Tom Select UI control by default. 8 * Add - Added the groups_uie_render_select_display_limit filter. 2 9 3 10 2026-03-03 - version 4.0.0 -
groups/trunk/groups.php
r3473982 r3490458 22 22 * Plugin URI: https://www.itthinx.com/plugins/groups 23 23 * Description: Groups provides group-based user membership management, group-based capabilities and content access control. 24 * Version: 4. 0.024 * Version: 4.1.0 25 25 * Requires at least: 6.7 26 26 * Requires PHP: 7.4 27 27 * WC requires at least: 10.0 28 * WC tested up to: 10. 528 * WC tested up to: 10.6 29 29 * Author: itthinx 30 30 * Author URI: https://www.itthinx.com … … 37 37 exit; 38 38 } 39 define( 'GROUPS_CORE_VERSION', '4. 0.0' );39 define( 'GROUPS_CORE_VERSION', '4.1.0' ); 40 40 define( 'GROUPS_FILE', __FILE__ ); 41 41 if ( !defined( 'GROUPS_CORE_DIR' ) ) { -
groups/trunk/lib/access/class-groups-post-access.php
r3473982 r3490458 944 944 } 945 945 } 946 do_action( 'groups_post_access_wp_count_posts_before_query', $query_args, $counts, $type, $perm ); 946 947 $posts = get_posts( $query_args ); 948 do_action( 'groups_post_access_wp_count_posts_after_query', $query_args, $counts, $type, $perm ); 947 949 $count = count( $posts ); 948 950 unset( $posts ); -
groups/trunk/lib/extra/class-groups-extra.php
r3473982 r3490458 28 28 */ 29 29 class Groups_Extra { 30 31 /** 32 * bbPress pre_get_posts filter priority. 33 * 34 * @since 4.1.0 35 * 36 * @var int 37 */ 38 private static $bbp_pre_get_posts_priority = null; 39 40 /** 41 * Post status before bbPress alters. 42 * 43 * @since 4.1.0 44 * 45 * @var string|string[] 46 */ 47 private static $bbp_pre_get_posts_post_status = null; 30 48 31 49 /** … … 46 64 add_filter( 'groups_post_access_posts_where_query_get_post_types', array( __CLASS__, 'groups_post_access_posts_where_query_get_post_types' ), 10, 3 ); 47 65 add_filter( 'woocommerce_duplicate_product_capability', array( __CLASS__, 'woocommerce_duplicate_product_capability' ) ); 66 add_filter( 'groups_post_access_wp_count_posts_before_query', array( __CLASS__, 'groups_post_access_wp_count_posts_before_query' ), 10, 4 ); 67 add_filter( 'groups_post_access_wp_count_posts_after_query', array( __CLASS__, 'groups_post_access_wp_count_posts_after_query' ), 10, 4 ); 48 68 } 49 69 … … 190 210 return $capability; 191 211 } 212 213 /** 214 * Fires before get_posts query. 215 * 216 * @since 4.1.0 217 * 218 * @param array $query_args 219 * @param object $counts 220 * @param string $type 221 * @param string $perm 222 */ 223 public static function groups_post_access_wp_count_posts_before_query( $query_args, $counts, $type, $perm ) { 224 // Workaound issue introduced by bbPress action on pre_get_posts which introduces additional types ... related https://bbpress.trac.wordpress.org/ticket/2512 225 if ( $type === 'forum' ) { 226 $priority = has_action( 'pre_get_posts', 'bbp_pre_get_posts_normalize_forum_visibility' ); 227 if ( $priority !== false ) { 228 // Instead of removing the action, we revert the altered post_status: 229 // remove_action( 'pre_get_posts', 'bbp_pre_get_posts_normalize_forum_visibility', $priority ); 230 add_action( 'pre_get_posts', array( __CLASS__, 'bbp_fix_pre_get_posts' ), $priority + 1 ); 231 self::$bbp_pre_get_posts_priority = $priority; 232 self::$bbp_pre_get_posts_post_status = $query_args['post_status']; 233 } 234 } 235 } 236 237 /** 238 * Fires after get_posts query. 239 * 240 * @since 4.1.0 241 * 242 * @param array $query_args 243 * @param object $counts 244 * @param string $type 245 * @param string $perm 246 */ 247 public static function groups_post_access_wp_count_posts_after_query( $query_args, $counts, $type, $perm ) { 248 if ( self::$bbp_pre_get_posts_priority !== null ) { 249 // see note in ...before... action 250 // add_action( 'pre_get_posts', 'bbp_pre_get_posts_normalize_forum_visibility', self::$bbp_pre_get_posts_priority ); 251 remove_action( 'pre_get_posts', array( __CLASS__, 'bbp_fix_pre_get_posts' ), self::$bbp_pre_get_posts_priority + 1 ); 252 self::$bbp_pre_get_posts_priority = null; 253 self::$bbp_pre_get_posts_post_status = null; 254 } 255 } 256 257 /** 258 * Reestablish altered post_status. 259 * 260 * @since 4.1.0 261 * 262 * @param WP_Query $query 263 */ 264 public static function bbp_fix_pre_get_posts( $query ) { 265 if ( self::$bbp_pre_get_posts_post_status !== null ) { 266 $query->set( 'post_status', self::$bbp_pre_get_posts_post_status ); 267 } 268 } 192 269 } 193 270 Groups_Extra::boot(); -
groups/trunk/lib/views/class-groups-uie.php
r3473982 r3490458 145 145 break; 146 146 default: 147 /** 148 * Allows to determine the maximum number of options displayed in the dropdown. 149 * 150 * Provide a number > 0, or null for no limit. 151 * Defaults to null for unlimited options displayed. 152 * This limits the number of options that are displayed, but not the total available options. 153 * 154 * @since 4.1.0 155 * 156 * @param int|null $max_options 157 */ 158 $max_options = apply_filters( 'groups_uie_render_select_display_limit', null ); 159 if ( is_numeric( $max_options ) ) { 160 $max_options = max( 1, intval( $max_options ) ); 161 } else { 162 $max_options = null; 163 } 147 164 $call_output .= 'if ( typeof jQuery !== "undefined" && typeof tomSelect === "function" ) {'; 148 165 $call_output .= sprintf( 149 'tomSelect("%s",{%splugins: ["remove_button","clear_button"], wrapperClass:"groups-ts-wrapper",controlClass:"groups-ts-control",dropdownClass:"groups-ts-dropdown",dropdownContentClass:"groups-ts-dropdown-content"});',166 'tomSelect("%s",{%splugins: ["remove_button","clear_button"],maxOptions:%s,wrapperClass:"groups-ts-wrapper",controlClass:"groups-ts-control",dropdownClass:"groups-ts-dropdown",dropdownContentClass:"groups-ts-dropdown-content"});', 150 167 $selector, 151 $create ? 'create:true,' : '' 152 ); 168 $create ? 'create:true,' : '', 169 $max_options === null ? 'null' : $max_options 170 ); 153 171 $call_output .= '}'; 154 172 break; -
groups/trunk/readme.txt
r3473982 r3490458 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 4. 0.08 Stable tag: 4.1.0 9 9 License: GPLv3 10 10
Note: See TracChangeset
for help on using the changeset viewer.