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.