From 1b30d3a4ce75fb2b5ea3f85a5b86e93631259652 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 18 Feb 2014 19:33:06 +1100 Subject: [PATCH] Tidy up player edit screen and add custom menu icons --- admin/hooks/admin-init.php | 38 ---- admin/hooks/admin-menu.php | 16 +- admin/hooks/admin-print-styles.php | 8 +- admin/hooks/save-post.php | 11 +- admin/includes/notice-theme-support.php | 6 +- admin/post-types/player.php | 92 +++++----- admin/settings/settings.php | 165 +++++++++--------- admin/templates/player-metrics.php | 23 ++- admin/tools/importers.php | 40 +++++ .../{importers => tools}/player-importer.php | 0 admin/{importers => tools}/team-importer.php | 0 assets/css/admin.css | 66 ++++++- assets/fonts/sportspress.eot | Bin 0 -> 2276 bytes assets/fonts/sportspress.svg | 14 ++ assets/fonts/sportspress.ttf | Bin 0 -> 2096 bytes assets/fonts/sportspress.woff | Bin 0 -> 1828 bytes assets/js/admin.js | 4 +- functions.php | 16 +- sportspress.php | 3 + 19 files changed, 293 insertions(+), 209 deletions(-) create mode 100644 admin/tools/importers.php rename admin/{importers => tools}/player-importer.php (100%) rename admin/{importers => tools}/team-importer.php (100%) create mode 100755 assets/fonts/sportspress.eot create mode 100755 assets/fonts/sportspress.svg create mode 100755 assets/fonts/sportspress.ttf create mode 100755 assets/fonts/sportspress.woff diff --git a/admin/hooks/admin-init.php b/admin/hooks/admin-init.php index 1dc3c75c..5f39597e 100644 --- a/admin/hooks/admin-init.php +++ b/admin/hooks/admin-init.php @@ -1,38 +1,4 @@ dispatch(); -} - -function sportspress_player_importer() { - require_once ABSPATH . 'wp-admin/includes/import.php'; - - if ( ! class_exists( 'WP_Importer' ) ) { - $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php'; - if ( file_exists( $class_wp_importer ) ) - require $class_wp_importer; - } - - // includes - require dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/importers/player-importer.php'; - - // Dispatch - $importer = new SP_Player_Importer(); - $importer->dispatch(); -} - function sportspress_admin_init() { $post_types = array( 'sp_event', @@ -69,9 +35,5 @@ function sportspress_admin_init() { $administrator->add_cap( $cap . '_' . $post_type . 's' ); endforeach; endforeach; - - // Importers - register_importer( 'sportspress_team_csv', __( 'SportsPress Teams (CSV)', 'sportspress' ), __( 'Import teams from a csv file.', 'sportspress'), 'sportspress_team_importer' ); - register_importer( 'sportspress_player_csv', __( 'SportsPress Players (CSV)', 'sportspress' ), __( 'Import players from a csv file.', 'sportspress'), 'sportspress_player_importer' ); } add_action( 'admin_init', 'sportspress_admin_init' ); diff --git a/admin/hooks/admin-menu.php b/admin/hooks/admin-menu.php index d4872485..49bb94ca 100644 --- a/admin/hooks/admin-menu.php +++ b/admin/hooks/admin-menu.php @@ -3,15 +3,15 @@ function sportspress_admin_menu( $position ) { global $menu, $submenu; - // Find where our placeholder is in the menu + // Find where our separator is in the menu foreach( $menu as $key => $data ): if ( is_array( $data ) && array_key_exists( 2, $data ) && $data[2] == 'edit.php?post_type=sp_separator' ) - $seperator_position = $key; + $separator_position = $key; endforeach; - // Swap our placeholder post type with a menu separator - if ( $seperator_position ): - $menu[ $seperator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' ); + // Swap our separator post type with a menu separator + if ( isset( $separator_position ) ): + $menu[ $separator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' ); endif; // Remove "Venues" and "Positions" links from Media submenu @@ -41,6 +41,12 @@ function sportspress_admin_menu( $position ) { } add_action( 'admin_menu', 'sportspress_admin_menu' ); +if ( ! function_exists( 'sportspress_admin_menu_remove_add_new' ) ) { + function sportspress_admin_menu_remove_add_new( $arr = array() ) { + return $arr[0] != __( 'Add New', 'sportspress' ); + } +} + if ( ! function_exists( 'sportspress_admin_menu_remove_leagues' ) ) { function sportspress_admin_menu_remove_leagues( $arr = array() ) { return $arr[0] != __( 'Leagues', 'sportspress' ); diff --git a/admin/hooks/admin-print-styles.php b/admin/hooks/admin-print-styles.php index a234803b..20f848be 100644 --- a/admin/hooks/admin-print-styles.php +++ b/admin/hooks/admin-print-styles.php @@ -1,10 +1,8 @@ id != 'settings_page_sportspress' ): - if ( isset( $_REQUEST['sportspress_installed'] ) ): update_option( 'sportspress_installed', $_REQUEST['sportspress_installed'] ); endif; @@ -12,13 +10,11 @@ function sportspress_admin_notices_styles() { if ( ! get_option( 'sportspress_installed' ) ): add_action( 'admin_notices', 'sportspress_admin_install_notices' ); endif; - endif; $template = get_option( 'template' ); if ( ! current_theme_supports( 'sportspress' ) && ! in_array( $template, array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ): - if ( ! empty( $_GET['hide_sportspress_theme_support_check'] ) ): update_option( 'sportspress_theme_support_check', $template ); return; @@ -27,9 +23,7 @@ function sportspress_admin_notices_styles() { if ( get_option( 'sportspress_theme_support_check' ) !== $template ): add_action( 'admin_notices', 'sportspress_theme_check_notice' ); endif; - endif; - } add_action( 'admin_print_styles', 'sportspress_admin_notices_styles' ); @@ -50,5 +44,5 @@ function sportspress_admin_install_notices() { * @return void */ function sportspress_theme_check_notice() { - include( dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/includes/notice-theme-support.php' ); +// include( dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/includes/notice-theme-support.php' ); } diff --git a/admin/hooks/save-post.php b/admin/hooks/save-post.php index 6b6bda34..046798fb 100644 --- a/admin/hooks/save-post.php +++ b/admin/hooks/save-post.php @@ -95,15 +95,18 @@ function sportspress_save_post( $post_id ) { // Update seasons teams to show update_post_meta( $post_id, 'sp_leagues', sportspress_array_value( $_POST, 'sp_leagues', array() ) ); + // Update current team + update_post_meta( $post_id, 'sp_current_team', sportspress_array_value( $_POST, 'sp_current_team', null ) ); + + // Update past team array + sportspress_update_post_meta_recursive( $post_id, 'sp_past_team', sportspress_array_value( $_POST, 'sp_past_team', array() ) ); + // Update team array - sportspress_update_post_meta_recursive( $post_id, 'sp_team', sportspress_array_value( $_POST, 'sp_team', array() ) ); + sportspress_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sportspress_array_value( $_POST, 'sp_current_team', null ) ), sportspress_array_value( $_POST, 'sp_past_team', array() ) ) ); // Update player number update_post_meta( $post_id, 'sp_number', sportspress_array_value( $_POST, 'sp_number', '' ) ); - // Update current team - update_post_meta( $post_id, 'sp_current_team', sportspress_array_value( $_POST, 'sp_current_team', '' ) ); - // Update nationality update_post_meta( $post_id, 'sp_nationality', sportspress_array_value( $_POST, 'sp_nationality', '' ) ); diff --git a/admin/includes/notice-theme-support.php b/admin/includes/notice-theme-support.php index cbeb37e2..ccf9d3be 100644 --- a/admin/includes/notice-theme-support.php +++ b/admin/includes/notice-theme-support.php @@ -1,12 +1,10 @@ -
-

Your theme does not declare SportsPress support – if you encounter layout issues please read our integration guide or choose a SportsPress theme :)', 'sportspress' ); ?>

+

Your theme does not declare SportsPress support – if you encounter layout issues please read our integration guide or choose a SportsPress theme :)', 'sportspress' ); ?>

