diff --git a/includes/sp-event-export.php b/includes/sp-event-export.php index 2fab4a3..3e82472 100644 --- a/includes/sp-event-export.php +++ b/includes/sp-event-export.php @@ -53,6 +53,7 @@ function tse_sp_event_export_get_column_definitions() { 'away_team' => __( 'Away Team', 'tonys-sportspress-enhancements' ), 'home_team' => __( 'Home Team', 'tonys-sportspress-enhancements' ), 'field_name' => __( 'Field Name', 'tonys-sportspress-enhancements' ), + 'field_address' => __( 'Field Address', 'tonys-sportspress-enhancements' ), 'officials' => __( 'Officials', 'tonys-sportspress-enhancements' ), ), 'team' => array( @@ -65,6 +66,7 @@ function tse_sp_event_export_get_column_definitions() { 'opponent_name' => __( 'Opponent', 'tonys-sportspress-enhancements' ), 'location_flag' => __( 'Home/Away', 'tonys-sportspress-enhancements' ), 'field_name' => __( 'Field Name', 'tonys-sportspress-enhancements' ), + 'field_address' => __( 'Field Address', 'tonys-sportspress-enhancements' ), 'field_abbreviation' => __( 'Field Abbreviation', 'tonys-sportspress-enhancements' ), 'field_short_name' => __( 'Field Short Name', 'tonys-sportspress-enhancements' ), 'officials' => __( 'Officials', 'tonys-sportspress-enhancements' ), @@ -332,6 +334,7 @@ function tse_sp_event_export_get_events( $filters ) { 'home_team' => $home_id > 0 ? get_the_title( $home_id ) : '', 'away_team' => $away_id > 0 ? get_the_title( $away_id ) : '', 'field_name' => isset( $venue['name'] ) ? $venue['name'] : '', + 'field_address' => isset( $venue['address'] ) ? $venue['address'] : '', 'field_abbreviation' => isset( $venue['abbreviation'] ) ? $venue['abbreviation'] : '', 'field_short_name' => isset( $venue['short_name'] ) ? $venue['short_name'] : '', 'season' => tse_sp_event_export_get_event_term_names( $event_id, 'sp_season' ), @@ -380,15 +383,18 @@ function tse_sp_event_export_get_primary_field( $event_id ) { if ( ! is_array( $venues ) || ! isset( $venues[0] ) || ! $venues[0] instanceof WP_Term ) { return array( 'name' => '', + 'address' => '', 'abbreviation' => '', 'short_name' => '', ); } $venue = $venues[0]; + $meta = get_option( 'taxonomy_' . $venue->term_id ); return array( 'name' => isset( $venue->name ) ? (string) $venue->name : '', + 'address' => is_array( $meta ) && isset( $meta['sp_address'] ) ? trim( (string) $meta['sp_address'] ) : '', 'abbreviation' => trim( (string) get_term_meta( $venue->term_id, 'tse_abbreviation', true ) ), 'short_name' => trim( (string) get_term_meta( $venue->term_id, 'tse_short_name', true ) ), ); diff --git a/includes/sp-schedule-exporter.php b/includes/sp-schedule-exporter.php index 2415c56..5f6b160 100644 --- a/includes/sp-schedule-exporter.php +++ b/includes/sp-schedule-exporter.php @@ -1,6 +1,6 @@ '; - echo '

' . esc_html__( 'Schedule Exporter', 'tonys-sportspress-enhancements' ) . '

'; - echo '

' . esc_html__( 'Choose filters once, then generate the CSV feed, iCal link, or printable page URL from the same controls.', 'tonys-sportspress-enhancements' ) . '

'; - - echo '
'; - echo ''; - echo '
'; - - echo '
'; - echo '
'; - echo ''; - echo '

' . esc_html__( 'CSV builds a feed URL, iCal Link builds a subscription URL, and Printable opens the printable page.', 'tonys-sportspress-enhancements' ) . '

'; - echo '
'; - - echo '
'; - echo '
'; - echo ''; - echo '

' . esc_html__( 'Matchup is away vs home. Team is opponent-based and requires one specific team.', 'tonys-sportspress-enhancements' ) . '

'; - echo '
'; - - echo '
'; - echo '
'; - echo ''; - echo '
'; - - echo '
'; - echo '
'; - echo ''; - echo '
'; - - echo '
'; - echo '
'; - echo ''; - echo '

' . esc_html__( 'Teams are filtered by the selected league and season.', 'tonys-sportspress-enhancements' ) . '

'; - echo '
'; - - echo '
'; - echo '
'; - echo ''; - echo '

' . esc_html__( 'Use the field filter to narrow the feed to a specific venue.', 'tonys-sportspress-enhancements' ) . '

'; - echo '
'; - - echo '
'; - echo '
'; - - if ( empty( $teams ) ) { - echo '

' . esc_html__( 'No SportsPress teams match the selected league and season.', 'tonys-sportspress-enhancements' ) . '

'; - echo ''; - return; - } - - echo '
'; - echo '

' . esc_html__( 'Output URL', 'tonys-sportspress-enhancements' ) . '

'; - echo '

' . esc_html__( 'The generated URL below updates from the shared controls above.', 'tonys-sportspress-enhancements' ) . '

'; - - tse_sp_schedule_exporter_render_column_picker( 'matchup', 'admin', $subformat ); - tse_sp_schedule_exporter_render_column_picker( 'team', 'admin', $subformat ); - - $base_args = array( - 'league_id' => $league_id, - 'team_id' => $team_id, - 'season_id' => $season_id, - 'field_id' => $field_id, - 'format' => $subformat, - ); - $csv_url = tse_sp_event_export_get_feed_url( $base_args, 'csv' ); - $ics_url = tse_sp_event_export_get_feed_url( - array( - 'league_id' => $league_id, - 'team_id' => $team_id, - 'season_id' => $season_id, - 'field_id' => $field_id, - ), - 'ics' - ); - $print_url = tse_sp_schedule_exporter_get_printable_url( $team_id, $season_id, 'letter', $league_id ); - $current_url = tse_sp_schedule_exporter_get_output_url( $export_type, $csv_url, $ics_url, $print_url ); - - echo '
'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo '
'; - echo '

' . esc_html__( 'Use the buttons to copy the generated URL or open the right destination for this export type.', 'tonys-sportspress-enhancements' ) . '

'; - tse_sp_schedule_exporter_render_link_sync_script( true ); - echo '
'; - echo ''; -} - /** * Render the public shortcode. * diff --git a/tonys-sportspress-enhancements.php b/tonys-sportspress-enhancements.php index a4e492b..49d6af2 100644 --- a/tonys-sportspress-enhancements.php +++ b/tonys-sportspress-enhancements.php @@ -8,13 +8,13 @@ * Text Domain: tonys-sportspress-enhancements * Domain Path: /languages * Update URI: https://github.com/anthonyscorrea/tonys-sportspress-enhancements - * Version: 0.1.8 + * Version: 0.1.9 * * @package Tonys_Sportspress_Enhancements */ if ( ! defined( 'TONY_SPORTSPRESS_ENHANCEMENTS_VERSION' ) ) { - define( 'TONY_SPORTSPRESS_ENHANCEMENTS_VERSION', '0.1.8' ); + define( 'TONY_SPORTSPRESS_ENHANCEMENTS_VERSION', '0.1.9' ); } if ( ! defined( 'TONY_SPORTSPRESS_ENHANCEMENTS_FILE' ) ) {