PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.0.0
Forumax – AI Powered Advanced Community Forum Plugin v2.0.0
2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 2.0.0 2.1.0 All 29 releases
bbp-core / includes / hooks / actions.php

actions.php in Forumax – AI Powered Advanced Community Forum Plugin 2.0.0, at includes/hooks/actions.php

42 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Hooks.
3 add_action( 'bbpc-resolved-topics', 'forumax_solve_topic_callback', 10, 2 );
4
5 // functions
6 function forumax_solve_topic_callback( $content = '', $topic_id = 0 ) {
7
8 if ( forumax_get_opt( 'is_solved_topics', true ) ) {
9
10 if ( empty( $topic_id ) ) {
11 $topic_id = bbp_get_topic_id( $topic_id );
12 }
13
14 $open = '';
15 $close = '';
16 $resolved = '';
17 $has_best_answer = '';
18
19 $obj = features\forumax_solve_topic();
20
21 if ( $obj->is_solved( $topic_id ) || $obj->has_best_answer( $topic_id ) ) {
22 $open = '<div class="solved-topic-bar">';
23 $close = '</div>';
24 }
25
26 if ( $obj->is_solved( $topic_id ) ) {
27 $resolved = '<span class="accepted-ans-mark badge"><i class="icon_check_alt"></i> ' . esc_html__( 'Resolved', 'forumax' ) . '</span>';
28 }
29
30 $content = $content . $open . $resolved . $has_best_answer . $close;
31
32 $allowed_html = [
33 'div' => [ 'class' => [] ],
34 'span' => [ 'class' => [] ],
35 'i' => [ 'class' => [] ],
36 ];
37
38 echo wp_kses( $content, $allowed_html );
39 }
40 }
41
42