PluginProbe
WP Ultimate Post Grid / 2.4.0
WP Ultimate Post Grid v2.4.0
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
← All changes | helpers/assets.php +28 -2 1.82.4.0 View file →
@@ -45,9 +45,9 @@
45 45 'file' => '/css/' . $base_layout,
46 46 'public' => true
47 47 ),
48 48 array(
49 - 'name' => 'isotope',
49 + 'name' => 'isotopewpupg',
50 50 'file' => '/vendor/isotope/isotope.pkgd.min.js',
51 51 'public' => true,
52 52 'deps' => array(
53 53 'jquery',
@@ -66,9 +66,9 @@
66 66 'name' => 'wpupg_grid',
67 67 'public' => true,
68 68 'deps' => array(
69 69 'jquery',
70 - 'isotope',
70 + 'isotopewpupg',
71 71 'imagesloaded',
72 72 ),
73 73 'data' => array(
74 74 'name' => 'wpupg_public',
@@ -73,10 +73,14 @@
73 73 'data' => array(
74 74 'name' => 'wpupg_public',
75 75 'ajax_url' => WPUltimatePostGrid::get()->helper('ajax')->url(),
76 76 'animationSpeed' => WPUltimatePostGrid::option( 'grid_animation_speed', '0.8' ) . 's',
77 + 'animationShow' => $this->animation_string_to_array( WPUltimatePostGrid::option( 'grid_animation_show', 'opacity: 1' ) ),
78 + 'animationHide' => $this->animation_string_to_array( WPUltimatePostGrid::option( 'grid_animation_hide', 'opacity: 0' ) ),
77 79 'nonce' => wp_create_nonce( 'wpupg_grid' ),
78 80 'rtl' => is_rtl(),
81 + 'dropdown_hide_search' => WPUltimatePostGrid::option( 'filters_dropdown_hide_search', '0' ) == '1' ? true : false,
82 + 'link_class' => WPUltimatePostGrid::option( 'grid_links_class', '' ),
79 83 ),
80 84 )
81 85 );
82 86 }
@@ -81,8 +85,21 @@
81 85 );
82 86 }
83 87 }
84 88
89 + private function animation_string_to_array( $string )
90 + {
91 + $array = array();
92 +
93 + $options = explode( ', ', $string );
94 + foreach( $options as $option ) {
95 + list( $k, $v ) = explode( ': ', $option );
96 + $array[$k] = $v;
97 + }
98 +
99 + return $array;
100 + }
101 +
85 102 public function default_admin_assets()
86 103 {
87 104 $this->add(
88 105 array(
@@ -135,8 +152,13 @@
135 152 'admin' => true,
136 153 'deps' => array(
137 154 'jquery',
138 155 ),
156 + 'data' => array(
157 + 'name' => 'wpupg_admin_post',
158 + 'text_add_grid_image' => __( 'Add Grid Image', 'wp-ultimate-post-grid' ),
159 + 'text_remove_grid_image' => __( 'Remove Grid Image', 'wp-ultimate-post-grid' ),
160 + ),
139 161 ),
140 162 array(
141 163 'file' => '/js/admin_form.js',
142 164 'admin' => true,
@@ -258,8 +280,12 @@
258 280 $js_to_enqueue[] = $asset;
259 281 break;
260 282 }
261 283 }
284 +
285 + // Hooks for assets
286 + $css_to_enqueue = apply_filters( 'wpupg_assets_css', $css_to_enqueue );
287 + $js_to_enqueue = apply_filters( 'wpupg_assets_js', $js_to_enqueue );
262 288
263 289 // We've got the assets we need, enqueue them
264 290 if( count( $css_to_enqueue ) > 0 ) $this->enqueue_css( $css_to_enqueue );
265 291 if( count( $js_to_enqueue ) > 0 ) $this->enqueue_js( $js_to_enqueue );