diff --git a/assets/css/dashboard.css b/assets/css/dashboard.css index f35f99bb..e5134b9b 100644 --- a/assets/css/dashboard.css +++ b/assets/css/dashboard.css @@ -6,30 +6,37 @@ } -#dashboard_right_now .sp-event-count a:before, -#dashboard_right_now .sp-event-count span:before, -#dashboard_right_now .sp-team-count a:before, -#dashboard_right_now .sp-team-count span:before, -#dashboard_right_now .sp-player-count a:before, -#dashboard_right_now .sp-player-count span:before { +#dashboard_right_now .sp_event-count a:before, +#dashboard_right_now .sp_event-count span:before, +#dashboard_right_now .sp_team-count a:before, +#dashboard_right_now .sp_team-count span:before, +#dashboard_right_now .sp_player-count a:before, +#dashboard_right_now .sp_player-count span:before, +#dashboard_right_now .sp_staff-count a:before, +#dashboard_right_now .sp_staff-count span:before { font-family: 'sportspress'; } -#dashboard_right_now .sp-event-count a:before, -#dashboard_right_now .sp-event-count span:before { +#dashboard_right_now .sp_event-count a:before, +#dashboard_right_now .sp_event-count span:before { content: "\f145"; } -#dashboard_right_now .sp-team-count a:before, -#dashboard_right_now .sp-team-count span:before { +#dashboard_right_now .sp_team-count a:before, +#dashboard_right_now .sp_team-count span:before { content: "\f334"; } -#dashboard_right_now .sp-player-count a:before, -#dashboard_right_now .sp-player-count span:before { +#dashboard_right_now .sp_player-count a:before, +#dashboard_right_now .sp_player-count span:before { content: "\f307"; } +#dashboard_right_now .sp_staff-count a:before, +#dashboard_right_now .sp_staff-count span:before { + content: "\f338"; +} + #sportspress_dashboard_status .sp_status_list { overflow: hidden; margin: 0; diff --git a/assets/js/admin/editor-lang.php b/assets/js/admin/editor-lang.php index 182dd70e..447e12ef 100644 --- a/assets/js/admin/editor-lang.php +++ b/assets/js/admin/editor-lang.php @@ -11,12 +11,6 @@ $options = array( ), ); -if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) { - $options['event'][] = 'calendar'; - $options['event'][] = 'list'; - $options['event'][] = 'blocks'; -} - if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) { $options['table'] = array( 'table' ); } diff --git a/includes/admin/class-sp-admin-dashboard.php b/includes/admin/class-sp-admin-dashboard.php index a8f4d264..213ddc58 100644 --- a/includes/admin/class-sp-admin-dashboard.php +++ b/includes/admin/class-sp-admin-dashboard.php @@ -39,7 +39,7 @@ class SP_Admin_Dashboard { * Add links to At a Glance */ function glance_items( $items = array() ) { - $post_types = array( 'sp_event', 'sp_team', 'sp_player' ); + $post_types = apply_filters( 'sportspress_glance_items', array( 'sp_event', 'sp_team', 'sp_player', 'sp_staff' ) ); foreach ( $post_types as $type ): if ( ! post_type_exists( $type ) ) continue; $num_posts = wp_count_posts( $type ); @@ -49,12 +49,11 @@ class SP_Admin_Dashboard { $text = _n( '%s ' . $post_type->labels->singular_name, '%s ' . $post_type->labels->name, $published, 'sportspress' ); $text = sprintf( $text, number_format_i18n( $published ) ); if ( current_user_can( $post_type->cap->edit_posts ) ): - $output = '' . $text . ''; - echo '
- __( 'All', 'sportspress' ), - 'post_type' => 'sp_team', - 'name' => 'sp_team', - 'selected' => $team_id, - 'values' => 'ID' - ); - if ( ! sp_dropdown_pages( $args ) ): - sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) ); - endif; - ?> -
+ __( 'All', 'sportspress' ), + 'post_type' => 'sp_team', + 'name' => 'sp_team', + 'selected' => $team_id, + 'values' => 'ID' + ); + if ( ! sp_dropdown_pages( $args ) ): + sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) ); + endif; + ?> +
@@ -144,8 +142,6 @@ class SP_Meta_Box_Calendar_Details { update_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null ) ); update_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null ) ); update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) ); - if ( 'team' == get_option( 'sportspress_mode', 'team' ) ) { - update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', 0 ) ); - } + update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', 0 ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php index 849fd52a..b698c05f 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php @@ -53,31 +53,32 @@ class SP_Meta_Box_Event_Teams { sp_dropdown_taxonomies( $args ); ?>
- 'sp_team', - 'name' => 'sp_team[]', - 'class' => 'sportspress-pages', - 'show_option_none' => __( '— None —', 'sportspress' ), - 'values' => 'ID', - 'selected' => $team, - ); - sp_dropdown_pages( $args ); - ?> -
+ 'sp_team', + 'name' => 'sp_team[]', + 'class' => 'sportspress-pages', + 'show_option_none' => __( '— None —', 'sportspress' ), + 'values' => 'ID', + 'selected' => $team, + ); + sp_dropdown_pages( $args ); + ?> +
- 'sp_team', - 'name' => 'sp_team', - 'show_option_all' => __( 'All', 'sportspress' ), - 'selected' => $team_id, - 'values' => 'ID', - ); - if ( ! sp_dropdown_pages( $args ) ): - sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) ); - endif; - ?> -
+ 'sp_team', + 'name' => 'sp_team', + 'show_option_all' => __( 'All', 'sportspress' ), + 'selected' => $team_id, + 'values' => 'ID', + ); + if ( ! sp_dropdown_pages( $args ) ): + sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) ); + endif; + ?> +
@@ -128,9 +128,7 @@ class SP_Meta_Box_List_Details { * Save meta box data */ public static function save( $post_id, $post ) { - if ( 'team' == get_option( 'sportspress_mode', 'team' ) ) { - update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) ); - } + update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) ); wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_league', 0 ), 'sp_league' ); wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_season', 0 ), 'sp_season' ); update_post_meta( $post_id, 'sp_grouping', sp_array_value( $_POST, 'sp_grouping', array() ) ); diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php index 0b7883f1..6e1ed5ac 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php @@ -83,37 +83,35 @@ class SP_Meta_Box_Player_Details { sp_dropdown_taxonomies( $args ); ?>
'sp_team', - 'name' => 'sp_current_team[]', - 'selected' => $current_teams, - 'values' => 'ID', - 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ), - 'class' => 'sp-current-teams widefat', - 'property' => 'multiple', - 'chosen' => true, - ); - sp_dropdown_pages( $args ); - ?>
'sp_team', + 'name' => 'sp_current_team[]', + 'selected' => $current_teams, + 'values' => 'ID', + 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ), + 'class' => 'sp-current-teams widefat', + 'property' => 'multiple', + 'chosen' => true, + ); + sp_dropdown_pages( $args ); + ?>
'sp_team', - 'name' => 'sp_past_team[]', - 'selected' => $past_teams, - 'values' => 'ID', - 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ), - 'class' => 'sp-past-teams widefat', - 'property' => 'multiple', - 'chosen' => true, - ); - sp_dropdown_pages( $args ); - ?>
'sp_team', + 'name' => 'sp_past_team[]', + 'selected' => $past_teams, + 'values' => 'ID', + 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ), + 'class' => 'sp-past-teams widefat', + 'property' => 'multiple', + 'chosen' => true, + ); + sp_dropdown_pages( $args ); + ?>
ID, 'sp_equation', true ); - self::builder( $post->post_title, $equation, array( 'player_event', 'outcome', 'performance', 'metric' ) ); + $groups = array( 'player_event', 'outcome', 'performance', 'metric' ); + self::builder( $post->post_title, $equation, $groups ); } } diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php index 1a3b88c0..79ae5d57 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php @@ -103,7 +103,7 @@ class SP_Meta_Box_Table_Data { ?>
+ +
> diff --git a/includes/admin/settings/class-sp-settings-events.php b/includes/admin/settings/class-sp-settings-events.php index 121e35cb..00532f62 100644 --- a/includes/admin/settings/class-sp-settings-events.php +++ b/includes/admin/settings/class-sp-settings-events.php @@ -193,139 +193,6 @@ class SP_Settings_Events extends SP_Settings_Page { ); - if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) { - - $settings = array_merge( $settings, - - array( - array( 'title' => __( 'Event List', 'sportspress' ), 'type' => 'title', 'id' => 'event_list_options' ), - ), - - apply_filters( 'sportspress_event_list_options', array( - array( - 'title' => __( 'Teams', 'sportspress' ), - 'desc' => __( 'Display logos', 'sportspress' ), - 'id' => 'sportspress_event_list_show_logos', - 'default' => 'no', - 'type' => 'checkbox', - ), - - array( - 'title' => __( 'Title Format', 'sportspress' ), - 'id' => 'sportspress_event_list_title_format', - 'default' => 'title', - 'type' => 'select', - 'options' => array( - 'title' => __( 'Title', 'sportspress' ), - 'teams' => __( 'Teams', 'sportspress' ), - 'homeaway' => sprintf( '%s | %s', __( 'Home', 'sportspress' ), __( 'Away', 'sportspress' ) ), - ), - ), - - array( - 'title' => __( 'Time/Results Format', 'sportspress' ), - 'id' => 'sportspress_event_list_time_format', - 'default' => 'combined', - 'type' => 'select', - 'options' => array( - 'combined' => __( 'Combined', 'sportspress' ), - 'separate' => __( 'Separate', 'sportspress' ), - 'time' => __( 'Time Only', 'sportspress' ), - 'results' => __( 'Results Only', 'sportspress' ), - ), - ), - - array( - 'title' => __( 'Pagination', 'sportspress' ), - 'desc' => __( 'Paginate', 'sportspress' ), - 'id' => 'sportspress_event_list_paginated', - 'default' => 'yes', - 'type' => 'checkbox', - ), - - array( - 'title' => __( 'Limit', 'sportspress' ), - 'id' => 'sportspress_event_list_rows', - 'class' => 'small-text', - 'default' => '10', - 'desc' => __( 'events', 'sportspress' ), - 'type' => 'number', - 'custom_attributes' => array( - 'min' => 1, - 'step' => 1 - ), - ), - )), - - array( - array( 'type' => 'sectionend', 'id' => 'event_list_options' ), - array( 'title' => __( 'Event Blocks', 'sportspress' ), 'type' => 'title', 'id' => 'event_blocks_options' ), - ), - - apply_filters( 'sportspress_event_blocks_options', array( - array( - 'title' => __( 'Title', 'sportspress' ), - 'desc' => __( 'Display calendar title', 'sportspress' ), - 'id' => 'sportspress_event_blocks_show_title', - 'default' => 'no', - 'type' => 'checkbox', - ), - - array( - 'title' => __( 'Details', 'sportspress' ), - 'desc' => __( 'Display competition', 'sportspress' ), - 'id' => 'sportspress_event_blocks_show_league', - 'default' => 'no', - 'type' => 'checkbox', - 'checkboxgroup' => 'start', - ), - - array( - 'desc' => __( 'Display season', 'sportspress' ), - 'id' => 'sportspress_event_blocks_show_season', - 'default' => 'no', - 'type' => 'checkbox', - 'checkboxgroup' => '', - ), - - array( - 'desc' => __( 'Display venue', 'sportspress' ), - 'id' => 'sportspress_event_blocks_show_venue', - 'default' => 'no', - 'type' => 'checkbox', - 'checkboxgroup' => 'end', - ), - - array( - 'title' => __( 'Pagination', 'sportspress' ), - 'desc' => __( 'Paginate', 'sportspress' ), - 'id' => 'sportspress_event_blocks_paginated', - 'default' => 'yes', - 'type' => 'checkbox', - ), - - array( - 'title' => __( 'Limit', 'sportspress' ), - 'id' => 'sportspress_event_blocks_rows', - 'class' => 'small-text', - 'default' => '10', - 'desc' => __( 'events', 'sportspress' ), - 'type' => 'number', - 'custom_attributes' => array( - 'min' => 1, - 'step' => 1 - ), - ), - )), - - array( - array( 'type' => 'sectionend', 'id' => 'event_list_options' ), - ) - - ); - - } // End event settings - return apply_filters( 'sportspress_event_settings', $settings ); } diff --git a/includes/admin/settings/class-sp-settings-general.php b/includes/admin/settings/class-sp-settings-general.php index f71ea001..c8ed168a 100644 --- a/includes/admin/settings/class-sp-settings-general.php +++ b/includes/admin/settings/class-sp-settings-general.php @@ -60,12 +60,12 @@ class SP_Settings_General extends SP_Settings_Page { array( 'title' => __( 'Mode', 'sportspress' ), - 'id' => 'sportspress_mode', - 'default' => 'team', + 'id' => 'sportspress_load_individual_mode_module', + 'default' => 'no', 'type' => 'radio', 'options' => array( - 'team' => __( 'Teams', 'sportspress' ), - 'player' => __( 'Players', 'sportspress' ) . ' ' . __( '(Beta)', 'sportspress' ), + 'no' => __( 'Team vs team', 'sportspress' ), + 'yes' => __( 'Player vs player', 'sportspress' ), ), 'desc_tip' => _x( 'Who competes in events?', 'mode setting description', 'sportspress' ), ), @@ -344,8 +344,8 @@ class SP_Settings_General extends SP_Settings_Page { */ function current_mode_setting() { ?> - - + +