-
- \ No newline at end of file diff --git a/admin/post-types/player.php b/admin/post-types/player.php index ad38d66b..110d151e 100644 --- a/admin/post-types/player.php +++ b/admin/post-types/player.php @@ -96,7 +96,7 @@ function sportspress_player_details_meta( $post ) { endif; $teams = get_posts( array( 'post_type' => 'sp_team', 'posts_per_page' => -1 ) ); - $the_teams = array_filter( get_post_meta( $post->ID, 'sp_team', false ) ); + $past_teams = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) ); $current_team = get_post_meta( $post->ID, 'sp_current_team', true ); ?>

@@ -114,6 +114,51 @@ function sportspress_player_details_meta( $post ) {

+

+

'sp_position', + 'name' => 'tax_input[sp_position][]', + 'selected' => $position_ids, + 'values' => 'term_id', + 'placeholder' => __( 'Select Positions', 'sportspress' ), + 'class' => 'widefat', + 'property' => 'multiple', + 'chosen' => true, + ); + sportspress_dropdown_taxonomies( $args ); + ?>

+ +

+

'sp_team', + 'name' => 'sp_current_team', + 'show_option_blank' => true, + 'selected' => $current_team, + 'values' => 'ID', + 'placeholder' => __( 'Select Team', 'sportspress' ), + 'class' => 'sp-current-team widefat', + 'chosen' => true, + ); + sportspress_dropdown_pages( $args ); + ?>

