Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/27/2023 06:19:06 PM (13 months ago)
Author:
imath
Message:

Improve Components Member's single item navigation generation

  • Edit the BP_Component Class so that it globalize navigation items before registering it.
  • Introduce bp_get_component_navigations(), a new function that will be used to get Member's single navigation customizable slugs within the BuddyPress settings area.
  • Perform all remaining bp_loggedin_user_domain() replacements (55) in favor of the bp_loggedin_user_url() function which uses BP Rewrites to build URLs.
  • Improve bp_loggedin_user_link() by adding a new $chunks array of arguments to output escaped URL in templates.
  • Adapt some PHPUnit testcases.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

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

    r13441 r13442  
    210210
    211211/**
    212  * @since 3.0.0
     212 * Replaces the Notices Compose URL.
     213 *
     214 * @since 3.0.0
     215 *
     216 * @param array $admin_nav The WP Admin Nav.
    213217 */
    214218function bp_nouveau_messages_adjust_admin_nav( $admin_nav ) {
     
    217221    }
    218222
    219     $user_messages_link = trailingslashit( bp_loggedin_user_domain() . bp_nouveau_get_component_slug( 'messages' ) );
    220 
    221223    foreach ( $admin_nav as $nav_iterator => $nav ) {
    222224        $nav_id = str_replace( 'my-account-messages-', '', $nav['id'] );
    223225
    224226        if ( 'notices' === $nav_id ) {
    225             $admin_nav[ $nav_iterator ]['href'] = esc_url( add_query_arg( array(
    226                 'page' => 'bp-notices'
    227             ), bp_get_admin_url( 'users.php' ) ) );
     227            $admin_nav[ $nav_iterator ]['href'] = esc_url(
     228                add_query_arg(
     229                    array(
     230                        'page' => 'bp-notices',
     231                    ),
     232                    bp_get_admin_url( 'users.php' )
     233                )
     234            );
    228235        }
    229236    }
     
    271278        'total_count'       => 1,
    272279        'content'           => __( 'New sitewide notice', 'buddypress' ),
    273         'href'              => bp_loggedin_user_domain(),
     280        'href'              => bp_loggedin_user_url(),
    274281    );
    275282
Note: See TracChangeset for help on using the changeset viewer.