Use primary instead of main for consistency

This commit is contained in:
Brian Miyaji
2014-06-19 19:32:10 +10:00
parent 7f1be9d5a4
commit 28da9fc2f8
3 changed files with 5 additions and 5 deletions

View File

@@ -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 ) {