Plugin Directory

Changeset 3347684


Ignore:
Timestamp:
08/20/2025 05:41:10 PM (4 months ago)
Author:
boonebgorges
Message:

Create tag 2.2.6.

Location:
buddypress-docs
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • buddypress-docs/tags/2.2.6/includes/access-query.php

    r1884284 r3347684  
    321321    // results, so we check the post type, and bail if the post_type rules
    322322    // out Docs to begin with
     323    $docs_post_type    = bp_docs_get_post_type_name();
    323324    $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' );
    326330
    327331    $filter_query = false;
    328332
    329     // 'pagename' queries always fetch pages.
    330     if ( ! $queried_post_type && ! $query->get( 'pagename' ) ) {
     333    if ( 'any' === $queried_post_type ) {
    331334        $filter_query = true;
    332     } elseif ( 'any' === $queried_post_type ) {
     335    } elseif ( $is_bp_doc_post_type ) {
    333336        $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 ) );
    363372        }
    364373    }
  • buddypress-docs/tags/2.2.6/includes/component.php

    r3299013 r3347684  
    103103        parent::start(
    104104            'bp_docs',
    105             __( 'BuddyPress Docs', 'buddypress-docs' ),
     105            'BuddyPress Docs',
    106106            BP_DOCS_INSTALL_PATH
    107107        );
  • buddypress-docs/tags/2.2.6/includes/integration-groups.php

    r3162780 r3347684  
    12921292            }
    12931293
    1294             if ( $settings_are_changed ) {
    1295                 // No need to resave settings if they're the same
     1294            $success = false;
     1295            if ( ! $settings_are_changed ) {
    12961296                $success = true;
    12971297            } elseif ( groups_update_groupmeta( $group_id, 'bp-docs', $settings ) ) {
  • buddypress-docs/tags/2.2.6/loader.php

    r3299013 r3347684  
    44Plugin URI: http://github.com/boonebgorges/buddypress-docs
    55Description: Adds collaborative Docs to BuddyPress
    6 Version: 2.2.5
     6Version: 2.2.6
    77Author: Boone B Gorges, David Cavins
    88Author URI: http://boone.gorg.es
     
    1616*/
    1717
    18 define( 'BP_DOCS_VERSION', '2.2.5' );
     18define( 'BP_DOCS_VERSION', '2.2.6' );
    1919
    2020require_once __DIR__ . '/vendor/autoload.php';
  • buddypress-docs/tags/2.2.6/readme.txt

    r3299013 r3347684  
    55Requires at least: 3.3
    66Tested up to: 6.8
    7 Stable tag: 2.2.5
     7Stable tag: 2.2.6
    88
    99Adds collaborative Docs to BuddyPress.
     
    3333
    3434== 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.
    3540
    3641= 2.2.5 =
  • buddypress-docs/trunk/includes/access-query.php

    r1884284 r3347684  
    321321    // results, so we check the post type, and bail if the post_type rules
    322322    // out Docs to begin with
     323    $docs_post_type    = bp_docs_get_post_type_name();
    323324    $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' );
    326330
    327331    $filter_query = false;
    328332
    329     // 'pagename' queries always fetch pages.
    330     if ( ! $queried_post_type && ! $query->get( 'pagename' ) ) {
     333    if ( 'any' === $queried_post_type ) {
    331334        $filter_query = true;
    332     } elseif ( 'any' === $queried_post_type ) {
     335    } elseif ( $is_bp_doc_post_type ) {
    333336        $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 ) );
    363372        }
    364373    }
  • buddypress-docs/trunk/includes/component.php

    r3299013 r3347684  
    103103        parent::start(
    104104            'bp_docs',
    105             __( 'BuddyPress Docs', 'buddypress-docs' ),
     105            'BuddyPress Docs',
    106106            BP_DOCS_INSTALL_PATH
    107107        );
  • buddypress-docs/trunk/includes/integration-groups.php

    r3162780 r3347684  
    12921292            }
    12931293
    1294             if ( $settings_are_changed ) {
    1295                 // No need to resave settings if they're the same
     1294            $success = false;
     1295            if ( ! $settings_are_changed ) {
    12961296                $success = true;
    12971297            } elseif ( groups_update_groupmeta( $group_id, 'bp-docs', $settings ) ) {
  • buddypress-docs/trunk/loader.php

    r3299013 r3347684  
    44Plugin URI: http://github.com/boonebgorges/buddypress-docs
    55Description: Adds collaborative Docs to BuddyPress
    6 Version: 2.2.5
     6Version: 2.2.6
    77Author: Boone B Gorges, David Cavins
    88Author URI: http://boone.gorg.es
     
    1616*/
    1717
    18 define( 'BP_DOCS_VERSION', '2.2.5' );
     18define( 'BP_DOCS_VERSION', '2.2.6' );
    1919
    2020require_once __DIR__ . '/vendor/autoload.php';
  • buddypress-docs/trunk/readme.txt

    r3299013 r3347684  
    55Requires at least: 3.3
    66Tested up to: 6.8
    7 Stable tag: 2.2.5
     7Stable tag: 2.2.6
    88
    99Adds collaborative Docs to BuddyPress.
     
    3333
    3434== 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.
    3540
    3641= 2.2.5 =
Note: See TracChangeset for help on using the changeset viewer.