Skip to:
Content

BuddyPress.org

Changeset 13648


Ignore:
Timestamp:
11/23/2023 03:48:20 AM (16 months ago)
Author:
imath
Message:

Inform Administrators about the current BP URL parser in use

Adds a new row to the BuddyPress panel of the WP Site Health's debug information screen to inform about the URL Parser currently in use (Legacy or BP Rewrites).

Fixes #9027
Closes https://github.com/buddypress/buddypress/pull/194

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

Legend:

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

    r13515 r13648  
    697697    $active_components = array_intersect_key( bp_core_get_components(), buddypress()->active_components );
    698698    $bp_settings       = array();
     699    $bp_url_parsers    = array(
     700        'rewrites' => __( 'BP Rewrites API', 'buddypress' ),
     701        'legacy'   => __( 'Legacy Parser', 'buddypress' ),
     702    );
     703
     704    // Get the current URL parser.
     705    $current_parser = bp_core_get_query_parser();
     706    if ( isset( $bp_url_parsers[ $current_parser ] ) ) {
     707        $bp_url_parser = $bp_url_parsers[ $current_parser ];
     708    } else {
     709        $bp_url_parser = __( 'Custom', 'buddypress' );
     710    }
     711
    699712
    700713    foreach ( $wp_settings_fields['buddypress'] as $section => $settings ) {
     
    755768                    'value' => bp_get_theme_compat_name() . ' ' . bp_get_theme_compat_version(),
    756769                ),
     770                'url_parser'    => array(
     771                    'label' => __( 'URL Parser', 'buddypress' ),
     772                    'value' => $bp_url_parser,
     773                ),
    757774            ),
    758775            $bp_settings
  • trunk/src/bp-core/bp-core-functions.php

    r13632 r13648  
    143143
    144144/**
    145  * Get the BuddyPress parser in use.
     145 * Get the BuddyPress URL Parser in use.
    146146 *
    147147 * @since 12.0.0
Note: See TracChangeset for help on using the changeset viewer.