php – apply_filters with several different values?

Question

Hi I am very new to php but I am trying to learn. Hope the question is ok to ask.

I don’t know if it is even possible or if I should use another way to get my result. But I like to know what I’m doing wrong when it comes to season, what I’m trying to get is all IDs between 1 and 1000 on seasons except 62 and 269 i this case.

Im try to work with apply_filters but can I only add 1 value? Or should I use another method to get what I want?

$sasong = array_filter(range(1,1000), function($item) { return $item !== 62 && $item !== 269; } );

$format = get_option( 'sportspress_team_events_format', 'blocks' );
if ( 'calendar' === $format ) {
    sp_get_template( 'event-calendar.php', array( 'team' => $id ) );
} elseif ( 'list' === $format ) {
    $args = array(
        'team'         => $id,
        'league'       => apply_filters( 'sp_team_events_league', 0 ),
        'season'       => apply_filters( 'sp_team_events_season', $sasong ),
        'title_format' => 'homeaway',
        'time_format'  => 'separate',
        'columns'      => array( 'event', 'time', 'results' ),
        'order'        => 'DESC',
    );
    $args = apply_filters( 'sp_team_events_list_args', $args );
    sp_get_template( 'event-list.php', $args );
} else {
    sp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) );
}

Thanks for the help in advance!

0
Kalle 1 month 2022-08-21T12:37:43-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse