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/WordPress/ShortcodesServiceProvider.php +8 -0 1.3.21.9.2 View file →
@@ -34,11 +34,17 @@
34 34 */
35 35 public function loadShortcodeAssets() {
36 36 global $post;
37 37
38 + if ( !empty( \Depicter::options()->get( 'always_load_assets', 1 ) ) ) {
39 + \Depicter::front()->assets()->enqueueStyles();
40 + \Depicter::front()->assets()->enqueueScripts();
41 + }
42 +
38 43 if( empty( $post->post_content ) ){
39 44 return;
40 45 }
46 +
41 47 $content = $post->post_content;
42 48
43 49 $shortcodeInfo = Extract::shortcodeAttributes( $content, self::SHORTCODE_NAME, self::SHORTCODE_ATTRS );
44 50
@@ -51,8 +57,9 @@
51 57 // Load custom css files
52 58 foreach( self::SHORTCODE_ATTRS as $documentAttribute ){
53 59 if( ! empty( $shortcodeInfo[ $documentAttribute ][0] ) ){
54 60 \Depicter::front()->assets()->enqueueCustomAssets( $shortcodeInfo[ $documentAttribute ][0] );
61 + \Depicter::front()->assets()->enqueuePreloadTags( $shortcodeInfo[ $documentAttribute ][0] );
55 62 }
56 63 }
57 64 }
58 65
@@ -64,8 +71,9 @@
64 71 preg_match_all( '/wp:depicter\/slider\s+{"id":(\d+)/', $post->post_content, $sliderIDs, PREG_SET_ORDER );
65 72 if ( !empty( $sliderIDs ) ) {
66 73 foreach( $sliderIDs as $sliderID ) {
67 74 \Depicter::front()->assets()->enqueueCustomAssets( $sliderID[1] );
75 + \Depicter::front()->assets()->enqueuePreloadTags( $sliderID[1] );
68 76 }
69 77 }
70 78 }
71 79 }