Skip to content

Commit

Permalink
Fixing foreach arguments, removing commented out markup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmbacon committed Aug 19, 2015
1 parent 8228753 commit ee90ba6
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions user-people.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ function createTextCell($setting, $field){
// get all the people
$the_query = new WP_Query( $args );

//print_r($the_query->posts);
//echo '<hr>';
// focusing on just the people, not the rest of the query.
$people = $the_query->posts;

Expand All @@ -107,27 +105,22 @@ function createTextCell($setting, $field){

foreach($people as $value){
$id = $value->ID;
//echo '<br/>';
$terms = get_the_terms($id, 'group');
foreach($terms as $value){
//duplicates will overwrite themselves...
$slug = $value->slug;
$groups_in_use[$slug]= $slug;
}
//var_dump($groups_in_use);
if (is_array($terms)){
foreach($terms as $key => $value){
//duplicates will overwrite themselves...
$slug = $value->slug;
$groups_in_use[$slug]= $slug;
}
};
}

// sort the groups in use alphabetically
sort($groups_in_use);

// for each item in the list of terms, do a new query, but this time we're going to limit it to ONLY items from that one group.
//echo '<hr>';
//var_dump($args);
foreach($groups_in_use as $value){

//echo $value;
//echo '<br/>';

// this sets up the query we'll need, and will overwrite any group queries from the original settings.
$tax_query = array();
$group_query = array(
Expand All @@ -147,9 +140,7 @@ function createTextCell($setting, $field){
if ($layout == 'table') {
include('inc/people-table.php');
}

//echo '<hr>';


}

} else {
Expand Down

0 comments on commit ee90ba6

Please sign in to comment.