Changeset 3347684
- Timestamp:
- 08/20/2025 05:41:10 PM (4 months ago)
- Location:
- buddypress-docs
- Files:
-
- 10 edited
- 1 copied
-
tags/2.2.6 (copied) (copied from buddypress-docs/trunk)
-
tags/2.2.6/includes/access-query.php (modified) (1 diff)
-
tags/2.2.6/includes/component.php (modified) (1 diff)
-
tags/2.2.6/includes/integration-groups.php (modified) (1 diff)
-
tags/2.2.6/loader.php (modified) (2 diffs)
-
tags/2.2.6/readme.txt (modified) (2 diffs)
-
trunk/includes/access-query.php (modified) (1 diff)
-
trunk/includes/component.php (modified) (1 diff)
-
trunk/includes/integration-groups.php (modified) (1 diff)
-
trunk/loader.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
buddypress-docs/tags/2.2.6/includes/access-query.php
r1884284 r3347684 321 321 // results, so we check the post type, and bail if the post_type rules 322 322 // out Docs to begin with 323 $docs_post_type = bp_docs_get_post_type_name(); 323 324 $queried_post_type = $query->get( 'post_type' ); 324 $pt = bp_docs_get_post_type_name(); 325 $is_bp_doc_query = is_array( $queried_post_type ) ? in_array( $pt, $queried_post_type ) : $pt == $queried_post_type; 325 326 $is_bp_doc_post_type = is_array( $queried_post_type ) ? in_array( $docs_post_type, $queried_post_type ) : $docs_post_type === $queried_post_type; 327 328 $docs_tag_tax = apply_filters( 'bp_docs_docs_tag_tax_name', 'bp_docs_tag' ); 329 $queried_tax_query = $query->get( 'tax_query' ); 326 330 327 331 $filter_query = false; 328 332 329 // 'pagename' queries always fetch pages. 330 if ( ! $queried_post_type && ! $query->get( 'pagename' ) ) { 333 if ( 'any' === $queried_post_type ) { 331 334 $filter_query = true; 332 } elseif ( 'any' === $queried_post_type ) {335 } elseif ( $is_bp_doc_post_type ) { 333 336 $filter_query = true; 334 } elseif ( $is_bp_doc_query ) { 335 $filter_query = true; 336 } 337 338 if ( $filter_query ) { 339 $bp_docs_access_query = bp_docs_access_query(); 340 341 if ( $pt == $queried_post_type ) { 342 // Use a tax query if possible 343 $tax_query = $query->get( 'tax_query' ); 344 if ( ! $tax_query ) { 345 $tax_query = array(); 346 } 347 348 $query->set( 'tax_query', array_merge( $tax_query, $bp_docs_access_query->get_tax_query() ) ); 349 350 } else { 351 // When it's not a straight bp_doc query, a tax_query 352 // approach won't work (because the taxonomy in 353 // question only applies to bp_docs, and conditional 354 // tax_query is not supported by WP). Instead, get a 355 // list of off-limits Docs and pass to post__not_in 356 $exclude = $bp_docs_access_query->get_doc_ids(); 357 358 if ( ! empty( $exclude ) ) { 359 $not_in = $query->get( 'post__not_in' ); 360 $query->set( 'post__not_in', array_merge( (array) $not_in, $exclude ) ); 361 } 362 337 } elseif ( $queried_tax_query ) { 338 foreach ( $queried_tax_query as $tax_query ) { 339 if ( ! empty( $tax_query['taxonomy'] ) && $docs_tag_tax === $tax_query['taxonomy'] ) { 340 $filter_query = true; 341 break; 342 } 343 } 344 } 345 346 if ( ! $filter_query ) { 347 return; 348 } 349 350 $bp_docs_access_query = bp_docs_access_query(); 351 352 if ( $docs_post_type == $queried_post_type ) { 353 // Use a tax query if possible 354 $tax_query = $query->get( 'tax_query' ); 355 if ( ! $tax_query ) { 356 $tax_query = array(); 357 } 358 359 $query->set( 'tax_query', array_merge( $tax_query, $bp_docs_access_query->get_tax_query() ) ); 360 361 } else { 362 // When it's not a straight bp_doc query, a tax_query 363 // approach won't work (because the taxonomy in 364 // question only applies to bp_docs, and conditional 365 // tax_query is not supported by WP). Instead, get a 366 // list of off-limits Docs and pass to post__not_in 367 $exclude = $bp_docs_access_query->get_doc_ids(); 368 369 if ( ! empty( $exclude ) ) { 370 $not_in = $query->get( 'post__not_in' ); 371 $query->set( 'post__not_in', array_merge( (array) $not_in, $exclude ) ); 363 372 } 364 373 } -
buddypress-docs/tags/2.2.6/includes/component.php
r3299013 r3347684 103 103 parent::start( 104 104 'bp_docs', 105 __( 'BuddyPress Docs', 'buddypress-docs' ),105 'BuddyPress Docs', 106 106 BP_DOCS_INSTALL_PATH 107 107 ); -
buddypress-docs/tags/2.2.6/includes/integration-groups.php
r3162780 r3347684 1292 1292 } 1293 1293 1294 if ( $settings_are_changed ) {1295 // No need to resave settings if they're the same1294 $success = false; 1295 if ( ! $settings_are_changed ) { 1296 1296 $success = true; 1297 1297 } elseif ( groups_update_groupmeta( $group_id, 'bp-docs', $settings ) ) { -
buddypress-docs/tags/2.2.6/loader.php
r3299013 r3347684 4 4 Plugin URI: http://github.com/boonebgorges/buddypress-docs 5 5 Description: Adds collaborative Docs to BuddyPress 6 Version: 2.2. 56 Version: 2.2.6 7 7 Author: Boone B Gorges, David Cavins 8 8 Author URI: http://boone.gorg.es … … 16 16 */ 17 17 18 define( 'BP_DOCS_VERSION', '2.2. 5' );18 define( 'BP_DOCS_VERSION', '2.2.6' ); 19 19 20 20 require_once __DIR__ . '/vendor/autoload.php'; -
buddypress-docs/tags/2.2.6/readme.txt
r3299013 r3347684 5 5 Requires at least: 3.3 6 6 Tested up to: 6.8 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 9 9 Adds collaborative Docs to BuddyPress. … … 33 33 34 34 == Changelog == 35 36 = 2.2.6 = 37 * Changed the logic for access-protection, so that the off-limits Docs query is run far less frequently. This helps with performance as well as with global pollution. 38 * Fixed the logic for saving group settings. 39 * Improve compatibility with recent versions of WordPress and BuddyPress when loading the BP_Component. 35 40 36 41 = 2.2.5 = -
buddypress-docs/trunk/includes/access-query.php
r1884284 r3347684 321 321 // results, so we check the post type, and bail if the post_type rules 322 322 // out Docs to begin with 323 $docs_post_type = bp_docs_get_post_type_name(); 323 324 $queried_post_type = $query->get( 'post_type' ); 324 $pt = bp_docs_get_post_type_name(); 325 $is_bp_doc_query = is_array( $queried_post_type ) ? in_array( $pt, $queried_post_type ) : $pt == $queried_post_type; 325 326 $is_bp_doc_post_type = is_array( $queried_post_type ) ? in_array( $docs_post_type, $queried_post_type ) : $docs_post_type === $queried_post_type; 327 328 $docs_tag_tax = apply_filters( 'bp_docs_docs_tag_tax_name', 'bp_docs_tag' ); 329 $queried_tax_query = $query->get( 'tax_query' ); 326 330 327 331 $filter_query = false; 328 332 329 // 'pagename' queries always fetch pages. 330 if ( ! $queried_post_type && ! $query->get( 'pagename' ) ) { 333 if ( 'any' === $queried_post_type ) { 331 334 $filter_query = true; 332 } elseif ( 'any' === $queried_post_type ) {335 } elseif ( $is_bp_doc_post_type ) { 333 336 $filter_query = true; 334 } elseif ( $is_bp_doc_query ) { 335 $filter_query = true; 336 } 337 338 if ( $filter_query ) { 339 $bp_docs_access_query = bp_docs_access_query(); 340 341 if ( $pt == $queried_post_type ) { 342 // Use a tax query if possible 343 $tax_query = $query->get( 'tax_query' ); 344 if ( ! $tax_query ) { 345 $tax_query = array(); 346 } 347 348 $query->set( 'tax_query', array_merge( $tax_query, $bp_docs_access_query->get_tax_query() ) ); 349 350 } else { 351 // When it's not a straight bp_doc query, a tax_query 352 // approach won't work (because the taxonomy in 353 // question only applies to bp_docs, and conditional 354 // tax_query is not supported by WP). Instead, get a 355 // list of off-limits Docs and pass to post__not_in 356 $exclude = $bp_docs_access_query->get_doc_ids(); 357 358 if ( ! empty( $exclude ) ) { 359 $not_in = $query->get( 'post__not_in' ); 360 $query->set( 'post__not_in', array_merge( (array) $not_in, $exclude ) ); 361 } 362 337 } elseif ( $queried_tax_query ) { 338 foreach ( $queried_tax_query as $tax_query ) { 339 if ( ! empty( $tax_query['taxonomy'] ) && $docs_tag_tax === $tax_query['taxonomy'] ) { 340 $filter_query = true; 341 break; 342 } 343 } 344 } 345 346 if ( ! $filter_query ) { 347 return; 348 } 349 350 $bp_docs_access_query = bp_docs_access_query(); 351 352 if ( $docs_post_type == $queried_post_type ) { 353 // Use a tax query if possible 354 $tax_query = $query->get( 'tax_query' ); 355 if ( ! $tax_query ) { 356 $tax_query = array(); 357 } 358 359 $query->set( 'tax_query', array_merge( $tax_query, $bp_docs_access_query->get_tax_query() ) ); 360 361 } else { 362 // When it's not a straight bp_doc query, a tax_query 363 // approach won't work (because the taxonomy in 364 // question only applies to bp_docs, and conditional 365 // tax_query is not supported by WP). Instead, get a 366 // list of off-limits Docs and pass to post__not_in 367 $exclude = $bp_docs_access_query->get_doc_ids(); 368 369 if ( ! empty( $exclude ) ) { 370 $not_in = $query->get( 'post__not_in' ); 371 $query->set( 'post__not_in', array_merge( (array) $not_in, $exclude ) ); 363 372 } 364 373 } -
buddypress-docs/trunk/includes/component.php
r3299013 r3347684 103 103 parent::start( 104 104 'bp_docs', 105 __( 'BuddyPress Docs', 'buddypress-docs' ),105 'BuddyPress Docs', 106 106 BP_DOCS_INSTALL_PATH 107 107 ); -
buddypress-docs/trunk/includes/integration-groups.php
r3162780 r3347684 1292 1292 } 1293 1293 1294 if ( $settings_are_changed ) {1295 // No need to resave settings if they're the same1294 $success = false; 1295 if ( ! $settings_are_changed ) { 1296 1296 $success = true; 1297 1297 } elseif ( groups_update_groupmeta( $group_id, 'bp-docs', $settings ) ) { -
buddypress-docs/trunk/loader.php
r3299013 r3347684 4 4 Plugin URI: http://github.com/boonebgorges/buddypress-docs 5 5 Description: Adds collaborative Docs to BuddyPress 6 Version: 2.2. 56 Version: 2.2.6 7 7 Author: Boone B Gorges, David Cavins 8 8 Author URI: http://boone.gorg.es … … 16 16 */ 17 17 18 define( 'BP_DOCS_VERSION', '2.2. 5' );18 define( 'BP_DOCS_VERSION', '2.2.6' ); 19 19 20 20 require_once __DIR__ . '/vendor/autoload.php'; -
buddypress-docs/trunk/readme.txt
r3299013 r3347684 5 5 Requires at least: 3.3 6 6 Tested up to: 6.8 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 9 9 Adds collaborative Docs to BuddyPress. … … 33 33 34 34 == Changelog == 35 36 = 2.2.6 = 37 * Changed the logic for access-protection, so that the off-limits Docs query is run far less frequently. This helps with performance as well as with global pollution. 38 * Fixed the logic for saving group settings. 39 * Improve compatibility with recent versions of WordPress and BuddyPress when loading the BP_Component. 35 40 36 41 = 2.2.5 =
Note: See TracChangeset
for help on using the changeset viewer.