bbp_get_reply_title_fallback

Get empty reply title fallback.

Description

(string) bbp_get_reply_title_fallback( (string) $post_title = '', (int) $post_id = 0 ); 

Returns (string)

Title of reply

Parameters (2)

0. $post_title — Optional. (string) => ''
Required. Reply Title
1. $post_id — Optional. (int)
Required. Reply ID

Usage

  1. if ( !function_exists( 'bbp_get_reply_title_fallback' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/replies/template.php'; 
  3.  
  4. // Required. Reply Title 
  5. $post_title = ''; 
  6.  
  7. // Required. Reply ID 
  8. $post_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bbp_get_reply_title_fallback($post_title, $post_id); 
  12.  

Defined (1)

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

/includes/replies/template.php  
  1. function bbp_get_reply_title_fallback( $post_title = '', $post_id = 0 ) { 
  2.  
  3. // Bail if title not empty, or post is not a reply 
  4. if ( ! empty( $post_title ) || ! bbp_is_reply( $post_id ) ) { 
  5. return $post_title; 
  6.  
  7. // Get reply topic title. 
  8. $topic_title = bbp_get_reply_topic_title( $post_id ); 
  9.  
  10. // Get empty reply title fallback. 
  11. $reply_title = sprintf( __( 'Reply To: %s', bbpress ), $topic_title ); 
  12.  
  13. return apply_filters( 'bbp_get_reply_title_fallback', $reply_title, $post_id, $topic_title );