Clean up functions
This commit is contained in:
@@ -22,11 +22,7 @@ if ( !function_exists( 'sportspress_array_between' ) ) {
|
|||||||
|
|
||||||
if ( !function_exists( 'sportspress_array_value' ) ) {
|
if ( !function_exists( 'sportspress_array_value' ) ) {
|
||||||
function sportspress_array_value( $arr = array(), $key = 0, $default = null ) {
|
function sportspress_array_value( $arr = array(), $key = 0, $default = null ) {
|
||||||
if ( is_array( $arr ) && array_key_exists( $key, $arr ) )
|
return ( isset( $arr[ $key ] ) ? $arr[ $key ] : $default );
|
||||||
$subset = $arr[ $key ];
|
|
||||||
else
|
|
||||||
$subset = $default;
|
|
||||||
return $subset;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2037,17 +2033,11 @@ if ( !function_exists( 'sportspress_get_player_statistics_data' ) ) {
|
|||||||
$position_ids[] = $position->term_id;
|
$position_ids[] = $position->term_id;
|
||||||
endforeach;
|
endforeach;
|
||||||
$args['tax_query'] = array(
|
$args['tax_query'] = array(
|
||||||
'relation' => 'OR',
|
|
||||||
array(
|
array(
|
||||||
'taxonomy' => 'sp_position',
|
'taxonomy' => 'sp_position',
|
||||||
'field' => 'id',
|
'field' => 'id',
|
||||||
'terms' => $position_ids,
|
'terms' => $position_ids,
|
||||||
),
|
),
|
||||||
array(
|
|
||||||
'taxonomy' => 'sp_position',
|
|
||||||
'field' => 'id',
|
|
||||||
'operator' => 'NOT SET',
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user