| @@ -1,17 +1,28 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | // Require widget files |
| 3 | 3 | require plugin_dir_path(__FILE__) . '/forum-info/Forum_Information.php'; |
| 4 | -require plugin_dir_path(__FILE__) . '/Forum_Topic_Info.php';; | |
| 4 | +require plugin_dir_path(__FILE__) . '/Forumax_Topic_Info.php'; | |
| 5 | +require plugin_dir_path(__FILE__) . '/Forumax_Forums_List.php'; | |
| 5 | 6 | |
| 6 | - | |
| 7 | 7 | // Register Widgets |
| 8 | 8 | add_action( 'widgets_init', function() { |
| 9 | - register_widget( 'BBPCore\WpWidgets\Forum_Information'); | |
| 10 | - register_widget( 'BBPCore\WpWidgets\Forum_Topic_Info'); | |
| 11 | 9 | |
| 10 | + // Register only Forumax-specific widgets | |
| 11 | + register_widget( 'Forumax\WpWidgets\Forumax_Forum_Information'); | |
| 12 | + register_widget( 'Forumax\WpWidgets\Forumax_Topic_Info'); | |
| 13 | + | |
| 14 | + | |
| 15 | + if ( class_exists('bbPress') ) { | |
| 16 | + unregister_widget( 'BBP_Forums_Widget' ); | |
| 17 | + | |
| 18 | + register_widget( 'Forumax\WpWidgets\Forumax_Forums_List'); | |
| 19 | + } | |
| 20 | + | |
| 21 | + // Enqueue widget styles | |
| 12 | 22 | add_action('admin_enqueue_scripts', function($hook){ |
| 13 | 23 | if ( $hook === 'widgets.php' ) { |
| 14 | - wp_enqueue_style( 'bbp-core-wp-widget', BBPC_ASSETS . 'admin/css/wp-widget.css' ); | |
| 24 | + wp_enqueue_style( 'forumax-wp-widget', FORUMAX_ASSETS . 'admin/css/wp-widget.css' ); | |
| 15 | 25 | } |
| 16 | 26 | }); |
| 17 | -}); | |
| 27 | +}, 11 ); // Priority 20 | |
| 28 | + | |