Use primary instead of main for consistency
This commit is contained in:
@@ -82,12 +82,12 @@ class SP_Admin_Sports {
|
||||
$post_type = 'sp_result';
|
||||
$results = sp_array_value( $preset, 'results', array() );
|
||||
self::delete_preset_posts( $post_type );
|
||||
$main_result = 0;
|
||||
$primary_result = 0;
|
||||
foreach ( $results as $index => $result ) {
|
||||
$post = self::get_post_array( $result, $post_type );
|
||||
if ( empty( $post ) ) continue;
|
||||
$id = self::insert_preset_post( $post, $index );
|
||||
if ( array_key_exists( 'main', $result ) ) $main_result = $post['post_name'];
|
||||
if ( array_key_exists( 'primary', $result ) ) $primary_result = $post['post_name'];
|
||||
}
|
||||
|
||||
// Performance
|
||||
@@ -135,7 +135,7 @@ class SP_Admin_Sports {
|
||||
update_post_meta( $id, 'sp_equation', sp_array_value( $statistic, 'equation', null ) );
|
||||
update_post_meta( $id, 'sp_precision', sp_array_value( $statistic, 'precision', 0 ) );
|
||||
}
|
||||
update_option( 'sportspress_primary_result', $main_result );
|
||||
update_option( 'sportspress_primary_result', $primary_result );
|
||||
}
|
||||
|
||||
public static function delete_preset_posts( $post_type = null ) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{ "name" : "Q4", "description" : "Fourth quarter points" },
|
||||
"Goals",
|
||||
"Behinds",
|
||||
{ "name" : "Total", "description" : "Total points", "main" : 1 }
|
||||
{ "name" : "Total", "description" : "Total points", "primary" : 1 }
|
||||
],
|
||||
"performance": [
|
||||
"Kicks",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{ "name" : "1st Half", "description" : "1st half goals" },
|
||||
{ "name" : "2nd Half", "description" : "2nd half goals" },
|
||||
{ "name" : "PK", "description" : "Penalty kicks" },
|
||||
{ "name" : "Goals", "description" : "Total goals", "main" : 1 }
|
||||
{ "name" : "Goals", "description" : "Total goals", "primary" : 1 }
|
||||
],
|
||||
"performance": [
|
||||
"Goals",
|
||||
|
||||
Reference in New Issue
Block a user