PluginProbe
WP Ultimate Post Grid / 2.0
WP Ultimate Post Grid v2.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/models/grid.php +2 -51 2.4.02.0 View file →
@@ -5,11 +5,9 @@
5 5 private $post;
6 6 private $meta;
7 7 private $fields = array(
8 8 'wpupg_centered',
9 - 'wpupg_empty_message',
10 9 'wpupg_images_only',
11 - 'wpupg_filter_count',
12 10 'wpupg_filter_inverse',
13 11 'wpupg_filter_limit',
14 12 'wpupg_filter_limit_exclude',
15 13 'wpupg_filter_match_parents',
@@ -14,14 +12,12 @@
14 12 'wpupg_filter_limit_exclude',
15 13 'wpupg_filter_match_parents',
16 14 'wpupg_filter_multiselect',
17 15 'wpupg_filter_multiselect_type',
18 - 'wpupg_filter_show_empty',
19 16 'wpupg_filter_type',
20 17 'wpupg_pagination_type',
21 18 'wpupg_post_types',
22 19 'wpupg_layout_mode',
23 - 'wpupg_limit_terms',
24 20 'wpupg_limit_posts',
25 21 'wpupg_limit_posts_number',
26 22 'wpupg_link_target',
27 23 'wpupg_link_type',
@@ -93,13 +89,9 @@
93 89 'padding_vertical' => '5',
94 90 'padding_horizontal' => '10',
95 91 'alignment' => 'left',
96 92 'all_button_text' => 'Check Constructor',
97 - 'term_order' => 'alphabetical',
98 93 ),
99 - 'text' => array(
100 - 'placeholder_text' => '',
101 - ),
102 94 );
103 95
104 96 public function __construct( $post )
105 97 {
@@ -165,13 +157,8 @@
165 157 {
166 158 return $this->meta( 'wpupg_centered' );
167 159 }
168 160
169 - public function empty_message()
170 - {
171 - return $this->meta( 'wpupg_empty_message' );
172 - }
173 -
174 161 public function filter()
175 162 {
176 163 return $this->meta( 'wpupg_filter' );
177 164 }
@@ -200,17 +187,8 @@
200 187 $dropdown_labels = maybe_unserialize( $this->meta( 'wpupg_filter_dropdown_labels' ) );
201 188 return is_array( $dropdown_labels ) ? $dropdown_labels : array();
202 189 }
203 190
204 - public function filter_count()
205 - {
206 - if( WPUltimatePostGrid::is_premium_active() ) {
207 - return $this->meta( 'wpupg_filter_count' );
208 - } else {
209 - return false;
210 - }
211 - }
212 -
213 191 public function filter_inverse()
214 192 {
215 193 return $this->meta( 'wpupg_filter_inverse' );
216 194 }
@@ -249,13 +227,8 @@
249 227 {
250 228 return $this->meta( 'wpupg_filter_multiselect_type' );
251 229 }
252 230
253 - public function filter_show_empty()
254 - {
255 - return $this->meta( 'wpupg_filter_show_empty' );
256 - }
257 -
258 231 public function filter_type()
259 232 {
260 233 return $this->meta( 'wpupg_filter_type' );
261 234 }
@@ -275,24 +248,8 @@
275 248 $layout_mode = $this->meta( 'wpupg_layout_mode' );
276 249 return $layout_mode ? $layout_mode : 'masonry';
277 250 }
278 251
279 - public function limit_terms()
280 - {
281 - return $this->meta( 'wpupg_limit_terms' );
282 - }
283 -
284 - public function limit_terms_terms()
285 - {
286 - $limit_terms_terms = maybe_unserialize( $this->meta( 'wpupg_limit_terms_terms' ) );
287 - return is_array( $limit_terms_terms ) ? $limit_terms_terms : array();
288 - }
289 -
290 - public function limit_terms_type()
291 - {
292 - return $this->meta( 'wpupg_limit_terms_type' );
293 - }
294 -
295 252 public function limit_posts()
296 253 {
297 254 return $this->meta( 'wpupg_limit_posts' );
298 255 }
@@ -474,9 +431,9 @@
474 431 if( count( $post_ids ) == 0 ) return array();
475 432
476 433 $posts_per_page = -1;
477 434
478 - if( $page !== -2 && $this->pagination_type() == 'pages' ) {
435 + if( $this->pagination_type() == 'pages' ) {
479 436 $pagination = $this->pagination();
480 437 $posts_per_page = $pagination['pages']['posts_per_page'];
481 438 }
482 439
@@ -485,9 +442,9 @@
485 442 $offset = $page * $posts_per_page;
486 443 }
487 444
488 445 $args = array(
489 - 'post_type' => $this->post_types(), // "any" doesn't work for private post types.
446 + 'post_type' => 'any',
490 447 'post_status' => 'any',
491 448 'order' => $this->order(),
492 449 'posts_per_page' => $posts_per_page,
493 450 'offset' => $offset,
@@ -561,14 +518,8 @@
561 518 'orderby' => $this->terms_order_by(),
562 519 'order' => $this->terms_order(),
563 520 'hide_empty' => $this->terms_hide_empty(),
564 521 );
565 -
566 - if( $this->limit_terms() ) {
567 - $type = $this->limit_terms_type() == 'restrict' ? 'include' : 'exclude';
568 -
569 - $args[$type] = $this->limit_terms_terms();
570 - }
571 522
572 523 if( $this->terms_images_only() ) {
573 524 $args['meta_query'] = array(
574 525 array(