Change Statistic to Performance

This commit is contained in:
Brian Miyaji
2014-03-24 19:24:54 +11:00
parent 967e0729a1
commit 514e3d4da4
48 changed files with 284 additions and 277 deletions

View File

@@ -1,7 +1,7 @@
<?php
function sportspress_admin_head() {
global $typenow;
if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic', 'sp_metric' ) ) )
if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric' ) ) )
sportspress_highlight_admin_menu();
elseif ( $typenow == 'sp_table' )
sportspress_highlight_admin_menu( 'edit.php?post_type=sp_team', 'edit.php?post_type=sp_table' );

View File

@@ -3,7 +3,7 @@ function sportspress_post_updated_messages( $messages ) {
global $typenow, $post;
if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_metric', 'sp_statistic' ) ) ):
if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_metric', 'sp_performance' ) ) ):
$obj = get_post_type_object( $typenow );
for ( $i = 0; $i <= 10; $i++ ):

View File

@@ -7,7 +7,7 @@ function sportspress_pre_get_posts( $query ) {
endif;
$post_type = $query->query['post_type'];
if ( in_array( $post_type, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic' ) ) ):
if ( in_array( $post_type, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance' ) ) ):
$query->set( 'orderby', 'menu_order' );
$query->set( 'order', 'ASC' );
elseif ( $post_type == 'sp_event' ):

View File

@@ -5,7 +5,7 @@ function sportspress_sanitize_title( $title ) {
return $title;
elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic', 'sp_metric' ) ) ):
elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric' ) ) ):
$key = isset( $_POST['sp_key'] ) ? $_POST['sp_key'] : null;

View File

@@ -11,7 +11,7 @@ function sportspress_save_post( $post_id ) {
// Update leagues seasons to show
update_post_meta( $post_id, 'sp_leagues_seasons', sportspress_array_value( $_POST, 'sp_leagues_seasons', array() ) );
// Update player statistics array
// Update team columns array
if ( current_user_can( 'edit_sp_tables' ) )
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
@@ -25,7 +25,7 @@ function sportspress_save_post( $post_id ) {
// Update results
update_post_meta( $post_id, 'sp_results', $results );
// Update player statistics
// Update player performance
update_post_meta( $post_id, 'sp_players', sportspress_array_value( $_POST, 'sp_players', array() ) );
// Update team array
@@ -109,7 +109,7 @@ function sportspress_save_post( $post_id ) {
break;
case ( 'sp_statistic' ):
case ( 'sp_performance' ):
// Delete posts with duplicate key
sportspress_delete_duplicate_post( $_POST );
@@ -142,9 +142,9 @@ function sportspress_save_post( $post_id ) {
// Update player metrics array
update_post_meta( $post_id, 'sp_metrics', sportspress_array_value( $_POST, 'sp_metrics', array() ) );
// Update player statistics array
// Update player performance array
if ( current_user_can( 'edit_sp_teams' ) )
update_post_meta( $post_id, 'sp_statistics', sportspress_array_value( $_POST, 'sp_statistics', array() ) );
update_post_meta( $post_id, 'sp_performance', sportspress_array_value( $_POST, 'sp_performance', array() ) );
break;
@@ -176,7 +176,7 @@ function sportspress_save_post( $post_id ) {
case ( 'sp_list' ):
// Update statistics array
// Update performance array
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
// Update players array

View File

@@ -11,7 +11,7 @@ function sportspress_default_event_content( $content ) {
if ( is_singular( 'sp_event' ) && in_the_loop() ):
$details = sportspress_event_details();
$results = sportspress_event_results();
$statistics = sportspress_event_statistics();
$performance = sportspress_event_performance();
$staff = sportspress_event_staff();
$id = get_the_ID();
$video_url = get_post_meta( $id, 'sp_video', true );
@@ -22,10 +22,10 @@ function sportspress_default_event_content( $content ) {
$video = '';
endif;
if ( $results ):
$content = $video . $results . $details . $statistics . $staff . $content;
$content = $video . $results . $details . $performance . $staff . $content;
else:
$venue = sportspress_event_venue();
$content = $video . $details . $venue . $statistics . $staff . $content;
$content = $video . $details . $venue . $performance . $staff . $content;
endif;
endif;
return $content;
@@ -87,8 +87,8 @@ add_filter( 'the_content', 'sportspress_default_table_content' );
function sportspress_default_player_content( $content ) {
if ( is_singular( 'sp_player' ) && in_the_loop() ):
$metrics = sportspress_player_metrics();
$statistics = sportspress_player_statistics();
$content .= $metrics . $statistics;
$performance = sportspress_player_performance();
$content .= $metrics . $performance;
endif;
return $content;
}