diff --git a/admin/hooks/the-content.php b/admin/hooks/the-content.php index 304cd57e..3033d7fa 100644 --- a/admin/hooks/the-content.php +++ b/admin/hooks/the-content.php @@ -38,10 +38,10 @@ function sportspress_default_calendar_content( $content ) { $format = get_post_meta( $id, 'sp_format', true ); switch ( $format ): case 'list': - $calendar = sportspress_events_list( $id ); + $calendar = sportspress_event_list( $id ); break; default: - $calendar = sportspress_events_calendar( $id, false ); + $calendar = sportspress_event_calendar( $id, false ); break; endswitch; $content = $calendar . $content; diff --git a/admin/hooks/widget-text.php b/admin/hooks/widget-text.php index 1b08c458..5bf97f58 100644 --- a/admin/hooks/widget-text.php +++ b/admin/hooks/widget-text.php @@ -1,6 +1,6 @@

-

+

- +
<' . $caption_tag . ' class="sp-table-caption">' . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . ''; @@ -200,12 +200,12 @@ if ( !function_exists( 'sportspress_events_calendar' ) ) { if ( $id && $r['show_all_events_link'] ) $calendar_output .= '' . __( 'View all events', 'sportspress' ) . ''; - return apply_filters( 'sportspress_events_calendar', $calendar_output ); + return apply_filters( 'sportspress_event_calendar', $calendar_output ); } } -function sportspress_events_calendar_shortcode( $atts ) { +function sportspress_event_calendar_shortcode( $atts ) { if ( isset( $atts['id'] ) ): $id = $atts['id']; unset( $atts['id'] ); @@ -216,6 +216,7 @@ function sportspress_events_calendar_shortcode( $atts ) { $id = null; endif; $initial = isset( $atts['initial'] ) ? $atts['initial'] : true; - return sportspress_events_calendar( $id, $initial, $atts ); + return sportspress_event_calendar( $id, $initial, $atts ); } -add_shortcode('events-calendar', 'sportspress_events_calendar_shortcode'); +add_shortcode('event-calendar', 'sportspress_event_calendar_shortcode'); +add_shortcode('events-calendar', 'sportspress_event_calendar_shortcode'); diff --git a/admin/templates/events-list.php b/admin/templates/event-list.php similarity index 88% rename from admin/templates/events-list.php rename to admin/templates/event-list.php index 6ba087f3..e782d7bc 100644 --- a/admin/templates/events-list.php +++ b/admin/templates/event-list.php @@ -1,6 +1,6 @@ ' . - '
' . '' . ''; + '
' . '' . ''; list( $data, $usecolumns ) = sportspress_get_calendar_data( $id, true ); @@ -121,12 +121,12 @@ if ( !function_exists( 'sportspress_events_list' ) ) { $output .= ''; - return apply_filters( 'sportspress_events_list', $output ); + return apply_filters( 'sportspress_event_list', $output ); } } -function sportspress_events_list_shortcode( $atts ) { +function sportspress_event_list_shortcode( $atts ) { if ( isset( $atts['id'] ) ): $id = $atts['id']; unset( $atts['id'] ); @@ -136,6 +136,7 @@ function sportspress_events_list_shortcode( $atts ) { else: $id = null; endif; - return sportspress_events_list( $id, $atts ); + return sportspress_event_list( $id, $atts ); } -add_shortcode('events-list', 'sportspress_events_list_shortcode'); +add_shortcode('event-list', 'sportspress_event_list_shortcode'); +add_shortcode('events-list', 'sportspress_event_list_shortcode'); diff --git a/admin/templates/events.php b/admin/templates/events.php deleted file mode 100644 index 3b3e59bb..00000000 --- a/admin/templates/events.php +++ /dev/null @@ -1,66 +0,0 @@ - 'sp_event', - 'posts_per_page' => 1, - 'post_status' => 'publish', - 'tax_query' => array(), - ); - - if ( isset( $args['number'] ) ): - $options['posts_per_page'] = $args['number']; - endif; - - if ( isset( $args['status'] ) && $args['status'] == 'future' ): - $options['post_status'] = array( 'future' ); - $options['order'] = 'ASC'; - endif; - - if ( isset( $args['league'] ) ): - $options['tax_query'][] = array( - 'taxonomy' => 'sp_league', - 'field' => 'id', - 'terms' => $league - ); - endif; - - if ( isset( $args['season'] ) ): - $options['tax_query'][] = array( - 'taxonomy' => 'sp_season', - 'field' => 'id', - 'terms' => $season - ); - endif; - - if ( isset( $args['venue'] ) ): - $options['tax_query'][] = array( - 'taxonomy' => 'sp_venue', - 'field' => 'id', - 'terms' => $venue - ); - endif; - - $query = new WP_Query( $options ); - - if ( $query->have_posts() ): - $output = ''; - wp_reset_postdata(); - endif; - - return apply_filters( 'sportspress_events', $output ); - - } -} diff --git a/admin/widgets/events-calendar.php b/admin/widgets/event-calendar.php similarity index 73% rename from admin/widgets/events-calendar.php rename to admin/widgets/event-calendar.php index aae2a2b4..aec7ea18 100644 --- a/admin/widgets/events-calendar.php +++ b/admin/widgets/event-calendar.php @@ -1,9 +1,9 @@ 'widget_calendar widget_sp_events_calendar', 'description' => __( 'A calendar of events.', 'sportspress' ) ); - parent::__construct('sp_events_calendar', __( 'SportsPress Events Calendar', 'sportspress' ), $widget_ops); + $widget_ops = array('classname' => 'widget_calendar widget_sp_event_calendar', 'description' => __( 'A calendar of events.', 'sportspress' ) ); + parent::__construct('sp_event_calendar', __( 'SportsPress Events Calendar', 'sportspress' ), $widget_ops); } function widget( $args, $instance ) { @@ -15,7 +15,7 @@ class SportsPress_Widget_Events_Calendar extends WP_Widget { if ( $title ) echo $before_title . $title . $after_title; echo '
'; - echo sportspress_events_calendar( $id, true, array( 'caption_tag' => 'caption', 'show_all_events_link' => $show_all_events_link ) ); + echo sportspress_event_calendar( $id, true, array( 'caption_tag' => 'caption', 'show_all_events_link' => $show_all_events_link ) ); echo '
'; echo $after_widget; } @@ -47,7 +47,7 @@ class SportsPress_Widget_Events_Calendar extends WP_Widget { 'id' => $this->get_field_id('id'), 'selected' => $id, 'values' => 'ID', - 'class' => 'sp-events-calendar-select widefat', + 'class' => 'sp-event-calendar-select widefat', ); if ( ! sportspress_dropdown_pages( $args ) ): sportspress_post_adder( 'sp_calendar', __( 'Add New', 'sportspress' ) ); @@ -55,9 +55,9 @@ class SportsPress_Widget_Events_Calendar extends WP_Widget { ?>

-

> +

>

'widget_sp_events_list', 'description' => __( 'A list of events.', 'sportspress' ) ); - parent::__construct('sp_events_list', __( 'SportsPress Events List', 'sportspress' ), $widget_ops); + $widget_ops = array('classname' => 'widget_sp_event_list', 'description' => __( 'A list of events.', 'sportspress' ) ); + parent::__construct('sp_event_list', __( 'SportsPress Events List', 'sportspress' ), $widget_ops); } function widget( $args, $instance ) { @@ -15,7 +15,7 @@ class SportsPress_Widget_Events_List extends WP_Widget { echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; - echo sportspress_events_list( $id, array( 'columns' => $columns, 'show_all_events_link' => $show_all_events_link ) ); + echo sportspress_event_list( $id, array( 'columns' => $columns, 'show_all_events_link' => $show_all_events_link ) ); echo $after_widget; } @@ -48,7 +48,7 @@ class SportsPress_Widget_Events_List extends WP_Widget { 'id' => $this->get_field_id('id'), 'selected' => $id, 'values' => 'ID', - 'class' => 'sp-events-calendar-select widefat', + 'class' => 'sp-event-calendar-select widefat', ); if ( ! sportspress_dropdown_pages( $args ) ): sportspress_post_adder( 'sp_calendar', __( 'Add New', 'sportspress' ) ); @@ -73,9 +73,9 @@ class SportsPress_Widget_Events_List extends WP_Widget {

-

> +

>