| @@ -24,8 +24,29 @@ | ||
| 24 | 24 | |
| 25 | 25 | // Check if we need to filter the grid dynamically |
| 26 | 26 | $dynamic_rules = array(); |
| 27 | 27 | if( count( $options ) > 0 && WPUltimatePostGrid::is_premium_active() ) { |
| 28 | + | |
| 29 | + if( isset( $options['post_id'] ) ) { | |
| 30 | + $dynamic_rules[] = array( | |
| 31 | + 'post_type' => 'wpupg_general', | |
| 32 | + 'taxonomy' => 'id', | |
| 33 | + 'values' => explode( ';', str_replace( ',', ';', $options['post_id'] ) ), | |
| 34 | + 'type' => 'restrict', | |
| 35 | + ); | |
| 36 | + unset( $options['post_id'] ); | |
| 37 | + } | |
| 38 | + | |
| 39 | + if( isset( $options['exclude_post_id'] ) ) { | |
| 40 | + $dynamic_rules[] = array( | |
| 41 | + 'post_type' => 'wpupg_general', | |
| 42 | + 'taxonomy' => 'id', | |
| 43 | + 'values' => explode( ';', str_replace( ',', ';', $options['exclude_post_id'] ) ), | |
| 44 | + 'type' => 'exclude', | |
| 45 | + ); | |
| 46 | + unset( $options['exclude_post_id'] ); | |
| 47 | + } | |
| 48 | + | |
| 28 | 49 | foreach( $options as $taxonomy => $terms ) { |
| 29 | 50 | if( taxonomy_exists( $taxonomy ) ) { |
| 30 | 51 | $dynamic_rules[] = array( |
| 31 | 52 | 'post_type' => 'wpupg_dynamic', |