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/blogs/functions.php

    r13436 r13442  
    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        );
    3034
    3135        // If the user has blogs create a nav item
     
    3539                'slug'      => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope
    3640                'li_class'  => array(),
    37                 'link'      => bp_loggedin_user_domain() . bp_nouveau_get_component_slug( 'blogs' ),
     41                'link'      => bp_loggedin_user_url( $path_chunks ),
    3842                'text'      => __( 'My Sites', 'buddypress' ),
    3943                'count'     => $my_blogs_count,
Note: See TracChangeset for help on using the changeset viewer.