PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.0
Forumax – AI Powered Advanced Community Forum Plugin v2.5.0
2.5.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 All 30 releases
← All changes | widgets/widgets.php +30 -28 2.0.0 → 2.5.0 View file →
@@ -1,28 +1,30 @@
1 -<?php
2 -// Require widget files
3 -require plugin_dir_path(__FILE__) . '/forum-info/Forum_Information.php';
4 -require plugin_dir_path(__FILE__) . '/Forumax_Topic_Info.php';
5 -
6 -// Compatibility: Load docy-core Forums widget if it wasn't loaded
7 -// docy-core loads before forumax (alphabetically) so bbPress wasn't available when it checked
8 -add_action( 'widgets_init', function() {
9 - if ( class_exists( 'Docy_core' ) && ! class_exists( 'DocyCore\WpWidgets\Forums' ) ) {
10 - $docy_forums_widget = WP_PLUGIN_DIR . '/docy-core/wp-widgets/Forums_widget.php';
11 - if ( file_exists( $docy_forums_widget ) ) {
12 - require_once $docy_forums_widget;
13 - }
14 - }
15 -}, 5 );
16 -
17 -// Register Widgets
18 -add_action( 'widgets_init', function() {
19 - register_widget( 'Forumax\WpWidgets\Forumax_Forum_Information');
20 - register_widget( 'Forumax\WpWidgets\Forumax_Topic_Info');
21 -
22 - add_action('admin_enqueue_scripts', function($hook){
23 - if ( $hook === 'widgets.php' ) {
24 - wp_enqueue_style( 'forumax-wp-widget', FORUMAX_ASSETS . 'admin/css/wp-widget.css' );
25 - }
26 - });
27 -});
28 -
1 +<?php
2 +// Require widget files
3 +require plugin_dir_path(__FILE__) . '/forum-info/Forum_Information.php';
4 +require plugin_dir_path(__FILE__) . '/Forumax_Topic_Info.php';
5 +require plugin_dir_path(__FILE__) . '/Forumax_Forums_List.php';
6 +require plugin_dir_path(__FILE__) . '/Forumax_Active_Members.php';
7 +
8 +// Register Widgets
9 +add_action( 'widgets_init', function() {
10 +
11 + // Register only Forumax-specific widgets
12 + register_widget( 'Forumax\WpWidgets\Forumax_Forum_Information');
13 + register_widget( 'Forumax\WpWidgets\Forumax_Topic_Info');
14 + register_widget( 'Forumax\WpWidgets\Forumax_Active_Members');
15 +
16 +
17 + if ( class_exists('bbPress') ) {
18 + unregister_widget( 'BBP_Forums_Widget' );
19 +
20 + register_widget( 'Forumax\WpWidgets\Forumax_Forums_List');
21 + }
22 +
23 + // Enqueue widget styles
24 + add_action('admin_enqueue_scripts', function($hook){
25 + if ( $hook === 'widgets.php' ) {
26 + wp_enqueue_style( 'forumax-wp-widget', FORUMAX_ASSETS . 'admin/css/wp-widget.css' );
27 + }
28 + });
29 +}, 11 ); // Priority 20
30 +