Changeset 5080
- Timestamp:
- 08/31/2011 07:09:52 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-template.php
r5072 r5080 861 861 862 862 /** 863 * Echoes the output of bp_get_forum_topic_new_reply_link() 864 * 865 * @package BuddyPress 866 * @since 1.5 867 */ 868 function bp_forum_topic_new_reply_link() { 869 echo bp_get_forum_topic_new_reply_link(); 870 } 871 /** 872 * Returns the permalink for the New Reply button at the top of forum topics 873 * 874 * @package BuddyPress 875 * @since 1.5 876 * 877 * @uses apply_filters() Filter bp_get_forum_topic_new_reply_link to modify 878 * @return str The URL for the New Reply link 879 */ 880 function bp_get_forum_topic_new_reply_link() { 881 global $topic_template; 882 883 if ( $topic_template->pag->total_pages == $topic_template->pag_page ) { 884 // If we are on the last page, no need for a URL base 885 $link = ''; 886 } else { 887 // Create a link to the last page for the topic 888 $link = add_query_arg( array( 889 'topic_page' => $topic_template->pag->total_pages, 890 'num' => $topic_template->pag_num 891 ), bp_get_the_topic_permalink() ); 892 } 893 894 // Tack on the #post-topic-reply anchor before returning 895 return apply_filters( 'bp_get_forum_topic_new_reply_link', $link . '#post-topic-reply', $link ); 896 } 897 898 /** 863 899 * Echoes the output of bp_get_forums_tag_name() 864 900 * -
trunk/bp-themes/bp-default/groups/single/forum/topic.php
r5079 r5080 8 8 <ul> 9 9 <li> 10 <a href=" #post-topic-reply" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ) ?></a>10 <a href="<?php bp_forum_topic_new_reply_link() ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ) ?></a> 11 11 </li> 12 12
Note: See TracChangeset
for help on using the changeset viewer.