Skip to:
Content

BuddyPress.org

Changeset 13943


Ignore:
Timestamp:
07/03/2024 06:16:22 AM (4 months ago)
Author:
imath
Message:

Only generate rewrite rules when the BP Query Parser is 'rewrites'

Props dontdream

Fixes #9192
Closes https://github.com/buddypress/buddypress/pull/325

Location:
trunk/src/bp-core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-update.php

    r13907 r13943  
    977977        }
    978978    }
     979
     980    /*
     981     * Force permalinks to be refreshed at next page load.
     982     *
     983     * This will make sure configs using BP Classic won't include
     984     * unnecessary rewrite rules.
     985     *
     986     * @see https://buddypress.trac.wordpress.org/ticket/9192
     987     */
     988    if ( 'rewrites' !== bp_core_get_query_parser() ) {
     989        bp_delete_rewrite_rules();
     990    }
    979991}
    980992
  • trunk/src/bp-core/classes/class-bp-component.php

    r13900 r13943  
    10711071     */
    10721072    public function add_rewrite_tags( $rewrite_tags = array() ) {
    1073         if ( array_filter( $this->rewrite_ids ) ) {
     1073        if ( 'rewrites' === bp_core_get_query_parser() && array_filter( $this->rewrite_ids ) ) {
    10741074            $chunks = bp_rewrites_get_default_url_chunks();
    10751075
     
    11201120     */
    11211121    public function add_rewrite_rules( $rewrite_rules = array() ) {
    1122         if ( array_filter( $this->rewrite_ids ) ) {
     1122        if ( 'rewrites' === bp_core_get_query_parser() && array_filter( $this->rewrite_ids ) ) {
    11231123            $priority = 'top';
    11241124            $chunks   = array_merge( bp_rewrites_get_default_url_chunks(), $rewrite_rules );
     
    12121212        }
    12131213
    1214         if ( $permastructs ) {
     1214        if ( 'rewrites' === bp_core_get_query_parser() && $permastructs ) {
    12151215            foreach ( $permastructs as $name => $params ) {
    12161216                if ( ! $name || ! isset( $params['permastruct'] ) || ! $params['permastruct'] ) {
Note: See TracChangeset for help on using the changeset viewer.