Changeset 7403 for trunk/src/includes/forums/functions.php
- Timestamp:
- 05/07/2026 08:49:10 PM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/src/includes/forums/functions.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/functions.php
r7380 r7403 2293 2293 if ( ! empty( $forum_ids ) ) { 2294 2294 2295 // Comparison2296 $compare = ( 1 < count( $forum_ids ) )2297 ? 'NOT IN'2298 : '!=';2299 2300 2295 // Setup types 2301 2296 $types['array'] = $forum_ids; … … 2303 2298 $types['meta_query'] = array( 2304 2299 'key' => '_bbp_forum_id', 2305 'value' => $ types['string'],2300 'value' => $forum_ids, 2306 2301 'type' => 'NUMERIC', 2307 'compare' => $compare2302 'compare' => 'NOT IN' 2308 2303 ); 2309 2304 } … … 2358 2353 2359 2354 // Compare queried post-types to supported post-types 2360 $bbp_post_types = array_diff( $post_types, bbp_get_post_types() ); 2361 2362 // Bail if not a bbPress post type 2363 if ( ! empty( $bbp_post_types ) ) { 2364 return; 2365 } 2355 $bbp_post_types = array_intersect( $post_types, bbp_get_post_types() ); 2356 2357 // Bail if no bbPress post type is being queried 2358 if ( empty( $bbp_post_types ) ) { 2359 return; 2360 } 2361 2362 // Bail if this query has already been normalized 2363 if ( $posts_query->get( '_bbp_forum_visibility_normalized' ) ) { 2364 return; 2365 } 2366 2367 // Mark this query as normalized 2368 $posts_query->set( '_bbp_forum_visibility_normalized', true ); 2366 2369 2367 2370 // Forums … … 2381 2384 2382 2385 // Add our not-in to existing 2383 $not_in = array_unique( array_merge( $not_in, $forum_ids ) );2386 $not_in = wp_parse_id_list( array_merge( $not_in, $forum_ids ) ); 2384 2387 2385 2388 // Set the new not-in val … … 2389 2392 2390 2393 // Get forums to exclude 2391 $forum_ ids= bbp_exclude_forum_ids( 'meta_query' );2394 $forum_meta_query = bbp_exclude_forum_ids( 'meta_query' ); 2392 2395 2393 2396 // Excluding some forums 2394 if ( ! empty( $forum_ids) ) {2397 if ( is_array( $forum_meta_query ) && ! empty( $forum_meta_query['key'] ) && ! empty( $forum_meta_query['value'] ) ) { 2395 2398 2396 2399 // Get any existing meta queries … … 2398 2401 2399 2402 // Add our meta query to existing 2400 $meta_query[] = $forum_ ids;2403 $meta_query[] = $forum_meta_query; 2401 2404 2402 2405 // Set the new meta_query val
Note: See TracChangeset
for help on using the changeset viewer.