+ +

+

'sp_team', + 'name' => 'sp_past_team[]', + 'selected' => $past_teams, + 'values' => 'ID', + 'placeholder' => __( 'Select Teams', 'sportspress' ), + 'class' => 'sp-past-teams widefat', + 'property' => 'multiple', + 'chosen' => true, + ); + sportspress_dropdown_pages( $args ); + ?>

+

- -

-

'sp_team', - 'name' => 'sp_team[]', - 'selected' => $the_teams, - 'values' => 'ID', - 'placeholder' => __( 'Select Teams', 'sportspress' ), - 'class' => 'sp-team widefat', - 'property' => 'multiple', - 'chosen' => true, - ); - sportspress_dropdown_pages( $args ); - ?>

- -

-

'sp_team', - 'name' => 'sp_current_team', - 'show_option_blank' => true, - 'selected' => $current_team, - 'values' => 'ID', - 'placeholder' => __( 'Select Team', 'sportspress' ), - 'class' => 'sp-current-team widefat', - 'chosen' => true, - ); - sportspress_dropdown_pages( $args ); - ?>

- -

-

'sp_position', - 'name' => 'tax_input[sp_position][]', - 'selected' => $position_ids, - 'values' => 'term_id', - 'placeholder' => __( 'Select Positions', 'sportspress' ), - 'class' => 'widefat', - 'property' => 'multiple', - 'chosen' => true, - ); - sportspress_dropdown_taxonomies( $args ); - ?>

