PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 1.3.1
Forumax – AI Powered Advanced Community Forum Plugin v1.3.1
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 1.3.1, at includes/hooks/actions.php

40 lines 1.0 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', 'bbpc_resolved_topics', 10, 2 );
4
5 // functions
6 function bbpc_resolved_topics( $content = '', $topic_id = 0 ) {
7
8 if ( bbpc_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\bbp_solved_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"><i class="icon_check_alt"></i> ' . esc_html__( 'Resolved', 'ama-core' ) . '</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 }