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/shortcodes/grid_shortcode.php +13 -2 2.02.4.0 View file →
@@ -26,12 +26,15 @@
26 26 $dynamic_rules = array();
27 27 if( count( $options ) > 0 && WPUltimatePostGrid::is_premium_active() ) {
28 28
29 29 if( isset( $options['post_id'] ) ) {
30 + $post_ids = str_replace( ',', ';', $options['post_id'] );
31 + $post_ids = str_replace( 'current_post', get_the_ID(), $post_ids );
32 +
30 33 $dynamic_rules[] = array(
31 34 'post_type' => 'wpupg_general',
32 35 'taxonomy' => 'id',
33 - 'values' => explode( ';', str_replace( ',', ';', $options['post_id'] ) ),
36 + 'values' => explode( ';', $post_ids ),
34 37 'type' => 'restrict',
35 38 );
36 39 unset( $options['post_id'] );
37 40 }
@@ -36,12 +39,15 @@
36 39 unset( $options['post_id'] );
37 40 }
38 41
39 42 if( isset( $options['exclude_post_id'] ) ) {
43 + $post_ids = str_replace( ',', ';', $options['exclude_post_id'] );
44 + $post_ids = str_replace( 'current_post', get_the_ID(), $post_ids );
45 +
40 46 $dynamic_rules[] = array(
41 47 'post_type' => 'wpupg_general',
42 48 'taxonomy' => 'id',
43 - 'values' => explode( ';', str_replace( ',', ';', $options['exclude_post_id'] ) ),
49 + 'values' => explode( ';', $post_ids ),
44 50 'type' => 'exclude',
45 51 );
46 52 unset( $options['exclude_post_id'] );
47 53 }
@@ -70,8 +76,13 @@
70 76 $posts .= $grid->draw_posts();
71 77 $posts .= '</div>';
72 78
73 79 $output = apply_filters( 'wpupg_posts_shortcode', $posts, $grid );
80 +
81 + // Message when no items match filter
82 + if( $grid->empty_message() ) {
83 + $output .= '<div id="wpupg-grid-' . esc_attr( $slug ) . '-empty" class="wpupg-grid-empty">' . $grid->empty_message() . '</div>';
84 + }
74 85
75 86 $pagination = '';
76 87 if( $grid->pagination_type() == 'pages' ) {
77 88 $pagination_type = $grid->pagination_type();