Addition of managing officials

Added incorrectly missing includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php
This commit is contained in:
Rob Tucker
2017-06-11 13:13:12 +00:00
parent 72fc479809
commit dc3e152ead
8 changed files with 176 additions and 19 deletions

View File

@@ -114,4 +114,37 @@ endif;
?>
<div class="sp-template sp-template-event-results">
<?php echo $output; ?>
</div>
</div>
<?php
$officials = get_the_terms( $post->ID, 'sp_officials' );
$official_ids = array();
if ( $officials ):
foreach ( $officials as $official ):
$official_ids[] = $official->term_id;
endforeach;
endif;
if(sizeof($official_ids) > 0 ){
?>
<h4 class="sp-table-caption">Umpires</h4>
<div class="sp-template sp-template-event-results">
<?php
$i=0;
echo '<table class="sp-event-results sp-data-table sp-scrollable-table">';
echo '<thead><th class="data-name"></th></thead>';
echo '<tbody>';
foreach($officials as $official) {
echo '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
echo '<td class="data-name">' . $official->name . '</td>';
echo '</tr>';
$i++;
}
echo '</tbody>';
echo '</table>';
?>
</div>
<?php
}
?>
</div>