Changeset 4010 for trunk/bp-forums/bp-forums-template.php
- Timestamp:
- 02/02/2011 07:37:25 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-forums/bp-forums-template.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-template.php
r3983 r4010 335 335 336 336 $defaults = array( 337 'type' => 'thumb',338 'width' => false,337 'type' => 'thumb', 338 'width' => false, 339 339 'height' => false, 340 'alt' => __( 'Profile picture of %s', 'buddypress' )340 'alt' => __( 'Profile picture of %s', 'buddypress' ) 341 341 ); 342 342 … … 376 376 global $forum_template; 377 377 378 return apply_filters( 'bp_get_the_topic_object_name', $forum_template->topic->object_name ); 378 if ( isset( $forum_template->topic->object_name ) ) 379 $retval = $forum_template->topic->object_name; 380 else 381 $retval = ''; 382 383 return apply_filters( 'bp_get_the_topic_object_name', $retval ); 379 384 } 380 385 … … 394 399 global $bp, $forum_template; 395 400 396 /* Currently this will only work with group forums, extended support in the future */ 397 return apply_filters( 'bp_get_the_topic_object_permalink', bp_get_root_domain() . '/' . $bp->groups->root_slug . '/' . $forum_template->topic->object_slug . '/forum/' ); 401 // Currently this will only work with group forums, extended support in the future 402 if ( bp_is_active( 'groups' ) ) 403 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $forum_template->topic->object_slug . '/forum/' ); 404 else 405 $permalink = ''; 406 407 return apply_filters( 'bp_get_the_topic_object_permalink', $permalink ); 398 408 } 399 409 … … 416 426 global $forum_template; 417 427 428 if ( !isset( $forum_template->topic->object_id ) ) 429 return false; 430 418 431 $defaults = array( 419 'type' => 'thumb',420 'width' => false,432 'type' => 'thumb', 433 'width' => false, 421 434 'height' => false, 422 'alt' => __( 'Group logo for %s', 'buddypress' )435 'alt' => __( 'Group logo for %s', 'buddypress' ) 423 436 ); 424 437 … … 547 560 global $forum_template, $bp; 548 561 549 if ( !empty( $forum_template->topic->object_slug ) )550 $permalink = trailingslashit( bp_get_root_domain() . '/' . $bp->groups->root_slug . '/' . $forum_template->topic->object_slug);551 else if ( !empty( $bp->is_single_item) )552 $permalink = trailingslashit( bp_get_root_domain() . '/' . $bp->current_component. '/' . bp_current_item() );562 if ( bp_is_active( 'groups' ) && !empty( $forum_template->topic->object_slug ) ) 563 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $forum_template->topic->object_slug . '/forum' ); 564 else if ( bp_is_single_item() ) 565 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . bp_current_item() ); 553 566 else 554 $permalink = trailingslashit( bp_get_root_domain() . '/' . $bp->current_component. '/' . $bp->current_action );555 556 return apply_filters( 'bp_get_the_topic_permalink', trailingslashit( $permalink . ' forum/topic/' . $forum_template->topic->topic_slug ) );567 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . $bp->current_action ); 568 569 return apply_filters( 'bp_get_the_topic_permalink', trailingslashit( $permalink . 'topic/' . $forum_template->topic->topic_slug ) ); 557 570 } 558 571
Note: See TracChangeset
for help on using the changeset viewer.