PluginProbe
Borderless – Addons and Templates for Elementor / trunk
Borderless – Addons and Templates for Elementor vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / modules / wpbakery / wpbakery.php

wpbakery.php in Borderless – Addons and Templates for Elementor trunk, at modules/wpbakery/wpbakery.php

63 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // don't load directly
4 defined( 'ABSPATH' ) || exit;
5
6 final class Borderless_Wpbakery {
7
8 public function __construct() {
9
10 // We safely integrate with WPBakery with this hook
11 add_action( 'plugins_loaded', [ $this, 'wpbakery_check' ] );
12
13 add_action('admin_enqueue_scripts',array($this,'wpbakery_icon_fonts_styles'));
14
15 }
16
17 // Check if WPBakery is installed
18 public function wpbakery_check() {
19 if ( defined( 'WPB_VC_VERSION' ) ) {
20 add_action( 'init', [ $this, 'wpbakery_init' ] );
21 return;
22 } else {
23 return;
24 }
25 }
26
27 public function wpbakery_init() {
28
29 require_once( BORDERLESS__WPBAKERY . "/lean-map.php");
30 require_once( BORDERLESS__WPBAKERY . "/paramns/icon-manager-param.php" );
31
32 }
33
34 function wpbakery_icon_fonts_styles($hook) {
35
36 // enqueue css files on backend
37 if($hook == "post.php" || $hook == "post-new.php" || $hook == 'visual-composer_page_vc-roles'){
38 if((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || is_ssl()) {
39 $scheme = 'https';
40 }
41 else {
42 $scheme = 'http';
43 }
44 $this->paths = wp_upload_dir();
45 $this->paths['fonts'] = 'borderless_icon_fonts';
46 $this->paths['fonturl'] = set_url_scheme($this->paths['baseurl'].'/'.$this->paths['fonts'], $scheme);
47 $fonts = get_option('borderless_icon_fonts');
48 if(is_array($fonts))
49 {
50 foreach($fonts as $font => $info)
51 {
52 if(strpos($info['style'], 'http://' ) !== false) {
53 wp_enqueue_style('borderless-'.$font,$info['style']);
54 } else {
55 wp_enqueue_style('borderless-'.$font,trailingslashit($this->paths['fonturl']).$info['style']);
56 }
57 }
58 }
59 }
60 }
61
62 }
63 new Borderless_Wpbakery();