null, 'title' => false, 'status' => 'default', 'date' => 'default', 'date_from' => 'default', 'date_to' => 'default', 'date_past' => 'default', 'date_future' => 'default', 'date_relative' => 'default', 'day' => 'default', 'league' => null, 'season' => null, 'venue' => null, 'team' => null, 'player' => null, 'number' => -1, 'show_team_logo' => get_option( 'sportspress_event_blocks_show_logos', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_event_blocks_rows', 5 ), 'orderby' => 'default', 'order' => 'default', 'show_all_events_link' => false, 'show_title' => get_option( 'sportspress_event_blocks_show_title', 'no' ) == 'yes' ? true : false, 'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false, 'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false, 'show_venue' => get_option( 'sportspress_event_blocks_show_venue', 'no' ) == 'yes' ? true : false, 'hide_if_empty' => false, ); extract( $defaults, EXTR_SKIP ); $calendar = new SP_Calendar( $id ); if ( $status != 'default' ) $calendar->status = $status; if ( $date != 'default' ) $calendar->date = $date; if ( $date_from != 'default' ) $calendar->from = $date_from; if ( $date_to != 'default' ) $calendar->to = $date_to; if ( $date_past != 'default' ) $calendar->past = $date_past; if ( $date_future != 'default' ) $calendar->future = $date_future; if ( $date_relative != 'default' ) $calendar->relative = $date_relative; if ( $league ) $calendar->league = $league; if ( $season ) $calendar->season = $season; if ( $venue ) $calendar->venue = $venue; if ( $team ) $calendar->team = $team; if ( $player ) $calendar->player = $player; if ( $order != 'default' ) $calendar->order = $order; if ( $orderby != 'default' ) $calendar->orderby = $orderby; if ( $day != 'default' ) $calendar->day = $day; $data = $calendar->data(); if ( $hide_if_empty && empty( $data ) ) return false; if ( $show_title && false === $title && $id ): $caption = $calendar->caption; if ( $caption ) $title = $caption; else $title = get_the_title( $id ); endif; if ( $title ) echo '

' . $title . '

'; ?>
0 ) $limit = $number; foreach ( $data as $event ): if ( isset( $limit ) && $i >= $limit ) continue; $permalink = get_post_permalink( $event, false, true ); $results = get_post_meta( $event->ID, 'sp_results', true ); $teams = array_unique( get_post_meta( $event->ID, 'sp_team' ) ); $teams = array_filter( $teams, 'sp_filter_positive' ); $logos = array(); if ( $show_team_logo ): $j = 0; foreach( $teams as $team ): $j++; $team_name = get_the_title( $team ); if ( has_post_thumbnail ( $team ) ): $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'itemprop' => 'logo' ) ); if ( $link_teams ): $team_permalink = get_permalink( $team, false, true ); $logo = ''; endif; $logo = ''; else: $logo = ''; endif; $logos[] = $logo; endforeach; endif; if ( 'day' === $calendar->orderby ): $event_group = get_post_meta( $event->ID, 'sp_day', true ); if ( ! isset( $group ) || $event_group !== $group ): $group = $event_group; echo ''; endif; endif; ?>
', __( 'Match Day', 'sportspress' ), ' ', $group, '
' . implode( ' - ', apply_filters( 'sportspress_event_blocks_team_result_or_time', sp_get_main_results_or_time( $event ), $event->ID ) ) . '', $permalink, $link_events ); ?>
name; ?>
name; ?>
name; ?>

post_title, $permalink, $link_events ); ?>

' . __( 'View all events', 'sportspress' ) . '
'; ?>