diff --git a/includes/admin/post-types/class-sp-admin-meta-boxes.php b/includes/admin/post-types/class-sp-admin-meta-boxes.php index 53293cd0..af779608 100644 --- a/includes/admin/post-types/class-sp-admin-meta-boxes.php +++ b/includes/admin/post-types/class-sp-admin-meta-boxes.php @@ -101,8 +101,8 @@ class SP_Admin_Meta_Boxes { add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Event_Details::output', 'sp_event', 'side', 'default' ); add_meta_box( 'sp_teamdiv', __( 'Teams', 'sportspress' ), 'SP_Meta_Box_Event_Teams::output', 'sp_event', 'side', 'default' ); add_meta_box( 'sp_videodiv', __( 'Video', 'sportspress' ), 'SP_Meta_Box_Event_Video::output', 'sp_event', 'side', 'low' ); - add_meta_box( 'sp_resultsdiv', __( 'Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' ); - add_meta_box( 'sp_performancediv', __( 'Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' ); + add_meta_box( 'sp_resultsdiv', __( 'Team Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' ); + add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' ); add_meta_box( 'sp_editordiv', __( 'Article', 'sportspress' ), 'SP_Meta_Box_Event_Editor::output', 'sp_event', 'normal', 'high' ); // Calendars @@ -113,7 +113,7 @@ class SP_Admin_Meta_Boxes { add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Calendar_Editor::output', 'sp_calendar', 'normal', 'high' ); // Teams - add_meta_box( 'sp_columnssdiv', __( 'Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' ); + add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' ); add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'high' ); // Tables @@ -124,8 +124,8 @@ class SP_Admin_Meta_Boxes { // Players add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Player_Details::output', 'sp_player', 'side', 'default' ); - add_meta_box( 'sp_metricsdiv', __( 'Metrics', 'sportspress' ), 'SP_Meta_Box_Player_Metrics::output', 'sp_player', 'side', 'default' ); - add_meta_box( 'sp_performancediv', __( 'Performance', 'sportspress' ), 'SP_Meta_Box_Player_Performance::output', 'sp_player', 'normal', 'high' ); + add_meta_box( 'sp_metricsdiv', __( 'Player Metrics', 'sportspress' ), 'SP_Meta_Box_Player_Metrics::output', 'sp_player', 'side', 'default' ); + add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Player_Performance::output', 'sp_player', 'normal', 'high' ); add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Player_Editor::output', 'sp_player', 'normal', 'high' ); // Lists diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php index bb47e1f0..6dd95582 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php @@ -24,7 +24,7 @@ class SP_Meta_Box_Event_Shortcode {

- +

