bpbbpst_after_reply_form_subscription

Displays a checkbox on the Reply form to mark to support topic as resolved.

Description

(string) bpbbpst_after_reply_form_subscription(); 

Returns (string)

html output


Usage

  1. if ( !function_exists( 'bpbbpst_after_reply_form_subscription' ) ) { 
  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_after_reply_form_subscription(); 
  7.  

Defined (1)

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

/includes/functions.php  
  1. function bpbbpst_after_reply_form_subscription() { 
  2. $topic_id = bbp_get_topic_id(); 
  3. if ( empty( $topic_id ) ) { 
  4. return; 
  5.  
  6. $forum_id = bbp_get_forum_id(); 
  7. if ( empty( $forum_id ) ) { 
  8. $forum_id = get_post_field( 'post_parent', $topic_id ); 
  9.  
  10. // Not a support only forum, do not output 
  11. if ( 2 !== (int) bpbbpst_get_forum_support_setting( $forum_id ) ) { 
  12. return; 
  13.  
  14. // Topic resolved, do not output 
  15. if ( 2 === (int) get_post_meta( $topic_id, '_bpbbpst_support_topic', true ) ) { 
  16. return; 
  17.  
  18. // Output the Checkbox 
  19. ?> 
  20. <input name="_bpbbpst_support_topic_cb" id="bpbbpst_support_topic_cb" type="checkbox" value="1"/> 
  21. <label for="bpbbpst_support_topic_cb"><?php esc_html_e( 'Mark this support topic as resolved', 'buddy-bbpress-support-topic' ); ?></label> 
  22. <?php