Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/23/2023 07:35:38 PM (18 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-members/bp-members-adminbar.php

    r13395 r13441  
    4343            'group'  => true,
    4444            'title'  => __( 'Edit My Profile', 'buddypress' ),
    45             'href'   => bp_loggedin_user_domain(),
     45            'href'   => bp_loggedin_user_url(),
    4646            'meta'   => array(
    4747            'class'  => 'ab-sub-secondary'
     
    201201
    202202    if ( bp_current_user_can( 'bp_members_invitations_view_screens' ) ) {
    203         $bp               = buddypress();
    204         $invitations_link = trailingslashit( bp_loggedin_user_domain() . bp_get_members_invitations_slug() );
     203        $bp                 = buddypress();
     204        $invite_slug        = bp_get_members_invitations_slug();
     205        $custom_invite_slug = bp_rewrites_get_slug( 'members', 'member_' . $invite_slug, $invite_slug );
    205206
    206207        $wp_admin_bar->add_node(
     
    209210                'parent' => $bp->my_account_menu_id,
    210211                'title'  => __( 'Invitations', 'buddypress' ),
    211                 'href'   => $invitations_link,
     212                'href'   => bp_loggedin_user_url(
     213                    array(
     214                        'single_item_component' => $custom_invite_slug,
     215                    )
     216                ),
    212217                'meta'   => array(
    213218                    'class'  => 'ab-sub-secondary'
     
    222227                    'parent' => $bp->my_account_menu_id . '-invitations',
    223228                    'title'  => __( 'Send Invites', 'buddypress' ),
    224                     'href'   => $invitations_link . 'send-invites/',
     229                    'href'   => bp_loggedin_user_url(
     230                        array(
     231                            'single_item_component' => $custom_invite_slug,
     232                            'single_item_action'    => bp_rewrites_get_slug( 'members', 'member_' . $invite_slug . '_send_invites', 'send-invites' ),
     233                        )
     234                    ),
    225235                    'meta'   => array(
    226236                        'class'  => 'ab-sub-secondary'
     
    235245                'parent' => $bp->my_account_menu_id . '-invitations',
    236246                'title'  => __( 'Pending Invites', 'buddypress' ),
    237                 'href'   => $invitations_link . 'list-invites/',
     247                'href'   => bp_loggedin_user_url(
     248                    array(
     249                        'single_item_component' => $custom_invite_slug,
     250                        'single_item_action'    => bp_rewrites_get_slug( 'members', 'member_' . $invite_slug . '_list_invites', 'list-invites' ),
     251                    )
     252                ),
    238253                'meta'   => array(
    239254                    'class'  => 'ab-sub-secondary'
Note: See TracChangeset for help on using the changeset viewer.