Changeset 5085
- Timestamp:
- 09/01/2011 03:48:35 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-template.php
r5083 r5085 540 540 } 541 541 function bp_get_the_topic_object_permalink() { 542 global $bp, $forum_template;543 542 544 543 // Currently this will only work with group forums, extended support in the future 545 544 if ( bp_is_active( 'groups' ) ) 546 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $forum_template->topic->object_slug . '/forum/' );545 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_the_topic_object_slug() . '/forum' ); 547 546 else 548 547 $permalink = ''; … … 703 702 global $forum_template, $bp; 704 703 705 if ( bp_is_active( 'groups' ) && !empty( $forum_template->topic->object_slug ) ) 706 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $forum_template->topic->object_slug . '/forum' ); 707 else if ( bp_is_single_item() ) 704 // The topic is in a loop where its parent object is loaded 705 if ( bp_get_the_topic_object_slug() ) { 706 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_the_topic_object_slug() . '/forum' ); 707 708 // We are viewing a single group topic, so use the current item 709 } elseif ( bp_is_group_forum_topic() ) { 710 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_current_item() . '/forum' ); 711 712 // We are unsure what the context is, so fallback to forum root slug 713 } elseif ( bp_is_single_item() ) { 708 714 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . bp_current_item() ); 709 else 715 716 // This is some kind of error situation, so use forum root 717 } else { 710 718 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ); 719 } 711 720 712 721 return apply_filters( 'bp_get_the_topic_permalink', trailingslashit( $permalink . 'topic/' . $forum_template->topic->topic_slug ) );
Note: See TracChangeset
for help on using the changeset viewer.