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;
}

View File

@@ -22,7 +22,7 @@ function sportspress_calendar_post_init() {
'rewrite' => array( 'slug' => get_option( 'sportspress_calendar_slug', 'calendar' ) ),
'show_in_menu' => 'edit.php?post_type=sp_event',
'show_in_admin_bar' => true,
'capability_type' => 'sp_calendar'
'capability_type' => 'sp_calendar',
);
register_post_type( 'sp_calendar', $args );
}

View File

@@ -19,9 +19,10 @@ function sportspress_column_post_init() {
'show_in_menu' => false,
'has_archive' => false,
'hierarchical' => false,
'can_export' => false,
'supports' => array( 'title', 'page-attributes' ),
'register_meta_box_cb' => 'sportspress_column_meta_init',
'capability_type' => 'sp_config'
'capability_type' => 'sp_config',
);
register_post_type( 'sp_column', $args );
}

View File

@@ -22,7 +22,7 @@ function sportspress_directory_post_init() {
'rewrite' => array( 'slug' => get_option( 'sportspress_directory_slug', 'directory' ) ),
'show_in_menu' => 'edit.php?post_type=sp_player',
'show_in_admin_bar' => true,
'capability_type' => 'sp_directory'
'capability_type' => 'sp_directory',
);
register_post_type( 'sp_directory', $args );
}
@@ -125,7 +125,7 @@ function sportspress_directory_details_meta( $post ) {
'name' => __( 'Name', 'sportspress' ),
'eventsplayed' => __( 'Played', 'sportspress' )
),
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'name' => 'sp_orderby',
'selected' => $orderby,
'values' => 'slug',

View File

@@ -22,7 +22,7 @@ function sportspress_event_post_init() {
'register_meta_box_cb' => 'sportspress_event_meta_init',
'rewrite' => array( 'slug' => get_option( 'sportspress_events_slug', 'events' ) ),
'menu_icon' => 'dashicons-calendar',
'capability_type' => 'sp_event'
'capability_type' => 'sp_event',
);
register_post_type( 'sp_event', $args );
}
@@ -74,7 +74,7 @@ function sportspress_event_meta_init( $post ) {
do_action( 'sportspress_event_meta_init' );
if ( sizeof( $players ) > 0 )
add_meta_box( 'sp_statisticsdiv', __( 'Statistics', 'sportspress' ), 'sportspress_event_statistics_meta', 'sp_event', 'normal', 'high' );
add_meta_box( 'sp_performancediv', __( 'Performance', 'sportspress' ), 'sportspress_event_performance_meta', 'sp_event', 'normal', 'high' );
add_meta_box( 'sp_articlediv', __( 'Article', 'sportspress' ), 'sportspress_event_article_meta', 'sp_event', 'normal', 'high' );
}
@@ -214,12 +214,12 @@ function sportspress_event_video_meta( $post ) {
<?php
}
function sportspress_event_statistics_meta( $post ) {
function sportspress_event_performance_meta( $post ) {
$teams = (array)get_post_meta( $post->ID, 'sp_team', false );
$stats = (array)get_post_meta( $post->ID, 'sp_players', true );
// Get columns from statistic variables
$columns = sportspress_get_var_labels( 'sp_statistic' );
// Get columns from performance variables
$columns = sportspress_get_var_labels( 'sp_performance' );
foreach ( $teams as $key => $team_id ):
if ( ! $team_id ) continue;

View File

@@ -22,7 +22,7 @@ function sportspress_list_post_init() {
'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ),
'show_in_menu' => 'edit.php?post_type=sp_player',
'show_in_admin_bar' => true,
'capability_type' => 'sp_list'
'capability_type' => 'sp_list',
);
register_post_type( 'sp_list', $args );
}
@@ -136,7 +136,7 @@ function sportspress_list_details_meta( $post ) {
'name' => __( 'Name', 'sportspress' ),
'eventsplayed' => __( 'Played', 'sportspress' )
),
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'name' => 'sp_orderby',
'selected' => $orderby,
'values' => 'slug',

View File

@@ -19,8 +19,9 @@ function sportspress_metric_post_init() {
'show_in_menu' => false,
'has_archive' => false,
'hierarchical' => false,
'can_export' => false,
'supports' => array( 'title', 'page-attributes' ),
'capability_type' => 'sp_config'
'capability_type' => 'sp_config',
);
register_post_type( 'sp_metric', $args );
}

View File

@@ -19,9 +19,10 @@ function sportspress_outcome_post_init() {
'show_in_menu' => false,
'has_archive' => false,
'hierarchical' => false,
'can_export' => false,
'supports' => array( 'title', 'page-attributes' ),
'register_meta_box_cb' => 'sportspress_outcome_meta_init',
'capability_type' => 'sp_config'
'capability_type' => 'sp_config',
);
register_post_type( 'sp_outcome', $args );
}

View File

@@ -1,10 +1,10 @@
<?php
function sportspress_statistic_post_init() {
function sportspress_performance_post_init() {
$labels = array(
'name' => __( 'Statistics', 'sportspress' ),
'singular_name' => __( 'Statistic', 'sportspress' ),
'add_new_item' => __( 'Add New Statistic', 'sportspress' ),
'edit_item' => __( 'Edit Statistic', 'sportspress' ),
'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' ),
@@ -12,22 +12,23 @@ function sportspress_statistic_post_init() {
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
);
$args = array(
'label' => __( 'Statistics', 'sportspress' ),
'label' => __( 'Performance', 'sportspress' ),
'labels' => $labels,
'public' => false,
'show_ui' => true,
'show_in_menu' => false,
'has_archive' => false,
'hierarchical' => false,
'can_export' => false,
'supports' => array( 'title', 'page-attributes' ),
'register_meta_box_cb' => 'sportspress_statistic_meta_init',
'capability_type' => 'sp_config'
'register_meta_box_cb' => 'sportspress_performance_meta_init',
'capability_type' => 'sp_config',
);
register_post_type( 'sp_statistic', $args );
register_post_type( 'sp_performance', $args );
}
add_action( 'init', 'sportspress_statistic_post_init' );
add_action( 'init', 'sportspress_performance_post_init' );
function sportspress_statistic_edit_columns() {
function sportspress_performance_edit_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
@@ -36,13 +37,13 @@ function sportspress_statistic_edit_columns() {
);
return $columns;
}
add_filter( 'manage_edit-sp_statistic_columns', 'sportspress_statistic_edit_columns' );
add_filter( 'manage_edit-sp_performance_columns', 'sportspress_performance_edit_columns' );
function sportspress_statistic_meta_init() {
add_meta_box( 'sp_equationdiv', __( 'Details', 'sportspress' ), 'sportspress_statistic_equation_meta', 'sp_statistic', 'normal', 'high' );
function sportspress_performance_meta_init() {
add_meta_box( 'sp_equationdiv', __( 'Details', 'sportspress' ), 'sportspress_performance_equation_meta', 'sp_performance', 'normal', 'high' );
}
function sportspress_statistic_equation_meta( $post ) {
function sportspress_performance_equation_meta( $post ) {
$calculate = get_post_meta( $post->ID, 'sp_calculate', true );
?>
<p><strong><?php _e( 'Calculate', 'sportspress' ); ?></strong></p>

View File

@@ -56,7 +56,7 @@ function sportspress_player_meta_init( $post ) {
add_meta_box( 'sp_metricsdiv', __( 'Metrics', 'sportspress' ), 'sportspress_player_metrics_meta', 'sp_player', 'side', 'default' );
if ( $leagues && ! empty( $leagues ) && $seasons && ! empty( $seasons ) ):
add_meta_box( 'sp_statsdiv', __( 'Statistics', 'sportspress' ), 'sportspress_player_stats_meta', 'sp_player', 'normal', 'high' );
add_meta_box( 'sp_performancediv', __( 'Performance', 'sportspress' ), 'sportspress_player_performance_meta', 'sp_player', 'normal', 'high' );
endif;
}
@@ -236,12 +236,12 @@ function sportspress_player_metrics_meta( $post ) {
sportspress_nonce();
}
function sportspress_player_stats_meta( $post ) {
function sportspress_player_performance_meta( $post ) {
$leagues = get_the_terms( $post->ID, 'sp_league' );
$league_num = sizeof( $leagues );
// Loop through statistics for each league
// Loop through performance for each league
foreach ( $leagues as $league ):
if ( $league_num > 1 ):
@@ -250,9 +250,9 @@ function sportspress_player_stats_meta( $post ) {
<?php
endif;
list( $columns, $data, $placeholders, $merged, $seasons_teams ) = sportspress_get_player_statistics_data( $post->ID, $league->term_id, true );
list( $columns, $data, $placeholders, $merged, $seasons_teams ) = sportspress_get_player_performance_data( $post->ID, $league->term_id, true );
sportspress_edit_player_statistics_table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, ! current_user_can( 'edit_sp_teams' ) );
sportspress_edit_player_performance_table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, ! current_user_can( 'edit_sp_teams' ) );
endforeach;
}

View File

@@ -19,9 +19,10 @@ function sportspress_result_post_init() {
'show_in_menu' => false,
'has_archive' => false,
'hierarchical' => false,
'can_export' => false,
'supports' => array( 'title', 'page-attributes' ),
'register_meta_box_cb' => 'sportspress_result_meta_init',
'capability_type' => 'sp_config'
'capability_type' => 'sp_config',
);
register_post_type( 'sp_result', $args );
}

View File

@@ -5,7 +5,8 @@ function sportspress_separator_post_init() {
'public' => false,
'show_ui' => true,
'show_in_nav_menus' => false,
'show_in_admin_bar' => false
'show_in_admin_bar' => false,
'can_export' => false,
);
register_post_type( 'sp_separator', $args );
}

View File

@@ -21,7 +21,7 @@ function sportspress_staff_post_init() {
'register_meta_box_cb' => 'sportspress_staff_meta_init',
'rewrite' => array( 'slug' => get_option( 'sportspress_staff_slug', 'staff' ) ),
'show_in_menu' => 'edit.php?post_type=sp_player',
'capability_type' => 'sp_staff'
'capability_type' => 'sp_staff',
);
register_post_type( 'sp_staff', $args );
}

View File

@@ -22,7 +22,7 @@ function sportspress_table_post_init() {
'rewrite' => array( 'slug' => get_option( 'sportspress_table_slug', 'table' ) ),
'show_in_menu' => 'edit.php?post_type=sp_team',
'show_in_admin_bar' => true,
'capability_type' => 'sp_table'
'capability_type' => 'sp_table',
);
register_post_type( 'sp_table', $args );
}

