bpbbpst_support_topic_template

Displays a topic template inside the new topic editor if needed.

Description

(string) bpbbpst_support_topic_template( (string) $content = '' ); 

Returns (string)

html output

Parameters (1)

0. $content — Optional. (string) => ''
The content.

Usage

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

Defined (1)

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

/includes/functions.php  
  1. function bpbbpst_support_topic_template( $content = '' ) { 
  2. if ( ! empty( $content ) || ! bbp_is_single_forum() || bbp_is_topic_edit() ) { 
  3. return $content; 
  4.  
  5. $forum_id = bbp_get_forum_id(); 
  6.  
  7. if ( 2 === (int) bpbbpst_get_forum_support_setting( $forum_id ) ) { 
  8. $template = bpbbpst_get_forum_support_topic_template( $forum_id ); 
  9.  
  10. if ( ! empty( $template ) ) { 
  11. $content = $template; 
  12.  
  13. return apply_filters( 'bpbbpst_support_topic_template', $content, $forum_id );