PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 1.2.2
Forumax – AI Powered Advanced Community Forum Plugin v1.2.2
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 / admin / Assets.php

Assets.php in Forumax – AI Powered Advanced Community Forum Plugin 1.2.2, at includes/admin/Assets.php

71 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Admin;
3
4 /**
5 * Class Assets
6 * @package BBPCorePro\Admin
7 */
8 class Assets {
9 /**
10 * Assets constructor.
11 */
12 public function __construct() {
13 add_action('admin_enqueue_scripts', [$this, 'admin_scripts'], 999);
14 }
15
16 public function admin_scripts() {
17
18 wp_register_style( 'bbpc-admin', BBPC_ASSETS . 'css/bbpc-admin.css' );
19 wp_register_style( 'sweetalert', BBPC_ASSETS . '/css/sweetalert.css' );
20
21 wp_register_script( 'sweetalert', BBPC_ASSETS . 'js/sweetalert.min.js', [ 'jquery' ], '1.0', true );
22 wp_register_script( 'bbpc-notify-review', BBPC_ASSETS . 'admin/js/review.js', array( 'jquery' ), BBPC_VERSION, true );
23
24 if ( bbpc_admin_pages('admin') ) {
25 wp_enqueue_style( 'bbpc-admin' );
26 wp_enqueue_style( 'normalize', BBPC_ASSETS . 'css/normalize.css' );
27 wp_enqueue_style( 'nice-select', BBPC_ASSETS . 'css/nice-select.css' );
28 wp_enqueue_style( 'jquery-ui', BBPC_ASSETS . 'css/admin-ui-style.css' );
29 wp_enqueue_style( 'sweetalert' );
30
31 // Scripts.
32 wp_enqueue_script( 'modernizr', BBPC_ASSETS . 'js/modernizr-3.11.2.min.js', [ 'jquery' ], '3.11.2', true );
33 wp_enqueue_script( 'jquery-ui', BBPC_ASSETS . 'js/jquery-ui.js', [ 'jquery' ], '1.12.1', true );
34 wp_enqueue_script( 'mixitup', BBPC_ASSETS . 'js/mixitup.min.js', [ 'jquery' ], '3.3.1', true );
35 wp_enqueue_script( 'mixitup-multifilter', BBPC_ASSETS . 'js/mixitup-multifilter.js', [ 'jquery' ], '3.3.1', true );
36 wp_enqueue_script( 'jquery-nice-select', BBPC_ASSETS . 'js/jquery.nice-select.min.js', [ 'jquery' ], '1.0', true );
37 wp_enqueue_script( 'tabby-polyfills', BBPC_ASSETS . 'js/tabby.polyfills.min.js', [ 'jquery' ], '1.0', true );
38 wp_enqueue_script( 'sortable', BBPC_ASSETS . 'js/Sortable.min.js', [ 'jquery' ], '1.0', true );
39 wp_enqueue_script( 'accordion', BBPC_ASSETS . 'js/accordion.min.js', [ 'jquery' ], '1.0', true );
40 wp_enqueue_script( 'bbpc-admin-main', BBPC_ASSETS . 'js/admin-main.js', [ 'jquery' ], '1.0', true );
41 wp_enqueue_script( 'sweetalert' );
42 }
43
44 if ( bbpc_admin_pages('settings') ) {
45 wp_enqueue_style( 'bbpc-admin' );
46 wp_enqueue_style( 'sweetalert' );
47 wp_enqueue_script( 'sweetalert' );
48 wp_enqueue_script( 'bbpc-admin-global', BBPC_ASSETS . 'js/admin-global.js', BBPC_VERSION );
49 }
50
51 // Localize the script with new data
52 $ajax_url = admin_url('admin-ajax.php');
53 $wpml_current_language = apply_filters('wpml_current_language', null);
54
55 if ( !empty($wpml_current_language) ) {
56 $ajax_url = add_query_arg('wpml_lang', $wpml_current_language, $ajax_url);
57 }
58
59 wp_localize_script( 'jquery', 'bbp_core_local_object', [
60 'ajaxurl' => $ajax_url,
61 'create_forum_title' => esc_html__( 'Enter Forum Title', 'bbp-core' ),
62 'create_topic_title' => esc_html__( 'Enter Topic Title', 'bbp-core' ),
63 'forum_delete_title' => esc_html__( 'Are you sure to delete?', 'bbp-core' ),
64 'forum_delete_desc' => esc_html__( "This forum will be deleted with all the topics and you won't be able to revert!", 'bbp-core' ),
65 'topic_delete_desc' => esc_html__( "This topic will be deleted and you won't be able to revert!", 'bbp-core' ),
66 'BBPC_ASSETS' => BBPC_ASSETS,
67 'nonce' => wp_create_nonce('bbpc-admin-nonce')
68 ]
69 );
70 }
71 }