Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/31/2023 05:26:39 PM (22 months ago)
Author:
imath
Message:

Make sure all displayed user URLs are built using the BP Rewrites API

Replace all remaining bp_displayed_user_domain() usage in favor of
bp_displayed_user_url().
Introduce the bp_members_get_path_chunks() function to quickly build BP
Rewrites argument for member's URL using an array of slugs.
Deprecate bp_activities_member_rss_link(), bp_blogs_blog_tabs() &
bp_groups_header_tabs().
Improve bp_displayed_user_link() so that it's possible to pass an array
of slugs to output an escaped BP Rewrites ready URL.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-template.php

    r13436 r13443  
    13871387
    13881388/**
    1389  * Output navigation tabs for a user Blogs page.
    1390  *
    1391  * Currently unused by BuddyPress.
    1392  */
    1393 function bp_blogs_blog_tabs() {
    1394 
    1395     // Don't show these tabs on a user's own profile.
    1396     if ( bp_is_my_profile() ) {
    1397         return false;
    1398     } ?>
    1399 
    1400     <ul class="content-header-nav">
    1401         <li<?php if ( bp_is_current_action( 'my-blogs' ) || !bp_current_action() ) : ?> class="current"<?php endif; ?>>
    1402             <a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/my-blogs' ); ?>">
    1403                 <?php
    1404                 /* translators: %s: the User Display Name */
    1405                 printf( __( "%s's Sites", 'buddypress' ), bp_get_displayed_user_fullname() );
    1406                 ?>
    1407             </a>
    1408         </li>
    1409         <li<?php if ( bp_is_current_action( 'recent-posts' ) ) : ?> class="current"<?php endif; ?>>
    1410             <a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/recent-posts'    ); ?>">
    1411                 <?php
    1412                 /* translators: %s: the User Display Name */
    1413                 printf( __( "%s's Recent Posts", 'buddypress' ), bp_get_displayed_user_fullname() );
    1414                 ?>
    1415             </a>
    1416         </li>
    1417         <li<?php if ( bp_is_current_action( 'recent-comments' ) ) : ?> class="current"<?php endif; ?>>
    1418             <a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/recent-comments' ); ?>">
    1419                 <?php
    1420                 /* translators: %s: the User Display Name */
    1421                 printf( __( "%s's Recent Comments", 'buddypress' ), bp_get_displayed_user_fullname() );
    1422                 ?>
    1423             </a>
    1424         </li>
    1425     </ul>
    1426 
    1427 <?php
    1428 
    1429     /**
    1430      * Fires after the markup for the navigation tabs for a user Blogs page.
    1431      *
    1432      * @since 1.0.0
    1433      */
    1434     do_action( 'bp_blogs_blog_tabs' );
    1435 }
    1436 
    1437 /**
    14381389 * Output the blog directory search form.
     1390 *
     1391 * @since 1.9.0
    14391392 */
    14401393function bp_directory_blogs_search_form() {
Note: See TracChangeset for help on using the changeset viewer.