From f84fc2e5d66f7e7518549d3bda485906191e0c36 Mon Sep 17 00:00:00 2001 From: NickHeurter Date: Thu, 9 Jun 2016 15:06:28 +0200 Subject: [PATCH] Change Query when Meta Key is filled in --- includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index a6e2978..cd4a7e0 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -258,6 +258,11 @@ function rpwe_get_posts( $args = array() ) { if ( ! empty( $args['tag'] ) ) { $query['tag__in'] = $args['tag']; } + + // Limit posts based on meta key. + if ( ! empty( $args['meta_key'] ) ) { + $query['meta_key'] = $args['meta_key']; + } /** * Taxonomy query.