bp_get_forum_topic_new_reply_link

Return the permalink for the New Reply button at the top of forum topics.

Description

(string) bp_get_forum_topic_new_reply_link(); 

Returns (string)

The URL for the New Reply link.


Usage

  1. if ( !function_exists( 'bp_get_forum_topic_new_reply_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_forum_topic_new_reply_link(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bp-forums-template.php  
  1. function bp_get_forum_topic_new_reply_link() { 
  2. global $topic_template; 
  3.  
  4. if ( $topic_template->pag->total_pages == $topic_template->pag_page ) { 
  5. // If we are on the last page, no need for a URL base. 
  6. $link = ''; 
  7. } else { 
  8. // Create a link to the last page for the topic. 
  9. $link = add_query_arg( array( 
  10. 'topic_page' => $topic_template->pag->total_pages,  
  11. 'num' => $topic_template->pag_num 
  12.  
  13. /** 
  14. * Filters the permalink for the New Reply button at the top of forum topics. 
  15. * @since 1.5.0 
  16. * @param string $value Permalink for the New Reply button. 
  17. */ 
  18. return apply_filters( 'bp_get_forum_topic_new_reply_link', $link . '#post-topic-reply', $link );