From 823782a38ebe4e2ae54dc5f2f8c7a732b058c44d Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 2 Feb 2015 23:27:47 +1100 Subject: [PATCH] Add CS:GO preset and credits section --- includes/admin/class-sp-admin-sports.php | 7 +++++-- includes/admin/class-sp-admin-welcome.php | 25 ++++++++++++++++++++--- presets/esports/csgo.json | 21 +++++++++++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 presets/esports/csgo.json diff --git a/includes/admin/class-sp-admin-sports.php b/includes/admin/class-sp-admin-sports.php index 38c49ca9..38483d6a 100644 --- a/includes/admin/class-sp-admin-sports.php +++ b/includes/admin/class-sp-admin-sports.php @@ -110,7 +110,7 @@ class SP_Admin_Sports { $positions = sp_array_value( $preset, 'positions', array() ); foreach ( $positions as $index => $term ) { $slug = $index . '-' . sanitize_title( $term ); - wp_insert_term( $term, 'sp_position', array( 'description' => $term, 'slug' => $slug ) ); + wp_insert_term( $term, 'sp_position', array( 'slug' => $slug ) ); } // Outcomes @@ -228,7 +228,9 @@ class SP_Admin_Sports { $post_array['post_type'] = $post_type; // Add post excerpt - $post_array['post_excerpt'] = sp_array_value( $post, 'description', $post_array['post_title'] ); + if ( array_key_exists( 'description', $post ) ) { + $post_array['post_excerpt'] = $post['description']; + } return $post_array; } @@ -271,5 +273,6 @@ class SP_Admin_Sports { __( 'Water Polo', 'sportspress' ); __( 'Dota 2', 'sportspress' ); __( 'League of Legends', 'sportspress' ); + __( 'Counter-Strike: Global Offensive', 'sportspress' ); } } diff --git a/includes/admin/class-sp-admin-welcome.php b/includes/admin/class-sp-admin-welcome.php index ce7f68a3..05870698 100644 --- a/includes/admin/class-sp-admin-welcome.php +++ b/includes/admin/class-sp-admin-welcome.php @@ -319,12 +319,31 @@ class SP_Admin_Welcome { public function credits_screen() { ?>
- intro(); ?> - +

Contribute to SportsPress.', 'sportspress' ), 'https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md' ); ?>

- contributors(); ?> +
+

+ contributors(); ?> +
+ +

Add a Sport Preset.', 'sportspress' ), 'http://themeboy.com/add-sport-preset/' ); ?>

+ +
+

+ 'Oscar Wong', + ); + ?> +
+ $name ) { ?> +
+
+ +
+
" }, + { "name" : "Loss", "condition" : "<" } + ], + "results": [ + "Map Score", + { "name" : "Round Score", "primary" : 1 } + ], + "performance": [ + "Kills", + "Deaths", + "Assists" + ], + "metrics": [ + ], + "statistics": [ + { "name" : "KDA Ratio", "equation" : "( $kills + $assists ) / $deaths", "precision" : 2, "description" : "Kills/deaths/assists ratio" } + ] +} \ No newline at end of file