From: Anthony Talarico Date: Tue, 27 Jun 2017 17:14:19 +0000 (-0400) Subject: fixing the donate form fund search field population X-Git-Tag: v1.0.2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=08be3eb7c05a732c58a1ae6b7fe7ddfb4e425191;p=WP-Themes%2Fphsacf.git fixing the donate form fund search field population needed to add -1 numberposts to the get terms args array when getting the funds list for jquery --- diff --git a/functions.php b/functions.php index 167e677..8346806 100644 --- a/functions.php +++ b/functions.php @@ -146,23 +146,27 @@ add_action('thematic_searchloop', 'mytheme_search_loop'); add_action('init', function(){ function get_funds(){ + $all_funds = []; $custom_terms = get_terms('fund_group'); foreach($custom_terms as $custom_term) { wp_reset_query(); - $args = array('post_type' => 'fund', + $args = array( + 'post_type' => 'fund', + 'numberposts' => -1, 'tax_query' => array( array( 'taxonomy' => 'fund_group', 'field' => 'slug', 'terms' => $custom_term->slug, - ), + 'hide_empty' => false + ), ), ); $loop = get_posts($args); foreach($loop as $l){ $funds_grouped[$custom_term->name][] = $l->post_title; - $all_funds[] = $l->post_title; + $all_funds[]= $l->post_title; } }