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/models/grid.php +27 -1 2.32.4.0 View file →
@@ -19,8 +19,9 @@
19 19 'wpupg_filter_type',
20 20 'wpupg_pagination_type',
21 21 'wpupg_post_types',
22 22 'wpupg_layout_mode',
23 + 'wpupg_limit_terms',
23 24 'wpupg_limit_posts',
24 25 'wpupg_limit_posts_number',
25 26 'wpupg_link_target',
26 27 'wpupg_link_type',
@@ -94,8 +95,11 @@
94 95 'alignment' => 'left',
95 96 'all_button_text' => 'Check Constructor',
96 97 'term_order' => 'alphabetical',
97 98 ),
99 + 'text' => array(
100 + 'placeholder_text' => '',
101 + ),
98 102 );
99 103
100 104 public function __construct( $post )
101 105 {
@@ -271,8 +275,24 @@
271 275 $layout_mode = $this->meta( 'wpupg_layout_mode' );
272 276 return $layout_mode ? $layout_mode : 'masonry';
273 277 }
274 278
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 +
275 295 public function limit_posts()
276 296 {
277 297 return $this->meta( 'wpupg_limit_posts' );
278 298 }
@@ -454,9 +474,9 @@
454 474 if( count( $post_ids ) == 0 ) return array();
455 475
456 476 $posts_per_page = -1;
457 477
458 - if( $this->pagination_type() == 'pages' ) {
478 + if( $page !== -2 && $this->pagination_type() == 'pages' ) {
459 479 $pagination = $this->pagination();
460 480 $posts_per_page = $pagination['pages']['posts_per_page'];
461 481 }
462 482
@@ -541,8 +561,14 @@
541 561 'orderby' => $this->terms_order_by(),
542 562 'order' => $this->terms_order(),
543 563 'hide_empty' => $this->terms_hide_empty(),
544 564 );
565 +
566 + if( $this->limit_terms() ) {
567 + $type = $this->limit_terms_type() == 'restrict' ? 'include' : 'exclude';
568 +
569 + $args[$type] = $this->limit_terms_terms();
570 + }
545 571
546 572 if( $this->terms_images_only() ) {
547 573 $args['meta_query'] = array(
548 574 array(