Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/09/2015 11:34:12 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Replace all references to bp_get_root_domain() . '/' . bp_get_groups_root_slug() with the appropriate bp_get_groups_directory_permalink() function. This ensures all usages and filters are applied uniformly. See #4954 for the long-game here.

File:
1 edited

Legend:

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

    r9383 r9466  
    10091009
    10101010        // Currently this will only work with group forums, extended support in the future
    1011         if ( bp_is_active( 'groups' ) )
    1012             $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_the_topic_object_slug() . '/forum' );
    1013         else
     1011        if ( bp_is_active( 'groups' ) ) {
     1012            $permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_get_the_topic_object_slug() . '/forum' );
     1013        } else {
    10141014            $permalink = '';
     1015        }
    10151016
    10161017        /**
     
    14261427     */
    14271428    function bp_get_the_topic_permalink() {
    1428         global $forum_template, $bp;
     1429        global $forum_template;
    14291430
    14301431        // The topic is in a loop where its parent object is loaded
    14311432        if ( bp_get_the_topic_object_slug() ) {
    1432             $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_the_topic_object_slug() . '/forum' );
     1433            $permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_get_the_topic_object_slug() . '/forum' );
    14331434
    14341435        // We are viewing a single group topic, so use the current item
    14351436        } elseif ( bp_is_group_forum_topic() ) {
    1436             $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_current_item() . '/forum' );
     1437            $permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_current_item() . '/forum' );
    14371438
    14381439        // We are unsure what the context is, so fallback to forum root slug
     
    27122713     */
    27132714    function bp_get_forum_permalink( $forum_id = 0 ) {
    2714         global $bp;
    27152715
    27162716        if ( bp_is_groups_component() ) {
    2717             $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_current_item() . '/forum' );
     2717            $permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_current_item() . '/forum' );
    27182718        } else {
    27192719            if ( empty( $forum_id ) ) {
Note: See TracChangeset for help on using the changeset viewer.