Create SP_Table class to handle league table data

This commit is contained in:
Brian Miyaji
2014-04-26 13:19:36 +10:00
parent 0406de7552
commit 08f13358b3
5 changed files with 403 additions and 17 deletions

View File

@@ -167,3 +167,17 @@ function sportspress_delete_duplicate_post( &$post ) {
function sportspress_highlight_admin_menu( $p = 'options-general.php', $s = 'sportspress' ) {
return sp_highlight_admin_menu( $p, $s );
}
if ( !function_exists( 'sp_get_player_list_data' ) ) {
function sp_get_player_list_data( $post_id, $admin = false ) {
$formatter = new SP_Data_Formatter;
return $formatter->player_list( $post_id, $admin );
}
}
if ( !function_exists( 'sp_get_league_table_data' ) ) {
function sp_get_league_table_data( $post_id, $admin = false ) {
$table = new SP_Table( $post_id );
return $table->data( $admin );
}
}