Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/27/2023 06:19:06 PM (23 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-notifications/bp-notifications-adminbar.php

    r13395 r13442  
    3333    $alert_class   = (int) $count > 0 ? 'pending-count alert' : 'count no-alert';
    3434    $menu_title    = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . number_format_i18n( $count ) . '</span>';
    35     $menu_link     = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() );
     35    $notifications_slug        = bp_get_notifications_slug();
     36    $custom_notifications_slug = bp_rewrites_get_slug( 'members', 'member_' . $notifications_slug, $notifications_slug );
     37    $menu_link                 = bp_loggedin_user_url(
     38        array(
     39            'single_item_component' => $custom_notifications_slug,
     40        )
     41    );
    3642
    3743    // Add the top-level Notifications button.
Note: See TracChangeset for help on using the changeset viewer.