@@ -32,7 +32,7 @@ class SP_Meta_Box_Event_Shortcode {

- +

id, array( $this, 'save' ) ); } @@ -54,16 +55,16 @@ class SP_Settings_Config extends SP_Settings_Page { 'options' => $sports, ), - array( 'type' => 'results' ), - array( 'type' => 'outcomes' ), + + array( 'type' => 'results' ), + + array( 'type' => 'performance' ), array( 'type' => 'columns' ), array( 'type' => 'metrics' ), - array( 'type' => 'performance' ), - array( 'type' => 'statistics' ), array( 'type' => 'sectionend', 'id' => 'config_options' ), @@ -87,6 +88,56 @@ class SP_Settings_Config extends SP_Settings_Page { SP_Admin_Settings::save_fields( $settings ); } + /** + * Output outcomes settings + * + * @access public + * @return void + */ + public function outcomes_setting() { + $args = array( + 'post_type' => 'sp_outcome', + 'numberposts' => -1, + 'posts_per_page' => -1, + 'orderby' => 'menu_order', + 'order' => 'ASC' + ); + $data = get_posts( $args ); + ?> + + + +

+ + + + + + + + + + + + > + + + + + +
post_title; ?>post_name; ?>
+
+
+ + +
+
+
+ + + - + + +

+
- + @@ -158,23 +212,26 @@ class SP_Settings_Config extends SP_Settings_Page { } /** - * Output outcomes settings + * Output performance settings * * @access public * @return void */ - public function outcomes_setting() { + public function performance_setting() { $args = array( - 'post_type' => 'sp_outcome', + 'post_type' => 'sp_performance', 'numberposts' => -1, 'posts_per_page' => -1, - 'orderby' => 'menu_order', - 'order' => 'ASC' + 'orderby' => 'menu_order', + 'order' => 'ASC' ); $data = get_posts( $args ); ?> - + - +
+ +

+
@@ -194,8 +251,8 @@ class SP_Settings_Config extends SP_Settings_Page {
- - + +

@@ -221,7 +278,10 @@ class SP_Settings_Config extends SP_Settings_Page { $data = get_posts( $args ); ?>
+ +

+
@@ -238,7 +298,7 @@ class SP_Settings_Config extends SP_Settings_Page { > - + @@ -275,14 +335,16 @@ class SP_Settings_Config extends SP_Settings_Page { $data = get_posts( $args ); ?> - +
post_title; ?> post_name; ?>ID, $row->post_name ); ?>ID ); ?> ID ); ?> ID ); ?>
+ +

+
- @@ -291,7 +353,6 @@ class SP_Settings_Config extends SP_Settings_Page { > - @@ -310,14 +371,14 @@ class SP_Settings_Config extends SP_Settings_Page { } /** - * Output performance settings + * Output statistics settings * * @access public * @return void */ - public function performance_setting() { + public function statistics_setting() { $args = array( - 'post_type' => 'sp_performance', + 'post_type' => 'sp_statistic', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', @@ -326,15 +387,18 @@ class SP_Settings_Config extends SP_Settings_Page { $data = get_posts( $args ); ?> - + - + - + - + - + - +
 
post_title; ?> post_name; ?>ID, 'sp_position' ) ? the_terms( $row->ID, 'sp_position' ) : '—'; ?>  
+ +

+
- - + + @@ -342,16 +406,16 @@ class SP_Settings_Config extends SP_Settings_Page { > - - + +
post_title; ?> post_name; ?>ID, 'sp_position' ) ? the_terms( $row->ID, 'sp_position' ) : '—'; ?>ID ); ?>ID ); ?>ID ); ?>
- - + +

diff --git a/includes/admin/settings/class-sp-settings-events.php b/includes/admin/settings/class-sp-settings-events.php index f9610250..d597ac1a 100644 --- a/includes/admin/settings/class-sp-settings-events.php +++ b/includes/admin/settings/class-sp-settings-events.php @@ -61,7 +61,7 @@ class SP_Settings_Events extends SP_Settings_Page { ), array( - 'title' => __( 'Performance', 'sportspress' ), + 'title' => __( 'Player Performance', 'sportspress' ), 'desc' => __( 'Link players', 'sportspress' ), 'id' => 'sportspress_event_link_players', 'default' => 'yes', diff --git a/includes/admin/views/html-admin-page-status.php b/includes/admin/views/html-admin-page-status.php index 02d84c7f..2acfedde 100644 --- a/includes/admin/views/html-admin-page-status.php +++ b/includes/admin/views/html-admin-page-status.php @@ -228,7 +228,7 @@
:: 'sp_result', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); @@ -238,7 +238,7 @@ ?>
:: 'sp_outcome', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); @@ -248,7 +248,7 @@ ?>
:: 'sp_column', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); @@ -258,7 +258,7 @@ ?>
:: 'sp_metric', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); @@ -268,7 +268,7 @@ ?>
:: 'sp_performance', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any' ) ); diff --git a/includes/class-sp-post-types.php b/includes/class-sp-post-types.php index 4da44d87..5b337cf7 100644 --- a/includes/class-sp-post-types.php +++ b/includes/class-sp-post-types.php @@ -141,7 +141,7 @@ class SP_Post_types { 'hierarchical' => true, 'rewrite' => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ), ); - $object_types = array( 'sp_player', 'sp_performance', 'sp_metric' ); + $object_types = array( 'sp_player' ); register_taxonomy( 'sp_position', $object_types, $args ); foreach ( $object_types as $object_type ): register_taxonomy_for_object_type( 'sp_league', $object_type ); @@ -158,7 +158,7 @@ class SP_Post_types { apply_filters( 'sportspress_register_post_type_result', array( 'labels' => array( - 'name' => __( 'Results', 'sportspress' ), + 'name' => __( 'Team Results', 'sportspress' ), 'singular_name' => __( 'Result', 'sportspress' ), 'add_new_item' => __( 'Add New Result', 'sportspress' ), 'edit_item' => __( 'Edit Result', 'sportspress' ), @@ -188,7 +188,7 @@ class SP_Post_types { apply_filters( 'sportspress_register_post_type_outcome', array( 'labels' => array( - 'name' => __( 'Outcomes', 'sportspress' ), + 'name' => __( 'Event Outcomes', 'sportspress' ), 'singular_name' => __( 'Outcome', 'sportspress' ), 'add_new_item' => __( 'Add New Outcome', 'sportspress' ), 'edit_item' => __( 'Edit Outcome', 'sportspress' ), @@ -218,7 +218,7 @@ class SP_Post_types { apply_filters( 'sportspress_register_post_type_column', array( 'labels' => array( - 'name' => __( 'Columns', 'sportspress' ), + 'name' => __( 'Table Columns', 'sportspress' ), 'singular_name' => __( 'Column', 'sportspress' ), 'add_new_item' => __( 'Add New Column', 'sportspress' ), 'edit_item' => __( 'Edit Column', 'sportspress' ), @@ -244,41 +244,11 @@ class SP_Post_types { ) ); - register_post_type( 'sp_performance', - apply_filters( 'sportspress_register_post_type_performance', - array( - 'labels' => array( - 'name' => __( 'Performance', 'sportspress' ), - 'singular_name' => __( 'Performance', 'sportspress' ), - 'add_new_item' => __( 'Add New Performance', 'sportspress' ), - 'edit_item' => __( 'Edit Performance', 'sportspress' ), - 'new_item' => __( 'New', 'sportspress' ), - 'view_item' => __( 'View', 'sportspress' ), - 'search_items' => __( 'Search', 'sportspress' ), - 'not_found' => __( 'No results found.', 'sportspress' ), - 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), - ), - 'public' => false, - 'show_ui' => true, - 'capability_type' => 'sp_config', - 'map_meta_cap' => true, - 'publicly_queryable' => false, - 'exclude_from_search' => true, - 'hierarchical' => false, - 'supports' => array( 'title', 'page-attributes' ), - 'has_archive' => false, - 'show_in_nav_menus' => false, - 'can_export' => false, - 'show_in_menu' => false, - ) - ) - ); - register_post_type( 'sp_metric', apply_filters( 'sportspress_register_post_type_metric', array( 'labels' => array( - 'name' => __( 'Metrics', 'sportspress' ), + 'name' => __( 'Player Metrics', 'sportspress' ), 'singular_name' => __( 'Metric', 'sportspress' ), 'add_new_item' => __( 'Add New Metric', 'sportspress' ), 'edit_item' => __( 'Edit Metric', 'sportspress' ), @@ -304,11 +274,41 @@ class SP_Post_types { ) ); + register_post_type( 'sp_performance', + apply_filters( 'sportspress_register_post_type_performance', + array( + 'labels' => array( + 'name' => __( 'Player Performance', 'sportspress' ), + 'singular_name' => __( 'Player Performance', 'sportspress' ), + 'add_new_item' => __( 'Add New Performance', 'sportspress' ), + 'edit_item' => __( 'Edit Performance', 'sportspress' ), + 'new_item' => __( 'New', 'sportspress' ), + 'view_item' => __( 'View', 'sportspress' ), + 'search_items' => __( 'Search', 'sportspress' ), + 'not_found' => __( 'No results found.', 'sportspress' ), + 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), + ), + 'public' => false, + 'show_ui' => true, + 'capability_type' => 'sp_config', + 'map_meta_cap' => true, + 'publicly_queryable' => false, + 'exclude_from_search' => true, + 'hierarchical' => false, + 'supports' => array( 'title', 'page-attributes' ), + 'has_archive' => false, + 'show_in_nav_menus' => false, + 'can_export' => false, + 'show_in_menu' => false, + ) + ) + ); + register_post_type( 'sp_statistic', apply_filters( 'sportspress_register_post_type_statistic', array( 'labels' => array( - 'name' => __( 'Statistics', 'sportspress' ), + 'name' => __( 'Player Statistics', 'sportspress' ), 'singular_name' => __( 'Statistic', 'sportspress' ), 'add_new_item' => __( 'Add New Statistic', 'sportspress' ), 'edit_item' => __( 'Edit Statistic', 'sportspress' ), diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 0cc2c58a..b7f4b62e 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -737,19 +737,19 @@ if ( !function_exists( 'sp_equation_selector' ) ) { $options[ __( 'Events', 'sportspress' ) ] = array( '$eventsplayed' => __( 'Played', 'sportspress' ) ); break; case 'result': - $options[ __( 'Results', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_result', array( 'for' => '→', 'against' => '←' ), null, false ); + $options[ __( 'Team Results', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_result', array( 'for' => '→', 'against' => '←' ), null, false ); break; case 'outcome': - $options[ __( 'Outcomes', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_outcome', array() ); - $options[ __( 'Outcomes', 'sportspress' ) ]['$streak'] = __( 'Streak', 'sportspress' ); - $options[ __( 'Outcomes', 'sportspress' ) ]['$last5'] = __( 'Last 5', 'sportspress' ); - $options[ __( 'Outcomes', 'sportspress' ) ]['$last10'] = __( 'Last 10', 'sportspress' ); + $options[ __( 'Event Outcomes', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_outcome', array() ); + $options[ __( 'Event Outcomes', 'sportspress' ) ]['$streak'] = __( 'Streak', 'sportspress' ); + $options[ __( 'Event Outcomes', 'sportspress' ) ]['$last5'] = __( 'Last 5', 'sportspress' ); + $options[ __( 'Event Outcomes', 'sportspress' ) ]['$last10'] = __( 'Last 10', 'sportspress' ); break; case 'column': - $options[ __( 'Columns', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_column' ); + $options[ __( 'Table Columns', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_column' ); break; case 'performance': - $options[ __( 'Performance', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_performance' ); + $options[ __( 'Player Performance', 'sportspress' ) ] = sp_get_equation_optgroup_array( $postid, 'sp_performance' ); break; endswitch; endforeach; @@ -5289,7 +5289,7 @@ function sp_get_text_options() { 'event' => __( 'Event', 'sportspress' ), 'date' => __( 'Date', 'sportspress' ), 'time' => __( 'Time', 'sportspress' ), - 'results' => __( 'Results', 'sportspress' ), + 'results' => __( 'Team Results', 'sportspress' ), 'team' => __( 'Team', 'sportspress' ), 'teams' => __( 'Teams', 'sportspress' ), 'details' => __( 'Details', 'sportspress' ), @@ -5327,9 +5327,9 @@ function sp_get_text_options() { function sp_is_config_type( $typenow = null ) { if ( $typenow == null ) global $typenow; - $post_types = array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric' ); + $post_types = array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric', 'sp_statistic' ); - if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric' ) ) ) + if ( in_array( $typenow, $post_types ) ) return true; return false; } diff --git a/templates/event-results.php b/templates/event-results.php index 23480426..c8b8bf48 100644 --- a/templates/event-results.php +++ b/templates/event-results.php @@ -59,7 +59,7 @@ if ( empty( $table_rows ) ): else: - $output .= '

' . SP()->text->string('Results', 'event') . '

'; + $output .= '

' . SP()->text->string('Team Results', 'event') . '

'; $output .= '
' . '' .