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

37 lines 930 B
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 ( empty( $topic_id ) ) {
9 $topic_id = bbp_get_topic_id( $topic_id );
10 }
11
12 $open = '';
13 $close = '';
14 $resolved = '';
15 $has_best_answer = '';
16
17 $obj = features\bbp_solved_topic();
18
19 if ( $obj->is_solved( $topic_id ) || $obj->has_best_answer( $topic_id ) ) {
20 $open = '<div class="solved-topic-bar">';
21 $close = '</div>';
22 }
23
24 if ( $obj->is_solved( $topic_id ) ) {
25 $resolved = '<span class="accepted-ans-mark"><i class="icon_check_alt"></i> ' . esc_html__( 'Resolved', 'ama-core' ) . '</span>';
26 }
27
28 $content = $content . $open . $resolved . $has_best_answer . $close;
29
30 $allowed_html = [
31 'div' => [ 'class' => [] ],
32 'span' => [ 'class' => [] ],
33 'i' => [ 'class' => [] ],
34 ];
35
36 echo wp_kses( $content, $allowed_html );
37 }