@@ -43,13 +43,13 @@ function sportspress_sport_callback() { $custom_sport_name = sportspress_array_value( $options, 'custom_sport_name', null ); ?> - class="hidden">

+ class="hidden"> $terms ): + // Find empty terms and destroy + $allterms = get_terms( $taxonomy, 'hide_empty=0' ); - foreach( $term_groups as $taxonomy => $terms ): - // Find empty terms and destroy - $allterms = get_terms( $taxonomy, 'hide_empty=0' ); + foreach( $allterms as $term ): + if ( $term->count == 0 ) + wp_delete_term( $term->term_id, $taxonomy ); + endforeach; - foreach( $allterms as $term ): - if ( $term->count == 0 ) - wp_delete_term( $term->term_id, $taxonomy ); + // Insert terms + foreach( $terms as $term ): + wp_insert_term( $term['name'], $taxonomy, array( 'slug' => $term['slug'] ) ); + endforeach; endforeach; - // Insert terms - foreach( $terms as $term ): - wp_insert_term( $term['name'], $taxonomy, array( 'slug' => $term['slug'] ) ); - endforeach; - endforeach; + // Get array of post types to insert + $post_groups = sportspress_array_value( sportspress_array_value( $sportspress_sports, sportspress_array_value( $input, 'sport', null ), array() ), 'posts', array() ); - // Get array of post types to insert - $post_groups = sportspress_array_value( sportspress_array_value( $sportspress_sports, sportspress_array_value( $input, 'sport', null ), array() ), 'posts', array() ); + // Loop through each post type + foreach( $post_groups as $post_type => $posts ): - // Loop through each post type - foreach( $post_groups as $post_type => $posts ): - - $args = array( - 'post_type' => $post_type, - 'numberposts' => -1, - 'posts_per_page' => -1, - 'meta_query' => array( - array( - 'key' => '_sp_preset', - 'value' => 1 + $args = array( + 'post_type' => $post_type, + 'numberposts' => -1, + 'posts_per_page' => -1, + 'meta_query' => array( + array( + 'key' => '_sp_preset', + 'value' => 1 + ) ) - ) - ); + ); - // Delete posts - $old_posts = get_posts( $args ); + // Delete posts + $old_posts = get_posts( $args ); - foreach( $old_posts as $post ): - wp_delete_post( $post->ID, true); - endforeach; + foreach( $old_posts as $post ): + wp_delete_post( $post->ID, true); + endforeach; - // Add posts - foreach( $posts as $index => $post ): + // Add posts + foreach( $posts as $index => $post ): - // Make sure post doesn't overlap - if ( ! get_page_by_path( $post['post_name'], OBJECT, $post_type ) ): + // Make sure post doesn't overlap + if ( ! get_page_by_path( $post['post_name'], OBJECT, $post_type ) ): - // Translate post title - $post['post_title'] = __( $post['post_title'], 'sportspress' ); + // Translate post title + $post['post_title'] = __( $post['post_title'], 'sportspress' ); - // Set post type - $post['post_type'] = $post_type; + // Set post type + $post['post_type'] = $post_type; - // Increment menu order by 2 and publish post - $post['menu_order'] = $index * 2 + 2; - $post['post_status'] = 'publish'; - $id = wp_insert_post( $post ); + // Increment menu order by 2 and publish post + $post['menu_order'] = $index * 2 + 2; + $post['post_status'] = 'publish'; + $id = wp_insert_post( $post ); - // Flag as preset - update_post_meta( $id, '_sp_preset', 1 ); + // Flag as preset + update_post_meta( $id, '_sp_preset', 1 ); - // Update meta - if ( array_key_exists( 'meta', $post ) ): + // Update meta + if ( array_key_exists( 'meta', $post ) ): - foreach ( $post['meta'] as $key => $value ): + foreach ( $post['meta'] as $key => $value ): - update_post_meta( $id, $key, $value ); + update_post_meta( $id, $key, $value ); - endforeach; + endforeach; + + endif; + + // Update terms + if ( array_key_exists( 'tax_input', $post ) ): + + foreach ( $post['tax_input'] as $taxonomy => $terms ): + + wp_set_object_terms( $id, $terms, $taxonomy, false ); + + endforeach; + + endif; endif; - // Update terms - if ( array_key_exists( 'tax_input', $post ) ): - - foreach ( $post['tax_input'] as $taxonomy => $terms ): - - wp_set_object_terms( $id, $terms, $taxonomy, false ); - - endforeach; - - endif; - - endif; + endforeach; endforeach; - endforeach; + endif; - return $input; + // Merge with existing options + return array_merge( $options, $input ); } -function sportspress_add_options_page() { +function sportspress_add_menu_page() { add_options_page( __( 'SportsPress', 'sportspress' ), __( 'SportsPress', 'sportspress' ), @@ -244,4 +245,4 @@ function sportspress_add_options_page() { 'sportspress_settings' ); } -add_action( 'admin_menu', 'sportspress_add_options_page' ); +add_action( 'admin_menu', 'sportspress_add_menu_page' ); diff --git a/admin/templates/player-metrics.php b/admin/templates/player-metrics.php index 75eb722c..743718c1 100644 --- a/admin/templates/player-metrics.php +++ b/admin/templates/player-metrics.php @@ -9,15 +9,30 @@ if ( !function_exists( 'sportspress_player_metrics' ) ) { $number = get_post_meta( $id, 'sp_number', true ); $nationality = get_post_meta( $id, 'sp_nationality', true ); + $current_team = get_post_meta( $id, 'sp_current_team', true ); + $past_teams = get_post_meta( $id, 'sp_past_team', false ); $metrics = sportspress_get_player_metrics_data( $id ); - $common = array( - __( 'Number', 'sportspress' ) => $number, - __( 'Nationality', 'sportspress' ) => sportspress_array_value( $sportspress_countries, $nationality, '—' ), - ); + $common = array(); + + if ( $number != null ) + $common[ __( 'Number', 'sportspress' ) ] = $number; + if ( $nationality ) + $common[ __( 'Nationality', 'sportspress' ) ] = sportspress_array_value( $sportspress_countries, $nationality, '—' ); $data = array_merge( $common, $metrics ); + if ( $current_team ) + $data[ __( 'Current Team', 'sportspress' ) ] = '' . get_the_title( $current_team ) . ''; + + if ( $past_teams ): + $teams = array(); + foreach ( $past_teams as $team ): + $teams[] = '' . get_the_title( $team ) . ''; + endforeach; + $data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams ); + endif; + $output = '
' . '' . ''; diff --git a/admin/tools/importers.php b/admin/tools/importers.php new file mode 100644 index 00000000..00807a2a --- /dev/null +++ b/admin/tools/importers.php @@ -0,0 +1,40 @@ +dispatch(); +} + +function sportspress_player_importer() { + require_once ABSPATH . 'wp-admin/includes/import.php'; + + if ( ! class_exists( 'WP_Importer' ) ) { + $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php'; + if ( file_exists( $class_wp_importer ) ) + require $class_wp_importer; + } + + // includes + require dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/tools/player-importer.php'; + + // Dispatch + $importer = new SP_Player_Importer(); + $importer->dispatch(); +} + +function sportspress_register_importers() { + register_importer( 'sportspress_team_csv', __( 'SportsPress Teams (CSV)', 'sportspress' ), __( 'Import teams from a csv file.', 'sportspress'), 'sportspress_team_importer' ); + register_importer( 'sportspress_player_csv', __( 'SportsPress Players (CSV)', 'sportspress' ), __( 'Import players from a csv file.', 'sportspress'), 'sportspress_player_importer' ); +} +add_action( 'admin_init', 'sportspress_register_importers' ); diff --git a/admin/importers/player-importer.php b/admin/tools/player-importer.php similarity index 100% rename from admin/importers/player-importer.php rename to admin/tools/player-importer.php diff --git a/admin/importers/team-importer.php b/admin/tools/team-importer.php similarity index 100% rename from admin/importers/team-importer.php rename to admin/tools/team-importer.php diff --git a/assets/css/admin.css b/assets/css/admin.css index b1795195..56468ce8 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -1,5 +1,50 @@ /* SportsPress admin styles */ +@font-face { + font-family: 'sportspress'; + src:url('../fonts/sportspress.eot?ofuus8'); + src:url('../fonts/sportspress.eot?#iefixofuus8') format('embedded-opentype'), + url('../fonts/sportspress.woff?ofuus8') format('woff'), + url('../fonts/sportspress.ttf?ofuus8') format('truetype'), + url('../fonts/sportspress.svg?ofuus8#sportspress') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="icon-"], [class*=" icon-"] { + font-family: 'sportspress'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-sportspress:before { + content: "\f111"; +} +.icon-megaphone:before { + content: "\f155"; +} +.icon-calendar:before { + content: "\f145"; +} +.icon-shield:before { + content: "\f334"; +} + +#adminmenu #toplevel_page_sportspress .menu-icon-generic div.wp-menu-image:before, +#adminmenu #menu-posts-sp_event .menu-icon-sp_event div.wp-menu-image:before, +#adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before, +#adminmenu #menu-posts-sp_sponsor .menu-icon-sp_sponsor div.wp-menu-image:before { + font-family: sportspress, dashicons !important; +} + .sportspress-message { border-left-color: #6bc2a5 !important; } @@ -7,7 +52,7 @@ .sportspress-message a.button-primary, .sportspress-message a.button-secondary { background: #6bc2a5; - border-color: #3bad87; + border-color: #409e7f; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15); box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15); color: #fff; @@ -164,8 +209,23 @@ table.widefat td.column-sp_number .sp-flag { color: #a00; } -.chosen-container { - margin: 1px; +.chosen-container-single .chosen-single { + -webkit-border-radius: 3px; + border-radius: 3px; + color: #555; + border-color: #ccc; + background: #f7f7f7; + -webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08); + box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08); +} + +.chosen-container-active.chosen-with-drop .chosen-single { + background: #fff; +} + +.chosen-container-single .chosen-drop { + -webkit-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; } .chosen-container-multi .chosen-choices { diff --git a/assets/fonts/sportspress.eot b/assets/fonts/sportspress.eot new file mode 100755 index 0000000000000000000000000000000000000000..14612da74116f75dc41451a1f6791e339ba1be59 GIT binary patch literal 2276 zcmaJ@O>9(E6h8Ooz5Cw0&U^De{qMAcv_+hD=FN0K%4jf(Mo>^N5j8SGJ0+p**j5DN zf`y50Ov(;i7*-oHESG=3aOFWBQHJKJNwYLZ3js7o6X@q5=+aAo8}tqx zr#kpr_7za(z&(Z$GnAtu6=*cz{FfFm^#mL`O@c;We0ii~4lRv(Lcan2cA1Vd!#N-@I%1g2cDR&pKMZ+P61!k{F(an#K&g_UITssHr{B?&M#n| zC>G{`1qx1Vkqq$mut`vMxB5HOK_6(jHHGOR>&lZvx6AC>3O;rX+Ms3)U*i-6Qd>;H zuI8pl(mwPte45TEcPoDD>01YHmsjqttbjrfP}s_K_qMy_e%;vOUO+m`U}7~^9xLWYGpS5ApY0X;?-uEl%T+$@SMmi> z85fnBsMf?2EUyY;g!vHJ#>>U*Hc=cX@SUt62K{)|6>7A`)4pO&#@J2N1CETPJ3Z!R zdg9Vac;06*Hvw8t#${e-CMF{Xezo1GEyQDtL;jf8nQ|Bxob5lyBW<3|IWI_d)=5My zE1Gb2WQY3ORlKh~E>tuckyauWVYwWO#F9!zqERK{?R|08o*T~YIHQv7U0%}d>*;b> z!%1Np>2jr*SpNHaue&{|Hf_!Gly+`}eClLZ*+oR`5!yl{RHp4zqo?Ru+6(_^FZlU% zz7o^{m#5>YUhemoYP=FJ7kFOuSNhXJi)CA~ekJf7My#c=)4uO_G$tDzrmdt@w#g<} zp^oLBSot^KZeE%E-{k;LmE&@Vu_E?6nQb2x3P(Ovt84KI_nt$4(cf(d4sOd{Ipm?<^I zG!)~8GNmx25{4UxHODl~WHzqkVD*`Sv)t=^w5z)`)Xu%Wt=(P4d^Xr39NzHRdBi$O zC$M`eemq!sWiXAHwz7ZKH%N0oRmzn7$Jtn^0RdcQRxEoHUT{-@;r5FQ86Nnu$*V@bnON?^5y7RCP1 zl0xw1Yr#m3UO&HlLt3^i+cMdVv$SM5PQ)-HAZS}iGSd{?&%L>$Lh(pDhNg9fnPC#^H))w^GO^QJd`hn(>4`g!QmUz#2EI9;wH>u~ViyV@{L zpPk_m3Ha)&COs-BxC!qUZ3ddhQGL`Q)WZQcf-|+3K4%H`DIW(#3tIFp_OC7wd#Jed zWy==BrMJ2Qjw|sq0Wsj-ivvUjc&AEwreeZAd7Fhod*jQ#aUIsJ4>!6O8 f!~`9s9KD5$Hb>9FX|tI0Z183XR{oH~*Ao5(-ozR9 literal 0 HcmV?d00001 diff --git a/assets/fonts/sportspress.svg b/assets/fonts/sportspress.svg new file mode 100755 index 00000000..4ce6edb5 --- /dev/null +++ b/assets/fonts/sportspress.svg @@ -0,0 +1,14 @@ + + + +Generated by IcoMoon + + + + + + + + + + \ No newline at end of file diff --git a/assets/fonts/sportspress.ttf b/assets/fonts/sportspress.ttf new file mode 100755 index 0000000000000000000000000000000000000000..d3a8d7a933a2750b01816e67352a4b052b350d9c GIT binary patch literal 2096 zcmaJ?O>7%Q6n<}Jc4pTb@A_};{Kv_bCMm^{GE*PtROh!!ZcNE8q?ZQ@jF5)+5g zA`U$u!3C+kwH#1yAP)Sf5)!C~NFX5r6$eh-Dzz#CajB}psWxwR9SF2yyfgE?pLy@i zdoyD|0I=Z>(>MT4ikN>*=V#b1fuLG+fzrL|KQz@J3FM0Ebd%FzZt$qp0! z7SXAt#;F#h;WW`_wS2j;H2>bYi5H3fjC{P@T4}FQoYYK;0rJ2Z;8`$8whtGGv$r?j zh5>k6>uqYNm;9?e3~;NASG)AXt7MJLY?5mlfKk^TGc;;x1_V4qbAo=FkC4Bay!q(O zL$}J^JKZjE;6EJfUUP0a>(1wWKlN;cN`DUsNbB59zR72GXBf&q@%%qeK&{)sZ}2;) z!BfzHWeTj0<+-9io6Tf%er}ZOZ`iYP?eC)jEF&eO2Hy7?8>iRxajt z@Zv;)?ZyJ143brctJym90);I^yg~h-EfU_Ki%xbVDeRQ%ewc7l#2d*v=niHRB6jd+ z%ZXc@KY)z%kGq2z8yRPK-~x;FxfWxrAn?4MikoIUW$(&OjrXhMSbvhMcswS|R3e7? zJjN1fC1UZo;>rH8r0UO4=XRY_>HZ-%?Tn2K+1Ru*6oyx>6jPl)zIKQE(`w6hpJjA% zV-Ua~UcpOLvHM^f%s?4-LLDA~$6-I^M`t1MJ--t635R*f%qR=SOLbOBmJ7`1iZUqZONZcqRyff#yPUKw3%&Wl3DvKm(m0u>4C9G|T0EL2!W-gZ&}ION6MA zy3x5{L<#RIUC8Td_odt8FtXjtcPAXYolLat)yxQ37niBg&+sgTN6GrOjT6I8d9>+tm8h}~xk!FYOrP#se+pW(bZPO^Jf4?Ionp9BC+IhLVCCLUF@Mk~dpQna(AZn5;fFah|z@ z_YV!1ruvyXwtaZ0=;y*K!YCU7UZh&b;UwLjN{|dUUYYc$roGd@ksCVZL8g=~1rOp} zsX|%PnWJm4`P+?j0w_rn{`fX@kh1I*&$g5s?~`uURkQjqb74r%l`;)s>g1?!kb-F$ zoqIa@dLV)^A(h~!84ji}Or<#O*3hbSKeQ(2taCM7smW^>JJ*G2S)wnS%i8PfhHb|T z86$@FMTbmE&J1lpaP6zt$QvjBTEHc_jFc@aCXJYF8|&H&X|r%3tnW$hjd|hD$6vhS z)^39xa^c6R%fD-JG}G&Hg-#tkyy1(e1+-4TozW9X_{xSQEexBv0rafhkmVZnfcg~m zBbrb5Gy|jX5vK41RwG&~n(zkkbtARAnggHod?92>8ts6A14nz96MuUT3&OAUut7N6 z!;=2>_VjR!?$tZ`bru$Jw9N=dHX|I_jBsQ#!ja7gOIo|Xw>Glbh8C>ADy)G{&9_gxBE&J^b3}y>#}H&T{Cq gL7~jUF>?AU{n6&(2};@u1-%l667Kx2gl}g21zSP{6951J literal 0 HcmV?d00001 diff --git a/assets/fonts/sportspress.woff b/assets/fonts/sportspress.woff new file mode 100755 index 0000000000000000000000000000000000000000..d85b77a3e7ee1cb37ceec19f9fb7a639962ac8ce GIT binary patch literal 1828 zcmZ`)U2GIp6h714DO0FhARVMZ$wo@j2db17Nt85-v5iL3h87_r!nSOwl>WFowZBVS zXxVMg&i>BKcCoD{_)sZTEExGQNYoI2fG|4A6%|h6?*iD~Vp5Y@+E-Qc%sK#jE%CdV z2&-~#)i=A^h&x689wxtCxNhI;@)E}{Ctt|O;zqZN#(5|C&oW7GJUh`yByroxFJxl- zguB_;EOipsOTLpy4uIb5>SX!G$j>%KsD>6-vzxdN0l1w^u5#6L+{lsu-B zOPJ0fW!t(Gawy;91uIsrDk@$#C+{5CzP7!jecjsjijtBNQf2E&ttVAlS_Y8C4O1Zk z+k_n!(35x!zUI2P2U(L36o>UQ6i3RQS|iGn!4D7xqZ@g|;Jb2*umQDdUfVpibEY%A zbGqU5LF~d#9Keo&CijTYi`b+;k2uwXd_!VA_My0roR{D~y^efH| z7{%qY4qlnXSIXy~;7D!OFN$@yUcJ1}S0mjpIAhYVO9Ml0MN*~X(orQWABiB2N#mnY zU%dN0cl1Eyz-XTm7L?FbA`wZ1Wi1f*D?OpZ+F`YK+OG{IM-$_+zGU=h`DbItlY_VF zZwfx6SUePXV`l#^O+SZ!jD_N%b8jBoH1%SjdN3e3^g_KuM7>P6Q>iET4z(-Mo7i)# z<0G6DcIdSt8ntvX1sJ4aNMC;V|{kh|D?)GRi?Y z7z&2vupE(NVJ)gg)tDMpVw$3<2~AbwT3m}IqDLahP|`eoS|u_Z3WNe-f6z~F-YMk$ z=pPCA1A*ZH9u^SkAuIVQMZ{e84YAQ{908tg+G|_``IQ-a4+>zA{JD)=JlA9R1%Nwc z+_f}y?wWaPxj7+D6K9d8n+*A+*=Ro9nrgC(sWYAf=j|o8U%tKdPFeb|beb6W7sI8m zJMK6xI6lq2oXKGZJyINSG%wH0PUQC|e*b1y-o|^dh%F89Q_&ZH%-Zzd+$HV@@&&Ml z*$#l!KsTF(0e9(PCevk#eFq;kRs=A7wK2%&{}EJt>#wD%1Qly`v=4i7Y_gc literal 0 HcmV?d00001 diff --git a/assets/js/admin.js b/assets/js/admin.js index 81f29e89..5183bda2 100644 --- a/assets/js/admin.js +++ b/assets/js/admin.js @@ -15,9 +15,9 @@ jQuery(document).ready(function($){ single_backstroke_delete: false }); - $('#poststuff #sp_detailsdiv .sp-current-team').on('change', function(evt, params) { + $('#poststuff #sp_detailsdiv .sp-current-team').on('change', function() { $el = $(this).closest('#sp_detailsdiv').find('.sp-team'); - $el.find('option[value='+$(this).val()+']').attr('selected', true); + $el.find('option[value='+$(this).val()+']').attr('selected', false); $el.trigger('chosen:updated'); }); diff --git a/functions.php b/functions.php index c03f97e9..142c6e72 100644 --- a/functions.php +++ b/functions.php @@ -927,7 +927,7 @@ if ( !function_exists( 'sportspress_edit_player_statistics_table' ) ) { $args = array( 'post_type' => 'sp_team', 'name' => 'sp_leagues[' . $league_id . '][' . $div_id . ']', - 'show_option_none' => __( '-- Not set --', 'sportspress' ), + 'show_option_none' => __( '— None —', 'sportspress' ), 'sort_order' => 'ASC', 'sort_column' => 'menu_order', 'selected' => $value, @@ -948,19 +948,7 @@ if ( !function_exists( 'sportspress_edit_player_statistics_table' ) ) { ), ); if ( ! sportspress_dropdown_pages( $args ) ): - $args = array( - 'post_type' => 'sp_team', - 'name' => 'sp_leagues[' . $league_id . '][' . $div_id . ']', - 'show_option_none' => __( '-- Not set --', 'sportspress' ), - 'sort_order' => 'ASC', - 'sort_column' => 'menu_order', - 'selected' => $value, - 'values' => 'ID', - 'include' => $teams, - ); - if ( ! sportspress_dropdown_pages( $args ) ): - echo '—'; - endif; + _e( 'No teams found.', 'sportspress' ); endif; ?> diff --git a/sportspress.php b/sportspress.php index ffb2a5a0..6b263cbd 100644 --- a/sportspress.php +++ b/sportspress.php @@ -81,6 +81,9 @@ require_once dirname( __FILE__ ) . '/admin/widgets/events-calendar.php'; require_once dirname( __FILE__ ) . '/admin/widgets/player-list.php'; require_once dirname( __FILE__ ) . '/admin/widgets/league-table.php'; +// Tools +require_once dirname( __FILE__ ) . '/admin/tools/importers.php'; + // Typical request actions require_once dirname( __FILE__ ) . '/admin/hooks/plugins-loaded.php'; require_once dirname( __FILE__ ) . '/admin/hooks/after-setup-theme.php';