From 81fbe8aeee3a44ecf62041062c590123d51851bc Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Thu, 5 Mar 2015 19:13:09 +1100 Subject: [PATCH] Add API functions to get event outcomes and winner --- includes/sp-api-functions.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/includes/sp-api-functions.php b/includes/sp-api-functions.php index 40059964..21f0da51 100644 --- a/includes/sp-api-functions.php +++ b/includes/sp-api-functions.php @@ -65,6 +65,21 @@ function sp_the_main_results_or_time( $post = 0, $delimiter = '-' ) { echo implode( $delimiter, sp_get_main_results_or_time( $post ) ); } +function sp_get_outcome( $post = 0 ) { + $event = new SP_Event( $post ); + return $event->outcome( true ); +} + +function sp_get_outcomes( $post = 0 ) { + $event = new SP_Event( $post ); + return $event->outcome( false ); +} + +function sp_get_winner( $post = 0 ) { + $event = new SP_Event( $post ); + return $event->winner(); +} + function sp_get_performance( $post = 0 ) { $event = new SP_Event( $post ); return $event->performance();