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-messages/screens/view.php

    r13395 r13442  
    2222    }
    2323
    24     $thread_id = (int) bp_action_variable( 0 );
     24    $thread_id           = (int) bp_action_variable( 0 );
     25    $message_slug        = bp_get_messages_slug();
     26    $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug );
    2527
    2628    if ( empty( $thread_id ) || ! messages_is_valid_thread( $thread_id ) ) {
     
    2931        }
    3032
    31         bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ) );
     33        bp_core_redirect(
     34            bp_loggedin_user_url(
     35                array(
     36                    'single_item_component' => $custom_message_slug,
     37                )
     38            )
     39        );
    3240    }
    3341
     
    4250        } else {
    4351            bp_core_add_message( __( 'You do not have access to that conversation.', 'buddypress' ), 'error' );
    44             bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() ) );
     52
     53            bp_core_redirect(
     54                bp_loggedin_user_url(
     55                    array(
     56                        'single_item_component' => $custom_message_slug,
     57                    )
     58                )
     59            );
    4560        }
    4661    }
Note: See TracChangeset for help on using the changeset viewer.