Add description to config post types

This commit is contained in:
Brian Miyaji
2014-04-24 12:18:04 +10:00
parent 63e1ace191
commit feb870c491
8 changed files with 153 additions and 89 deletions

View File

@@ -101,8 +101,8 @@ class SP_Admin_Meta_Boxes {
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Event_Details::output', 'sp_event', 'side', 'default' ); add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Event_Details::output', 'sp_event', 'side', 'default' );
add_meta_box( 'sp_teamdiv', __( 'Teams', 'sportspress' ), 'SP_Meta_Box_Event_Teams::output', 'sp_event', 'side', 'default' ); add_meta_box( 'sp_teamdiv', __( 'Teams', 'sportspress' ), 'SP_Meta_Box_Event_Teams::output', 'sp_event', 'side', 'default' );
add_meta_box( 'sp_videodiv', __( 'Video', 'sportspress' ), 'SP_Meta_Box_Event_Video::output', 'sp_event', 'side', 'low' ); add_meta_box( 'sp_videodiv', __( 'Video', 'sportspress' ), 'SP_Meta_Box_Event_Video::output', 'sp_event', 'side', 'low' );
add_meta_box( 'sp_resultsdiv', __( 'Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' ); add_meta_box( 'sp_resultsdiv', __( 'Team Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' );
add_meta_box( 'sp_performancediv', __( 'Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' ); add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' );
add_meta_box( 'sp_editordiv', __( 'Article', 'sportspress' ), 'SP_Meta_Box_Event_Editor::output', 'sp_event', 'normal', 'high' ); add_meta_box( 'sp_editordiv', __( 'Article', 'sportspress' ), 'SP_Meta_Box_Event_Editor::output', 'sp_event', 'normal', 'high' );
// Calendars // Calendars
@@ -113,7 +113,7 @@ class SP_Admin_Meta_Boxes {
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Calendar_Editor::output', 'sp_calendar', 'normal', 'high' ); add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Calendar_Editor::output', 'sp_calendar', 'normal', 'high' );
// Teams // Teams
add_meta_box( 'sp_columnssdiv', __( 'Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' ); add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' );
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'high' ); add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'high' );
// Tables // Tables
@@ -124,8 +124,8 @@ class SP_Admin_Meta_Boxes {
// Players // Players
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Player_Details::output', 'sp_player', 'side', 'default' ); add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Player_Details::output', 'sp_player', 'side', 'default' );
add_meta_box( 'sp_metricsdiv', __( 'Metrics', 'sportspress' ), 'SP_Meta_Box_Player_Metrics::output', 'sp_player', 'side', 'default' ); add_meta_box( 'sp_metricsdiv', __( 'Player Metrics', 'sportspress' ), 'SP_Meta_Box_Player_Metrics::output', 'sp_player', 'side', 'default' );
add_meta_box( 'sp_performancediv', __( 'Performance', 'sportspress' ), 'SP_Meta_Box_Player_Performance::output', 'sp_player', 'normal', 'high' ); add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Player_Performance::output', 'sp_player', 'normal', 'high' );
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Player_Editor::output', 'sp_player', 'normal', 'high' ); add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Player_Editor::output', 'sp_player', 'normal', 'high' );
// Lists // Lists

View File

@@ -24,7 +24,7 @@ class SP_Meta_Box_Event_Shortcode {
<?php _e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?> <?php _e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?>
</p> </p>
<p> <p>
<strong><?php _e( 'Results', 'sportspress' ); ?></strong> <strong><?php _e( 'Team Results', 'sportspress' ); ?></strong>
</p> </p>
<p><input type="text" value="[event_results <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p> <p><input type="text" value="[event_results <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p>
<p> <p>
@@ -32,7 +32,7 @@ class SP_Meta_Box_Event_Shortcode {
</p> </p>
<p><input type="text" value="[event_details <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p> <p><input type="text" value="[event_details <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p>
<p> <p>
<strong><?php _e( 'Performance', 'sportspress' ); ?></strong> <strong><?php _e( 'Player Performance', 'sportspress' ); ?></strong>
</p> </p>
<p><input type="text" value="[event_performance <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p> <p><input type="text" value="[event_performance <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p>
<?php <?php

View File

@@ -31,6 +31,7 @@ class SP_Settings_Config extends SP_Settings_Page {
add_action( 'sportspress_admin_field_columns', array( $this, 'columns_setting' ) ); add_action( 'sportspress_admin_field_columns', array( $this, 'columns_setting' ) );
add_action( 'sportspress_admin_field_metrics', array( $this, 'metrics_setting' ) ); add_action( 'sportspress_admin_field_metrics', array( $this, 'metrics_setting' ) );
add_action( 'sportspress_admin_field_performance', array( $this, 'performance_setting' ) ); add_action( 'sportspress_admin_field_performance', array( $this, 'performance_setting' ) );
add_action( 'sportspress_admin_field_statistics', array( $this, 'statistics_setting' ) );
add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
} }
@@ -54,16 +55,16 @@ class SP_Settings_Config extends SP_Settings_Page {
'options' => $sports, 'options' => $sports,
), ),
array( 'type' => 'results' ),
array( 'type' => 'outcomes' ), array( 'type' => 'outcomes' ),
array( 'type' => 'results' ),
array( 'type' => 'performance' ),
array( 'type' => 'columns' ), array( 'type' => 'columns' ),
array( 'type' => 'metrics' ), array( 'type' => 'metrics' ),
array( 'type' => 'performance' ),
array( 'type' => 'statistics' ), array( 'type' => 'statistics' ),
array( 'type' => 'sectionend', 'id' => 'config_options' ), array( 'type' => 'sectionend', 'id' => 'config_options' ),
@@ -87,6 +88,56 @@ class SP_Settings_Config extends SP_Settings_Page {
SP_Admin_Settings::save_fields( $settings ); SP_Admin_Settings::save_fields( $settings );
} }
/**
* Output outcomes settings
*
* @access public
* @return void
*/
public function outcomes_setting() {
$args = array(
'post_type' => 'sp_outcome',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
);
$data = get_posts( $args );
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php _e( 'Event Outcomes', 'sportspress' ) ?>
<p class="description"><?php _e( 'Used for events.' ); ?></p>
</th>
<td class="forminp">
<table class="widefat sp-admin-config-table">
<thead>
<tr>
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
<th scope="col" class="edit"></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 class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td>
</tr>
<?php $i++; endforeach; ?>
</table>
<div class="tablenav bottom">
<div class="alignleft actions">
<a class="button" id="doaction" href="<?php echo admin_url( 'edit.php?post_type=sp_outcome' ); ?>"><?php _e( 'View All', 'sportspress' ); ?></a>
<a class="button" id="doaction2" href="<?php echo admin_url( 'post-new.php?post_type=sp_outcome' ); ?>"><?php _e( 'Add New', 'sportspress' ); ?></a>
</div>
<br class="clear">
</div>
</td>
</tr>
<?php
}
/** /**
* Results settings * Results settings
* *
@@ -106,10 +157,13 @@ class SP_Settings_Config extends SP_Settings_Page {
$data = get_posts( $args ); $data = get_posts( $args );
?> ?>
<tr valign="top"> <tr valign="top">
<th scope="row" class="titledesc"><?php _e( 'Results', 'sportspress' ) ?></th> <th scope="row" class="titledesc">
<?php _e( 'Team Results', 'sportspress' ) ?>
<p class="description"><?php _e( 'Used for events.' ); ?></p>
</th>
<td class="forminp"> <td class="forminp">
<fieldset> <fieldset>
<legend class="screen-reader-text"><span><?php _e( 'Results', 'sportspress' ) ?></span></legend> <legend class="screen-reader-text"><span><?php _e( 'Team Results', 'sportspress' ) ?></span></legend>
<table class="widefat sp-admin-config-table"> <table class="widefat sp-admin-config-table">
<thead> <thead>
<tr> <tr>
@@ -158,23 +212,26 @@ class SP_Settings_Config extends SP_Settings_Page {
} }
/** /**
* Output outcomes settings * Output performance settings
* *
* @access public * @access public
* @return void * @return void
*/ */
public function outcomes_setting() { public function performance_setting() {
$args = array( $args = array(
'post_type' => 'sp_outcome', 'post_type' => 'sp_performance',
'numberposts' => -1, 'numberposts' => -1,
'posts_per_page' => -1, 'posts_per_page' => -1,
'orderby' => 'menu_order', 'orderby' => 'menu_order',
'order' => 'ASC' 'order' => 'ASC'
); );
$data = get_posts( $args ); $data = get_posts( $args );
?> ?>
<tr valign="top"> <tr valign="top">
<th scope="row" class="titledesc"><?php _e( 'Outcomes', 'sportspress' ) ?></th> <th scope="row" class="titledesc">
<?php _e( 'Player Performance', 'sportspress' ) ?>
<p class="description"><?php _e( 'Used for events.' ); ?></p>
</th>
<td class="forminp"> <td class="forminp">
<table class="widefat sp-admin-config-table"> <table class="widefat sp-admin-config-table">
<thead> <thead>
@@ -194,8 +251,8 @@ class SP_Settings_Config extends SP_Settings_Page {
</table> </table>
<div class="tablenav bottom"> <div class="tablenav bottom">
<div class="alignleft actions"> <div class="alignleft actions">
<a class="button" id="doaction" href="<?php echo admin_url( 'edit.php?post_type=sp_outcome' ); ?>"><?php _e( 'View All', 'sportspress' ); ?></a> <a class="button" id="doaction" href="<?php echo admin_url( 'edit.php?post_type=sp_performance' ); ?>"><?php _e( 'View All', 'sportspress' ); ?></a>
<a class="button" id="doaction2" href="<?php echo admin_url( 'post-new.php?post_type=sp_outcome' ); ?>"><?php _e( 'Add New', 'sportspress' ); ?></a> <a class="button" id="doaction2" href="<?php echo admin_url( 'post-new.php?post_type=sp_performance' ); ?>"><?php _e( 'Add New', 'sportspress' ); ?></a>
</div> </div>
<br class="clear"> <br class="clear">
</div> </div>
@@ -221,7 +278,10 @@ class SP_Settings_Config extends SP_Settings_Page {
$data = get_posts( $args ); $data = get_posts( $args );
?> ?>
<tr valign="top"> <tr valign="top">
<th scope="row" class="titledesc"><?php _e( 'Columns', 'sportspress' ) ?></th> <th scope="row" class="titledesc">
<?php _e( 'Table Columns', 'sportspress' ) ?>
<p class="description"><?php _e( 'Used for league tables.' ); ?></p>
</th>
<td class="forminp"> <td class="forminp">
<table class="widefat sp-admin-config-table"> <table class="widefat sp-admin-config-table">
<thead> <thead>
@@ -238,7 +298,7 @@ class SP_Settings_Config extends SP_Settings_Page {
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>> <tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td> <td class="row-title"><?php echo $row->post_title; ?></td>
<td><?php echo $row->post_name; ?></td> <td><?php echo $row->post_name; ?></td>
<td><?php echo sp_get_post_equation( $row->ID, $row->post_name ); ?></td> <td><?php echo sp_get_post_equation( $row->ID ); ?></td>
<td><?php echo sp_get_post_precision( $row->ID ); ?></td> <td><?php echo sp_get_post_precision( $row->ID ); ?></td>
<td><?php echo sp_get_post_order( $row->ID ); ?></td> <td><?php echo sp_get_post_order( $row->ID ); ?></td>
<td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td> <td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td>
@@ -275,14 +335,16 @@ class SP_Settings_Config extends SP_Settings_Page {
$data = get_posts( $args ); $data = get_posts( $args );
?> ?>
<tr valign="top"> <tr valign="top">
<th scope="row" class="titledesc"><?php _e( 'Metrics', 'sportspress' ) ?></th> <th scope="row" class="titledesc">
<?php _e( 'Player Metrics', 'sportspress' ) ?>
<p class="description"><?php _e( 'Used for player lists.' ); ?></p>
</th>
<td class="forminp"> <td class="forminp">
<table class="widefat sp-admin-config-table"> <table class="widefat sp-admin-config-table">
<thead> <thead>
<tr> <tr>
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th> <th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th> <th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
<th scope="col"><?php _e( 'Positions', 'sportspress' ); ?></th>
<th scope="col">&nbsp;</th> <th scope="col">&nbsp;</th>
<th scope="col" class="edit"></th> <th scope="col" class="edit"></th>
</tr> </tr>
@@ -291,7 +353,6 @@ class SP_Settings_Config extends SP_Settings_Page {
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>> <tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td> <td class="row-title"><?php echo $row->post_title; ?></td>
<td><?php echo $row->post_name; ?></td> <td><?php echo $row->post_name; ?></td>
<td><?php echo get_the_terms ( $row->ID, 'sp_position' ) ? the_terms( $row->ID, 'sp_position' ) : '&mdash;'; ?></td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td> <td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td>
</tr> </tr>
@@ -310,14 +371,14 @@ class SP_Settings_Config extends SP_Settings_Page {
} }
/** /**
* Output performance settings * Output statistics settings
* *
* @access public * @access public
* @return void * @return void
*/ */
public function performance_setting() { public function statistics_setting() {
$args = array( $args = array(
'post_type' => 'sp_performance', 'post_type' => 'sp_statistic',
'numberposts' => -1, 'numberposts' => -1,
'posts_per_page' => -1, 'posts_per_page' => -1,
'orderby' => 'menu_order', 'orderby' => 'menu_order',
@@ -326,15 +387,18 @@ class SP_Settings_Config extends SP_Settings_Page {
$data = get_posts( $args ); $data = get_posts( $args );
?> ?>
<tr valign="top"> <tr valign="top">
<th scope="row" class="titledesc"><?php _e( 'Performance', 'sportspress' ) ?></th> <th scope="row" class="titledesc">
<?php _e( 'Player Statistics', 'sportspress' ) ?>
<p class="description"><?php _e( 'Used for player lists.' ); ?></p>
</th>
<td class="forminp"> <td class="forminp">
<table class="widefat sp-admin-config-table"> <table class="widefat sp-admin-config-table">
<thead> <thead>
<tr> <tr>
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th> <th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th> <th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
<th scope="col"><?php _e( 'Positions', 'sportspress' ); ?></th> <th scope="col"><?php _e( 'Equation', 'sportspress' ); ?></th>
<th scope="col"><?php _e( 'Calculate', 'sportspress' ); ?></th> <th scope="col"><?php _e( 'Rounding', 'sportspress' ); ?></th>
<th scope="col" class="edit"></th> <th scope="col" class="edit"></th>
</tr> </tr>
</thead> </thead>
@@ -342,16 +406,16 @@ class SP_Settings_Config extends SP_Settings_Page {
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>> <tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td> <td class="row-title"><?php echo $row->post_title; ?></td>
<td><?php echo $row->post_name; ?></td> <td><?php echo $row->post_name; ?></td>
<td><?php echo get_the_terms ( $row->ID, 'sp_position' ) ? the_terms( $row->ID, 'sp_position' ) : '&mdash;'; ?></td> <td><?php echo sp_get_post_equation( $row->ID ); ?></td>
<td><?php echo sp_get_post_calculate( $row->ID ); ?></td> <td><?php echo sp_get_post_precision( $row->ID ); ?></td>
<td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td> <td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td>
</tr> </tr>
<?php $i++; endforeach; ?> <?php $i++; endforeach; ?>
</table> </table>
<div class="tablenav bottom"> <div class="tablenav bottom">
<div class="alignleft actions"> <div class="alignleft actions">
<a class="button" id="doaction" href="<?php echo admin_url( 'edit.php?post_type=sp_performance' ); ?>"><?php _e( 'View All', 'sportspress' ); ?></a> <a class="button" id="doaction" href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php _e( 'View All', 'sportspress' ); ?></a>
<a class="button" id="doaction2" href="<?php echo admin_url( 'post-new.php?post_type=sp_performance' ); ?>"><?php _e( 'Add New', 'sportspress' ); ?></a> <a class="button" id="doaction2" href="<?php echo admin_url( 'post-new.php?post_type=sp_statistic' ); ?>"><?php _e( 'Add New', 'sportspress' ); ?></a>
</div> </div>
<br class="clear"> <br class="clear">
</div> </div>

View File

@@ -61,7 +61,7 @@ class SP_Settings_Events extends SP_Settings_Page {
), ),
array( array(
'title' => __( 'Performance', 'sportspress' ), 'title' => __( 'Player Performance', 'sportspress' ),
'desc' => __( 'Link players', 'sportspress' ), 'desc' => __( 'Link players', 'sportspress' ),
'id' => 'sportspress_event_link_players', 'id' => 'sportspress_event_link_players',
'default' => 'yes', 'default' => 'yes',

View File

@@ -228,7 +228,7 @@
<td><?php echo get_option( 'sportspress_sport', __( 'None', 'sportspress' ) ); ?></td> <td><?php echo get_option( 'sportspress_sport', __( 'None', 'sportspress' ) ); ?></td>
</tr> </tr>
<tr> <tr>
<td><?php _e( 'Results', 'sportspress' ); ?>:</td> <td><?php _e( 'Team Results', 'sportspress' ); ?>:</td>
<td><?php <td><?php
$display_posts = array(); $display_posts = array();
$posts = get_posts( array( 'post_type' => 'sp_result', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); $posts = get_posts( array( 'post_type' => 'sp_result', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) );
@@ -238,7 +238,7 @@
?></td> ?></td>
</tr> </tr>
<tr> <tr>
<td><?php _e( 'Outcomes', 'sportspress' ); ?>:</td> <td><?php _e( 'Event Outcomes', 'sportspress' ); ?>:</td>
<td><?php <td><?php
$display_posts = array(); $display_posts = array();
$posts = get_posts( array( 'post_type' => 'sp_outcome', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); $posts = get_posts( array( 'post_type' => 'sp_outcome', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) );
@@ -248,7 +248,7 @@
?></td> ?></td>
</tr> </tr>
<tr> <tr>
<td><?php _e( 'Columns', 'sportspress' ); ?>:</td> <td><?php _e( 'Table Columns', 'sportspress' ); ?>:</td>
<td><?php <td><?php
$display_posts = array(); $display_posts = array();
$posts = get_posts( array( 'post_type' => 'sp_column', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); $posts = get_posts( array( 'post_type' => 'sp_column', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) );
@@ -258,7 +258,7 @@
?></td> ?></td>
</tr> </tr>
<tr> <tr>
<td><?php _e( 'Metrics', 'sportspress' ); ?>:</td> <td><?php _e( 'Player Metrics', 'sportspress' ); ?>:</td>
<td><?php <td><?php
$display_posts = array(); $display_posts = array();
$posts = get_posts( array( 'post_type' => 'sp_metric', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); $posts = get_posts( array( 'post_type' => 'sp_metric', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) );
@@ -268,7 +268,7 @@
?></td> ?></td>
</tr> </tr>
<tr> <tr>
<td><?php _e( 'Performance', 'sportspress' ); ?>:</td> <td><?php _e( 'Player Performance', 'sportspress' ); ?>:</td>
<td><?php <td><?php
$display_posts = array(); $display_posts = array();
$posts = get_posts( array( 'post_type' => 'sp_performance', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); $posts = get_posts( array( 'post_type' => 'sp_performance', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) );

View File

@@ -141,7 +141,7 @@ class SP_Post_types {
'hierarchical' => true, 'hierarchical' => true,
'rewrite' => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ), 'rewrite' => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ),
); );
$object_types = array( 'sp_player', 'sp_performance', 'sp_metric' ); $object_types = array( 'sp_player' );
register_taxonomy( 'sp_position', $object_types, $args ); register_taxonomy( 'sp_position', $object_types, $args );
foreach ( $object_types as $object_type ): foreach ( $object_types as $object_type ):
register_taxonomy_for_object_type( 'sp_league', $object_type ); register_taxonomy_for_object_type( 'sp_league', $object_type );
@@ -158,7 +158,7 @@ class SP_Post_types {
apply_filters( 'sportspress_register_post_type_result', apply_filters( 'sportspress_register_post_type_result',
array( array(
'labels' => array( 'labels' => array(
'name' => __( 'Results', 'sportspress' ), 'name' => __( 'Team Results', 'sportspress' ),
'singular_name' => __( 'Result', 'sportspress' ), 'singular_name' => __( 'Result', 'sportspress' ),
'add_new_item' => __( 'Add New Result', 'sportspress' ), 'add_new_item' => __( 'Add New Result', 'sportspress' ),
'edit_item' => __( 'Edit Result', 'sportspress' ), 'edit_item' => __( 'Edit Result', 'sportspress' ),
@@ -188,7 +188,7 @@ class SP_Post_types {
apply_filters( 'sportspress_register_post_type_outcome', apply_filters( 'sportspress_register_post_type_outcome',
array( array(
'labels' => array( 'labels' => array(
'name' => __( 'Outcomes', 'sportspress' ), 'name' => __( 'Event Outcomes', 'sportspress' ),
'singular_name' => __( 'Outcome', 'sportspress' ), 'singular_name' => __( 'Outcome', 'sportspress' ),
'add_new_item' => __( 'Add New Outcome', 'sportspress' ), 'add_new_item' => __( 'Add New Outcome', 'sportspress' ),
'edit_item' => __( 'Edit Outcome', 'sportspress' ), 'edit_item' => __( 'Edit Outcome', 'sportspress' ),
@@ -218,7 +218,7 @@ class SP_Post_types {
apply_filters( 'sportspress_register_post_type_column', apply_filters( 'sportspress_register_post_type_column',
array( array(
'labels' => array( 'labels' => array(
'name' => __( 'Columns', 'sportspress' ), 'name' => __( 'Table Columns', 'sportspress' ),
'singular_name' => __( 'Column', 'sportspress' ), 'singular_name' => __( 'Column', 'sportspress' ),
'add_new_item' => __( 'Add New Column', 'sportspress' ), 'add_new_item' => __( 'Add New Column', 'sportspress' ),
'edit_item' => __( 'Edit Column', 'sportspress' ), 'edit_item' => __( 'Edit Column', 'sportspress' ),
@@ -244,41 +244,11 @@ class SP_Post_types {
) )
); );
register_post_type( 'sp_performance',
apply_filters( 'sportspress_register_post_type_performance',
array(
'labels' => array(
'name' => __( 'Performance', 'sportspress' ),
'singular_name' => __( 'Performance', 'sportspress' ),
'add_new_item' => __( 'Add New Performance', 'sportspress' ),
'edit_item' => __( 'Edit Performance', 'sportspress' ),
'new_item' => __( 'New', 'sportspress' ),
'view_item' => __( 'View', 'sportspress' ),
'search_items' => __( 'Search', 'sportspress' ),
'not_found' => __( 'No results found.', 'sportspress' ),
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
),
'public' => false,
'show_ui' => true,
'capability_type' => 'sp_config',
'map_meta_cap' => true,
'publicly_queryable' => false,
'exclude_from_search' => true,
'hierarchical' => false,
'supports' => array( 'title', 'page-attributes' ),
'has_archive' => false,
'show_in_nav_menus' => false,
'can_export' => false,
'show_in_menu' => false,
)
)
);
register_post_type( 'sp_metric', register_post_type( 'sp_metric',
apply_filters( 'sportspress_register_post_type_metric', apply_filters( 'sportspress_register_post_type_metric',
array( array(
'labels' => array( 'labels' => array(
'name' => __( 'Metrics', 'sportspress' ), 'name' => __( 'Player Metrics', 'sportspress' ),
'singular_name' => __( 'Metric', 'sportspress' ), 'singular_name' => __( 'Metric', 'sportspress' ),
'add_new_item' => __( 'Add New Metric', 'sportspress' ), 'add_new_item' => __( 'Add New Metric', 'sportspress' ),
'edit_item' => __( 'Edit Metric', 'sportspress' ), 'edit_item' => __( 'Edit Metric', 'sportspress' ),
@@ -304,11 +274,41 @@ class SP_Post_types {
) )
); );
register_post_type( 'sp_performance',
apply_filters( 'sportspress_register_post_type_performance',
array(
'labels' => array(
'name' => __( 'Player Performance', 'sportspress' ),
'singular_name' => __( 'Player Performance', 'sportspress' ),
'add_new_item' => __( 'Add New Performance', 'sportspress' ),
'edit_item' => __( 'Edit Performance', 'sportspress' ),
'new_item' => __( 'New', 'sportspress' ),
'view_item' => __( 'View', 'sportspress' ),
'search_items' => __( 'Search', 'sportspress' ),
'not_found' => __( 'No results found.', 'sportspress' ),
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
),
'public' => false,
'show_ui' => true,
'capability_type' => 'sp_config',
'map_meta_cap' => true,
'publicly_queryable' => false,
'exclude_from_search' => true,
'hierarchical' => false,
'supports' => array( 'title', 'page-attributes' ),
'has_archive' => false,
'show_in_nav_menus' => false,
'can_export' => false,
'show_in_menu' => false,
)
)
);
register_post_type( 'sp_statistic', register_post_type( 'sp_statistic',
apply_filters( 'sportspress_register_post_type_statistic', apply_filters( 'sportspress_register_post_type_statistic',
array( array(
'labels' => array( 'labels' => array(
'name' => __( 'Statistics', 'sportspress' ), 'name' => __( 'Player Statistics', 'sportspress' ),
'singular_name' => __( 'Statistic', 'sportspress' ), 'singular_name' => __( 'Statistic', 'sportspress' ),
'add_new_item' => __( 'Add New Statistic', 'sportspress' ), 'add_new_item' => __( 'Add New Statistic', 'sportspress' ),
'edit_item' => __( 'Edit Statistic', 'sportspress' ), 'edit_item' => __( 'Edit Statistic', 'sportspress' ),

View File

@@ -737,19 +737,19 @@ if ( !function_exists( 'sp_equation_selector' ) ) {
$options[ __( 'Events', 'sportspress' ) ] = array( '$eventsplayed' => __( 'Played', 'sportspress' ) ); $options[ __( 'Events', 'sportspress' ) ] = array( '$eventsplayed' => __( 'Played', 'sportspress' ) );
break; break;
case 'result': case 'result':
$options[ __( 'Results', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_result', array( 'for' => '&rarr;', 'against' => '&larr;' ), null, false ); $options[ __( 'Team Results', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_result', array( 'for' => '&rarr;', 'against' => '&larr;' ), null, false );
break; break;
case 'outcome': case 'outcome':
$options[ __( 'Outcomes', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_outcome', array() ); $options[ __( 'Event Outcomes', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_outcome', array() );
$options[ __( 'Outcomes', 'sportspress' ) ]['$streak'] = __( 'Streak', 'sportspress' ); $options[ __( 'Event Outcomes', 'sportspress' ) ]['$streak'] = __( 'Streak', 'sportspress' );
$options[ __( 'Outcomes', 'sportspress' ) ]['$last5'] = __( 'Last 5', 'sportspress' ); $options[ __( 'Event Outcomes', 'sportspress' ) ]['$last5'] = __( 'Last 5', 'sportspress' );
$options[ __( 'Outcomes', 'sportspress' ) ]['$last10'] = __( 'Last 10', 'sportspress' ); $options[ __( 'Event Outcomes', 'sportspress' ) ]['$last10'] = __( 'Last 10', 'sportspress' );
break; break;
case 'column': case 'column':
$options[ __( 'Columns', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_column' ); $options[ __( 'Table Columns', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_column' );
break; break;
case 'performance': case 'performance':
$options[ __( 'Performance', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_performance' ); $options[ __( 'Player Performance', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_performance' );
break; break;
endswitch; endswitch;
endforeach; endforeach;
@@ -5289,7 +5289,7 @@ function sp_get_text_options() {
'event' => __( 'Event', 'sportspress' ), 'event' => __( 'Event', 'sportspress' ),
'date' => __( 'Date', 'sportspress' ), 'date' => __( 'Date', 'sportspress' ),
'time' => __( 'Time', 'sportspress' ), 'time' => __( 'Time', 'sportspress' ),
'results' => __( 'Results', 'sportspress' ), 'results' => __( 'Team Results', 'sportspress' ),
'team' => __( 'Team', 'sportspress' ), 'team' => __( 'Team', 'sportspress' ),
'teams' => __( 'Teams', 'sportspress' ), 'teams' => __( 'Teams', 'sportspress' ),
'details' => __( 'Details', 'sportspress' ), 'details' => __( 'Details', 'sportspress' ),
@@ -5327,9 +5327,9 @@ function sp_get_text_options() {
function sp_is_config_type( $typenow = null ) { function sp_is_config_type( $typenow = null ) {
if ( $typenow == null ) global $typenow; if ( $typenow == null ) global $typenow;
$post_types = array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric' ); $post_types = array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric', 'sp_statistic' );
if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric' ) ) ) if ( in_array( $typenow, $post_types ) )
return true; return true;
return false; return false;
} }

View File

@@ -59,7 +59,7 @@ if ( empty( $table_rows ) ):
else: else:
$output .= '<h3>' . SP()->text->string('Results', 'event') . '</h3>'; $output .= '<h3>' . SP()->text->string('Team Results', 'event') . '</h3>';
$output .= '<div class="sp-table-wrapper">' . $output .= '<div class="sp-table-wrapper">' .
'<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' . '<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' .