Skip to:
Content

BuddyPress.org

Changeset 9467


Ignore:
Timestamp:
02/10/2015 12:12:52 AM (5 years ago)
Author:
johnjamesjacoby
Message:

Replace all references to bp_get_root_domain() . '/' . bp_get_members_root_slug() with bp_get_members_directory_permalink(), ensuring all usages and filters are applied uniformly. See #4954.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-catchuri.php

    r9428 r9467  
    649649        // the members directory to avoid redirect loops
    650650        } elseif ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) {
    651             $bp->canonical_stack['canonical_url'] = apply_filters( 'bp_loggedin_register_page_redirect_to', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) );
     651            $bp->canonical_stack['canonical_url'] = apply_filters( 'bp_loggedin_register_page_redirect_to', bp_get_members_directory_permalink() );
    652652        }
    653653    }
  • trunk/src/bp-core/deprecated/2.1.php

    r9466 r9467  
    340340        <a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>
    341341        <ul class="random-list">
    342             <li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '?random-member' ?>" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
     342            <li><a href="<?php bp_members_directory_permalink(); ?>?random-member" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
    343343
    344344            <?php if ( bp_is_active( 'groups' ) ) : ?>
  • trunk/src/bp-forums/bp-forums-filters.php

    r9383 r9467  
    168168 * Prevents embedded anchor tags.
    169169 *
    170  * @global object $bp Global BuddyPress settings object.
    171  *
    172170 * @param string $content Edited post content.
    173171 * @return string $content Sanitized post content.
    174172 */
    175173function bp_forums_strip_mentions_on_post_edit( $content ) {
    176     global $bp;
    177 
    178     $content = htmlspecialchars_decode( $content );
    179 
    180     $pattern = "|<a href=&#039;" . bp_get_root_domain() . "/" . bp_get_members_root_slug() . "/[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.@]+)</a>|";
    181 
    182     $content = preg_replace( $pattern, "$1", $content );
     174    $content   = htmlspecialchars_decode( $content );
     175    $directory = bp_get_members_directory_permalink();
     176    $pattern   = "|<a href=&#039;{$directory}[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.@]+)</a>|";
     177    $content   = preg_replace( $pattern, "$1", $content );
    183178
    184179    return $content;
    185180}
    186181add_filter( 'bp_get_the_topic_post_edit_text', 'bp_forums_strip_mentions_on_post_edit' );
    187 add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' );
     182add_filter( 'bp_get_the_topic_text',           'bp_forums_strip_mentions_on_post_edit' );
    188183
    189184/** "Replied to" SQL filters *************************************************/
  • trunk/src/bp-forums/bp-forums-template.php

    r9466 r9467  
    10431043        global $forum_template;
    10441044
    1045         $domain = bp_core_get_user_domain( $forum_template->topic->topic_last_poster, $forum_template->topic->topic_last_poster_nicename, $forum_template->topic->topic_last_poster_login ) ;
     1045        $domain = bp_core_get_user_domain( $forum_template->topic->topic_last_poster, $forum_template->topic->topic_last_poster_nicename, $forum_template->topic->topic_last_poster_login );
    10461046
    10471047        // In the case where no user is found, bp_core_get_user_domain() may return the URL
    10481048        // of the Members directory
    1049         if ( !$domain || $domain == bp_core_get_root_domain() . '/' . bp_get_members_root_slug() . '/' )
     1049        if ( empty( $domain ) || ( bp_get_members_directory_permalink() === $domain ) ) {
    10501050            return __( 'Deleted User', 'buddypress' );
     1051        }
    10511052
    10521053        /**
  • trunk/src/bp-members/bp-members-screens.php

    r9401 r9467  
    7575    // If the user is logged in, redirect away from here
    7676    if ( is_user_logged_in() ) {
    77         if ( bp_is_component_front_page( 'register' ) )
    78             $redirect_to = trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() );
    79         else
    80             $redirect_to = bp_get_root_domain();
     77
     78        $redirect_to = bp_is_component_front_page( 'register' )
     79            ? bp_get_members_directory_permalink()
     80            : bp_get_root_domain();
    8181
    8282        /**
     
    306306        // avoid an infinite loop. Otherwise, set to root domain.
    307307        $redirect_to = bp_is_component_front_page( 'activate' )
    308             ? bp_get_root_domain() . '/' . bp_get_members_root_slug()
     308            ? bp_get_members_directory_permalink()
    309309            : bp_get_root_domain();
    310310
  • trunk/src/bp-members/bp-members-widgets.php

    r9351 r9467  
    6464        echo $before_widget;
    6565
    66         $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . $title . '</a>' : $title;
     66        $title = $instance['link_title'] ? '<a href="' . bp_get_members_directory_permalink() . '">' . $title . '</a>' : $title;
    6767
    6868        echo $before_title
Note: See TracChangeset for help on using the changeset viewer.