bpbbpst_template_notices

Displays template notices when needed.

Description

(string) bpbbpst_template_notices(); 

Returns (string)

html output


Usage

  1. if ( !function_exists( 'bpbbpst_template_notices' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddy-bbpress-support-topic/includes/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bpbbpst_template_notices(); 
  7.  

Defined (1)

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

/includes/functions.php  
  1. function bpbbpst_template_notices() { 
  2. $notices = array(); 
  3.  
  4. if ( bbp_is_single_forum() && ! bbp_is_topic_edit() ) { 
  5. $forum_id = bbp_get_forum_id(); 
  6.  
  7. if ( 2 === (int) bpbbpst_get_forum_support_setting( $forum_id ) ) { 
  8. $intro = bpbbpst_get_forum_support_topic_intro( $forum_id ); 
  9.  
  10. if ( ! empty( $intro ) ) { 
  11. $notices[] = sprintf( '<div class="bbp-template-notice topic-intro"><p>%s</p></div>', nl2br( $intro ) ); 
  12.  
  13. if ( ! empty( $notices ) ) { 
  14. echo join( "\n", $notices );