| @@ -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( |