Add Player Metric (sp_metric) post type and behaviour
This commit is contained in:
@@ -45,7 +45,44 @@
|
||||
);
|
||||
$data = get_posts( $args );
|
||||
?>
|
||||
<h3 class="title"><?php _e( 'Statistics', 'sportspress' ); ?></h3>
|
||||
<h3 class="title"><?php _e( 'Player Statistics', 'sportspress' ); ?></h3>
|
||||
<table class="widefat sp-admin-config-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Key', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Format', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
||||
<td><?php echo $row->post_name; ?></td>
|
||||
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
|
||||
<td>Σ <?php echo $row->post_name; ?></td>
|
||||
<td><?php echo sportspress_get_post_order( $row->ID ); ?></td>
|
||||
</tr>
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Player Statistics', 'sportspress' ) ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_metric',
|
||||
'numberposts' => -1,
|
||||
'posts_per_page' => -1,
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC'
|
||||
);
|
||||
$data = get_posts( $args );
|
||||
?>
|
||||
<h3 class="title"><?php _e( 'Player Metrics', 'sportspress' ); ?></h3>
|
||||
<table class="widefat sp-admin-config-table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -67,7 +104,7 @@
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Statistics', 'sportspress' ) ); ?></a></th>
|
||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_metric' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Player Metrics', 'sportspress' ) ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -96,7 +133,7 @@
|
||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
||||
<td><?php echo $row->post_name; ?></td>
|
||||
<td><?php echo $row->post_name; ?>for / <?php echo $row->post_name; ?>against</td>
|
||||
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
|
||||
<td>—</td>
|
||||
<td>—</td>
|
||||
|
||||
Reference in New Issue
Block a user