Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/18/2023 04:11:04 AM (2 years ago)
Author:
imath
Message:

BP Rewrites: optimize the code used to build URLs

The bp_members_get_path_chunks() & bp_groups_get_path_chunks() functions are making sure URL chunks are customized according to the slugs settings. Instead of redoing at many places all or some of the operations performed by these functions, update the code to build URLs so that it uses these functions.

See #4954
Fixes #8923
Closes https://github.com/buddypress/buddypress/pull/117

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/blogs/functions.php

    r13461 r13503  
    2828    if ( is_user_logged_in() ) {
    2929        $my_blogs_count = bp_get_total_blog_count_for_user( bp_loggedin_user_id() );
    30         $blogs_slug     = bp_nouveau_get_component_slug( 'blogs' );
    31         $path_chunks    = array(
    32             'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $blogs_slug, $blogs_slug ),
    33         );
    3430
    3531        // If the user has blogs create a nav item
     
    3935                'slug'      => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope
    4036                'li_class'  => array(),
    41                 'link'      => bp_loggedin_user_url( $path_chunks ),
     37                'link'      => bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'blogs' ) ) ) ),
    4238                'text'      => __( 'My Sites', 'buddypress' ),
    4339                'count'     => $my_blogs_count,
Note: See TracChangeset for help on using the changeset viewer.