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 / Frontend / Assets.php

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

46 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Frontend;
3
4 /**
5 * Class Assets
6 * @package EazyDocs\Admin
7 */
8 class Assets {
9
10 /**
11 * Assets constructor.
12 */
13 public function __construct() {
14 add_action('wp_enqueue_scripts', [$this, 'frontend_scripts'], 999 );
15 }
16
17 /**
18 * Register scripts and styles [ FRONTEND ]
19 */
20 public function frontend_scripts() {
21
22 wp_enqueue_style( 'bbpc-frontend-global', BBPC_ASSETS . 'frontend/css/frontend.css', array(), BBPC_VERSION );
23
24 // Elementor widgets styles
25 wp_enqueue_style( 'bbpc-el-widgets', BBPC_ASSETS . 'css/el-widgets.css', );
26 wp_enqueue_style( 'bbpc-style', BBPC_ASSETS . 'css/custom.css' );
27
28 // Elementor widgets scripts
29 wp_enqueue_script( 'bbpc_js', BBPC_ASSETS . 'js/forumTab.js', ['jquery'], true, true );
30
31 wp_enqueue_script( 'bbpc-frontend-js', BBPC_ASSETS . 'frontend/js/frontend.js', array('jquery'), BBPC_VERSION, true );
32 wp_register_script( 'bbpc-ajax', BBPC_ASSETS . 'js/ajax.js', array('jquery'), BBPC_VERSION, true );
33
34 // localize
35 wp_localize_script( 'bbpc-frontend-js', 'bbpc_localize_script', array(
36 'ajaxurl' => admin_url( 'admin-ajax.php' ),
37 'nonce' => wp_create_nonce( 'bbpc-nonce' ),
38 'bbpc_subscribed_link' => wp_kses_post(bbp_get_forum_subscription_link()),
39 'bbpc_subscribed_forum_title' => bbpc_forum_title(),
40 'bbpc_subscribed_forum_id' => bbp_get_forum_id()
41 ) );
42
43 $dynamic_css = ":root { --bbpc_brand_color: " . bbpc_get_opt('bbpc_brand_color') . "; }";
44 wp_add_inline_style( 'bbpc-frontend-global', $dynamic_css );
45 }
46 }