View File

@@ -22,7 +22,7 @@ function sportspress_team_post_init() {
'register_meta_box_cb' => 'sportspress_team_meta_init',
'rewrite' => array( 'slug' => get_option( 'sportspress_teams_slug', 'teams' ) ),
'menu_icon' => 'dashicons-shield-alt',
'capability_type' => 'sp_team'
'capability_type' => 'sp_team',
);
register_post_type( 'sp_team', $args );
}
@@ -55,7 +55,7 @@ function sportspress_team_columns_meta( $post ) {
$league_num = sizeof( $leagues );
// Loop through statistics for each league
// Loop through columns for each league
foreach ( $leagues as $league ):
$league_id = $league->term_id;

View File

@@ -29,9 +29,9 @@ class SportsPressEventSettingsPage {
);
add_settings_field(
'statistics',
__( 'Statistics', 'sportspress' ),
array( $this, 'statistics_callback' ),
'performance',
__( 'Performance', 'sportspress' ),
array( $this, 'performance_callback' ),
'sportspress_events',
'event'
);
@@ -68,29 +68,29 @@ class SportsPressEventSettingsPage {
<?php
}
function statistics_callback() {
$responsive = sportspress_array_value( $this->options, 'event_statistics_responsive', true );
$sortable = sportspress_array_value( $this->options, 'event_statistics_sortable', true );
$link_posts = sportspress_array_value( $this->options, 'event_statistics_link_posts', true );
function performance_callback() {
$responsive = sportspress_array_value( $this->options, 'event_performance_responsive', true );
$sortable = sportspress_array_value( $this->options, 'event_performance_sortable', true );
$link_posts = sportspress_array_value( $this->options, 'event_performance_link_posts', true );
?>
<fieldset>
<label for="sportspress_event_statistics_responsive">
<input id="sportspress_event_statistics_responsive_default" name="sportspress[event_statistics_responsive]" type="hidden" value="0">
<input id="sportspress_event_statistics_responsive" name="sportspress[event_statistics_responsive]" type="checkbox" value="1" <?php checked( $responsive ); ?>>
<label for="sportspress_event_performance_responsive">
<input id="sportspress_event_performance_responsive_default" name="sportspress[event_performance_responsive]" type="hidden" value="0">
<input id="sportspress_event_performance_responsive" name="sportspress[event_performance_responsive]" type="checkbox" value="1" <?php checked( $responsive ); ?>>
<?php _e( 'Responsive', 'sportspress' ); ?>
</label>
</fieldset>
<fieldset>
<label for="sportspress_event_statistics_sortable">
<input id="sportspress_event_statistics_sortable_default" name="sportspress[event_statistics_sortable]" type="hidden" value="0">
<input id="sportspress_event_statistics_sortable" name="sportspress[event_statistics_sortable]" type="checkbox" value="1" <?php checked( $sortable ); ?>>
<label for="sportspress_event_performance_sortable">
<input id="sportspress_event_performance_sortable_default" name="sportspress[event_performance_sortable]" type="hidden" value="0">
<input id="sportspress_event_performance_sortable" name="sportspress[event_performance_sortable]" type="checkbox" value="1" <?php checked( $sortable ); ?>>
<?php _e( 'Sortable', 'sportspress' ); ?>
</label>
</fieldset>
<fieldset>
<label for="sportspress_event_statistics_link_posts">
<input id="sportspress_event_statistics_link_posts_default" name="sportspress[event_statistics_link_posts]" type="hidden" value="0">
<input id="sportspress_event_statistics_link_posts" name="sportspress[event_statistics_link_posts]" type="checkbox" value="1" <?php checked( $link_posts ); ?>>
<label for="sportspress_event_performance_link_posts">
<input id="sportspress_event_performance_link_posts_default" name="sportspress[event_performance_link_posts]" type="hidden" value="0">
<input id="sportspress_event_performance_link_posts" name="sportspress[event_performance_link_posts]" type="checkbox" value="1" <?php checked( $link_posts ); ?>>
<?php _e( 'Link players', 'sportspress' ); ?>
</label>
</fieldset>

View File

@@ -60,9 +60,9 @@ class SportsPressPlayerSettingsPage {
);
add_settings_field(
'statistics',
__( 'Statistics', 'sportspress' ),
array( $this, 'statistics_callback' ),
'performance',
__( 'Performance', 'sportspress' ),
array( $this, 'performance_callback' ),
'sportspress_players',
'list'
);
@@ -161,9 +161,9 @@ class SportsPressPlayerSettingsPage {
<?
}
function statistics_callback() {
function performance_callback() {
$args = array(
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
@@ -190,8 +190,8 @@ class SportsPressPlayerSettingsPage {
</table>
<div class="tablenav bottom">
<div class="alignleft actions">
<a class="button" id="doaction" href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php _e( 'Edit', '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>
<a class="button" id="doaction" href="<?php echo admin_url( 'edit.php?post_type=sp_performance' ); ?>"><?php _e( 'Edit', '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>
<br class="clear">
</div>

View File

@@ -1,6 +1,6 @@
<?php
if ( !function_exists( 'sportspress_event_statistics' ) ) {
function sportspress_event_statistics( $id = null ) {
if ( !function_exists( 'sportspress_event_performance' ) ) {
function sportspress_event_performance( $id = null ) {
global $sportspress_options;
if ( ! $id )
@@ -9,10 +9,10 @@ if ( !function_exists( 'sportspress_event_statistics' ) ) {
$teams = (array)get_post_meta( $id, 'sp_team', false );
$staff = (array)get_post_meta( $id, 'sp_staff', false );
$stats = (array)get_post_meta( $id, 'sp_players', true );
$statistic_labels = sportspress_get_var_labels( 'sp_statistic' );
$link_posts = sportspress_array_value( $sportspress_options, 'event_statistics_link_posts', true );
$sortable = sportspress_array_value( $sportspress_options, 'event_statistics_sortable', true );
$responsive = sportspress_array_value( $sportspress_options, 'event_statistics_responsive', true );
$performance_labels = sportspress_get_var_labels( 'sp_performance' );
$link_posts = sportspress_array_value( $sportspress_options, 'event_performance_link_posts', true );
$sortable = sportspress_array_value( $sportspress_options, 'event_performance_sortable', true );
$responsive = sportspress_array_value( $sportspress_options, 'event_performance_responsive', true );
$output = '';
@@ -28,12 +28,12 @@ if ( !function_exists( 'sportspress_event_statistics' ) ) {
$output .= '<h3>' . get_the_title( $team_id ) . '</h3>';
$output .= '<div class="sp-table-wrapper">' .
'<table class="sp-event-statistics sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . ( $sortable ? ' sp-sortable-table' : '' ) . '">' . '<thead>' . '<tr>';
'<table class="sp-event-performance sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . ( $sortable ? ' sp-sortable-table' : '' ) . '">' . '<thead>' . '<tr>';
$output .= '<th class="data-number">#</th>';
$output .= '<th class="data-number">' . __( 'Player', 'sportspress' ) . '</th>';
foreach( $statistic_labels as $key => $label ):
foreach( $performance_labels as $key => $label ):
$output .= '<th class="data-' . $key . '">' . $label . '</th>';
endforeach;
@@ -65,7 +65,7 @@ if ( !function_exists( 'sportspress_event_statistics' ) ) {
$output .= '<td class="data-name">' . $name . '</td>';
foreach( $statistic_labels as $key => $label ):
foreach( $performance_labels as $key => $label ):
if ( $key == 'name' )
continue;
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
@@ -100,7 +100,7 @@ if ( !function_exists( 'sportspress_event_statistics' ) ) {
$row = $data[0];
foreach( $statistic_labels as $key => $label ):
foreach( $performance_labels as $key => $label ):
if ( $key == 'name' ):
continue;
endif;
@@ -120,7 +120,7 @@ if ( !function_exists( 'sportspress_event_statistics' ) ) {
endforeach;
return apply_filters( 'sportspress_event_statistics', $output );
return apply_filters( 'sportspress_event_performance', $output );
}
}

View File

@@ -48,16 +48,16 @@ if ( !function_exists( 'sportspress_player_gallery' ) ) {
// Remove the first row to leave us with the actual data
unset( $data[0] );
$statistics = sportspress_array_value( $r, 'statistics', null );
$performance = sportspress_array_value( $r, 'performance', null );
if ( $r['orderby'] == 'default' ):
$r['orderby'] = get_post_meta( $id, 'sp_orderby', true );
$r['order'] = get_post_meta( $id, 'sp_order', true );
else:
global $sportspress_statistic_priorities;
$sportspress_statistic_priorities = array(
global $sportspress_performance_priorities;
$sportspress_performance_priorities = array(
array(
'statistic' => $r['orderby'],
'key' => $r['orderby'],
'order' => $r['order'],
),
);
@@ -94,7 +94,7 @@ if ( !function_exists( 'sportspress_player_gallery' ) ) {
if ( is_int( $r['number'] ) && $r['number'] > 0 )
$limit = $r['number'];
foreach( $data as $player_id => $statistics ):
foreach( $data as $player_id => $performance ):
if ( $r['show_names_on_hover'] ):
$caption = get_the_title( $player_id );

View File

@@ -1,6 +1,6 @@
<?php
if ( !function_exists( 'sportspress_player_league_statistics' ) ) {
function sportspress_player_league_statistics( $league, $id = null ) {
if ( !function_exists( 'sportspress_player_league_performance' ) ) {
function sportspress_player_league_performance( $league, $id = null ) {
if ( ! $league )
return false;
@@ -8,7 +8,7 @@ if ( !function_exists( 'sportspress_player_league_statistics' ) ) {
if ( ! $id )
$id = get_the_ID();
$data = sportspress_get_player_statistics_data( $id, $league->term_id );
$data = sportspress_get_player_performance_data( $id, $league->term_id );
// The first row should be column labels
$labels = $data[0];
@@ -22,7 +22,7 @@ if ( !function_exists( 'sportspress_player_league_statistics' ) ) {
$output = '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
'<div class="sp-table-wrapper">' .
'<table class="sp-player-statistics sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
'<table class="sp-player-performance sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
foreach( $labels as $key => $label ):
$output .= '<th class="data-' . $key . '">' . $label . '</th>';
@@ -48,7 +48,7 @@ if ( !function_exists( 'sportspress_player_league_statistics' ) ) {
$output .= '</tbody>' . '</table>' . '</div>';
return apply_filters( 'sportspress_player_league_statistics', $output );
return apply_filters( 'sportspress_player_league_performance', $output );
}
}

View File

@@ -9,7 +9,7 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
$defaults = array(
'number' => -1,
'statistics' => null,
'performance' => null,
'orderby' => 'default',
'order' => 'ASC',
'show_all_players_link' => false,
@@ -31,16 +31,16 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
// Remove the first row to leave us with the actual data
unset( $data[0] );
$statistics = sportspress_array_value( $r, 'statistics', null );
$performance = sportspress_array_value( $r, 'performance', null );
if ( $r['orderby'] == 'default' ):
$r['orderby'] = get_post_meta( $id, 'sp_orderby', true );
$r['order'] = get_post_meta( $id, 'sp_order', true );
else:
global $sportspress_statistic_priorities;
$sportspress_statistic_priorities = array(
global $sportspress_performance_priorities;
$sportspress_performance_priorities = array(
array(
'statistic' => $r['orderby'],
'key' => $r['orderby'],
'order' => $r['order'],
),
);
@@ -54,7 +54,7 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
endif;
foreach( $labels as $key => $label ):
if ( ! is_array( $statistics ) || $key == 'name' || in_array( $key, $statistics ) )
if ( ! is_array( $performance ) || $key == 'name' || in_array( $key, $performance ) )
$output .= '<th class="data-' . $key . '">'. $label . '</th>';
endforeach;
@@ -91,7 +91,7 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
foreach( $labels as $key => $value ):
if ( $key == 'name' )
continue;
if ( ! is_array( $statistics ) || in_array( $key, $statistics ) )
if ( ! is_array( $performance ) || in_array( $key, $performance ) )
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '&mdash;' ) . '</td>';
endforeach;

View File

@@ -0,0 +1,22 @@
<?php
if ( !function_exists( 'sportspress_player_performance' ) ) {
function sportspress_player_performance( $id = null ) {
if ( ! $id )
$id = get_the_ID();
$leagues = get_the_terms( $id, 'sp_league' );
$output = '';
// Loop through performance for each league
if ( is_array( $leagues ) ):
foreach ( $leagues as $league ):
$output .= sportspress_player_league_performance( $league, $id );
endforeach;
endif;
return apply_filters( 'sportspress_player_performance', $output );
}
}

View File

@@ -6,7 +6,7 @@ if ( !function_exists( 'sportspress_player_roster' ) ) {
$id = get_the_ID();
$defaults = array(
'statistics' => null,
'performance' => null,
'orderby' => 'default',
'order' => 'ASC',
);
@@ -23,16 +23,16 @@ if ( !function_exists( 'sportspress_player_roster' ) ) {
// Remove the first row to leave us with the actual data
unset( $data[0] );
$statistics = sportspress_array_value( $r, 'statistics', null );
$performance = sportspress_array_value( $r, 'performance', null );
if ( $r['orderby'] == 'default' ):
$r['orderby'] = get_post_meta( $id, 'sp_orderby', true );
$r['order'] = get_post_meta( $id, 'sp_order', true );
else:
global $sportspress_statistic_priorities;
$sportspress_statistic_priorities = array(
global $sportspress_performance_priorities;
$sportspress_performance_priorities = array(
array(
'statistic' => $r['orderby'],
'key' => $r['orderby'],
'order' => $r['order'],
),
);
@@ -68,7 +68,7 @@ if ( !function_exists( 'sportspress_player_roster' ) ) {
foreach( $labels as $key => $value ):
if ( $key == 'name' )
continue;
if ( ! is_array( $statistics ) || in_array( $key, $statistics ) )
if ( ! is_array( $performance ) || in_array( $key, $performance ) )
$rows .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '&mdash;' ) . '</td>';
endforeach;
@@ -89,7 +89,7 @@ if ( !function_exists( 'sportspress_player_roster' ) ) {
endif;
foreach( $labels as $key => $label ):
if ( ! is_array( $statistics ) || $key == 'name' || in_array( $key, $statistics ) )
if ( ! is_array( $performance ) || $key == 'name' || in_array( $key, $performance ) )
$output .= '<th class="data-' . $key . '">'. $label . '</th>';
endforeach;
$output .= '</tr>' . '</thead>' . '<tbody>' . $rows . '</tbody>' . '</table>' . '</div>';

View File

@@ -1,22 +0,0 @@
<?php
if ( !function_exists( 'sportspress_player_statistics' ) ) {
function sportspress_player_statistics( $id = null ) {
if ( ! $id )
$id = get_the_ID();
$leagues = get_the_terms( $id, 'sp_league' );
$output = '';
// Loop through statistics for each league
if ( is_array( $leagues ) ):
foreach ( $leagues as $league ):
$output .= sportspress_player_league_statistics( $league, $id );
endforeach;
endif;
return apply_filters( 'sportspress_player_statistics', $output );
}
}

View File

@@ -23,7 +23,7 @@ function sportspress_position_term_init() {
'hierarchical' => true,
'rewrite' => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ),
);
$object_types = array( 'sp_player', 'sp_statistic', 'sp_metric', 'attachment' );
$object_types = array( 'sp_player', 'sp_performance', 'sp_metric', 'attachment' );
register_taxonomy( 'sp_position', $object_types, $args );
foreach ( $object_types as $object_type ):
register_taxonomy_for_object_type( 'sp_league', $object_type );

View File

@@ -119,9 +119,9 @@ if ( class_exists( 'WP_Importer' ) ) {
$league = ( empty( $_POST['sp_league'] ) ? false : $_POST['sp_league'] );
$season = ( empty( $_POST['sp_season'] ) ? false : $_POST['sp_season'] );
// Get labels from result and statistic post types
// Get labels from result and performance post types
$result_labels = sportspress_get_var_labels( 'sp_result' );
$statistic_labels = sportspress_get_var_labels( 'sp_statistic' );
$performance_labels = sportspress_get_var_labels( 'sp_performance' );
while ( ( $row = fgetcsv( $handle, 0, $this->delimiter ) ) !== FALSE ):
@@ -133,7 +133,7 @@ if ( class_exists( 'WP_Importer' ) ) {
// Add new event if date is given
if ( sizeof( $event ) > 0 && ! empty( $event[0] ) ):
// Add player statistics to last event if available
// Add player performance to last event if available
if ( isset( $id ) && isset( $players ) && sizeof( $players ) > 0 ):
update_post_meta( $id, 'sp_players', $players );
endif;
@@ -155,7 +155,7 @@ if ( class_exists( 'WP_Importer' ) ) {
// Insert event
$id = wp_insert_post( $args );
// Initialize statistics array
// Initialize performance array
$players = array();
// Flag as import
@@ -331,7 +331,7 @@ if ( class_exists( 'WP_Importer' ) ) {
// Add new player if player name is given
if ( sizeof( $player ) > 0 && ! empty( $player[0] ) ):
// Get and unset player name leaving us with the statistics
// Get and unset player name leaving us with the performance
$player_name = $player[0];
unset( $player[0] );
@@ -378,17 +378,17 @@ if ( class_exists( 'WP_Importer' ) ) {
// Add player to event
add_post_meta( $id, 'sp_player', $player_id );
// Add player statistics to array if team is available
// Add player performance to array if team is available
if ( isset( $team_id ) ):
// Initialize statistics array
$statistics = array();
// Initialize performance array
$performance = array();
// Map keys to player statistics
foreach ( $statistic_labels as $key => $label ):
$statistics[ $key ] = array_shift( $player );
// Map keys to player performance
foreach ( $performance_labels as $key => $label ):
$performance[ $key ] = array_shift( $player );
endforeach;
$players[ $team_id ][ $player_id ] = $statistics;
$players[ $team_id ][ $player_id ] = $performance;
// Get player teams
$player_teams = get_post_meta( $player_id, 'sp_team', false );
@@ -415,7 +415,7 @@ if ( class_exists( 'WP_Importer' ) ) {
endwhile;
// Add player statistics to last event if available
// Add player performance to last event if available
if ( isset( $id ) && isset( $players ) && sizeof( $players ) > 0 ):
update_post_meta( $id, 'sp_players', $players );
endif;

View File

@@ -78,7 +78,7 @@ class SP_Widget_Player_Gallery extends WP_Widget {
'name' => __( 'Name', 'sportspress' ),
'eventsplayed' => __( 'Played', 'sportspress' )
),
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'name' => $this->get_field_name('orderby'),
'id' => $this->get_field_id('orderby'),
'selected' => $orderby,

View File

@@ -11,7 +11,7 @@ class SP_Widget_Player_list extends WP_Widget {
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$id = empty($instance['id']) ? null : $instance['id'];
$number = empty($instance['number']) ? null : $instance['number'];
$statistics = $instance['statistics'];
$performance = $instance['performance'];
$orderby = empty($instance['orderby']) ? 'default' : $instance['orderby'];
$order = empty($instance['order']) ? 'ASC' : $instance['order'];
$show_all_players_link = empty($instance['show_all_players_link']) ? false : $instance['show_all_players_link'];
@@ -19,7 +19,7 @@ class SP_Widget_Player_list extends WP_Widget {
if ( $title )
echo $before_title . $title . $after_title;
echo '<div id="sp_player_list_wrap">';
echo sportspress_player_list( $id, array( 'number' => $number, 'statistics' => $statistics, 'orderby' => $orderby , 'order' => $order, 'show_all_players_link' => $show_all_players_link ) );
echo sportspress_player_list( $id, array( 'number' => $number, 'performance' => $performance, 'orderby' => $orderby , 'order' => $order, 'show_all_players_link' => $show_all_players_link ) );
echo '</div>';
echo $after_widget;
}
@@ -29,7 +29,7 @@ class SP_Widget_Player_list extends WP_Widget {
$instance['title'] = strip_tags($new_instance['title']);
$instance['id'] = intval($new_instance['id']);
$instance['number'] = intval($new_instance['number']);
$instance['statistics'] = (array)$new_instance['statistics'];
$instance['performance'] = (array)$new_instance['performance'];
$instance['orderby'] = strip_tags($new_instance['orderby']);
$instance['order'] = strip_tags($new_instance['order']);
$instance['show_all_players_link'] = $new_instance['show_all_players_link'];
@@ -38,11 +38,11 @@ class SP_Widget_Player_list extends WP_Widget {
}
function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '', 'number' => 5, 'statistics' => null, 'orderby' => 'default', 'order' => 'ASC', 'show_all_players_link' => true ) );
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '', 'number' => 5, 'performance' => null, 'orderby' => 'default', 'order' => 'ASC', 'show_all_players_link' => true ) );
$title = strip_tags($instance['title']);
$id = intval($instance['id']);
$number = intval($instance['number']);
$statistics = $instance['statistics'];
$performance = $instance['performance'];
$orderby = strip_tags($instance['orderby']);
$order = strip_tags($instance['order']);
$show_all_players_link = $instance['show_all_players_link'];
@@ -70,23 +70,23 @@ class SP_Widget_Player_list extends WP_Widget {
<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo esc_attr($number); ?>" size="3"></p>
<p class="sp-prefs">
<?php _e( 'Statistics:', 'sportspress' ); ?><br>
<?php _e( 'Performance:', 'sportspress' ); ?><br>
<?php
$args = array(
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
);
$the_statistics = get_posts( $args );
$the_performance = get_posts( $args );
$field_name = $this->get_field_name('statistics') . '[]';
$field_id = $this->get_field_id('statistics');
$field_name = $this->get_field_name('performance') . '[]';
$field_id = $this->get_field_id('performance');
?>
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . 'eventsplayed'; ?>" value="<?php echo 'eventsplayed'; ?>" <?php if ( is_array( $statistics) && in_array( 'eventsplayed', $statistics ) ): ?>checked="checked"<?php endif; ?>><?php _e( 'Played', 'sportspress' ); ?></label>
<?php foreach ( $the_statistics as $column ): ?>
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $column->post_name; ?>" value="<?php echo $column->post_name; ?>" <?php if ( $statistics === null || in_array( $column->post_name, $statistics ) ): ?>checked="checked"<?php endif; ?>><?php echo $column->post_title; ?></label>
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . 'eventsplayed'; ?>" value="<?php echo 'eventsplayed'; ?>" <?php if ( is_array( $performance) && in_array( 'eventsplayed', $performance ) ): ?>checked="checked"<?php endif; ?>><?php _e( 'Played', 'sportspress' ); ?></label>
<?php foreach ( $the_performance as $column ): ?>
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $column->post_name; ?>" value="<?php echo $column->post_name; ?>" <?php if ( $performance === null || in_array( $column->post_name, $performance ) ): ?>checked="checked"<?php endif; ?>><?php echo $column->post_title; ?></label>
<?php endforeach; ?>
</p>
@@ -99,7 +99,7 @@ class SP_Widget_Player_list extends WP_Widget {
'name' => __( 'Name', 'sportspress' ),
'eventsplayed' => __( 'Played', 'sportspress' )
),
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'name' => $this->get_field_name('orderby'),
'id' => $this->get_field_id('orderby'),
'selected' => $orderby,

View File

@@ -326,7 +326,7 @@ jQuery(document).ready(function($){
});
// Remove slug editor in quick edit for slug-sensitive post types
$(".inline-edit-sp_result, .inline-edit-sp_outcome, .inline-edit-sp_column, .inline-edit-sp_statistic").find("input[name=post_name]").closest("label").remove();
$(".inline-edit-sp_result, .inline-edit-sp_outcome, .inline-edit-sp_column, .inline-edit-sp_performance").find("input[name=post_name]").closest("label").remove();
// Prevent address input from submitting form
$(".sp-address").keypress(function(event) {

View File

@@ -24,7 +24,7 @@ function viewport() {
/* Data Tables */
if (viewport().width > 640) {
$(".sp-league-table, .sp-event-statistics, .sp-player-list").each(function() {
$(".sp-league-table, .sp-event-performance, .sp-player-list").each(function() {
sort = $(this).hasClass("sp-sortable-table");
$(this).dataTable({
"aaSorting": [],

View File

@@ -95,7 +95,7 @@ if ( !function_exists( 'sportspress_flush_rewrite_rules' ) ) {
sportspress_result_post_init();
sportspress_outcome_post_init();
sportspress_column_post_init();
sportspress_statistic_post_init();
sportspress_performance_post_init();
sportspress_event_post_init();
sportspress_calendar_post_init();
sportspress_team_post_init();
@@ -648,8 +648,8 @@ if ( !function_exists( 'sportspress_equation_selector' ) ) {
case 'column':
$options[ __( 'Columns', 'sportspress' ) ] = sportspress_get_equation_optgroup_array( $postid, 'sp_column' );
break;
case 'statistic':
$options[ __( 'Player Statistics', 'sportspress' ) ] = sportspress_get_equation_optgroup_array( $postid, 'sp_statistic' );
case 'performance':
$options[ __( 'Performance', 'sportspress' ) ] = sportspress_get_equation_optgroup_array( $postid, 'sp_performance' );
break;
endswitch;
endforeach;
@@ -1074,8 +1074,8 @@ if ( !function_exists( 'sportspress_edit_team_columns_table' ) ) {
}
}
if ( !function_exists( 'sportspress_edit_player_statistics_table' ) ) {
function sportspress_edit_player_statistics_table( $id = null, $league_id, $columns = array(), $data = array(), $placeholders = array(), $merged = array(), $seasons_teams = array(), $readonly = true ) {
if ( !function_exists( 'sportspress_edit_player_performance_table' ) ) {
function sportspress_edit_player_performance_table( $id = null, $league_id, $columns = array(), $data = array(), $placeholders = array(), $merged = array(), $seasons_teams = array(), $readonly = true ) {
if ( ! $id )
$id = get_the_ID();
@@ -1096,7 +1096,7 @@ if ( !function_exists( 'sportspress_edit_player_statistics_table' ) ) {
<?php
$i = 0;
foreach ( $data as $div_id => $div_stats ):
if ( !$div_id || $div_id == 'statistics' ) continue;
if ( !$div_id || $div_id == 'performance' ) continue;
$div = get_term( $div_id, 'sp_season' );
?>
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
@@ -1139,7 +1139,7 @@ if ( !function_exists( 'sportspress_edit_player_statistics_table' ) ) {
<td><?php
$value = sportspress_array_value( sportspress_array_value( $data, $div_id, array() ), $column, null );
$placeholder = sportspress_array_value( sportspress_array_value( $placeholders, $div_id, array() ), $column, 0 );
echo '<input type="text" name="sp_statistics[' . $league_id . '][' . $div_id . '][' . $column . ']" value="' . $value . '" placeholder="' . $placeholder . '"' . ( $readonly ? ' disabled="disabled"' : '' ) . ' />';
echo '<input type="text" name="sp_performance[' . $league_id . '][' . $div_id . '][' . $column . ']" value="' . $value . '" placeholder="' . $placeholder . '"' . ( $readonly ? ' disabled="disabled"' : '' ) . ' />';
?></td>
<?php endforeach; ?>
</tr>
@@ -1250,7 +1250,7 @@ if ( !function_exists( 'sportspress_event_player_sub_selector' ) ) {
$output .= '<option value="0">' . __( 'None', 'sportspress' ) . '</option>';
// Add players as selectable options
foreach( $data as $id => $statistics ):
foreach( $data as $id => $performance ):
if ( ! $id || $id == $player_id ) continue;
$number = get_post_meta( $id, 'sp_number', true );
$output .= '<option value="' . $id . '"' . ( $id == $value ? ' selected' : '' ) . '>' . ( $number ? $number . '. ' : '' ) . get_the_title( $id ) . '</option>';
@@ -1267,7 +1267,7 @@ if ( !function_exists( 'sportspress_edit_event_players_table' ) ) {
function sportspress_edit_event_players_table( $columns = array(), $data = array(), $team_id ) {
?>
<div class="sp-data-table-container">
<table class="widefat sp-data-table sp-statistic-table">
<table class="widefat sp-data-table sp-performance-table">
<thead>
<tr>
<th>#</th>
@@ -1281,7 +1281,7 @@ if ( !function_exists( 'sportspress_edit_event_players_table' ) ) {
<tbody>
<?php
$i = 0;
foreach ( $data as $player_id => $player_statistics ):
foreach ( $data as $player_id => $player_performance ):
if ( !$player_id ) continue;
$number = get_post_meta( $player_id, 'sp_number', true );
?>
@@ -1289,15 +1289,15 @@ if ( !function_exists( 'sportspress_edit_event_players_table' ) ) {
<td><?php echo ( $number ? $number : '&nbsp;' ); ?></td>
<td><?php echo get_the_title( $player_id ); ?></td>
<?php foreach( $columns as $column => $label ):
$value = sportspress_array_value( $player_statistics, $column, '' );
$value = sportspress_array_value( $player_performance, $column, '' );
?>
<td>
<input class="sp-player-<?php echo $column; ?>-input" type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo $value; ?>" placeholder="0" />
</td>
<?php endforeach; ?>
<td class="sp-status-selector">
<?php echo sportspress_event_player_status_selector( $team_id, $player_id, sportspress_array_value( $player_statistics, 'status', null ) ); ?>
<?php echo sportspress_event_player_sub_selector( $team_id, $player_id, sportspress_array_value( $player_statistics, 'sub', null ), $data ); ?>
<?php echo sportspress_event_player_status_selector( $team_id, $player_id, sportspress_array_value( $player_performance, 'status', null ) ); ?>
<?php echo sportspress_event_player_sub_selector( $team_id, $player_id, sportspress_array_value( $player_performance, 'sub', null ), $data ); ?>
</td>
</tr>
<?php
@@ -1309,8 +1309,8 @@ if ( !function_exists( 'sportspress_edit_event_players_table' ) ) {
<td><strong><?php _e( 'Total', 'sportspress' ); ?></strong></td>
<?php foreach( $columns as $column => $label ):
$player_id = 0;
$player_statistics = sportspress_array_value( $data, 0, array() );
$value = sportspress_array_value( $player_statistics, $column, '' );
$player_performance = sportspress_array_value( $data, 0, array() );
$value = sportspress_array_value( $player_performance, $column, '' );
?>
<td><input type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo $value; ?>" placeholder="0" /></td>
<?php endforeach; ?>
@@ -2085,7 +2085,7 @@ if ( !function_exists( 'sportspress_get_league_table_data' ) ) {
uasort( $merged, 'sportspress_sort_table_teams' );
// Rearrange data array to reflect statistics
// Rearrange data array to reflect values
$data = array();
foreach( $merged as $key => $value ):
$data[ $key ] = $tempdata[ $key ];
@@ -2155,7 +2155,7 @@ if ( !function_exists( 'sportspress_get_player_list_data' ) ) {
$usecolumns = get_post_meta( $post_id, 'sp_columns', true );
// Get labels from result variables
$columns = (array)sportspress_get_var_labels( 'sp_statistic' );
$columns = (array)sportspress_get_var_labels( 'sp_performance' );
// Get all leagues populated with stats where available
$tempdata = sportspress_array_combine( $player_ids, $stats );
@@ -2174,13 +2174,13 @@ if ( !function_exists( 'sportspress_get_player_list_data' ) ) {
$totals[ $player_id ][ $key ] = 0;
endforeach;
// Get static statistics
$static = get_post_meta( $player_id, 'sp_statistics', true );
// Get static performance
$static = get_post_meta( $player_id, 'sp_performance', true );
// Create placeholders entry for the player
$placeholders[ $player_id ] = array( 'eventsplayed' => 0 );
// Add static statistics to placeholders
// Add static performance to placeholders
if ( is_array( $static ) && array_key_exists( $league_id, $static ) && array_key_exists( $div_id, $static[ $league_id ] ) ):
$placeholders[ $player_id ] = array_merge( $placeholders[ $player_id ], $static[ $league_id ][ $div_id ] );
endif;
@@ -2235,17 +2235,17 @@ if ( !function_exists( 'sportspress_get_player_list_data' ) ) {
$players = sportspress_array_value( $teams, $team_id, array() );
foreach ( $players as $player_id => $player_statistics ):
foreach ( $players as $player_id => $player_performance ):
if ( ! $player_id || ! in_array( $player_id, $player_ids ) )
continue;
// Increment events played
if ( sportspress_array_value( $player_statistics, 'status' ) != 'sub' || sportspress_array_value( $player_statistics, 'sub', 0 ) ):
if ( sportspress_array_value( $player_performance, 'status' ) != 'sub' || sportspress_array_value( $player_performance, 'sub', 0 ) ):
$totals[ $player_id ]['eventsplayed']++;
endif;
foreach ( $player_statistics as $key => $value ):
foreach ( $player_performance as $key => $value ):
if ( array_key_exists( $key, $totals[ $player_id ] ) ):
$totals[ $player_id ][ $key ] += $value;
@@ -2259,17 +2259,17 @@ if ( !function_exists( 'sportspress_get_player_list_data' ) ) {
foreach ( $teams as $players ):
foreach ( $players as $player_id => $player_statistics ):
foreach ( $players as $player_id => $player_performance ):
if ( ! $player_id || ! in_array( $player_id, $player_ids ) )
continue;
// Increment events played
if ( sportspress_array_value( $player_statistics, 'status' ) != 'sub' || sportspress_array_value( $player_statistics, 'sub', 0 ) ):
if ( sportspress_array_value( $player_performance, 'status' ) != 'sub' || sportspress_array_value( $player_performance, 'sub', 0 ) ):
$totals[ $player_id ]['eventsplayed']++;
endif;
foreach ( $player_statistics as $key => $value ):
foreach ( $player_performance as $key => $value ):
if ( array_key_exists( $key, $totals[ $player_id ] ) ):
$totals[ $player_id ][ $key ] += $value;
@@ -2286,26 +2286,26 @@ if ( !function_exists( 'sportspress_get_player_list_data' ) ) {
endforeach;
$args = array(
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC',
);
$statistics = get_posts( $args );
$performances = get_posts( $args );
$columns = array( 'eventsplayed' => __( 'Played', 'sportspress' ) );
foreach ( $statistics as $statistic ):
foreach ( $performances as $performance ):
// Get post meta
$meta = get_post_meta( $statistic->ID );
$meta = get_post_meta( $performance->ID );
// Add equation to object
$statistic->equation = sportspress_array_value( sportspress_array_value( $meta, 'sp_equation', array() ), 0, 0 );
$performance->equation = sportspress_array_value( sportspress_array_value( $meta, 'sp_equation', array() ), 0, 0 );
// Add column name to columns
$columns[ $statistic->post_name ] = $statistic->post_title;
$columns[ $performance->post_name ] = $performance->post_title;
endforeach;
@@ -2315,18 +2315,18 @@ if ( !function_exists( 'sportspress_get_player_list_data' ) ) {
if ( ! $player_id )
continue;
// Add events played as an object to statistics for placeholder calculations
// Add events played as an object to performance for placeholder calculations
$epstat = new stdClass();
$epstat->post_name = 'eventsplayed';
array_unshift( $statistics, $epstat );
array_unshift( $performances, $epstat );
foreach ( $statistics as $statistic ):
if ( sportspress_array_value( $placeholders[ $player_id ], $statistic->post_name, '' ) == '' ):
foreach ( $performances as $performance ):
if ( sportspress_array_value( $placeholders[ $player_id ], $performance->post_name, '' ) == '' ):
if ( $statistic->post_name == 'eventsplayed' ):
if ( $performance->post_name == 'eventsplayed' ):
$calculate = 'total';
else:
$calculate = get_post_meta( $statistic->ID, 'sp_calculate', true );
$calculate = get_post_meta( $performance->ID, 'sp_calculate', true );
endif;
if ( $calculate && $calculate == 'average' ):
@@ -2334,15 +2334,15 @@ if ( !function_exists( 'sportspress_get_player_list_data' ) ) {
// Reflect average
$eventsplayed = (int)sportspress_array_value( $totals[ $player_id ], 'eventsplayed', 0 );
if ( ! $eventsplayed ):
$placeholders[ $player_id ][ $statistic->post_name ] = 0;
$placeholders[ $player_id ][ $performance->post_name ] = 0;
else:
$placeholders[ $player_id ][ $statistic->post_name ] = sportspress_array_value( sportspress_array_value( $totals, $player_id, array() ), $statistic->post_name, 0 ) / $eventsplayed;
$placeholders[ $player_id ][ $performance->post_name ] = sportspress_array_value( sportspress_array_value( $totals, $player_id, array() ), $performance->post_name, 0 ) / $eventsplayed;
endif;
else:
// Reflect total
$placeholders[ $player_id ][ $statistic->post_name ] = sportspress_array_value( sportspress_array_value( $totals, $player_id, array() ), $statistic->post_name, 0 );
$placeholders[ $player_id ][ $performance->post_name ] = sportspress_array_value( sportspress_array_value( $totals, $player_id, array() ), $performance->post_name, 0 );
endif;
@@ -2371,17 +2371,17 @@ if ( !function_exists( 'sportspress_get_player_list_data' ) ) {
endforeach;
if ( $orderby != 'number' || $order != 'ASC' ):
global $sportspress_statistic_priorities;
$sportspress_statistic_priorities = array(
global $sportspress_performance_priorities;
$sportspress_performance_priorities = array(
array(
'statistic' => $orderby,
'key' => $orderby,
'order' => $order,
),
);
uasort( $merged, 'sportspress_sort_list_players' );
endif;
// Rearrange data array to reflect statistics
// Rearrange data array to reflect performance
$data = array();
foreach( $merged as $key => $value ):
$data[ $key ] = $tempdata[ $key ];
@@ -2415,7 +2415,7 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
$order = get_post_meta( $post_id, 'sp_order', true );
// Get labels from result variables
$columns = (array)sportspress_get_var_labels( 'sp_statistic' );
$columns = (array)sportspress_get_var_labels( 'sp_performance' );
// Get all leagues populated with stats where available
$tempdata = sportspress_array_combine( $player_ids, $stats );
@@ -2440,13 +2440,13 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
$totals[ $player_id ][ $key ] = 0;
endforeach;
// Get static statistics
$static = get_post_meta( $player_id, 'sp_statistics', true );
// Get static performance
$static = get_post_meta( $player_id, 'sp_performance', true );
// Create placeholders entry for the player
$placeholders[ $player_id ] = array( 'eventsplayed' => 0, 'positions' => $position_ids );
// Add static statistics to placeholders
// Add static performance to placeholders
if ( is_array( $static ) && array_key_exists( $league_id, $static ) && array_key_exists( $div_id, $static[ $league_id ] ) ):
$placeholders[ $player_id ] = array_merge( $placeholders[ $player_id ], $static[ $league_id ][ $div_id ] );
endif;
@@ -2501,17 +2501,17 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
$players = sportspress_array_value( $teams, $team_id, array() );
foreach ( $players as $player_id => $player_statistics ):
foreach ( $players as $player_id => $player_performance ):
if ( ! $player_id || ! in_array( $player_id, $player_ids ) )
continue;
// Increment events played
if ( sportspress_array_value( $player_statistics, 'status' ) != 'sub' || sportspress_array_value( $player_statistics, 'sub', 0 ) ):
if ( sportspress_array_value( $player_performance, 'status' ) != 'sub' || sportspress_array_value( $player_performance, 'sub', 0 ) ):
$totals[ $player_id ]['eventsplayed']++;
endif;
foreach ( $player_statistics as $key => $value ):
foreach ( $player_performance as $key => $value ):
if ( array_key_exists( $key, $totals[ $player_id ] ) ):
$totals[ $player_id ][ $key ] += $value;
@@ -2525,17 +2525,17 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
foreach ( $teams as $players ):
foreach ( $players as $player_id => $player_statistics ):
foreach ( $players as $player_id => $player_performance ):
if ( ! $player_id || ! in_array( $player_id, $player_ids ) )
continue;
// Increment events played
if ( sportspress_array_value( $player_statistics, 'status' ) != 'sub' || sportspress_array_value( $player_statistics, 'sub', 0 ) ):
if ( sportspress_array_value( $player_performance, 'status' ) != 'sub' || sportspress_array_value( $player_performance, 'sub', 0 ) ):
$totals[ $player_id ]['eventsplayed']++;
endif;
foreach ( $player_statistics as $key => $value ):
foreach ( $player_performance as $key => $value ):
if ( array_key_exists( $key, $totals[ $player_id ] ) ):
$totals[ $player_id ][ $key ] += $value;
@@ -2552,26 +2552,26 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
endforeach;
$args = array(
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC',
);
$statistics = get_posts( $args );
$performances = get_posts( $args );
$columns = array( 'eventsplayed' => __( 'Played', 'sportspress' ) );
foreach ( $statistics as $statistic ):
foreach ( $performances as $performance ):
// Get post meta
$meta = get_post_meta( $statistic->ID );
$meta = get_post_meta( $performance->ID );
// Add equation to object
$statistic->equation = sportspress_array_value( sportspress_array_value( $meta, 'sp_equation', array() ), 0, 0 );
$performance->equation = sportspress_array_value( sportspress_array_value( $meta, 'sp_equation', array() ), 0, 0 );
// Add column name to columns
$columns[ $statistic->post_name ] = $statistic->post_title;
$columns[ $performance->post_name ] = $performance->post_title;
endforeach;
@@ -2581,18 +2581,18 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
if ( ! $player_id )
continue;
// Add events played as an object to statistics for placeholder calculations
// Add events played as an object to performance for placeholder calculations
$epstat = new stdClass();
$epstat->post_name = 'eventsplayed';
array_unshift( $statistics, $epstat );
array_unshift( $performances, $epstat );
foreach ( $statistics as $statistic ):
if ( sportspress_array_value( $placeholders[ $player_id ], $statistic->post_name, '' ) == '' ):
foreach ( $performances as $performance ):
if ( sportspress_array_value( $placeholders[ $player_id ], $performance->post_name, '' ) == '' ):
if ( $statistic->post_name == 'eventsplayed' ):
if ( $performance->post_name == 'eventsplayed' ):
$calculate = 'total';
else:
$calculate = get_post_meta( $statistic->ID, 'sp_calculate', true );
$calculate = get_post_meta( $performance->ID, 'sp_calculate', true );
endif;
if ( $calculate && $calculate == 'average' ):
@@ -2600,15 +2600,15 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
// Reflect average
$eventsplayed = (int)sportspress_array_value( $totals[ $player_id ], 'eventsplayed', 0 );
if ( ! $eventsplayed ):
$placeholders[ $player_id ][ $statistic->post_name ] = 0;
$placeholders[ $player_id ][ $performance->post_name ] = 0;
else:
$placeholders[ $player_id ][ $statistic->post_name ] = sportspress_array_value( sportspress_array_value( $totals, $player_id, array() ), $statistic->post_name, 0 ) / $eventsplayed;
$placeholders[ $player_id ][ $performance->post_name ] = sportspress_array_value( sportspress_array_value( $totals, $player_id, array() ), $performance->post_name, 0 ) / $eventsplayed;
endif;
else:
// Reflect total
$placeholders[ $player_id ][ $statistic->post_name ] = sportspress_array_value( sportspress_array_value( $totals, $player_id, array() ), $statistic->post_name, 0 );
$placeholders[ $player_id ][ $performance->post_name ] = sportspress_array_value( sportspress_array_value( $totals, $player_id, array() ), $performance->post_name, 0 );
endif;
@@ -2637,17 +2637,17 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
endforeach;
if ( $orderby != 'number' || $order != 'ASC' ):
global $sportspress_statistic_priorities;
$sportspress_statistic_priorities = array(
global $sportspress_performance_priorities;
$sportspress_performance_priorities = array(
array(
'statistic' => $orderby,
'key' => $orderby,
'order' => $order,
),
);
uasort( $merged, 'sportspress_sort_list_players' );
endif;
// Rearrange data array to reflect statistics
// Rearrange data array to reflect performance
$data = array();
foreach( $merged as $key => $value ):
$data[ $key ] = $tempdata[ $key ];
@@ -2666,22 +2666,22 @@ if ( !function_exists( 'sportspress_get_player_roster_data' ) ) {
if ( !function_exists( 'sportspress_sort_list_players' ) ) {
function sportspress_sort_list_players ( $a, $b ) {
global $sportspress_statistic_priorities;
global $sportspress_performance_priorities;
// Loop through priorities
foreach( $sportspress_statistic_priorities as $priority ):
foreach( $sportspress_performance_priorities as $priority ):
// Proceed if columns are not equal
if ( sportspress_array_value( $a, $priority['statistic'], 0 ) != sportspress_array_value( $b, $priority['statistic'], 0 ) ):
if ( sportspress_array_value( $a, $priority['key'], 0 ) != sportspress_array_value( $b, $priority['key'], 0 ) ):
if ( $priority['statistic'] == 'name' ):
if ( $priority['key'] == 'name' ):
$output = strcmp( sportspress_array_value( $a, 'name', null ), sportspress_array_value( $b, 'name', null ) );
else:
// Compare statistic values
$output = sportspress_array_value( $a, $priority['statistic'], 0 ) - sportspress_array_value( $b, $priority['statistic'], 0 );
// Compare performance values
$output = sportspress_array_value( $a, $priority['key'], 0 ) - sportspress_array_value( $b, $priority['key'], 0 );
endif;
@@ -2724,16 +2724,16 @@ if ( !function_exists( 'sportspress_get_player_metrics_data' ) ) {
}
}
if ( !function_exists( 'sportspress_get_player_statistics_data' ) ) {
function sportspress_get_player_statistics_data( $post_id, $league_id, $admin = false ) {
if ( !function_exists( 'sportspress_get_player_performance_data' ) ) {
function sportspress_get_player_performance_data( $post_id, $league_id, $admin = false ) {
$seasons = (array)get_the_terms( $post_id, 'sp_season' );
$positions = get_the_terms( $post_id, 'sp_position' );
$stats = (array)get_post_meta( $post_id, 'sp_statistics', true );
$stats = (array)get_post_meta( $post_id, 'sp_performance', true );
$seasons_teams = sportspress_array_value( (array)get_post_meta( $post_id, 'sp_leagues', true ), $league_id, array() );
$args = array(
'post_type' => 'sp_statistic',
'post_type' => 'sp_performance',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
@@ -2754,15 +2754,15 @@ if ( !function_exists( 'sportspress_get_player_statistics_data' ) ) {
);
endif;
$statistics = get_posts( $args );
$performances = get_posts( $args );
$statistic_labels = array();
$performance_labels = array();
$equations = array( 'eventsplayed' => 'total' );
foreach ( $statistics as $statistic ):
$statistic_labels[ $statistic->post_name ] = $statistic->post_title;
$equations[ $statistic->post_name ] = get_post_meta( $statistic->ID, 'sp_calculate', true );
foreach ( $performances as $performance ):
$performance_labels[ $performance->post_name ] = $performance->post_title;
$equations[ $performance->post_name ] = get_post_meta( $performance->ID, 'sp_calculate', true );
endforeach;
$columns = array_merge( array( 'eventsplayed' => __( 'Played', 'sportspress' ) ), $statistic_labels );
$columns = array_merge( array( 'eventsplayed' => __( 'Played', 'sportspress' ) ), $performance_labels );
// Generate array of all season ids and season names
$div_ids = array();
@@ -2785,7 +2785,7 @@ if ( !function_exists( 'sportspress_get_player_statistics_data' ) ) {
$totals = array( 'eventsattended' => 0, 'eventsplayed' => 0 );
foreach ( $statistic_labels as $key => $value ):
foreach ( $performance_labels as $key => $value ):
$totals[ $key ] = 0;
endforeach;
@@ -2817,16 +2817,16 @@ if ( !function_exists( 'sportspress_get_player_statistics_data' ) ) {
foreach( $events as $event ):
$totals['eventsattended']++;
$team_statistics = (array)get_post_meta( $event->ID, 'sp_players', true );
$team_performance = (array)get_post_meta( $event->ID, 'sp_players', true );
// Add all team statistics
foreach ( $team_statistics as $players ):
// Add all team performance
foreach ( $team_performance as $players ):
if ( array_key_exists( $post_id, $players ) ):
$player_statistics = sportspress_array_value( $players, $post_id, array() );
if ( sportspress_array_value( $player_statistics, 'status' ) != 'sub' || sportspress_array_value( $player_statistics, 'sub', 0 ) ):
$player_performance = sportspress_array_value( $players, $post_id, array() );
if ( sportspress_array_value( $player_performance, 'status' ) != 'sub' || sportspress_array_value( $player_performance, 'sub', 0 ) ):
$totals['eventsplayed']++;
endif;
foreach ( $player_statistics as $key => $value ):
foreach ( $player_performance as $key => $value ):
if ( array_key_exists( $key, $totals ) ):
$totals[ $key ] += $value;
endif;

View File

@@ -68,7 +68,7 @@ $sportspress_sports['baseball'] = array(
),
),
// Statistics
'sp_statistic' => array(
'sp_performance' => array(
),
// Results
'sp_result' => array(

View File

@@ -149,7 +149,7 @@ $sportspress_sports['basketball'] = array(
),
),
// Player Statistics
'sp_statistic' => array(
'sp_performance' => array(
array(
'post_title' => 'MIN',
'post_name' => 'min',

View File

@@ -59,7 +59,7 @@ $sportspress_sports['cricket'] = array(
),
),
// Statistics
'sp_statistic' => array(
'sp_performance' => array(
),
// Results
'sp_result' => array(

View File

@@ -184,7 +184,7 @@ $sportspress_sports['football'] = array(
),
),
// Player Statistics
'sp_statistic' => array(
'sp_performance' => array(
array(
'post_title' => 'Comp',
'post_name' => 'comp',

View File

@@ -64,7 +64,7 @@ $sportspress_sports['footy'] = array(
)
),
// Statistics
'sp_statistic' => array(
'sp_performance' => array(
),
// Results
'sp_result' => array(

View File

@@ -57,7 +57,7 @@ $sportspress_sports['gaming'] = array(
),
),
// Statistics
'sp_statistic' => array(
'sp_performance' => array(
),
// Results
'sp_result' => array(

View File

@@ -8,7 +8,7 @@ $sportspress_sports['golf'] = array(
'sp_column' => array(
),
// Statistics
'sp_statistic' => array(
'sp_performance' => array(
array(
'post_title' => 'Events',
'post_name' => 'events',

View File

@@ -64,7 +64,7 @@ $sportspress_sports['hockey'] = array(
),
),
// Statistics
'sp_statistic' => array(
'sp_performance' => array(
),
// Results
'sp_result' => array(

View File

@@ -8,7 +8,7 @@ $sportspress_sports['racing'] = array(
'sp_column' => array(
),
// Statistics
'sp_statistic' => array(
'sp_performance' => array(
array(
'post_title' => 'Pts',
'post_name' => 'pts',

View File

@@ -119,7 +119,7 @@ $sportspress_sports['rugby'] = array(
),
),
// Player Statistics
'sp_statistic' => array(
'sp_performance' => array(
array(
'post_title' => 'Points',
'post_name' => 'points',

View File

@@ -156,7 +156,7 @@ $sportspress_sports['soccer'] = array(
),
),
// Player Statistics
'sp_statistic' => array(
'sp_performance' => array(
array(
'post_title' => 'Goals',
'post_name' => 'goals',

View File

@@ -35,19 +35,19 @@ require_once dirname( __FILE__ ) . '/functions.php';
// Templates
require_once dirname( __FILE__ ) . '/admin/templates/countdown.php';
require_once dirname( __FILE__ ) . '/admin/templates/event-details.php';
require_once dirname( __FILE__ ) . '/admin/templates/event-statistics.php';
require_once dirname( __FILE__ ) . '/admin/templates/event-performance.php';
require_once dirname( __FILE__ ) . '/admin/templates/event-results.php';
require_once dirname( __FILE__ ) . '/admin/templates/event-staff.php';
require_once dirname( __FILE__ ) . '/admin/templates/event-venue.php';
require_once dirname( __FILE__ ) . '/admin/templates/event-calendar.php';
require_once dirname( __FILE__ ) . '/admin/templates/event-list.php';
require_once dirname( __FILE__ ) . '/admin/templates/league-table.php';
require_once dirname( __FILE__ ) . '/admin/templates/player-league-statistics.php';
require_once dirname( __FILE__ ) . '/admin/templates/player-league-performance.php';
require_once dirname( __FILE__ ) . '/admin/templates/player-list.php';
//require_once dirname( __FILE__ ) . '/admin/templates/player-roster.php';
require_once dirname( __FILE__ ) . '/admin/templates/player-gallery.php';
require_once dirname( __FILE__ ) . '/admin/templates/player-metrics.php';
require_once dirname( __FILE__ ) . '/admin/templates/player-statistics.php';
require_once dirname( __FILE__ ) . '/admin/templates/player-performance.php';
require_once dirname( __FILE__ ) . '/admin/templates/team-columns.php';
// Options
@@ -62,7 +62,8 @@ require_once dirname( __FILE__ ) . '/admin/settings/options-permalink.php';
// Custom post types
require_once dirname( __FILE__ ) . '/admin/post-types/separator.php';
require_once dirname( __FILE__ ) . '/admin/post-types/column.php';
require_once dirname( __FILE__ ) . '/admin/post-types/statistic.php';
require_once dirname( __FILE__ ) . '/admin/post-types/performance.php';
//require_once dirname( __FILE__ ) . '/admin/post-types/statistic.php';
require_once dirname( __FILE__ ) . '/admin/post-types/metric.php';
require_once dirname( __FILE__ ) . '/admin/post-types/result.php';
require_once dirname( __FILE__ ) . '/admin/post-types/outcome.php';