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 | js/grid.js +316 -68 1.5 → 2.4.0 View file →
@@ -6,17 +6,17 @@
6 6 var grid_id = container.data('grid');
7 7
8 8 var args = {
9 9 itemSelector: '.wpupg-item',
10 - transitionDuration: '0.8s',
11 - hiddenStyle: {
12 - opacity: 0
13 - },
14 - visibleStyle: {
15 - opacity: 1
16 - }
10 + transitionDuration: wpupg_public.animationSpeed,
11 + hiddenStyle: wpupg_public.animationHide,
12 + visibleStyle: wpupg_public.animationShow
17 13 };
18 14
15 + if(wpupg_public.rtl) {
16 + args.isOriginLeft = false;
17 + }
18 +
19 19 var layout_mode = container.data('layout-mode');
20 20 if(layout_mode) {
21 21 args.layoutMode = layout_mode;
22 22 }
@@ -26,65 +26,190 @@
26 26 isFitWidth: true
27 27 };
28 28 }
29 29
30 - container.isotope(args);
30 + container.isotopewpupg(args);
31 31
32 32 container.imagesLoaded( function() {
33 - container.isotope('layout');
33 + container.isotopewpupg('layout');
34 34 });
35 35
36 36 WPUltimatePostGrid.grids[grid_id] = {
37 + args: args,
37 38 container: container,
38 39 centered: container.data('centered'),
40 + data: window['wpupg_grid_' + container.data('grid-id')],
41 + id: container.data('grid-id'),
39 42 pages: [0],
40 43 page: 0,
41 - filters: {}
44 + filter: '',
45 + filters: {},
46 + filter_text: false,
47 + filter_text_search: '',
48 + filter_text_posts: []
42 49 };
43 50
44 51 WPUltimatePostGrid.checkLinks(grid_id);
52 + WPUltimatePostGrid.updatePosts(grid_id);
53 +
54 + jQuery(container).on('hover', '.wpupg-item', function(e) {
55 + var hovering = e.type == 'mouseenter';
56 + WPUltimatePostGrid.hoverGridItem(jQuery(this), hovering);
57 + });
58 +
59 + // Check for empty grid
60 + container.on('arrangeComplete', function() {
61 + WPUltimatePostGrid.checkEmpty(container);
62 + });
45 63 };
46 64
65 +WPUltimatePostGrid.hoverGridItem = function(grid_item, hovering) {
66 + if(hovering) {
67 + grid_item.addClass('wpupg-hovering');
68 +
69 + grid_item.find('.wpupg-show-on-hover').each(function() {
70 + var item = jQuery(this),
71 + effect = item.data('hover-in'),
72 + duration = parseInt(item.data('hover-in-duration'));
73 +
74 + if(effect == 'fade') {
75 + item.fadeIn(duration);
76 + } else if(effect == 'slide') {
77 + item.slideDown(duration);
78 + } else {
79 + item.show();
80 + }
81 + });
82 +
83 + grid_item.find('.wpupg-hide-on-hover').each(function() {
84 + var item = jQuery(this),
85 + effect = item.data('hover-out'),
86 + duration = parseInt(item.data('hover-out-duration'));
87 +
88 + if(effect == 'fade') {
89 + item.fadeOut(duration);
90 + } else if(effect == 'slide') {
91 + item.slideUp(duration);
92 + } else {
93 + item.hide();
94 + }
95 + });
96 + } else {
97 + grid_item.removeClass('wpupg-hovering');
98 +
99 + grid_item.find('.wpupg-show-on-hover').each(function() {
100 + var item = jQuery(this),
101 + effect = item.data('hover-out'),
102 + duration = parseInt(item.data('hover-out-duration'));
103 +
104 + if(effect == 'fade') {
105 + item.fadeOut(duration);
106 + } else if(effect == 'slide') {
107 + item.slideUp(duration);
108 + } else {
109 + item.hide();
110 + }
111 + });
112 +
113 + grid_item.find('.wpupg-hide-on-hover').each(function() {
114 + var item = jQuery(this),
115 + effect = item.data('hover-in'),
116 + duration = parseInt(item.data('hover-in-duration'));
117 +
118 + if(effect == 'fade') {
119 + item.fadeIn(duration);
120 + } else if(effect == 'slide') {
121 + item.slideDown(duration);
122 + } else {
123 + item.show();
124 + }
125 + });
126 + }
127 +};
128 +
129 +WPUltimatePostGrid.updatePosts = function(grid_id) {
130 + var grid = WPUltimatePostGrid.grids[grid_id];
131 +
132 + var posts = [];
133 +
134 + grid.container.find('.wpupg-item').each(function() {
135 + var post_id = jQuery(this).data('id');
136 + posts.push(post_id);
137 + });
138 +
139 + WPUltimatePostGrid.grids[grid_id].posts = posts;
140 +};
141 +
47 142 WPUltimatePostGrid.filterGrid = function(grid_id) {
48 143 var grid = WPUltimatePostGrid.grids[grid_id];
49 144 var filters = [];
50 145
51 - // Page filter
52 - if(grid.pagination_type != 'load_more') {
53 - var page = grid.page || 0;
54 - filters.push(['.wpupg-page-' + page]);
55 - }
146 + if(grid.filter_text) {
147 + grid.filter = '';
148 + var posts = [];
56 149
57 - // Taxonomy filters
58 - for(var taxonomy in grid.filters) {
59 - if(grid.filters.hasOwnProperty(taxonomy)) {
60 - var taxonomy_filters = grid.filters[taxonomy];
150 + for(var i=0; i < grid.filter_text_posts.length; i++) {
151 + posts.push('#wpupg-container-post-' + grid.filter_text_posts[i]);
152 + posts.push('#wpurp-container-recipe-' + grid.filter_text_posts[i]);
153 + }
61 154
62 - var match_one_filters = [];
63 - var match_all_filter = '';
155 + if(posts.length == 0) {
156 + posts.push('no-result');
157 + }
64 158
65 - if(taxonomy_filters) {
66 - for(var i = 0; i < taxonomy_filters.length; i++) {
67 - if(grid.multiselect_type == 'match_one') {
68 - match_one_filters.push('.wpupg-tax-' + taxonomy + '-' + taxonomy_filters[i]);
69 - } else {
70 - match_all_filter += '.wpupg-tax-' + taxonomy + '-' + taxonomy_filters[i];
159 + WPUltimatePostGrid.getFilterString(grid_id, '', [posts], 0);
160 + } else {
161 + // Page filter
162 + if(grid.pagination_type == 'pages') {
163 + var page = grid.page || 0;
164 + filters.push(['.wpupg-page-' + page]);
165 + }
166 +
167 + // Taxonomy filters
168 + for(var taxonomy in grid.filters) {
169 + if(grid.filters.hasOwnProperty(taxonomy)) {
170 + var taxonomy_filters = grid.filters[taxonomy];
171 +
172 + var match_one_filters = [];
173 + var match_all_filter = '';
174 + var filter = '';
175 +
176 + if(taxonomy_filters) {
177 + for(var i = 0; i < taxonomy_filters.length; i++) {
178 + filter = '.wpupg-tax-' + taxonomy + '-' + taxonomy_filters[i];
179 +
180 + if(grid.multiselect_type == 'match_one') {
181 + match_one_filters.push(filter);
182 + } else {
183 + match_all_filter += filter;
184 + }
71 185 }
72 186 }
187 +
188 + if(grid.multiselect_type == 'match_one') {
189 + if(match_one_filters.length > 0) filters.push(match_one_filters);
190 + } else {
191 + if(match_all_filter !== '') filters.push([match_all_filter]);
192 + }
73 193 }
194 + }
74 195
75 - if(grid.multiselect_type == 'match_one') {
76 - if(match_one_filters.length > 0) filters.push(match_one_filters);
196 + grid.filter = '';
197 + WPUltimatePostGrid.getFilterString(grid_id, '', filters, 0);
198 + if(grid.inverse) {
199 + if(grid.pagination_type == 'pages') {
200 + var page = grid.page || 0;
201 + var filter_without_page = grid.filter.replace('.wpupg-page-' + page, '');
202 +
203 + grid.filter = '.wpupg-page-' + page + ':not(' + filter_without_page + ')';
77 204 } else {
78 - if(match_all_filter !== '') filters.push([match_all_filter]);
205 + grid.filter = ':not(' + grid.filter + ')';
79 206 }
80 207 }
81 208 }
82 209
83 - grid.filter = '';
84 - WPUltimatePostGrid.getFilterString(grid_id, '', filters, 0);
85 -
86 - grid.container.isotope({ filter: grid.filter });
210 + jQuery('#wpupg-grid-' + grid_id + '-empty').hide();
211 + grid.container.isotopewpupg({ filter: grid.filter });
87 212 grid.container.trigger('wpupgFiltered');
88 213 WPUltimatePostGrid.updateDeeplink();
89 214 };
90 215
@@ -98,8 +223,18 @@
98 223 }
99 224 }
100 225 };
101 226
227 +WPUltimatePostGrid.checkEmpty = function(container) {
228 + var grid_id = container.data('grid'),
229 + filter = WPUltimatePostGrid.grids[grid_id].filter,
230 + visible_items = container.find(filter);
231 +
232 + if(filter !== '' && visible_items.length == 0) {
233 + jQuery('#wpupg-grid-' + grid_id + '-empty').slideDown(300);
234 + }
235 +};
236 +
102 237 WPUltimatePostGrid.updateDeeplink = function() {
103 238 var link = '';
104 239
105 240 for(var grid_id in WPUltimatePostGrid.grids) {
@@ -106,18 +241,23 @@
106 241 if(WPUltimatePostGrid.grids.hasOwnProperty(grid_id)) {
107 242 var grid = WPUltimatePostGrid.grids[grid_id];
108 243 var grid_link = '';
109 244
110 - // Page filter
111 - if(grid.page != 0) grid_link += '|p:' + (grid.page+1);
112 245
113 - // Taxonomy filters
114 - for(var taxonomy in grid.filters) {
115 - if(grid.filters.hasOwnProperty(taxonomy)) {
116 - var taxonomy_filter = grid.filters[taxonomy];
246 + if(grid.filter_text) {
247 + grid_link += '+s:' + grid.filter_text_search;
248 + } else {
249 + // Page filter
250 + if(grid.page != 0) grid_link += '+p:' + (grid.page+1);
117 251
118 - if(taxonomy_filter.length > 0) {
119 - grid_link += '|' + taxonomy + ':' + taxonomy_filter.join(',');
252 + // Taxonomy filters
253 + for(var taxonomy in grid.filters) {
254 + if(grid.filters.hasOwnProperty(taxonomy)) {
255 + var taxonomy_filter = grid.filters[taxonomy];
256 +
257 + if(taxonomy_filter.length > 0) {
258 + grid_link += '+' + taxonomy + ':' + taxonomy_filter.join(',');
259 + }
120 260 }
121 261 }
122 262 }
123 263
@@ -128,27 +268,90 @@
128 268 }
129 269 }
130 270 }
131 271
132 - if(link == '') link = '*';
133 - document.location.hash = link;
272 + WPUltimatePostGrid.replaceDeeplink(link);
134 273 };
135 274
275 +/**
276 + * Source: http://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-with-javascript-without-page-refresh/5298684#5298684
277 + */
278 +WPUltimatePostGrid.replaceDeeplink = function(link) {
279 + var scrollV, scrollH, loc = window.location;
280 + if ("replaceState" in history) {
281 + var hash = link == '' ? '' : '#' + link;
282 + history.replaceState("", document.title, loc.pathname + hash + loc.search);
283 + } else {
284 + // Prevent scrolling by storing the page's current scroll offset
285 + scrollV = document.documentElement.scrollTop || document.body.scrollTop;
286 + scrollH = document.documentElement.scrollLeft || document.body.scrollLeft;
287 +
288 + loc.hash = link;
289 +
290 + // Restore the scroll offset, should be flicker free
291 + document.documentElement.scrollTop = document.body.scrollTop = scrollV;
292 + document.documentElement.scrollLeft = document.body.scrollLeft = scrollH;
293 + }
294 +};
295 +
296 +WPUltimatePostGrid.preFilterGrid = function() {
297 + var link = document.location.hash;
298 + link = link.substr(1);
299 +
300 + if(!link) {
301 + var link = '';
302 +
303 + for(var grid_id in WPUltimatePostGrid.grids) {
304 + if(WPUltimatePostGrid.grids.hasOwnProperty(grid_id)) {
305 + var grid = WPUltimatePostGrid.grids[grid_id];
306 + var grid_link = '';
307 +
308 + if(grid.filter_data) {
309 + var pre_filter = grid.filter_data['pre_filter'];
310 +
311 + // Taxonomy filters
312 + for(var taxonomy in pre_filter) {
313 + if(pre_filter.hasOwnProperty(taxonomy)) {
314 + var taxonomy_filter = pre_filter[taxonomy];
315 +
316 + if(taxonomy_filter.length > 0) {
317 + grid_link += '+' + taxonomy + ':' + taxonomy_filter.join(',');
318 + }
319 + }
320 + }
321 + }
322 +
323 + if(grid_link != '') {
324 + if(link != '') link += '#';
325 + link += grid_id;
326 + link += grid_link;
327 + }
328 + }
329 + }
330 +
331 + WPUltimatePostGrid.replaceDeeplink(link);
332 + }
333 +};
334 +
136 335 WPUltimatePostGrid.restoreDeeplink = function() {
137 336 var link = document.location.hash;
138 337 link = link.substr(1);
139 338
140 - if(link && link != '*') {
339 + if(link) {
141 340 // Make sure characters are not URL encoded
142 341 link = link.replace('%23', '#');
143 342 link = link.replace('%7C', '|');
343 + link = link.replace('%2B', '+');
144 344 link = link.replace('%3A', ':');
145 345 link = link.replace('%2C', ',');
146 346
347 + // Backwards compatibility
348 + link = link.replace('|', '+');
349 +
147 350 var grids = link.split('#');
148 351
149 352 for(var i=0; i < grids.length; i++) {
150 - var parts = grids[i].split('|');
353 + var parts = grids[i].split('+');
151 354 var grid_id = parts[0];
152 355
153 356 for(var j=1; j < parts.length; j++) {
154 357 var filter = parts[j].split(':');
@@ -155,11 +358,13 @@
155 358
156 359 if(filter[0] == 'p') {
157 360 var page = parseInt(filter[1]) - 1;
158 361 WPUltimatePostGrid.updatePagination(jQuery('#wpupg-grid-' + grid_id + '-pagination'), page);
362 + } else if(filter[0] == 's') {
363 + WPUltimatePostGrid.updateFilter(jQuery('#wpupg-grid-' + grid_id + '-filter'), filter[0], 'text', filter[1]);
159 364 } else {
160 365 var terms = filter[1].split(',');
161 - WPUltimatePostGrid.updateFilter(jQuery('#wpupg-grid-' + grid_id + '-filter'), filter[0], terms);
366 + WPUltimatePostGrid.updateFilter(jQuery('#wpupg-grid-' + grid_id + '-filter'), filter[0], 'terms', terms);
162 367 }
163 368 }
164 369 }
165 370 }
@@ -166,16 +371,18 @@
166 371 };
167 372
168 373 WPUltimatePostGrid.checkLinks = function(grid_id) {
169 374 var grid = WPUltimatePostGrid.grids[grid_id];
170 - var link_type = grid.container.data('link-type');
375 + var default_link_type = grid.container.data('link-type');
376 + var link_target = grid.container.data('link-target');
377 + var link_rel = link_target == 'post' ? '' : ' rel="lightbox"';
171 378
172 - if(link_type != 'none') {
379 + if(default_link_type != 'none') {
173 380 grid.container.find('.wpupg-item').each(function() {
174 381 var item = jQuery(this);
175 382
176 383 // Remove links from item
177 - item.find('a:not(.wpupg-keep-link, .wpurp-recipe-favorite, .wpurp-recipe-add-to-shopping-list, .wpurp-recipe-print-button, .wpurp-recipe-grid-link)').each(function() {
384 + item.find('a:not(.wpupg-keep-link, .wpurp-recipe-favorite, .wpurp-recipe-add-to-shopping-list, .wpurp-recipe-add-to-meal-plan, .wpurp-recipe-print-button, .wpurp-recipe-grid-link)').each(function() {
178 385 var link = jQuery(this);
179 386 if(link.parents('.sharrre').length == 0) {
180 387 link.replaceWith(function() { return link.contents(); });
181 388 }
@@ -180,25 +387,30 @@
180 387 link.replaceWith(function() { return link.contents(); });
181 388 }
182 389 });
183 390
391 + var link = item.data('custom-link') ? item.data('custom-link') : ( link_target == 'post' ? item.data('permalink') : item.data('image') );
392 + var link_behaviour = item.data('custom-link-behaviour');
393 +
394 + var link_type = link_behaviour == '_blank' || link_behaviour == '_self' ? link_behaviour : default_link_type;
395 +
184 396 // Add link around item
185 - if (item.parent('a').length == 0) {
186 - item.wrap('<a href="' + item.data('permalink') + '" target="' + link_type + '"></a>');
397 + if (link_behaviour !== 'none' && link && item.parent('a').length == 0) {
398 + item.wrap('<a href="' + link + '" target="' + link_type + '"' + link_rel + ' class="' + wpupg_public.link_class + '"></a>');
187 399 }
188 400 });
189 401 }
190 402 };
191 403
192 -WPUltimatePostGrid.updateFilter = function(container, taxonomy, terms) {
193 - var type = container.data('type');
194 - var func = 'updateFilter' + type.charAt(0).toUpperCase() + type.slice(1);
404 +WPUltimatePostGrid.updateFilter = function(container, taxonomy, type, terms) {
405 + var filter_type = container.data('type');
406 + var func = 'updateFilter' + filter_type.charAt(0).toUpperCase() + filter_type.slice(1);
195 407 if(typeof WPUltimatePostGrid[func] == 'function') {
196 - WPUltimatePostGrid[func](container, taxonomy, terms);
408 + WPUltimatePostGrid[func](container, taxonomy, type, terms);
197 409 }
198 410 };
199 411
200 -WPUltimatePostGrid.updateFilterIsotope = function(container, taxonomy, terms) {
412 +WPUltimatePostGrid.updateFilterIsotope = function(container, taxonomy, type, terms) {
201 413 for(var i = 0; i < terms.length; i++) {
202 414 container.find('.wpupg-filter-tag-' + terms[i]).click();
203 415 }
204 416 };
@@ -207,8 +419,9 @@
207 419 var grid_id = container.data('grid');
208 420
209 421 WPUltimatePostGrid.grids[grid_id].multiselect = container.data('multiselect');
210 422 WPUltimatePostGrid.grids[grid_id].multiselect_type = container.data('multiselect-type');
423 + WPUltimatePostGrid.grids[grid_id].inverse = container.data('inverse');
211 424
212 425 container.find('.wpupg-filter-isotope-term').click(function() {
213 426 var filter_item = jQuery(this);
214 427 var taxonomy = filter_item.data('taxonomy');
@@ -267,9 +480,9 @@
267 480
268 481 var filter_type = container.data('filter-type');
269 482 var filter_items = container.find('.wpupg-filter-item');
270 483
271 - if(filter_type == 'isotope') {
484 + if(filter_type == 'isotope' || filter_type == 'text_isotope') {
272 485 var margin = container.data('margin-vertical') + 'px ' + container.data('margin-horizontal') + 'px';
273 486 var padding = container.data('padding-vertical') + 'px ' + container.data('padding-horizontal') + 'px';
274 487 var border = container.data('border-width') + 'px solid ' + container.data('border-color');
275 488 var background_color = container.data('background-color');
@@ -325,11 +538,14 @@
325 538 };
326 539
327 540 WPUltimatePostGrid.updatePagination = function(container, page) {
328 541 var type = container.data('type');
329 - var func = 'updatePagination' + type.charAt(0).toUpperCase() + type.slice(1);
330 - if(typeof WPUltimatePostGrid[func] == 'function') {
331 - WPUltimatePostGrid[func](container, page);
542 +
543 + if(type) {
544 + var func = 'updatePagination' + type.charAt(0).toUpperCase() + type.slice(1);
545 + if(typeof WPUltimatePostGrid[func] == 'function') {
546 + WPUltimatePostGrid[func](container, page);
547 + }
332 548 }
333 549 };
334 550
335 551 WPUltimatePostGrid.updatePaginationPages = function(container, page) {
@@ -344,8 +560,10 @@
344 560 pagination_item.siblings('.wpupg-pagination-term').removeClass('active').trigger('checkActiveFilter');
345 561
346 562 var page = parseInt(pagination_item.addClass('active').trigger('checkActiveFilter').data('page'));
347 563
564 + WPUltimatePostGrid.scrollTo(WPUltimatePostGrid.grids[grid_id].container);
565 +
348 566 if(WPUltimatePostGrid.grids[grid_id].pages.indexOf(page) !== -1) {
349 567 WPUltimatePostGrid.grids[grid_id].page = page;
350 568 WPUltimatePostGrid.filterGrid(grid_id);
351 569 } else {
@@ -362,21 +580,17 @@
362 580
363 581 // Get recipes through AJAX
364 582 jQuery.post(wpupg_public.ajax_url, data, function(html) {
365 583 var posts = jQuery(html).toArray();
366 - WPUltimatePostGrid.grids[grid_id].container.isotope('insert', posts);
584 +
367 585 WPUltimatePostGrid.grids[grid_id].page = page;
368 - WPUltimatePostGrid.filterGrid(grid_id);
369 - WPUltimatePostGrid.checkLinks(grid_id);
586 + WPUltimatePostGrid.insertPosts(grid_id, posts);
370 587
371 - WPUltimatePostGrid.grids[grid_id].container.imagesLoaded( function() {
372 - WPUltimatePostGrid.grids[grid_id].container.isotope('layout');
373 - });
374 -
375 588 pagination_item.removeClass('wpupg-spinner');
376 589 pagination_item.css('color', WPUltimatePostGrid.grids[grid_id].pagination_style.active_text_color);
377 590
378 591 WPUltimatePostGrid.grids[grid_id].pages.push(page);
592 + WPUltimatePostGrid.updatePosts(grid_id);
379 593 });
380 594 }
381 595 });
382 596
@@ -449,8 +663,40 @@
449 663 }).trigger('checkActiveFilter');
450 664 });
451 665 };
452 666
667 +WPUltimatePostGrid.insertPosts = function(grid_id, posts) {
668 + var scrollV = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
669 + scrollH = document.documentElement.scrollLeft || document.body.scrollLeft;
670 +
671 + WPUltimatePostGrid.grids[grid_id].container.isotopewpupg('destroy');
672 +
673 + WPUltimatePostGrid.grids[grid_id].container.append(posts);
674 + WPUltimatePostGrid.grids[grid_id].container.isotopewpupg(WPUltimatePostGrid.grids[grid_id].args);
675 +
676 + // Restore the scroll offset, should be flicker free
677 + jQuery(window).scrollTop(scrollV);
678 + document.documentElement.scrollLeft = document.body.scrollLeft = scrollH;
679 +
680 + WPUltimatePostGrid.updatePosts(grid_id);
681 + WPUltimatePostGrid.checkLinks(grid_id);
682 + WPUltimatePostGrid.filterGrid(grid_id);
683 +
684 + WPUltimatePostGrid.grids[grid_id].container.imagesLoaded( function() {
685 + WPUltimatePostGrid.grids[grid_id].container.isotopewpupg('layout');
686 + WPUltimatePostGrid.grids[grid_id].loading = false;
687 + });
688 +};
689 +
690 +WPUltimatePostGrid.scrollTo = function(target) {
691 + var scroll_to = target.offset().top - 50;
692 + scroll_to = scroll_to < 0 ? 0 : scroll_to;
693 +
694 + jQuery('html,body').animate({
695 + scrollTop: scroll_to
696 + }, 500);
697 +};
698 +
453 699 jQuery(document).ready(function($) {
454 700 $('.wpupg-grid').each(function() {
455 701 WPUltimatePostGrid.initGrid($(this));
456 702 });
@@ -460,8 +706,9 @@
460 706 var grid_id = container.data('grid');
461 707 var type = container.data('type');
462 708
463 709 WPUltimatePostGrid.grids[grid_id].filter_type = type;
710 + WPUltimatePostGrid.grids[grid_id].filter_data = window['wpupg_filter_' + WPUltimatePostGrid.grids[grid_id].id];
464 711
465 712 var func = 'initFilter' + type.charAt(0).toUpperCase() + type.slice(1);
466 713 if(typeof WPUltimatePostGrid[func] == 'function') {
467 714 WPUltimatePostGrid[func](container);
@@ -479,6 +726,7 @@
479 726 if(typeof WPUltimatePostGrid[func] == 'function') {
480 727 WPUltimatePostGrid[func](container);
481 728 }
482 729 });
730 + WPUltimatePostGrid.preFilterGrid();
483 731 WPUltimatePostGrid.restoreDeeplink();
484 732 });