From 614ae1d45a8c5a6fdae0a3fcb2bfedfdfb32fc1d Mon Sep 17 00:00:00 2001 From: Thuan Bui Date: Fri, 2 Oct 2020 23:16:15 +0700 Subject: [PATCH] Fix no category specified Support when no category specified --- display-posts-shortcode-remote.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display-posts-shortcode-remote.php b/display-posts-shortcode-remote.php index acf2327..70879c6 100644 --- a/display-posts-shortcode-remote.php +++ b/display-posts-shortcode-remote.php @@ -253,7 +253,7 @@ if ( ! class_exists( 'Display_Posts_Remote' ) ) { $url = trailingslashit( $atts['url'] ) . 'wp-json/wp/v2/posts'; $url = add_query_arg( '_embed' , '', $url ); - if ( ! empty( $atts['category_id'] ) ) { + if ( ! empty( $atts['category_id'] ) && ( is_array( $atts['category_id'] ) || false !== filter_var( $atts['category_id'], FILTER_VALIDATE_BOOLEAN ) ) ) { if ( is_array( $atts['category_id'] ) ) {