class-media-library-organizer-page-builders.php
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Page Builders class.
*
* @package Media_Library_Organizer
* @author WP Media Library
*/
/**
* Adds Media Category filtering support for Frontend Page Builders
* that might not trigger WordPress standard functions
*
* @since 1.1.4
*/
class Media_Library_Organizer_Page_Builders {
/**
* Holds the base object.
*
* @since 1.1.4
*
* @var object
*/
public $base;
/**
* Constructor
*
* @since 1.1.4
*
* @param object $base Base Plugin Class.
*/
public function __construct( $base ) {
// Store base class.
$this->base = $base;
// Elementor.
add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'register_elementor_scripts_css' ) );
// Thrive Architect.
add_action( 'tcb_hook_template_redirect', array( $this, 'register_thrive_architect_scripts_css' ) );
}
/**
* Elementor: Enqueue CSS and JS when frontend editing as Elementor removes actions hooked
* to admin_enqueue_scripts / wp_enqueue_scripts / wp_enqueue_media
*
* @since 1.1.4
*/
public function register_elementor_scripts_css() {
$this->base->get_class( 'media' )->enqueue_js_css();
}
/**
* Thrive Architect: Enqueue CSS and JS when frontend editing as Thrive Architect removes actions hooked
* to admin_enqueue_scripts / wp_enqueue_scripts / wp_enqueue_media
*
* @since 2.5.8
*/
public function register_thrive_architect_scripts_css() {
$this->base->get_class( 'media' )->enqueue_js_css();
}
}