diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php index 4f8cc4da..97220011 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php @@ -26,7 +26,7 @@ class SP_Meta_Box_Statistic_Details extends SP_Meta_Box_Config { $precision = get_post_meta( $post->ID, 'sp_precision', true ); $section = get_post_meta( $post->ID, 'sp_section', true ); $format = get_post_meta( $post->ID, 'sp_format', true ); - $total = get_post_meta( $post->ID, 'sp_total_type', true ); + $total = get_post_meta( $post->ID, 'sp_type', true ); $visible = get_post_meta( $post->ID, 'sp_visible', true ); // Defaults @@ -68,7 +68,7 @@ class SP_Meta_Box_Statistic_Details extends SP_Meta_Box_Config {

- __( 'Total', 'sportspress' ), 'average' => __( 'Average', 'sportspress' ) ) ); foreach ( $options as $key => $value ): @@ -104,7 +104,7 @@ class SP_Meta_Box_Statistic_Details extends SP_Meta_Box_Config { public static function save( $post_id, $post ) { self::delete_duplicate( $_POST ); update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) ); - update_post_meta( $post_id, 'sp_total_type', sp_array_value( $_POST, 'sp_total_type', 'total' ) ); + update_post_meta( $post_id, 'sp_type', sp_array_value( $_POST, 'sp_type', 'total' ) ); update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) ); update_post_meta( $post_id, 'sp_precision', (int) sp_array_value( $_POST, 'sp_precision', 1 ) ); update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) ); diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index f3962956..ca76253f 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -642,7 +642,7 @@ class SP_Player extends SP_Custom_Post { } $formats[ $post->post_name ] = $format; - $total_type = get_post_meta( $post->ID, 'sp_total_type', true ); + $total_type = get_post_meta( $post->ID, 'sp_type', true ); if ( '' === $total_type ) { $total_type = 'total'; } @@ -670,7 +670,7 @@ class SP_Player extends SP_Custom_Post { // Calculate average-based statistics from performance foreach ( $posts as $post ) { - $type = get_post_meta( $post->ID, 'sp_total_type', 'total' ); + $type = get_post_meta( $post->ID, 'sp_type', 'total' ); if ( 'average' !== $type ) continue; $value = sp_array_value( $equations, $post->post_name, null ); if ( null === $value || ! isset( $value['equation'] ) ) continue;