PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
← All changes | app/src/Modules/Elementor/Module.php +5 -8 1.3.01.9.2 View file →
@@ -34,12 +34,12 @@
34 34 * load required script for elementor widget in elementor editor env
35 35 */
36 36 public function enqueueWidgetScript() {
37 37 global $post;
38 - if ( !class_exists( '\Elementor\Plugin' ) ) {
38 + if ( !class_exists( '\Elementor\Plugin' ) || empty( $post->ID ) ) {
39 39 return;
40 - }
41 -
40 + }
41 +
42 42 if ( \Elementor\Plugin::$instance->documents->get($post->ID)->is_built_with_elementor() ) {
43 43 $elementor_data = get_post_meta( $post->ID, '_elementor_data', true );
44 44 $elementor_data = is_array( $elementor_data ) ? JSON::encode( $elementor_data ) : $elementor_data;
45 45
@@ -49,13 +49,10 @@
49 49
50 50 preg_match_all( '/slider_id":"(\d+)"/', $elementor_data, $sliderIDs, PREG_SET_ORDER );
51 51 foreach( $sliderIDs as $key => $sliderID ) {
52 52 if ( !empty( $sliderID[1] ) ) {
53 - if ( \Depicter::authorization()->currentUserCan( [ 'manage_options', 'publish_depicter' ] ) ) {
54 - \Depicter::front()->assets()->enqueueCustomGoogleFonts( $sliderID[1] );
55 - } else {
56 - \Depicter::front()->assets()->enqueueCustomStyles( $sliderID[1] );
57 - }
53 + \Depicter::front()->assets()->enqueueCustomAssets( $sliderID[1] );
54 + \Depicter::front()->assets()->enqueuePreloadTags( $sliderID[1] );
58 55 }
59 56 }
60 57 }
61 58 }