Refactor
This commit is contained in:
@@ -20,21 +20,7 @@ class SP_Meta_Box_Player_Statistics {
|
|||||||
*/
|
*/
|
||||||
public static function output( $post ) {
|
public static function output( $post ) {
|
||||||
$player = new SP_Player( $post );
|
$player = new SP_Player( $post );
|
||||||
$args = array(
|
$leagues = $player->get_terms_sorted_by_sp_order( 'sp_league' );
|
||||||
'meta_query' => array(
|
|
||||||
'relation' => 'OR',
|
|
||||||
array(
|
|
||||||
'key' => 'sp_order',
|
|
||||||
'compare' => 'NOT EXISTS',
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'key' => 'sp_order',
|
|
||||||
'compare' => 'EXISTS',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
$leagues = get_the_terms( $post->ID, 'sp_league', $args );
|
|
||||||
usort( $leagues, 'sp_sort_terms' );
|
|
||||||
$league_num = sizeof( $leagues );
|
$league_num = sizeof( $leagues );
|
||||||
$sections = get_option( 'sportspress_player_performance_sections', -1 );
|
$sections = get_option( 'sportspress_player_performance_sections', -1 );
|
||||||
$show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;
|
$show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;
|
||||||
|
|||||||
Reference in New Issue
Block a user