diff --git a/changelog.txt b/changelog.txt index 9cd213c..2827539 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ = 3.3.1 = * WordPress 6.7 compatible. * Adds fixes for "Translation loading for the ... domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. ..." PHP notices raised as of WordPress 6.7.0 in certain scenarios when translations are requested before the init or the after_setup_theme action have fired. +* Avoids a potential infinite recursion when evaluating post counts. = 3.3.0 = * WordPress 6.7 compatible. diff --git a/lib/access/class-groups-post-access.php b/lib/access/class-groups-post-access.php index 0e5e194..ece3a04 100644 --- a/lib/access/class-groups-post-access.php +++ b/lib/access/class-groups-post-access.php @@ -938,6 +938,8 @@ public static function groups_deleted_group( $group_id ) { * @see Groups_Post_Access::purge_count_posts_cached() */ public static function wp_count_posts( $counts, $type, $perm ) { + // @since 3.3.1 remove temporarily to avoid potential infinite recursion https://github.com/itthinx/groups/pull/160 + remove_filter( 'wp_count_posts', array( __CLASS__, 'wp_count_posts' ), 10 ); if ( !empty( $type ) && is_string( $type ) && self::handles_post_type( $type ) ) { $sub_group = Groups_Cache::get_group( '' ); // @since 2.20.0 cached per post type gathering counts per subgroup @@ -987,6 +989,7 @@ public static function wp_count_posts( $counts, $type, $perm ) { Groups_Cache::set( self::COUNT_POSTS . '_' . $type, $type_counts, self::CACHE_GROUP ); } } + add_filter( 'wp_count_posts', array( __CLASS__, 'wp_count_posts' ), 10, 3 ); // @since 3.3.1 reestablish filter for next use return $counts; } diff --git a/lib/admin/class-groups-admin-post-columns.php b/lib/admin/class-groups-admin-post-columns.php index e737cac..a40bd3e 100644 --- a/lib/admin/class-groups-admin-post-columns.php +++ b/lib/admin/class-groups-admin-post-columns.php @@ -105,7 +105,7 @@ public static function admin_init() { public static function columns( $column_headers ) { $column_headers[self::GROUPS] = sprintf( '%s' . - ' ', + ' ', esc_attr__( 'One or more groups granting access to entries.', 'groups' ), esc_html_x( 'Groups', 'Column header', 'groups' ) );