+ -1,
+ 'post_type' => 'person',
+ 'meta_key' => 'last_name',
+ 'orderby' => 'menu_order meta_value title',
+ 'order' => 'ASC',
+ );
+
+
+
+ // Settings
+
+ $layout = get_field( "layout" );
+ $people_to_display = get_field( "people_to_display" );
+ $break_into_groups = get_field( "break_into_groups" );
+ $specific_people = get_field( "specific_people" );
+ $specific_groups = get_field( "specific_groups" );
+ $specific_tags = get_field( "specific_tags" );
+ $information_to_display = get_field( "information_to_display" );
+
+ function createTextCell($setting, $field){
+ global $information_to_display;
+ if (in_array($setting, $information_to_display)) {
+ echo '';
+ the_field($field);
+ echo ' ';
+ }
+ };
+
+ function sort_group_by_order( $a, $b ){
+ // Getting the order for groups $a and $b
+ $groupA = get_term_by('slug', $a, 'group')->term_id;
+ $array_orderGroupA = get_option( "taxonomy_{$groupA}" );
+ $orderGroupA = $array_orderGroupA['group_order'];
+
+ $groupB = get_term_by('slug', $b, 'group')->term_id;
+ $array_orderGroupB = get_option( "taxonomy_{$groupB}" );
+ $orderGroupB = $array_orderGroupB['group_order'];
+
+ $r = strnatcasecmp( $orderGroupA, $orderGroupB );
+ if( $r === 0 ){
+ $r = strnatcasecmp( $a, $b );
+ }
+ return $r;
+ }
+
+ if ($specific_people){
+ global $specific_people;
+ global $args;
+ $post__in = array();
+ foreach($specific_people as &$value){
+ //array_push($post__in, $value->ID);
+ array_push($post__in, $value);
+ }
+ $args[post__in]= $post__in;
+ }
+
+ // do we need a tax query?
+ if ($specific_groups != false || $specific_tags != false){
+
+ $tax_query = array();
+ $isTagSet = false;
+
+ if ($specific_groups != false) {
+ $group_query = array(
+ 'taxonomy' => 'group',
+ 'field' => 'term_id',
+ 'terms' => $specific_groups
+ );
+ array_push($tax_query, $group_query);
+ }
+ if ($specific_tags != false) {
+ $isTagSet = true;
+ $tag_query = array(
+ 'taxonomy' => 'persontag',
+ 'field' => 'term_id',
+ 'terms' => $specific_tags
+ );
+ array_push($tax_query, $tag_query);
+ }
+ $args[tax_query] = $tax_query;
+
+ }
+ if ($break_into_groups == 1 ){
+ //echo '
+
+
+
+
+