diff --git a/user-people.php b/user-people.php
index bb536c3..f9456d4 100644
--- a/user-people.php
+++ b/user-people.php
@@ -97,8 +97,6 @@ function createTextCell($setting, $field){
// get all the people
$the_query = new WP_Query( $args );
- //print_r($the_query->posts);
- //echo '
';
// focusing on just the people, not the rest of the query.
$people = $the_query->posts;
@@ -107,27 +105,22 @@ function createTextCell($setting, $field){
foreach($people as $value){
$id = $value->ID;
- //echo '
';
$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 '
';
- //var_dump($args);
foreach($groups_in_use as $value){
- //echo $value;
- //echo '
';
-
// this sets up the query we'll need, and will overwrite any group queries from the original settings.
$tax_query = array();
$group_query = array(
@@ -147,9 +140,7 @@ function createTextCell($setting, $field){
if ($layout == 'table') {
include('inc/people-table.php');
}
-
- //echo '
';
-
+
}
} else {