Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/23/2023 07:35:38 PM (13 months ago)
Author:
imath
Message:

Make BP_Core_Nav generate "BP Rewrites ready" navigation links

  • Remove all components $parent_url attributes when setting sub nav items.
  • Only use the bp_core_create_nav_link() $link attribute argument & the bp_core_create_subnav_link() $parent_url attribute argument if specified to preserve backward compatibility.
  • Migrates the Community search feature so that it uses BP Rewrites.
  • Perform some bp_loggedin_user_domain() in favor of bp_loggedin_user_url().
  • Update some PHPUnit tests.

Props r-a-y, johnjamesjacoby, boonebgorges

Closes https://github.com/buddypress/buddypress/pull/77
See #4954

File:
1 edited

Legend:

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

    r13436 r13441  
    520520    $url = bp_rewrites_get_url(
    521521        array(
    522             'component_id' => bp_get_search_slug(),
     522            'component_id'     => 'core',
     523            'community_search' => 1,
    523524        )
    524525    );
     
    36433644    foreach ( $bp->{$component}->nav->get_item_nav() as $nav_menu ) {
    36443645        // Get the correct menu link. See https://buddypress.trac.wordpress.org/ticket/4624.
    3645         $link = bp_loggedin_user_domain() ? str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $nav_menu->link ) : trailingslashit( bp_displayed_user_domain() . $nav_menu->link );
     3646        $link = $nav_menu->link;
     3647        if ( bp_loggedin_user_url() ) {
     3648            $link = str_replace( bp_loggedin_user_url(), bp_displayed_user_url(), $nav_menu->link );
     3649        }
    36463650
    36473651        // Add this menu.
Note: See TracChangeset for help on using the changeset viewer.