PluginProbe
WPB Addons for Elementor – News Ticker, Timeline, Team & More Widgets / 1.2
WPB Addons for Elementor – News Ticker, Timeline, Team & More Widgets v1.2
trunk 1.0.8.7 1.0.8.8 1.0.8.9 1.0.9 1.2 1.3 1.4 1.5 1.6 1.7
wpb-elementor-addons / inc / wpb_scripts.php

wpb_scripts.php in WPB Addons for Elementor – News Ticker, Timeline, Team & More Widgets 1.2, at inc/wpb_scripts.php

116 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin: WPB Elementor Addons
4 *
5 * Author: WpBean
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 /**
13 * Front End Scripts
14 */
15 function wpb_ea_register_scripts() {
16
17 $load_line_icons = apply_filters( 'wpb_ea_load_line_icons', 'on' );
18
19 wp_enqueue_style( 'wpb-ea-bootstrap-grid', plugins_url( '../assets/css/grid.min.css', __FILE__ ), '', '4.0.0', false );
20 wp_enqueue_style( 'wpb-ea-owl-carousel', plugins_url( '../assets/css/owl.carousel.css', __FILE__ ), '', '2.3.4', false );
21 wp_enqueue_style( 'fancybox', plugins_url( '../assets/css/jquery.fancybox.min.css', __FILE__ ), '', '3.0.47', false );
22 if ( $load_line_icons == 'on' ) {
23 wp_enqueue_style( 'wpb-lineicons-css', plugins_url( '../assets/icons/lineicons/lineicons.min.css', __FILE__ ), '', '1.0', false );
24 }
25 wp_enqueue_style( 'wpb_ea_main_css', plugins_url( '../assets/css/main.css', __FILE__ ), '', '1.0', false );
26 if ( is_rtl() ) {
27 wp_enqueue_style( 'wpb-ea-rtl', plugins_url( '../assets/css/wpb-ea-rtl.css', __FILE__ ), '', '1.0', false );
28 }
29 }
30
31 add_action( 'wp_enqueue_scripts', 'wpb_ea_register_scripts' );
32
33 /**
34 * Admin Scripts
35 */
36 function wpb_ea_register_admin_scripts() {
37
38 wp_register_style( 'wpb-ea-settings', plugins_url( '../admin/assets/css/settings.css', __FILE__ ), '', '1.0', false );
39
40 $screen = get_current_screen();
41
42 if ( is_object( $screen ) ) {
43 if ( $screen->base == 'toplevel_page_wpb-ea-about' || $screen->base == 'wpb-ea-addons_page_wpb_ea_settings' || $screen->base == 'wpb-ea-addons_page_wpb_woo_ea_settings' ) {
44 wp_enqueue_style( 'wpb-ea-settings' );
45 }
46 }
47 }
48
49 add_action( 'admin_enqueue_scripts', 'wpb_ea_register_admin_scripts' );
50
51
52 /**
53 * Register CSS for Elementor frontend
54 */
55
56 add_action(
57 'elementor/frontend/after_register_styles',
58 function () {
59 wp_register_style( 'breaking-news-ticker-css', plugins_url( '../assets/css/breaking-news-ticker.css', __FILE__ ), '', '1.0', false );
60 }
61 );
62
63 /**
64 * Enqueing CSS file for Elementor live preview
65 */
66 add_action(
67 'elementor/preview/enqueue_styles',
68 function () {
69 wp_enqueue_style( 'breaking-news-ticker-css' );
70 }
71 );
72
73 /**
74 * Register scripts for Elementor.
75 */
76 add_action( 'elementor/frontend/after_register_scripts', 'wpb_ea_elementor_widget_scripts_register' );
77
78 function wpb_ea_elementor_widget_scripts_register() {
79 wp_register_script( 'wpb-ea-counterup', plugins_url( '../assets/js/jquery.counterup.min.js', __FILE__ ), array( 'jquery' ), '1.0', true );
80 wp_register_script( 'wpb-ea-waypoints', plugins_url( '../assets/js/waypoints.min.js', __FILE__ ), array( 'jquery' ), '1.6.2', true );
81 wp_register_script( 'wpb-ea-owl-carousel', plugins_url( '../assets/js/owl.carousel.min.js', __FILE__ ), array( 'jquery' ), '2.3.4', true );
82 wp_register_script( 'isotope', plugins_url( '../assets/js/isotope.pkgd.js', __FILE__ ), array( 'jquery' ), '3.0.1', true );
83 wp_register_script( 'fancybox', plugins_url( '../assets/js/jquery.fancybox.min.js', __FILE__ ), array( 'jquery' ), '3.0.47', true );
84 wp_register_script( 'breaking-news-ticker', plugins_url( '../assets/js/breaking-news-ticker.min.js', __FILE__ ), array( 'jquery' ), '1.0', true );
85 wp_register_script( 'wpb-ea-super-js', plugins_url( '../assets/js/super.js', __FILE__ ), array( 'jquery' ), '1.0', true );
86 }
87
88 /**
89 * Add custom CSS
90 */
91 if ( ! function_exists( 'wpb_ea_add_inline_styles' ) ) {
92
93 function wpb_ea_add_inline_styles() {
94
95 $wpb_ea_primary_color = wpb_ea_get_option( 'wpb_ea_primary_color', 'wpb_ea_style', '#3878ff' );
96
97 $custom_css = '';
98
99 $custom_css .= "
100 .wpb-ea-team-member .social-buttons,
101 .wpb-ea-service-box-image .wpb-ea-service-box-btn:hover {
102 background: {$wpb_ea_primary_color};
103 }
104 .wpb-ea-service-box-icon .wpb-ea-service-box-btn:hover {
105 color: {$wpb_ea_primary_color};
106 }
107 .wpb-ea-service-box-image .wpb-ea-service-box-btn:hover {
108 border-color: {$wpb_ea_primary_color};
109 }
110 ";
111
112 wp_add_inline_style( 'wpb_ea_main_css', $custom_css );
113 }
114 }
115 add_action( 'wp_enqueue_scripts', 'wpb_ea_add_inline_styles' );
116