SportsPress – Sports Club & League Manager - Version 2.6.9

Version Description

  • Feature - New event shortcodes: venue, officials, teams, and full event info.
  • Feature - Option to choose default nationality for faster data entry.
  • Feature - Date and time display options in countdown widgets.
  • Feature - Ability to filter player list shortcodes by league, season, and team.
  • Tweak - Improve page load for new player lists.
  • Tweak - Improve iCal feed by fixing wrapping issues.
  • Tweak - Use lighter placeholder color to differentiate from entered values.
  • Tweak - Preserve league, season, and position assignments when importing players.
  • Fix - PHP warnings when using version 7.2 or later.
  • Fix - Countdown timer format when event is 100 or more days away.
  • Fix - Player list displaying zero values when formatted using decimal places.
  • Fix - Start of the week filters for week-based calendars.
  • Fix - Location picker freezing issue.
  • Fix - Custom post types pages displaying blank page when Gutenberg is installed.
Download this release

Release Info

Developer brianmiyaji
Plugin Icon 128x128 SportsPress – Sports Club & League Manager
Version 2.6.9
Comparing to
See all releases

Code changes from version 2.6.8 to 2.6.9

Files changed (42) hide show
  1. assets/css/admin.css +5 -0
  2. assets/css/menu.css +9 -6
  3. assets/css/sportspress-style.css +4 -2
  4. assets/fonts/sportspress.eot +0 -0
  5. assets/fonts/sportspress.svg +2 -1
  6. assets/fonts/sportspress.ttf +0 -0
  7. assets/fonts/sportspress.woff +0 -0
  8. assets/fonts/sportspress.woff2 +0 -0
  9. assets/js/admin/editor-lang.php +5 -1
  10. assets/js/locationpicker.jquery.js +270 -166
  11. assets/js/sportspress.js +1 -1
  12. changelog.txt +16 -0
  13. feeds/ical.php +17 -5
  14. includes/admin/class-sp-admin-taxonomies.php +6 -4
  15. includes/admin/importers/class-sp-player-importer.php +18 -1
  16. includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php +6 -3
  17. includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php +5 -1
  18. includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php +10 -5
  19. includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php +9 -1
  20. includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php +7 -3
  21. includes/class-sp-ajax.php +171 -2
  22. includes/class-sp-calendar.php +126 -12
  23. includes/class-sp-event.php +3 -2
  24. includes/class-sp-modules.php +8 -1
  25. includes/class-sp-player-list.php +19 -6
  26. includes/class-sp-player.php +2 -2
  27. includes/class-sp-shortcodes.php +49 -1
  28. includes/shortcodes/class-sp-shortcode-event-full.php +139 -0
  29. includes/shortcodes/class-sp-shortcode-event-officials.php +24 -0
  30. includes/shortcodes/class-sp-shortcode-event-teams.php +24 -0
  31. includes/shortcodes/class-sp-shortcode-event-venue.php +24 -0
  32. includes/widgets/class-sp-widget-countdown.php +7 -1
  33. modules/sportspress-default-nationality.php +67 -0
  34. modules/sportspress-gutenberg.php +58 -0
  35. readme.txt +18 -2
  36. sportspress.php +3 -3
  37. templates/countdown.php +13 -1
  38. templates/event-blocks.php +7 -1
  39. templates/event-list.php +7 -1
  40. templates/player-list.php +5 -2
  41. templates/post-excerpt.php +4 -2
  42. templates/team-events.php +10 -6
assets/css/admin.css CHANGED
@@ -322,6 +322,11 @@ table.widefat.sp-data-table input[type="number"] {
322
  padding: 3px 5px;
323
  }
324
 
 
 
 
 
 
325
  table.widefat.sp-data-table input.small-text {
326
  width: 50px;
327
  min-width: 0;
322
  padding: 3px 5px;
323
  }
324
 
325
+ table.widefat.sp-data-table input[type="text"]::placeholder,
326
+ table.widefat.sp-data-table input[type="number"]::placeholder {
327
+ color: silver;
328
+ }
329
+
330
  table.widefat.sp-data-table input.small-text {
331
  width: 50px;
332
  min-width: 0;
assets/css/menu.css CHANGED
@@ -1,12 +1,12 @@
1
  /* SportsPress menu styles */
2
  @font-face {
3
  font-family: 'sportspress';
4
- src:url('../fonts/sportspress.eot?p81i3r');
5
- src:url('../fonts/sportspress.eot?#iefixp81i3r') format('embedded-opentype'),
6
- url('../fonts/sportspress.woff2?p81i3r') format('woff2'),
7
- url('../fonts/sportspress.ttf?p81i3r') format('truetype'),
8
- url('../fonts/sportspress.woff?p81i3r') format('woff'),
9
- url('../fonts/sportspress.svg?p81i3r#sportspress') format('svg');
10
  font-weight: normal;
11
  font-style: normal;
12
  }
@@ -91,6 +91,9 @@
91
  .sp-icon-globe:before {
92
  content: "\f319";
93
  }
 
 
 
94
  .sp-icon-import:before {
95
  content: "\f316";
96
  }
1
  /* SportsPress menu styles */
2
  @font-face {
3
  font-family: 'sportspress';
4
+ src:url('../fonts/sportspress.eot?42ynjo');
5
+ src:url('../fonts/sportspress.eot?#iefix42ynjo') format('embedded-opentype'),
6
+ url('../fonts/sportspress.woff2?42ynjo') format('woff2'),
7
+ url('../fonts/sportspress.ttf?42ynjo') format('truetype'),
8
+ url('../fonts/sportspress.woff?42ynjo') format('woff'),
9
+ url('../fonts/sportspress.svg?42ynjo#sportspress') format('svg');
10
  font-weight: normal;
11
  font-style: normal;
12
  }
91
  .sp-icon-globe:before {
92
  content: "\f319";
93
  }
94
+ .sp-icon-history:before {
95
+ content: "\f321";
96
+ }
97
  .sp-icon-import:before {
98
  content: "\f316";
99
  }
assets/css/sportspress-style.css CHANGED
@@ -251,7 +251,8 @@
251
 
252
  .sp-template-countdown .sp-event-name,
253
  .sp-template-countdown .sp-event-venue,
254
- .sp-template-countdown .sp-event-league {
 
255
  margin: 0 !important;
256
  padding: 5px 10px !important;
257
  text-align: center !important;
@@ -270,7 +271,8 @@
270
  }
271
 
272
  .sp-template-countdown .sp-event-venue,
273
- .sp-template-countdown .sp-event-league {
 
274
  font-size: 12px !important;
275
  font-weight: 500 !important;
276
  background: #fff !important;
251
 
252
  .sp-template-countdown .sp-event-name,
253
  .sp-template-countdown .sp-event-venue,
254
+ .sp-template-countdown .sp-event-league,
255
+ .sp-template-countdown .sp-event-date {
256
  margin: 0 !important;
257
  padding: 5px 10px !important;
258
  text-align: center !important;
271
  }
272
 
273
  .sp-template-countdown .sp-event-venue,
274
+ .sp-template-countdown .sp-event-league,
275
+ .sp-template-countdown .sp-event-date {
276
  font-size: 12px !important;
277
  font-weight: 500 !important;
278
  background: #fff !important;
assets/fonts/sportspress.eot CHANGED
Binary file
assets/fonts/sportspress.svg CHANGED
@@ -51,10 +51,11 @@
51
  <glyph unicode="&#xf307;" glyph-name="tshirt" d="M459.6 307.2h-76.8v-179.2h-256v179.2h-76.8v102.4h132.4c10.56-29.84 38.96-51.2 72.4-51.2s61.84 21.36 72.4 51.2h132.4v-102.4zM382.8 102.4v-51.2h-256v51.2h256z" />
52
  <glyph unicode="&#xf309;" glyph-name="color" d="M435.2 204.8c0-98.96-80.24-179.2-179.2-179.2s-179.2 80.24-179.2 179.2c0 49.52 20.080 94.32 52.48 126.72v0l126.72 126.72 126.72-126.72c32.4-32.4 52.48-77.2 52.48-126.72zM343.28 298l-87.44 87.44-89.040-89.040c-23.84-23.28-38.8-55.6-38.8-91.6 0-70.72 57.28-128 128-128s128 57.28 128 128c0 36.88-15.76 69.84-40.72 93.2zM256 102.4l0.080 246.8 70.4-70.4c19.6-18.64 31.92-44.8 31.92-74 0-56.56-45.84-102.4-102.4-102.4z" />
53
  <glyph unicode="&#xf313;" glyph-name="tournament" d="M384 286v149.2h25.6c14.16 0 25.6-11.44 25.6-25.6v-51.2c0-33.44-21.36-61.84-51.2-72.4zM153.6 51.52h204.8v-51.52h-204.8v51.52zM179.2 76.8l25.6 25.6h25.6v25.6l25.6 25.6 25.6-25.6v-25.6h25.6l25.6-25.6h-153.6zM256 179.2c-56.56 0-102.4 45.84-102.4 102.4v179.2h204.8v-179.2c0-56.56-45.84-102.4-102.4-102.4zM76.8 358.4v51.2c0 14.16 11.44 25.6 25.6 25.6h25.6v-149.2c-29.84 10.56-51.2 38.96-51.2 72.4z" />
54
- <glyph unicode="&#xf314;" glyph-name="matrix" d="M358.4 332.8h-51.2v-51.2h51.2v51.2zM204.8 256h-51.2v-51.2h51.2v51.2zM358.4 256h-51.2v-51.2h51.2v51.2zM435.2 435.2h-358.4c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v307.2h307.2v-307.2zM281.6 332.8h-51.2v-51.2h51.2v51.2zM204.8 179.2h-51.2v-51.2h51.2v51.2zM281.6 179.2h-51.2v-51.2h51.2v51.2z" />
55
  <glyph unicode="&#xf316;" glyph-name="import" d="M435.2 256c-14.16 0-25.6-11.44-25.6-25.6v-153.6h-307.2v153.6c0 14.16-11.44 25.6-25.6 25.6s-25.6-11.44-25.6-25.6v-179.2c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v179.2c0 14.16-11.44 25.6-25.6 25.6zM281.6 256v156.72c0 12.4-11.44 22.48-25.6 22.48s-25.6-10.080-25.6-22.48v-156.72h-76.8l102.4-102.4 102.4 102.4h-76.8z" />
56
  <glyph unicode="&#xf317;" glyph-name="export" d="M435.2 256c-14.16 0-25.6-11.44-25.6-25.6v-153.6h-307.2v153.6c0 14.16-11.44 25.6-25.6 25.6s-25.6-11.44-25.6-25.6v-179.2c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v179.2c0 14.16-11.44 25.6-25.6 25.6zM230.4 179.2c0-14.16 11.44-25.6 25.6-25.6s25.6 11.44 25.6 25.6v153.6h76.8l-102.4 102.4-102.4-102.4h76.8v-153.6z" />
57
  <glyph unicode="&#xf319;" glyph-name="globe" d="M256 25.6c-113.12 0-204.8 91.68-204.8 204.8s91.68 204.8 204.8 204.8 204.8-91.68 204.8-204.8-91.68-204.8-204.8-204.8zM256 384c-84.8 0-153.6-68.8-153.6-153.6s68.8-153.6 153.6-153.6 153.6 68.8 153.6 153.6-68.8 153.6-153.6 153.6zM331.28 138.080l-4.48-2.64-12.96-7.92-7.68-5.6c-5.68-2.72-11.68-4.88-17.76-6.72v7.52l-2.16 17.36c0 0-1.040 10-2.72 12.64-1.6 2.64-5.44 6.32-9.2 7.92s-6.48 1.6-8.64 4.16c-2.16 2.64-3.84 7.36-6.48 11.6-2.72 4.24-6 8.48-6 10.56s0 23.76 0 23.76l2.72 20 5.92 4.24 7.040 7.92 4.88 1.6 16.8-3.12h11.84l4.88-10 11.36-8.96 7.040-11.040 9.2-3.12h10.32l7.040-8.48 4.32-8.96 1.6-6.32v-10.56l-1.12-6.24c-6.8-11.28-15.52-21.2-25.76-29.6v0 0zM289.36 319.92l-11.92-6.32-4.32-12.16-7.040-6.32h-23.36l-10.8-4.24-0.56-8.4-4.32-6.88-1.12-7.36 2.16-6.32 2.72-6.32c0 0 6.56-7.36 0-12.64 0 0-8.16 0-9.76 2.64s-13.52 10-15.76 12.16c-2.16 2.080-9.2 4.16-9.2 4.16l-8.64 3.2-8.16 0.56 0.56 11.040-0.56 9.44-3.28 6.88-9.2 6.88-0.56 7.36 1.12 4.080c21.92 21.2 52.16 34.4 85.6 34.4 18.88 0 36.48-4.56 52.4-12l-0.32-2.8-15.68-11.040z" />
 
58
  <glyph unicode="&#xf322;" glyph-name="archive" d="M409.84 332.8c0 25.76-25.6 25.76-25.6 25.76h-256.24c0 0-25.6 0-25.6-25.76v-25.76h307.44v25.76zM332.96 410h-153.68c0 0-25.6 0-25.6-25.76h204.88c0 25.76-25.6 25.76-25.6 25.76s0 0 0 0zM449.36 309.44c-14.32 12.72-14.32 12.72-14.32 12.72v-40.72h-358v40.72c0 0 0 0-14.32-12.72s-24.56-16.16-18.8-43.12c5.68-26.8 33.44-174 37.6-193.92 4.56-21.84 29.52-21.52 29.52-21.52h289.92c0 0 25.040-0.32 29.52 21.52 4.16 19.92 31.84 167.040 37.6 193.92 5.84 26.96-4.4 30.4-18.72 43.12v0 0zM358.64 179.2c0 0 0-25.76-25.68-25.76h-153.76c-25.6 0-25.6 25.76-25.6 25.76v51.52h26.24v-50.88h153.28v50.88h25.52v-51.52z" />
59
  <glyph unicode="&#xf325;" glyph-name="bracket" d="M434.8 154h-102.4c-14.16 0-25.6 11.44-25.6 25.6v25.6h-25.6v-76.8c0-14.16-11.44-25.6-25.6-25.6h-51.2v-25.6c0-14.16-11.44-25.6-25.6-25.6h-102.4c-14.16 0-25.6 11.44-25.6 25.6v102.4c0 14.16 11.44 25.6 25.6 25.6h102.4c14.16 0 25.6-11.44 25.6-25.6v-25.6h25.6v153.6h-25.6v-25.6c0-14.16-11.44-25.6-25.6-25.6h-102.4c-14.16 0-25.6 11.44-25.6 25.6v102.4c0 14.16 11.44 25.6 25.6 25.6h102.4c14.16 0 25.6-11.44 25.6-25.6v-25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-76.8h25.6v25.6c0 14.16 11.44 25.6 25.6 25.6h102.4c14.16 0 25.6-11.44 25.6-25.6v-102.4c0-14.16-11.44-25.6-25.6-25.6z" />
60
  <glyph unicode="&#xf328;" glyph-name="friendly" horiz-adv-x="439" d="M324 179.28c-7.040-23.040-20.16-41.6-39.44-55.68-19.2-14.080-40.96-21.12-65.12-21.12s-45.92 7.040-65.12 21.12c-19.2 14.080-32.4 32.64-39.44 55.68-1.52 4.8-1.12 9.36 1.12 13.84 2.32 4.48 5.92 7.44 10.88 8.96 4.8 1.52 9.36 1.12 13.84-1.12 4.48-2.32 7.44-5.92 8.96-10.88 4.8-15.2 13.6-27.6 26.4-36.96 12.88-9.44 27.28-14.16 43.28-14.16s30.4 4.72 43.28 14.16c12.88 9.44 21.68 21.76 26.4 36.96 1.52 4.96 4.56 8.56 9.12 10.88s9.2 2.64 14 1.12c4.8-1.52 8.32-4.56 10.56-8.96 2.4-4.48 2.8-9.12 1.28-13.84v0zM182.88 303.52c0-10.080-3.6-18.72-10.72-25.84s-15.76-10.72-25.84-10.72c-10.080 0-18.72 3.6-25.84 10.72s-10.72 15.76-10.72 25.84 3.6 18.72 10.72 25.84c7.12 7.12 15.76 10.72 25.84 10.72s18.72-3.6 25.84-10.72c7.12-7.12 10.72-15.76 10.72-25.84v0zM329.12 303.52c0-10.080-3.6-18.72-10.72-25.84s-15.76-10.72-25.84-10.72c-10.080 0-18.72 3.6-25.84 10.72s-10.72 15.76-10.72 25.84 3.6 18.72 10.72 25.84c7.12 7.12 15.76 10.72 25.84 10.72s18.72-3.6 25.84-10.72c7.2-7.12 10.72-15.76 10.72-25.84v0zM402.32 230.4c0 24.8-4.88 48.4-14.56 70.96s-22.72 42-39.040 58.32-35.68 29.28-58.32 39.040-46.24 14.56-71.040 14.56c-24.8 0-48.4-4.88-71.040-14.56-22.56-9.68-42-22.72-58.32-39.040s-29.12-35.68-38.88-58.32-14.56-46.16-14.56-70.96c0-24.8 4.88-48.4 14.56-71.040s22.72-42 39.040-58.32c16.32-16.32 35.68-29.28 58.32-39.040s46.24-14.56 71.040-14.56 48.4 4.88 71.040 14.56c22.56 9.68 42 22.72 58.32 39.040s29.28 35.68 39.040 58.32c9.52 22.64 14.4 46.32 14.4 71.040v0zM438.88 230.4c0-39.84-9.84-76.56-29.44-110.16s-46.24-60.24-79.84-79.84-70.32-29.44-110.16-29.44-76.56 9.84-110.16 29.44-60.24 46.24-79.84 79.84-29.44 70.32-29.44 110.16 9.84 76.56 29.44 110.16 46.24 60.24 79.84 79.84 70.32 29.44 110.16 29.44 76.48-9.84 110.16-29.44 60.24-46.24 79.84-79.84c19.6-33.6 29.44-70.32 29.44-110.16v0z" />
51
  <glyph unicode="&#xf307;" glyph-name="tshirt" d="M459.6 307.2h-76.8v-179.2h-256v179.2h-76.8v102.4h132.4c10.56-29.84 38.96-51.2 72.4-51.2s61.84 21.36 72.4 51.2h132.4v-102.4zM382.8 102.4v-51.2h-256v51.2h256z" />
52
  <glyph unicode="&#xf309;" glyph-name="color" d="M435.2 204.8c0-98.96-80.24-179.2-179.2-179.2s-179.2 80.24-179.2 179.2c0 49.52 20.080 94.32 52.48 126.72v0l126.72 126.72 126.72-126.72c32.4-32.4 52.48-77.2 52.48-126.72zM343.28 298l-87.44 87.44-89.040-89.040c-23.84-23.28-38.8-55.6-38.8-91.6 0-70.72 57.28-128 128-128s128 57.28 128 128c0 36.88-15.76 69.84-40.72 93.2zM256 102.4l0.080 246.8 70.4-70.4c19.6-18.64 31.92-44.8 31.92-74 0-56.56-45.84-102.4-102.4-102.4z" />
53
  <glyph unicode="&#xf313;" glyph-name="tournament" d="M384 286v149.2h25.6c14.16 0 25.6-11.44 25.6-25.6v-51.2c0-33.44-21.36-61.84-51.2-72.4zM153.6 51.52h204.8v-51.52h-204.8v51.52zM179.2 76.8l25.6 25.6h25.6v25.6l25.6 25.6 25.6-25.6v-25.6h25.6l25.6-25.6h-153.6zM256 179.2c-56.56 0-102.4 45.84-102.4 102.4v179.2h204.8v-179.2c0-56.56-45.84-102.4-102.4-102.4zM76.8 358.4v51.2c0 14.16 11.44 25.6 25.6 25.6h25.6v-149.2c-29.84 10.56-51.2 38.96-51.2 72.4z" />
54
+ <glyph unicode="&#xf314;" glyph-name="grid" d="M358.4 332.8h-51.2v-51.2h51.2v51.2zM204.8 256h-51.2v-51.2h51.2v51.2zM358.4 256h-51.2v-51.2h51.2v51.2zM435.2 435.2h-358.4c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v307.2h307.2v-307.2zM281.6 332.8h-51.2v-51.2h51.2v51.2zM204.8 179.2h-51.2v-51.2h51.2v51.2zM281.6 179.2h-51.2v-51.2h51.2v51.2z" />
55
  <glyph unicode="&#xf316;" glyph-name="import" d="M435.2 256c-14.16 0-25.6-11.44-25.6-25.6v-153.6h-307.2v153.6c0 14.16-11.44 25.6-25.6 25.6s-25.6-11.44-25.6-25.6v-179.2c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v179.2c0 14.16-11.44 25.6-25.6 25.6zM281.6 256v156.72c0 12.4-11.44 22.48-25.6 22.48s-25.6-10.080-25.6-22.48v-156.72h-76.8l102.4-102.4 102.4 102.4h-76.8z" />
56
  <glyph unicode="&#xf317;" glyph-name="export" d="M435.2 256c-14.16 0-25.6-11.44-25.6-25.6v-153.6h-307.2v153.6c0 14.16-11.44 25.6-25.6 25.6s-25.6-11.44-25.6-25.6v-179.2c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v179.2c0 14.16-11.44 25.6-25.6 25.6zM230.4 179.2c0-14.16 11.44-25.6 25.6-25.6s25.6 11.44 25.6 25.6v153.6h76.8l-102.4 102.4-102.4-102.4h76.8v-153.6z" />
57
  <glyph unicode="&#xf319;" glyph-name="globe" d="M256 25.6c-113.12 0-204.8 91.68-204.8 204.8s91.68 204.8 204.8 204.8 204.8-91.68 204.8-204.8-91.68-204.8-204.8-204.8zM256 384c-84.8 0-153.6-68.8-153.6-153.6s68.8-153.6 153.6-153.6 153.6 68.8 153.6 153.6-68.8 153.6-153.6 153.6zM331.28 138.080l-4.48-2.64-12.96-7.92-7.68-5.6c-5.68-2.72-11.68-4.88-17.76-6.72v7.52l-2.16 17.36c0 0-1.040 10-2.72 12.64-1.6 2.64-5.44 6.32-9.2 7.92s-6.48 1.6-8.64 4.16c-2.16 2.64-3.84 7.36-6.48 11.6-2.72 4.24-6 8.48-6 10.56s0 23.76 0 23.76l2.72 20 5.92 4.24 7.040 7.92 4.88 1.6 16.8-3.12h11.84l4.88-10 11.36-8.96 7.040-11.040 9.2-3.12h10.32l7.040-8.48 4.32-8.96 1.6-6.32v-10.56l-1.12-6.24c-6.8-11.28-15.52-21.2-25.76-29.6v0 0zM289.36 319.92l-11.92-6.32-4.32-12.16-7.040-6.32h-23.36l-10.8-4.24-0.56-8.4-4.32-6.88-1.12-7.36 2.16-6.32 2.72-6.32c0 0 6.56-7.36 0-12.64 0 0-8.16 0-9.76 2.64s-13.52 10-15.76 12.16c-2.16 2.080-9.2 4.16-9.2 4.16l-8.64 3.2-8.16 0.56 0.56 11.040-0.56 9.44-3.28 6.88-9.2 6.88-0.56 7.36 1.12 4.080c21.92 21.2 52.16 34.4 85.6 34.4 18.88 0 36.48-4.56 52.4-12l-0.32-2.8-15.68-11.040z" />
58
+ <glyph unicode="&#xf321;" glyph-name="history" d="M287.411 440.32c-113.817 0-206.362-91.187-209.126-204.672h-62.925l94.183-104.986 94.157 104.986h-73.113c2.765 84.506 71.885 152.192 156.826 152.192 86.682 0 156.928-70.477 156.928-157.44s-70.246-157.44-156.928-157.44c-34.765 0-66.867 11.366-92.877 30.541l-35.993-38.502c35.533-27.878 80.256-44.519 128.87-44.519 115.558 0 209.255 93.978 209.255 209.92-0.026 115.942-93.721 209.92-209.255 209.92zM268.8 343.040v-120.064l76.928-76.928 25.344 25.344-66.432 66.432v105.216h-35.84z" />
59
  <glyph unicode="&#xf322;" glyph-name="archive" d="M409.84 332.8c0 25.76-25.6 25.76-25.6 25.76h-256.24c0 0-25.6 0-25.6-25.76v-25.76h307.44v25.76zM332.96 410h-153.68c0 0-25.6 0-25.6-25.76h204.88c0 25.76-25.6 25.76-25.6 25.76s0 0 0 0zM449.36 309.44c-14.32 12.72-14.32 12.72-14.32 12.72v-40.72h-358v40.72c0 0 0 0-14.32-12.72s-24.56-16.16-18.8-43.12c5.68-26.8 33.44-174 37.6-193.92 4.56-21.84 29.52-21.52 29.52-21.52h289.92c0 0 25.040-0.32 29.52 21.52 4.16 19.92 31.84 167.040 37.6 193.92 5.84 26.96-4.4 30.4-18.72 43.12v0 0zM358.64 179.2c0 0 0-25.76-25.68-25.76h-153.76c-25.6 0-25.6 25.76-25.6 25.76v51.52h26.24v-50.88h153.28v50.88h25.52v-51.52z" />
60
  <glyph unicode="&#xf325;" glyph-name="bracket" d="M434.8 154h-102.4c-14.16 0-25.6 11.44-25.6 25.6v25.6h-25.6v-76.8c0-14.16-11.44-25.6-25.6-25.6h-51.2v-25.6c0-14.16-11.44-25.6-25.6-25.6h-102.4c-14.16 0-25.6 11.44-25.6 25.6v102.4c0 14.16 11.44 25.6 25.6 25.6h102.4c14.16 0 25.6-11.44 25.6-25.6v-25.6h25.6v153.6h-25.6v-25.6c0-14.16-11.44-25.6-25.6-25.6h-102.4c-14.16 0-25.6 11.44-25.6 25.6v102.4c0 14.16 11.44 25.6 25.6 25.6h102.4c14.16 0 25.6-11.44 25.6-25.6v-25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-76.8h25.6v25.6c0 14.16 11.44 25.6 25.6 25.6h102.4c14.16 0 25.6-11.44 25.6-25.6v-102.4c0-14.16-11.44-25.6-25.6-25.6z" />
61
  <glyph unicode="&#xf328;" glyph-name="friendly" horiz-adv-x="439" d="M324 179.28c-7.040-23.040-20.16-41.6-39.44-55.68-19.2-14.080-40.96-21.12-65.12-21.12s-45.92 7.040-65.12 21.12c-19.2 14.080-32.4 32.64-39.44 55.68-1.52 4.8-1.12 9.36 1.12 13.84 2.32 4.48 5.92 7.44 10.88 8.96 4.8 1.52 9.36 1.12 13.84-1.12 4.48-2.32 7.44-5.92 8.96-10.88 4.8-15.2 13.6-27.6 26.4-36.96 12.88-9.44 27.28-14.16 43.28-14.16s30.4 4.72 43.28 14.16c12.88 9.44 21.68 21.76 26.4 36.96 1.52 4.96 4.56 8.56 9.12 10.88s9.2 2.64 14 1.12c4.8-1.52 8.32-4.56 10.56-8.96 2.4-4.48 2.8-9.12 1.28-13.84v0zM182.88 303.52c0-10.080-3.6-18.72-10.72-25.84s-15.76-10.72-25.84-10.72c-10.080 0-18.72 3.6-25.84 10.72s-10.72 15.76-10.72 25.84 3.6 18.72 10.72 25.84c7.12 7.12 15.76 10.72 25.84 10.72s18.72-3.6 25.84-10.72c7.12-7.12 10.72-15.76 10.72-25.84v0zM329.12 303.52c0-10.080-3.6-18.72-10.72-25.84s-15.76-10.72-25.84-10.72c-10.080 0-18.72 3.6-25.84 10.72s-10.72 15.76-10.72 25.84 3.6 18.72 10.72 25.84c7.12 7.12 15.76 10.72 25.84 10.72s18.72-3.6 25.84-10.72c7.2-7.12 10.72-15.76 10.72-25.84v0zM402.32 230.4c0 24.8-4.88 48.4-14.56 70.96s-22.72 42-39.040 58.32-35.68 29.28-58.32 39.040-46.24 14.56-71.040 14.56c-24.8 0-48.4-4.88-71.040-14.56-22.56-9.68-42-22.72-58.32-39.040s-29.12-35.68-38.88-58.32-14.56-46.16-14.56-70.96c0-24.8 4.88-48.4 14.56-71.040s22.72-42 39.040-58.32c16.32-16.32 35.68-29.28 58.32-39.040s46.24-14.56 71.040-14.56 48.4 4.88 71.040 14.56c22.56 9.68 42 22.72 58.32 39.040s29.28 35.68 39.040 58.32c9.52 22.64 14.4 46.32 14.4 71.040v0zM438.88 230.4c0-39.84-9.84-76.56-29.44-110.16s-46.24-60.24-79.84-79.84-70.32-29.44-110.16-29.44-76.56 9.84-110.16 29.44-60.24 46.24-79.84 79.84-29.44 70.32-29.44 110.16 9.84 76.56 29.44 110.16 46.24 60.24 79.84 79.84 70.32 29.44 110.16 29.44 76.48-9.84 110.16-29.44 60.24-46.24 79.84-79.84c19.6-33.6 29.44-70.32 29.44-110.16v0z" />
assets/fonts/sportspress.ttf CHANGED
Binary file
assets/fonts/sportspress.woff CHANGED
Binary file
assets/fonts/sportspress.woff2 CHANGED
Binary file
assets/js/admin/editor-lang.php CHANGED
@@ -4,7 +4,7 @@ $shortcodes = '';
4
 
5
  $options = array(
6
  'event' => array(
7
- 'details', 'results', 'performance'
8
  ),
9
  'team' => array(),
10
  'player' => array(
@@ -30,6 +30,10 @@ $raw = apply_filters( 'sportspress_tinymce_strings', array(
30
  'results' => __( 'Results', 'sportspress' ),
31
  'countdown' => __( 'Countdown', 'sportspress' ),
32
  'performance' => __( 'Box Score', 'sportspress' ),
 
 
 
 
33
  'calendar' => __( 'Calendar', 'sportspress' ),
34
  'statistics' => __( 'Statistics', 'sportspress' ),
35
  'team' => __( 'Team', 'sportspress' ),
4
 
5
  $options = array(
6
  'event' => array(
7
+ 'details', 'results', 'performance', 'venue', 'officials', 'teams', 'full',
8
  ),
9
  'team' => array(),
10
  'player' => array(
30
  'results' => __( 'Results', 'sportspress' ),
31
  'countdown' => __( 'Countdown', 'sportspress' ),
32
  'performance' => __( 'Box Score', 'sportspress' ),
33
+ 'venue' => __( 'Venue', 'sportspress' ),
34
+ 'officials' => __( 'Officials', 'sportspress' ),
35
+ 'teams' => __( 'Teams', 'sportspress' ),
36
+ 'full' => __( 'Full Info', 'sportspress' ),
37
  'calendar' => __( 'Calendar', 'sportspress' ),
38
  'statistics' => __( 'Statistics', 'sportspress' ),
39
  'team' => __( 'Team', 'sportspress' ),
assets/js/locationpicker.jquery.js CHANGED
@@ -1,44 +1,14 @@
1
- /*
2
- * File: locationpicker.jquery.js
3
- * Version: 0.1.6
4
- * Author: Dmitry Berezovsky, Logicify (http://logicify.com/)
5
- * Info: http://logicify.github.io/jquery-locationpicker-plugin/
6
- *
7
- * Copyright 2013 Logicify
8
- *
9
- * The MIT License (MIT)
10
- *
11
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
12
- * this software and associated documentation files (the "Software"), to deal in
13
- * the Software without restriction, including without limitation the rights to
14
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
15
- * the Software, and to permit persons to whom the Software is furnished to do so,
16
- * subject to the following conditions:
17
- *
18
- * The above copyright notice and this permission notice shall be included in all
19
- * copies or substantial portions of the Software.
20
- *
21
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
23
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
24
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
25
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
- */
28
-
29
- (function ( $ ) {
30
-
31
- /**
32
- * Holds google map object and related utility entities.
33
- * @constructor
34
- */
35
  function GMapContext(domElement, options) {
36
  var _map = new google.maps.Map(domElement, options);
37
  var _marker = new google.maps.Marker({
38
  position: new google.maps.LatLng(54.19335, -3.92695),
39
  map: _map,
40
  title: "Drag Me",
41
- draggable: true
 
 
42
  });
43
  return {
44
  map: _map,
@@ -47,23 +17,23 @@
47
  location: _marker.position,
48
  radius: options.radius,
49
  locationName: options.locationName,
 
 
 
 
 
 
 
 
 
 
 
50
  settings: options.settings,
51
  domContainer: domElement,
52
  geodecoder: new google.maps.Geocoder()
53
- }
54
  }
55
-
56
- // Utility functions for Google Map Manipulations
57
  var GmUtility = {
58
- /**
59
- * Draw a circle over the the map. Returns circle object.
60
- * Also writes new circle object in gmapContext.
61
- *
62
- * @param center - LatLng of the center of the circle
63
- * @param radius - radius in meters
64
- * @param gmapContext - context
65
- * @param options
66
- */
67
  drawCircle: function(gmapContext, center, radius, options) {
68
  if (gmapContext.circle != null) {
69
  gmapContext.circle.setMap(null);
@@ -72,10 +42,10 @@
72
  radius *= 1;
73
  options = $.extend({
74
  strokeColor: "#0000FF",
75
- strokeOpacity: 0.35,
76
  strokeWeight: 2,
77
  fillColor: "#0000FF",
78
- fillOpacity: 0.20
79
  }, options);
80
  options.map = gmapContext.map;
81
  options.radius = radius;
@@ -85,199 +55,328 @@
85
  }
86
  return null;
87
  },
88
- /**
89
- *
90
- * @param gMapContext
91
- * @param location
92
- * @param callback
93
- */
94
  setPosition: function(gMapContext, location, callback) {
95
  gMapContext.location = location;
96
  gMapContext.marker.setPosition(location);
97
  gMapContext.map.panTo(location);
98
  this.drawCircle(gMapContext, location, gMapContext.radius, {});
99
  if (gMapContext.settings.enableReverseGeocode) {
100
- gMapContext.geodecoder.geocode({latLng: gMapContext.location}, function(results, status){
101
- if (status == google.maps.GeocoderStatus.OK && results.length > 0){
102
- gMapContext.locationName = results[0].formatted_address;
103
- }
104
- if (callback) {
105
- callback.call(this, gMapContext);
106
- }
107
- });
108
  } else {
109
  if (callback) {
110
- callback.call(this, gmapContext);
111
  }
112
  }
113
-
114
  },
115
  locationFromLatLng: function(lnlg) {
116
- return {latitude: lnlg.lat(), longitude: lnlg.lng()}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  }
118
- }
119
-
120
  function isPluginApplied(domObj) {
121
  return getContextForElement(domObj) != undefined;
122
  }
123
-
124
  function getContextForElement(domObj) {
125
  return $(domObj).data("locationpicker");
126
  }
127
-
128
- function updateInputValues(inputBinding, gmapContext){
129
  if (!inputBinding) return;
130
- var currentLocation = GmUtility.locationFromLatLng(gmapContext.location);
131
  if (inputBinding.latitudeInput) {
132
- inputBinding.latitudeInput.val(currentLocation.latitude);
133
  }
134
  if (inputBinding.longitudeInput) {
135
- inputBinding.longitudeInput.val(currentLocation.longitude);
136
  }
137
  if (inputBinding.radiusInput) {
138
- inputBinding.radiusInput.val(gmapContext.radius);
139
  }
140
  if (inputBinding.locationNameInput) {
141
- inputBinding.locationNameInput.val(gmapContext.locationName);
142
  }
143
- }
144
-
145
  function setupInputListenersInput(inputBinding, gmapContext) {
146
  if (inputBinding) {
147
- if (inputBinding.radiusInput){
148
- inputBinding.radiusInput.on("change", function() {
149
- gmapContext.radius = $(this).val();
150
- GmUtility.setPosition(gmapContext, gmapContext.location, function(context){
151
- context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false);
152
- });
153
- });
 
 
 
 
154
  }
155
  if (inputBinding.locationNameInput && gmapContext.settings.enableAutocomplete) {
156
- gmapContext.autocomplete = new google.maps.places.Autocomplete(inputBinding.locationNameInput.get(0));
157
- google.maps.event.addListener(gmapContext.autocomplete, 'place_changed', function() {
 
 
158
  var place = gmapContext.autocomplete.getPlace();
159
  if (!place.geometry) {
160
- gmapContext.onlocationnotfound();
161
  return;
162
  }
163
- GmUtility.setPosition(gmapContext, place.geometry.location, function(context) {
164
  updateInputValues(inputBinding, context);
165
- context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false);
166
  });
167
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  }
169
  if (inputBinding.latitudeInput) {
170
- inputBinding.latitudeInput.on("change", function() {
171
- GmUtility.setPosition(gmapContext, new google.maps.LatLng($(this).val(), gmapContext.location.lng()), function(context){
172
- context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false);
173
- });
174
- });
 
 
 
 
 
175
  }
176
  if (inputBinding.longitudeInput) {
177
- inputBinding.longitudeInput.on("change", function() {
178
- GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), $(this).val()), function(context){
179
- context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false);
180
- });
181
- });
 
 
 
 
 
182
  }
183
  }
184
  }
185
-
186
- /**
187
- * Initialization:
188
- * $("#myMap").locationpicker(options);
189
- * @param options
190
- * @param params
191
- * @returns {*}
192
- */
193
- $.fn.locationpicker = function( options, params ) {
194
- if (typeof options == 'string') { // Command provided
 
 
 
 
 
 
 
 
 
195
  var _targetDomElement = this.get(0);
196
- // Plug-in is not applied - nothing to do.
197
  if (!isPluginApplied(_targetDomElement)) return;
198
  var gmapContext = getContextForElement(_targetDomElement);
199
  switch (options) {
200
- case "location":
201
- if (params == undefined) { // Getter
202
- var location = GmUtility.locationFromLatLng(gmapContext.location);
203
- location.radius = gmapContext.radius;
204
- location.name = gmapContext.locationName;
205
- return location;
206
- } else { // Setter
207
- if (params.radius) {
208
- gmapContext.radius = params.radius;
209
- }
210
- GmUtility.setPosition(gmapContext, new google.maps.LatLng(params.latitude, params.longitude), function(gmapContext) {
211
- updateInputValues(gmapContext.settings.inputBinding, gmapContext);
212
- });
213
  }
214
- break;
215
- case "subscribe":
216
- /**
217
- * Provides interface for subscribing for GoogleMap events.
218
- * See Google API documentation for details.
219
- * Parameters:
220
- * - event: string, name of the event
221
- * - callback: function, callback function to be invoked
222
- */
223
- if (options == undefined) { // Getter is not available
 
 
 
 
224
  return null;
225
- } else {
226
- var event = params.event;
227
- var callback = params.callback;
228
- if (!event || ! callback) {
229
- console.error("LocationPicker: Invalid arguments for method \"subscribe\"")
230
- return null;
231
- }
232
- google.maps.event.addListener(gmapContext.map, event, callback);
233
  }
 
 
 
234
 
235
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  }
237
  return null;
238
  }
239
  return this.each(function() {
240
  var $target = $(this);
241
- // If plug-in hasn't been applied before - initialize, otherwise - skip
242
- if (isPluginApplied(this)) return;
243
- // Plug-in initialization is required
244
- // Defaults
245
- var settings = $.extend({}, $.fn.locationpicker.defaults, options );
246
- // Initialize
247
- var gmapContext = new GMapContext(this, {
248
  zoom: settings.zoom,
249
  center: new google.maps.LatLng(settings.location.latitude, settings.location.longitude),
250
- mapTypeId: google.maps.MapTypeId.ROADMAP,
251
  mapTypeControl: false,
 
252
  disableDoubleClickZoom: false,
253
  scrollwheel: settings.scrollwheel,
254
  streetViewControl: false,
255
  radius: settings.radius,
256
  locationName: settings.locationName,
257
- settings: settings
258
- });
 
 
 
 
 
 
259
  $target.data("locationpicker", gmapContext);
260
- // Subscribe GMap events
261
- google.maps.event.addListener(gmapContext.marker, "dragend", function(event) {
262
- GmUtility.setPosition(gmapContext, gmapContext.marker.position, function(context){
263
  var currentLocation = GmUtility.locationFromLatLng(gmapContext.location);
264
- context.settings.onchanged(currentLocation, context.radius, true);
265
  updateInputValues(gmapContext.settings.inputBinding, gmapContext);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  });
 
 
 
267
  });
268
- GmUtility.setPosition(gmapContext, new google.maps.LatLng(settings.location.latitude, settings.location.longitude), function(context){
 
 
 
269
  updateInputValues(settings.inputBinding, gmapContext);
 
270
  context.settings.oninitialized($target);
271
  });
272
- // Set up input bindings if needed
273
- setupInputListenersInput(settings.inputBinding, gmapContext);
274
  });
275
  };
276
  $.fn.locationpicker.defaults = {
277
- location: {latitude: 40.7324319, longitude: -73.82480799999996},
 
 
 
278
  locationName: "",
279
  radius: 500,
280
  zoom: 15,
 
 
 
281
  scrollwheel: true,
282
  inputBinding: {
283
  latitudeInput: null,
@@ -286,11 +385,16 @@
286
  locationNameInput: null
287
  },
288
  enableAutocomplete: false,
 
 
 
289
  enableReverseGeocode: true,
 
290
  onchanged: function(currentLocation, radius, isMarkerDropped) {},
291
  onlocationnotfound: function(locationName) {},
292
- oninitialized: function (component) {}
293
-
294
- }
295
-
296
- }( jQuery ));
 
1
+ /*! jquery-locationpicker - v0.1.16 - 2017-10-02 */
2
+ (function($) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  function GMapContext(domElement, options) {
4
  var _map = new google.maps.Map(domElement, options);
5
  var _marker = new google.maps.Marker({
6
  position: new google.maps.LatLng(54.19335, -3.92695),
7
  map: _map,
8
  title: "Drag Me",
9
+ visible: options.markerVisible,
10
+ draggable: options.markerDraggable,
11
+ icon: options.markerIcon !== undefined ? options.markerIcon : undefined
12
  });
13
  return {
14
  map: _map,
17
  location: _marker.position,
18
  radius: options.radius,
19
  locationName: options.locationName,
20
+ addressComponents: {
21
+ formatted_address: null,
22
+ addressLine1: null,
23
+ addressLine2: null,
24
+ streetName: null,
25
+ streetNumber: null,
26
+ city: null,
27
+ district: null,
28
+ state: null,
29
+ stateOrProvince: null
30
+ },
31
  settings: options.settings,
32
  domContainer: domElement,
33
  geodecoder: new google.maps.Geocoder()
34
+ };
35
  }
 
 
36
  var GmUtility = {
 
 
 
 
 
 
 
 
 
37
  drawCircle: function(gmapContext, center, radius, options) {
38
  if (gmapContext.circle != null) {
39
  gmapContext.circle.setMap(null);
42
  radius *= 1;
43
  options = $.extend({
44
  strokeColor: "#0000FF",
45
+ strokeOpacity: .35,
46
  strokeWeight: 2,
47
  fillColor: "#0000FF",
48
+ fillOpacity: .2
49
  }, options);
50
  options.map = gmapContext.map;
51
  options.radius = radius;
55
  }
56
  return null;
57
  },
 
 
 
 
 
 
58
  setPosition: function(gMapContext, location, callback) {
59
  gMapContext.location = location;
60
  gMapContext.marker.setPosition(location);
61
  gMapContext.map.panTo(location);
62
  this.drawCircle(gMapContext, location, gMapContext.radius, {});
63
  if (gMapContext.settings.enableReverseGeocode) {
64
+ this.updateLocationName(gMapContext, callback);
 
 
 
 
 
 
 
65
  } else {
66
  if (callback) {
67
+ callback.call(this, gMapContext);
68
  }
69
  }
 
70
  },
71
  locationFromLatLng: function(lnlg) {
72
+ return {
73
+ latitude: lnlg.lat(),
74
+ longitude: lnlg.lng()
75
+ };
76
+ },
77
+ addressByFormat: function(addresses, format) {
78
+ var result = null;
79
+ for (var i = addresses.length - 1; i >= 0; i--) {
80
+ if (addresses[i].types.indexOf(format) >= 0) {
81
+ result = addresses[i];
82
+ }
83
+ }
84
+ return result || addresses[0];
85
+ },
86
+ updateLocationName: function(gmapContext, callback) {
87
+ gmapContext.geodecoder.geocode({
88
+ latLng: gmapContext.marker.position
89
+ }, function(results, status) {
90
+ if (status == google.maps.GeocoderStatus.OK && results.length > 0) {
91
+ var address = GmUtility.addressByFormat(results, gmapContext.settings.addressFormat);
92
+ gmapContext.locationName = address.formatted_address;
93
+ gmapContext.addressComponents = GmUtility.address_component_from_google_geocode(address.address_components);
94
+ } else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
95
+ return setTimeout(function() {
96
+ GmUtility.updateLocationName(gmapContext, callback);
97
+ }, 1e3);
98
+ }
99
+ if (callback) {
100
+ callback.call(this, gmapContext);
101
+ }
102
+ });
103
+ },
104
+ address_component_from_google_geocode: function(address_components) {
105
+ var result = {};
106
+ for (var i = address_components.length - 1; i >= 0; i--) {
107
+ var component = address_components[i];
108
+ if (component.types.indexOf("postal_code") >= 0) {
109
+ result.postalCode = component.short_name;
110
+ } else if (component.types.indexOf("street_number") >= 0) {
111
+ result.streetNumber = component.short_name;
112
+ } else if (component.types.indexOf("route") >= 0) {
113
+ result.streetName = component.short_name;
114
+ } else if (component.types.indexOf("locality") >= 0) {
115
+ result.city = component.short_name;
116
+ } else if (component.types.indexOf("sublocality") >= 0) {
117
+ result.district = component.short_name;
118
+ } else if (component.types.indexOf("administrative_area_level_1") >= 0) {
119
+ result.stateOrProvince = component.short_name;
120
+ } else if (component.types.indexOf("country") >= 0) {
121
+ result.country = component.short_name;
122
+ }
123
+ }
124
+ result.addressLine1 = [ result.streetNumber, result.streetName ].join(" ").trim();
125
+ result.addressLine2 = "";
126
+ return result;
127
  }
128
+ };
 
129
  function isPluginApplied(domObj) {
130
  return getContextForElement(domObj) != undefined;
131
  }
 
132
  function getContextForElement(domObj) {
133
  return $(domObj).data("locationpicker");
134
  }
135
+ function updateInputValues(inputBinding, gmapContext) {
 
136
  if (!inputBinding) return;
137
+ var currentLocation = GmUtility.locationFromLatLng(gmapContext.marker.position);
138
  if (inputBinding.latitudeInput) {
139
+ inputBinding.latitudeInput.val(currentLocation.latitude).change();
140
  }
141
  if (inputBinding.longitudeInput) {
142
+ inputBinding.longitudeInput.val(currentLocation.longitude).change();
143
  }
144
  if (inputBinding.radiusInput) {
145
+ inputBinding.radiusInput.val(gmapContext.radius).change();
146
  }
147
  if (inputBinding.locationNameInput) {
148
+ inputBinding.locationNameInput.val(gmapContext.locationName).change();
149
  }
150
+ }
 
151
  function setupInputListenersInput(inputBinding, gmapContext) {
152
  if (inputBinding) {
153
+ if (inputBinding.radiusInput) {
154
+ inputBinding.radiusInput.on("change", function(e) {
155
+ var radiusInputValue = $(this).val();
156
+ if (!e.originalEvent || isNaN(radiusInputValue)) {
157
+ return;
158
+ }
159
+ gmapContext.radius = radiusInputValue;
160
+ GmUtility.setPosition(gmapContext, gmapContext.location, function(context) {
161
+ context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
162
+ });
163
+ });
164
  }
165
  if (inputBinding.locationNameInput && gmapContext.settings.enableAutocomplete) {
166
+ var blur = false;
167
+ gmapContext.autocomplete = new google.maps.places.Autocomplete(inputBinding.locationNameInput.get(0), gmapContext.settings.autocompleteOptions);
168
+ google.maps.event.addListener(gmapContext.autocomplete, "place_changed", function() {
169
+ blur = false;
170
  var place = gmapContext.autocomplete.getPlace();
171
  if (!place.geometry) {
172
+ gmapContext.settings.onlocationnotfound(place.name);
173
  return;
174
  }
175
+ GmUtility.setPosition(gmapContext, place.geometry.location, function(context) {
176
  updateInputValues(inputBinding, context);
177
+ context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
178
  });
179
  });
180
+ if (gmapContext.settings.enableAutocompleteBlur) {
181
+ inputBinding.locationNameInput.on("change", function(e) {
182
+ if (!e.originalEvent) {
183
+ return;
184
+ }
185
+ blur = true;
186
+ });
187
+ inputBinding.locationNameInput.on("blur", function(e) {
188
+ if (!e.originalEvent) {
189
+ return;
190
+ }
191
+ setTimeout(function() {
192
+ var address = $(inputBinding.locationNameInput).val();
193
+ if (address.length > 5 && blur) {
194
+ blur = false;
195
+ gmapContext.geodecoder.geocode({
196
+ address: address
197
+ }, function(results, status) {
198
+ if (status == google.maps.GeocoderStatus.OK && results && results.length) {
199
+ GmUtility.setPosition(gmapContext, results[0].geometry.location, function(context) {
200
+ updateInputValues(inputBinding, context);
201
+ context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
202
+ });
203
+ }
204
+ });
205
+ }
206
+ }, 1e3);
207
+ });
208
+ }
209
  }
210
  if (inputBinding.latitudeInput) {
211
+ inputBinding.latitudeInput.on("change", function(e) {
212
+ var latitudeInputValue = $(this).val();
213
+ if (!e.originalEvent || isNaN(latitudeInputValue)) {
214
+ return;
215
+ }
216
+ GmUtility.setPosition(gmapContext, new google.maps.LatLng(latitudeInputValue, gmapContext.location.lng()), function(context) {
217
+ context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
218
+ updateInputValues(gmapContext.settings.inputBinding, gmapContext);
219
+ });
220
+ });
221
  }
222
  if (inputBinding.longitudeInput) {
223
+ inputBinding.longitudeInput.on("change", function(e) {
224
+ var longitudeInputValue = $(this).val();
225
+ if (!e.originalEvent || isNaN(longitudeInputValue)) {
226
+ return;
227
+ }
228
+ GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), longitudeInputValue), function(context) {
229
+ context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
230
+ updateInputValues(gmapContext.settings.inputBinding, gmapContext);
231
+ });
232
+ });
233
  }
234
  }
235
  }
236
+ function autosize(gmapContext) {
237
+ google.maps.event.trigger(gmapContext.map, "resize");
238
+ setTimeout(function() {
239
+ gmapContext.map.setCenter(gmapContext.marker.position);
240
+ }, 300);
241
+ }
242
+ function updateMap(gmapContext, $target, options) {
243
+ var settings = $.extend({}, $.fn.locationpicker.defaults, options), latNew = settings.location.latitude, lngNew = settings.location.longitude, radiusNew = settings.radius, latOld = gmapContext.settings.location.latitude, lngOld = gmapContext.settings.location.longitude, radiusOld = gmapContext.settings.radius;
244
+ if (latNew == latOld && lngNew == lngOld && radiusNew == radiusOld) return;
245
+ gmapContext.settings.location.latitude = latNew;
246
+ gmapContext.settings.location.longitude = lngNew;
247
+ gmapContext.radius = radiusNew;
248
+ GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.settings.location.latitude, gmapContext.settings.location.longitude), function(context) {
249
+ setupInputListenersInput(gmapContext.settings.inputBinding, gmapContext);
250
+ context.settings.oninitialized($target);
251
+ });
252
+ }
253
+ $.fn.locationpicker = function(options, params) {
254
+ if (typeof options == "string") {
255
  var _targetDomElement = this.get(0);
 
256
  if (!isPluginApplied(_targetDomElement)) return;
257
  var gmapContext = getContextForElement(_targetDomElement);
258
  switch (options) {
259
+ case "location":
260
+ if (params == undefined) {
261
+ var location = GmUtility.locationFromLatLng(gmapContext.location);
262
+ location.radius = gmapContext.radius;
263
+ location.name = gmapContext.locationName;
264
+ return location;
265
+ } else {
266
+ if (params.radius) {
267
+ gmapContext.radius = params.radius;
 
 
 
 
268
  }
269
+ GmUtility.setPosition(gmapContext, new google.maps.LatLng(params.latitude, params.longitude), function(gmapContext) {
270
+ updateInputValues(gmapContext.settings.inputBinding, gmapContext);
271
+ });
272
+ }
273
+ break;
274
+
275
+ case "subscribe":
276
+ if (params == undefined) {
277
+ return null;
278
+ } else {
279
+ var event = params.event;
280
+ var callback = params.callback;
281
+ if (!event || !callback) {
282
+ console.error('LocationPicker: Invalid arguments for method "subscribe"');
283
  return null;
 
 
 
 
 
 
 
 
284
  }
285
+ google.maps.event.addListener(gmapContext.map, event, callback);
286
+ }
287
+ break;
288
 
289
+ case "map":
290
+ if (params == undefined) {
291
+ var locationObj = GmUtility.locationFromLatLng(gmapContext.location);
292
+ locationObj.formattedAddress = gmapContext.locationName;
293
+ locationObj.addressComponents = gmapContext.addressComponents;
294
+ return {
295
+ map: gmapContext.map,
296
+ marker: gmapContext.marker,
297
+ location: locationObj
298
+ };
299
+ } else {
300
+ return null;
301
+ }
302
+
303
+ case "autosize":
304
+ autosize(gmapContext);
305
+ return this;
306
  }
307
  return null;
308
  }
309
  return this.each(function() {
310
  var $target = $(this);
311
+ if (isPluginApplied(this)) {
312
+ updateMap(getContextForElement(this), $(this), options);
313
+ return;
314
+ }
315
+ var settings = $.extend({}, $.fn.locationpicker.defaults, options);
316
+ var gmapContext = new GMapContext(this, $.extend({}, {
 
317
  zoom: settings.zoom,
318
  center: new google.maps.LatLng(settings.location.latitude, settings.location.longitude),
319
+ mapTypeId: settings.mapTypeId,
320
  mapTypeControl: false,
321
+ styles: settings.styles,
322
  disableDoubleClickZoom: false,
323
  scrollwheel: settings.scrollwheel,
324
  streetViewControl: false,
325
  radius: settings.radius,
326
  locationName: settings.locationName,
327
+ settings: settings,
328
+ autocompleteOptions: settings.autocompleteOptions,
329
+ addressFormat: settings.addressFormat,
330
+ draggable: settings.draggable,
331
+ markerIcon: settings.markerIcon,
332
+ markerDraggable: settings.markerDraggable,
333
+ markerVisible: settings.markerVisible
334
+ }, settings.mapOptions));
335
  $target.data("locationpicker", gmapContext);
336
+ function displayMarkerWithSelectedArea() {
337
+ GmUtility.setPosition(gmapContext, gmapContext.marker.position, function(context) {
 
338
  var currentLocation = GmUtility.locationFromLatLng(gmapContext.location);
 
339
  updateInputValues(gmapContext.settings.inputBinding, gmapContext);
340
+ context.settings.onchanged.apply(gmapContext.domContainer, [ currentLocation, context.radius, true ]);
341
+ });
342
+ }
343
+ if (settings.markerInCenter) {
344
+ gmapContext.map.addListener("bounds_changed", function() {
345
+ if (!gmapContext.marker.dragging) {
346
+ gmapContext.marker.setPosition(gmapContext.map.center);
347
+ updateInputValues(gmapContext.settings.inputBinding, gmapContext);
348
+ }
349
+ });
350
+ gmapContext.map.addListener("idle", function() {
351
+ if (!gmapContext.marker.dragging) {
352
+ displayMarkerWithSelectedArea();
353
+ }
354
  });
355
+ }
356
+ google.maps.event.addListener(gmapContext.marker, "drag", function(event) {
357
+ updateInputValues(gmapContext.settings.inputBinding, gmapContext);
358
  });
359
+ google.maps.event.addListener(gmapContext.marker, "dragend", function(event) {
360
+ displayMarkerWithSelectedArea();
361
+ });
362
+ GmUtility.setPosition(gmapContext, new google.maps.LatLng(settings.location.latitude, settings.location.longitude), function(context) {
363
  updateInputValues(settings.inputBinding, gmapContext);
364
+ setupInputListenersInput(settings.inputBinding, gmapContext);
365
  context.settings.oninitialized($target);
366
  });
 
 
367
  });
368
  };
369
  $.fn.locationpicker.defaults = {
370
+ location: {
371
+ latitude: 40.7324319,
372
+ longitude: -73.82480777777776
373
+ },
374
  locationName: "",
375
  radius: 500,
376
  zoom: 15,
377
+ mapTypeId: google.maps.MapTypeId.ROADMAP,
378
+ styles: [],
379
+ mapOptions: {},
380
  scrollwheel: true,
381
  inputBinding: {
382
  latitudeInput: null,
385
  locationNameInput: null
386
  },
387
  enableAutocomplete: false,
388
+ enableAutocompleteBlur: false,
389
+ autocompleteOptions: null,
390
+ addressFormat: "postal_code",
391
  enableReverseGeocode: true,
392
+ draggable: true,
393
  onchanged: function(currentLocation, radius, isMarkerDropped) {},
394
  onlocationnotfound: function(locationName) {},
395
+ oninitialized: function(component) {},
396
+ markerIcon: undefined,
397
+ markerDraggable: true,
398
+ markerVisible: true
399
+ };
400
+ })(jQuery);
assets/js/sportspress.js CHANGED
@@ -42,7 +42,7 @@ function sp_viewport() {
42
  var seconds = Math.floor((distance % (1000 * 60)) / 1000);
43
 
44
  // Output the result
45
- $this.html("<span>"+('0' + days).slice(-2)+" <small>" + localized_strings.days + "</small></span> "
46
  + "<span>"+('0' + hours).slice(-2)+" <small>" + localized_strings.hrs + "</small></span> "
47
  + "<span>"+('0' + minutes).slice(-2)+" <small>" + localized_strings.mins + "</small></span> "
48
  + "<span>"+('0' + seconds).slice(-2)+" <small>" + localized_strings.secs + "</small></span>" );
42
  var seconds = Math.floor((distance % (1000 * 60)) / 1000);
43
 
44
  // Output the result
45
+ $this.html("<span>"+('0' + days).slice(-3)+" <small>" + localized_strings.days + "</small></span> "
46
  + "<span>"+('0' + hours).slice(-2)+" <small>" + localized_strings.hrs + "</small></span> "
47
  + "<span>"+('0' + minutes).slice(-2)+" <small>" + localized_strings.mins + "</small></span> "
48
  + "<span>"+('0' + seconds).slice(-2)+" <small>" + localized_strings.secs + "</small></span>" );
changelog.txt CHANGED
@@ -1,5 +1,21 @@
1
  == SportsPress Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 2.6.8 =
4
  * Feature - Ability to add icons to player statistics.
5
  * Feature - Ability to display matchday in event blocks.
1
  == SportsPress Changelog ==
2
 
3
+ = 2.6.9 =
4
+ * Feature - New event shortcodes: venue, officials, teams, and full event info.
5
+ * Feature - Option to choose default nationality for faster data entry.
6
+ * Feature - Date and time display options in countdown widgets.
7
+ * Feature - Ability to filter player list shortcodes by league, season, and team.
8
+ * Tweak - Improve page load for new player lists.
9
+ * Tweak - Improve iCal feed by fixing wrapping issues.
10
+ * Tweak - Use lighter placeholder color to differentiate from entered values.
11
+ * Tweak - Preserve league, season, and position assignments when importing players.
12
+ * Fix - PHP warnings when using version 7.2 or later.
13
+ * Fix - Countdown timer format when event is 100 or more days away.
14
+ * Fix - Player list displaying zero values when formatted using decimal places.
15
+ * Fix - Start of the week filters for week-based calendars.
16
+ * Fix - Location picker freezing issue.
17
+ * Fix - Custom post types pages displaying blank page when Gutenberg is installed.
18
+
19
  = 2.6.8 =
20
  * Feature - Ability to add icons to player statistics.
21
  * Feature - Ability to display matchday in event blocks.
feeds/ical.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Feeds
7
  * @package SportsPress/Feeds
8
- * @version 1.8.3
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -27,15 +27,18 @@ $main_result = get_option( 'sportspress_primary_result', null );
27
  // Get the timezone setting
28
  $timezone = sanitize_option( 'timezone_string', get_option( 'timezone_string' ) );
29
 
30
- // Initialize output. Max line length is 75 chars.
 
 
 
31
  $output =
32
  "BEGIN:VCALENDAR\n" .
33
  "VERSION:2.0\n" .
34
  "PRODID:-//ThemeBoy//SportsPress//" . strtoupper( $locale ) . "\n" .
35
  "CALSCALE:GREGORIAN\n" .
36
  "METHOD:PUBLISH\n" .
37
- "URL:" . add_query_arg( 'feed', 'sp-calendar-ical', get_post_permalink( $post ) ) . "\n" .
38
- "X-FROM-URL:" . add_query_arg( 'feed', 'sp-calendar-ical', get_post_permalink( $post ) ) . "\n" .
39
  "NAME:" . $post->post_title . "\n" .
40
  "X-WR-CALNAME:" . $post->post_title . "\n" .
41
  "DESCRIPTION:" . $post->post_title . "\n" .
@@ -51,6 +54,10 @@ foreach ( $events as $event):
51
  // Define date format
52
  $date_format = 'Ymd\THis';
53
 
 
 
 
 
54
  // Initialize end time
55
  $end = new DateTime( $event->post_date );
56
 
@@ -89,6 +96,7 @@ foreach ( $events as $event):
89
  $geo = false;
90
  }
91
  }
 
92
 
93
  // Get title or write summary based on scores
94
  $results = array();
@@ -131,13 +139,17 @@ foreach ( $events as $event):
131
  $output .=
132
  "BEGIN:VEVENT\n" .
133
  "SUMMARY:" . preg_replace('/([\,;])/','\\\$1', $summary) . "\n" .
134
- "DESCRIPTION:" . preg_replace('/([\,;])/','\\\$1', $event->post_content) . "\n" .
135
  "UID:$event->ID\n" .
136
  "STATUS:CONFIRMED\n" .
 
137
  "DTSTART:" . mysql2date( $date_format, $event->post_date ) . "\n" .
138
  "DTEND:" . $end->format( $date_format ) . "\n" .
139
  "LAST-MODIFIED:" . mysql2date( $date_format, $event->post_modified_gmt ) . "\n";
140
 
 
 
 
 
141
  if ( $location ) {
142
  $output .= "LOCATION:" . $location . "\n";
143
  }
5
  * @author ThemeBoy
6
  * @category Feeds
7
  * @package SportsPress/Feeds
8
+ * @version 2.6.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
27
  // Get the timezone setting
28
  $timezone = sanitize_option( 'timezone_string', get_option( 'timezone_string' ) );
29
 
30
+ // Get the URL
31
+ $url = add_query_arg( 'feed', 'sp-ical', get_post_permalink( $post ) );
32
+ $url = wordwrap( $url , 60, "\n\t", true );
33
+
34
  $output =
35
  "BEGIN:VCALENDAR\n" .
36
  "VERSION:2.0\n" .
37
  "PRODID:-//ThemeBoy//SportsPress//" . strtoupper( $locale ) . "\n" .
38
  "CALSCALE:GREGORIAN\n" .
39
  "METHOD:PUBLISH\n" .
40
+ "URL:" . $url . "\n" .
41
+ "X-FROM-URL:" . $url . "\n" .
42
  "NAME:" . $post->post_title . "\n" .
43
  "X-WR-CALNAME:" . $post->post_title . "\n" .
44
  "DESCRIPTION:" . $post->post_title . "\n" .
54
  // Define date format
55
  $date_format = 'Ymd\THis';
56
 
57
+ // Get description
58
+ $description = preg_replace( '/([\,;])/','\\\$1', $event->post_content );
59
+ $description = wordwrap( $description , 60, "\n\t" );
60
+
61
  // Initialize end time
62
  $end = new DateTime( $event->post_date );
63
 
96
  $geo = false;
97
  }
98
  }
99
+ $location = wordwrap( $location , 60, "\n\t" );
100
 
101
  // Get title or write summary based on scores
102
  $results = array();
139
  $output .=
140
  "BEGIN:VEVENT\n" .
141
  "SUMMARY:" . preg_replace('/([\,;])/','\\\$1', $summary) . "\n" .
 
142
  "UID:$event->ID\n" .
143
  "STATUS:CONFIRMED\n" .
144
+ "DTSTAMP:19700101T000000\n".
145
  "DTSTART:" . mysql2date( $date_format, $event->post_date ) . "\n" .
146
  "DTEND:" . $end->format( $date_format ) . "\n" .
147
  "LAST-MODIFIED:" . mysql2date( $date_format, $event->post_modified_gmt ) . "\n";
148
 
149
+ if ( $description ) {
150
+ $output .= "DESCRIPTION:" . $description . "\n";
151
+ }
152
+
153
  if ( $location ) {
154
  $output .= "LOCATION:" . $location . "\n";
155
  }
includes/admin/class-sp-admin-taxonomies.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
  * Handles taxonomies in admin
8
  *
9
  * @class SP_Admin_Taxonomies
10
- * @version 2.6
11
  * @package SportsPress/Admin
12
  * @category Class
13
  * @author ThemeBoy
@@ -105,7 +105,9 @@ class SP_Admin_Taxonomies {
105
  $term_meta = get_option( "taxonomy_$t_id" );
106
  $latitude = sp_array_value( $term_meta, 'sp_latitude', '40.7324319' );
107
  $longitude = sp_array_value( $term_meta, 'sp_longitude', '-73.82480799999996' );
108
- else:
 
 
109
  $latitude = '40.7324319';
110
  $longitude = '-73.82480799999996';
111
  endif;
@@ -147,13 +149,13 @@ class SP_Admin_Taxonomies {
147
  <tr class="form-field">
148
  <th scope="row" valign="top"><label for="term_meta[sp_latitude]"><?php _e( 'Latitude', 'sportspress' ); ?></label></th>
149
  <td>
150
- <input type="text" class="sp-latitude" name="term_meta[sp_latitude]" id="term_meta[sp_latitude]" value="<?php echo esc_attr( $term_meta['sp_latitude'] ) ? esc_attr( $term_meta['sp_latitude'] ) : ''; ?>">
151
  </td>
152
  </tr>
153
  <tr class="form-field">
154
  <th scope="row" valign="top"><label for="term_meta[sp_longitude]"><?php _e( 'Longitude', 'sportspress' ); ?></label></th>
155
  <td>
156
- <input type="text" class="sp-longitude" name="term_meta[sp_longitude]" id="term_meta[sp_longitude]" value="<?php echo esc_attr( $term_meta['sp_longitude'] ) ? esc_attr( $term_meta['sp_longitude'] ) : ''; ?>">
157
  </td>
158
  </tr>
159
  <?php
7
  * Handles taxonomies in admin
8
  *
9
  * @class SP_Admin_Taxonomies
10
+ * @version 2.6.9
11
  * @package SportsPress/Admin
12
  * @category Class
13
  * @author ThemeBoy
105
  $term_meta = get_option( "taxonomy_$t_id" );
106
  $latitude = sp_array_value( $term_meta, 'sp_latitude', '40.7324319' );
107
  $longitude = sp_array_value( $term_meta, 'sp_longitude', '-73.82480799999996' );
108
+ endif;
109
+ // Sanitize latitude and longitude, fallback to default.
110
+ if( ! is_numeric( $latitude) || ! is_numeric( $longitude) ):
111
  $latitude = '40.7324319';
112
  $longitude = '-73.82480799999996';
113
  endif;
149
  <tr class="form-field">
150
  <th scope="row" valign="top"><label for="term_meta[sp_latitude]"><?php _e( 'Latitude', 'sportspress' ); ?></label></th>
151
  <td>
152
+ <input type="text" class="sp-latitude" name="term_meta[sp_latitude]" id="term_meta[sp_latitude]" value="<?php echo is_numeric( esc_attr( $term_meta['sp_latitude'] ) ) ? esc_attr( $term_meta['sp_latitude'] ) : ''; ?>">
153
  </td>
154
  </tr>
155
  <tr class="form-field">
156
  <th scope="row" valign="top"><label for="term_meta[sp_longitude]"><?php _e( 'Longitude', 'sportspress' ); ?></label></th>
157
  <td>
158
+ <input type="text" class="sp-longitude" name="term_meta[sp_longitude]" id="term_meta[sp_longitude]" value="<?php echo is_numeric( esc_attr( $term_meta['sp_longitude'] ) ) ? esc_attr( $term_meta['sp_longitude'] ) : ''; ?>">
159
  </td>
160
  </tr>
161
  <?php
includes/admin/importers/class-sp-player-importer.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
- * @version 2.6.3
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -60,6 +60,18 @@ if ( class_exists( 'WP_Importer' ) ) {
60
 
61
  $meta = array();
62
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  foreach ( $columns as $index => $key ):
64
  $meta[ $key ] = sp_array_value( $row, $index );
65
  endforeach;
@@ -78,6 +90,11 @@ if ( class_exists( 'WP_Importer' ) ) {
78
  wp_update_post( array( 'ID' => $player_object->ID, 'post_status' => 'publish' ) );
79
  endif;
80
  $id = $player_object->ID;
 
 
 
 
 
81
  else:
82
  $args = array( 'post_type' => 'sp_player', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $name ) );
83
  $id = wp_insert_post( $args );
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
+ * @version 2.6.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
60
 
61
  $meta = array();
62
 
63
+ /**
64
+ * Prepare preservable metas keys.
65
+ */
66
+ $preservable_metas_keys = array(
67
+ 'sp_league',
68
+ 'sp_position',
69
+ 'sp_season',
70
+ );
71
+ foreach ( $preservable_metas_keys as $p ) {
72
+ $meta[ $key ] = '';
73
+ }
74
+
75
  foreach ( $columns as $index => $key ):
76
  $meta[ $key ] = sp_array_value( $row, $index );
77
  endforeach;
90
  wp_update_post( array( 'ID' => $player_object->ID, 'post_status' => 'publish' ) );
91
  endif;
92
  $id = $player_object->ID;
93
+ // Handle preservable data.
94
+ foreach ( $preservable_metas_keys as $p ) {
95
+ $terms = wp_get_object_terms( $id, $p, array( 'fields' => 'names' ) );
96
+ $meta[ $p ] .= '|' . implode( '|', $terms );
97
+ }
98
  else:
99
  $args = array( 'post_type' => 'sp_player', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $name ) );
100
  $id = wp_insert_post( $args );
includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -39,8 +39,11 @@ class SP_Meta_Box_Calendar_Data {
39
  $title_format = get_option( 'sportspress_event_list_title_format', 'title' );
40
  $time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
41
 
42
- if ( is_array( $usecolumns ) )
43
  $usecolumns = array_filter( $usecolumns );
 
 
 
44
  ?>
45
  <div class="sp-data-table-container">
46
  <table class="widefat sp-data-table sp-calendar-table">
@@ -272,4 +275,4 @@ class SP_Meta_Box_Calendar_Data {
272
  </div>
273
  <?php
274
  }
275
- }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.6.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
39
  $title_format = get_option( 'sportspress_event_list_title_format', 'title' );
40
  $time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
41
 
42
+ if ( is_array( $usecolumns ) ) {
43
  $usecolumns = array_filter( $usecolumns );
44
+ }else{
45
+ $usecolumns = array();
46
+ }
47
  ?>
48
  <div class="sp-data-table-container">
49
  <table class="widefat sp-data-table sp-calendar-table">
275
  </div>
276
  <?php
277
  }
278
+ }
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.0
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -23,6 +23,10 @@ class SP_Meta_Box_Event_Shortcode {
23
  'event_results' => __( 'Results', 'sportspress' ),
24
  'event_details' => __( 'Details', 'sportspress' ),
25
  'event_performance' => __( 'Box Score', 'sportspress' ),
 
 
 
 
26
  ) );
27
  if ( $shortcodes ) {
28
  ?>
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.6.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
23
  'event_results' => __( 'Results', 'sportspress' ),
24
  'event_details' => __( 'Details', 'sportspress' ),
25
  'event_performance' => __( 'Box Score', 'sportspress' ),
26
+ 'event_venue' => __( 'Venue', 'sportspress' ),
27
+ 'event_officials' => __( 'Officials', 'sportspress' ),
28
+ 'event_teams' => __( 'Teams', 'sportspress' ),
29
+ 'event_full' => __( 'Full Info', 'sportspress' ),
30
  ) );
31
  if ( $shortcodes ) {
32
  ?>
includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -19,10 +19,15 @@ class SP_Meta_Box_List_Data {
19
  * Output the metabox
20
  */
21
  public static function output( $post ) {
22
- $list = new SP_Player_List( $post );
23
- list( $columns, $data, $placeholders, $merged, $orderby ) = $list->data( true );
24
- $adjustments = $list->adjustments;
25
- self::table( $columns, $data, $placeholders, $adjustments, $orderby );
 
 
 
 
 
26
  }
27
 
28
  /**
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.6.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
19
  * Output the metabox
20
  */
21
  public static function output( $post ) {
22
+ global $pagenow;
23
+ if ( is_admin() && in_array( $pagenow, array( 'post-new.php' ) ) && 'sp_list' == get_post_type() ) {
24
+ self::table( );
25
+ }else{
26
+ $list = new SP_Player_List( $post );
27
+ list( $columns, $data, $placeholders, $merged, $orderby ) = $list->data( true );
28
+ $adjustments = $list->adjustments;
29
+ self::table( $columns, $data, $placeholders, $adjustments, $orderby );
30
+ }
31
  }
32
 
33
  /**
includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -24,6 +24,14 @@ class SP_Meta_Box_Player_Details {
24
 
25
  $number = get_post_meta( $post->ID, 'sp_number', true );
26
  $nationalities = get_post_meta( $post->ID, 'sp_nationality', false );
 
 
 
 
 
 
 
 
27
  foreach ( $nationalities as $index => $nationality ):
28
  if ( 2 == strlen( $nationality ) ):
29
  $legacy = SP()->countries->legacy;
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.6.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
24
 
25
  $number = get_post_meta( $post->ID, 'sp_number', true );
26
  $nationalities = get_post_meta( $post->ID, 'sp_nationality', false );
27
+ $default_nationality = get_option( 'sportspress_default_nationality' , false );
28
+
29
+ if ( empty( $nationalities ) && $default_nationality ) {
30
+ if ( $default_nationality != '' ) {
31
+ $nationalities[] = $default_nationality;
32
+ }
33
+ }
34
+
35
  foreach ( $nationalities as $index => $nationality ):
36
  if ( 2 == strlen( $nationality ) ):
37
  $legacy = SP()->countries->legacy;
includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.6.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -21,7 +21,11 @@ class SP_Meta_Box_Player_Statistics {
21
  public static function output( $post ) {
22
  $player = new SP_Player( $post );
23
  $leagues = $player->get_terms_sorted_by_sp_order( 'sp_league' );
24
- $league_num = sizeof( $leagues );
 
 
 
 
25
  $sections = get_option( 'sportspress_player_performance_sections', -1 );
26
  $show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;
27
 
@@ -245,4 +249,4 @@ class SP_Meta_Box_Player_Statistics {
245
  </div>
246
  <?php
247
  }
248
- }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.6.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
21
  public static function output( $post ) {
22
  $player = new SP_Player( $post );
23
  $leagues = $player->get_terms_sorted_by_sp_order( 'sp_league' );
24
+ if ( is_array ( $leagues ) ) {
25
+ $league_num = sizeof( $leagues );
26
+ }else{
27
+ $league_num =0;
28
+ }
29
  $sections = get_option( 'sportspress_player_performance_sections', -1 );
30
  $show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;
31
 
249
  </div>
250
  <?php
251
  }
252
+ }
includes/class-sp-ajax.php CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
  * AJAX Event Handler
9
  *
10
  * @class SP_AJAX
11
- * @version 2.6.8
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
@@ -27,6 +27,10 @@ class SP_AJAX {
27
  'event_details_shortcode' => false,
28
  'event_results_shortcode' => false,
29
  'event_performance_shortcode' => false,
 
 
 
 
30
  'event_calendar_shortcode' => false,
31
  'event_list_shortcode' => false,
32
  'event_blocks_shortcode' => false,
@@ -181,6 +185,126 @@ class SP_AJAX {
181
  self::scripts();
182
  die();
183
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
185
  /**
186
  * AJAX event_calendar shortcode
@@ -647,7 +771,7 @@ class SP_AJAX {
647
  $args = array(
648
  'name' => 'date',
649
  'id' => 'date',
650
- 'selected' => $date,
651
  );
652
  sp_dropdown_dates( $args );
653
  ?>
@@ -948,6 +1072,48 @@ class SP_AJAX {
948
  ?>
949
  </label>
950
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
951
  <p>
952
  <label>
953
  <?php _e( 'Number of players to show:', 'sportspress' ); ?>
@@ -1192,6 +1358,9 @@ class SP_AJAX {
1192
  } else if ( 'player_list' == type ) {
1193
  args.title = $div.find('[name=title]').val();
1194
  args.number = $div.find('[name=number]').val();
 
 
 
1195
  args.columns = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(',');
1196
  args.orderby = $div.find('[name=orderby]').val();
1197
  args.order = $div.find('[name=order]').val();
8
  * AJAX Event Handler
9
  *
10
  * @class SP_AJAX
11
+ * @version 2.6.9
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
27
  'event_details_shortcode' => false,
28
  'event_results_shortcode' => false,
29
  'event_performance_shortcode' => false,
30
+ 'event_venue_shortcode' => false,
31
+ 'event_officials_shortcode' => false,
32
+ 'event_teams_shortcode' => false,
33
+ 'event_full_shortcode' => false,
34
  'event_calendar_shortcode' => false,
35
  'event_list_shortcode' => false,
36
  'event_blocks_shortcode' => false,
185
  self::scripts();
186
  die();
187
  }
188
+
189
+ /**
190
+ * AJAX event_venue shortcode
191
+ */
192
+ public function event_venue_shortcode() {
193
+ ?>
194
+ <div class="wrap sp-thickbox-content" id="sp-thickbox-event_venue">
195
+ <p>
196
+ <label>
197
+ <?php printf( __( 'Select %s:', 'sportspress' ), __( 'Event', 'sportspress' ) ); ?>
198
+ <?php
199
+ $args = array(
200
+ 'post_type' => 'sp_event',
201
+ 'name' => 'id',
202
+ 'values' => 'ID',
203
+ );
204
+ sp_dropdown_pages( $args );
205
+ ?>
206
+ </label>
207
+ </p>
208
+ <?php do_action( 'sportspress_ajax_shortcode_form', 'event-venue' ); ?>
209
+ <p class="submit">
210
+ <input type="button" class="button-primary" value="<?php _e( 'Insert Shortcode', 'sportspress' ); ?>" onclick="insertSportsPress('event_venue');" />
211
+ <a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
212
+ </p>
213
+ </div>
214
+ <?php
215
+ self::scripts();
216
+ die();
217
+ }
218
+
219
+ /**
220
+ * AJAX event_officials shortcode
221
+ */
222
+ public function event_officials_shortcode() {
223
+ ?>
224
+ <div class="wrap sp-thickbox-content" id="sp-thickbox-event_officials">
225
+ <p>
226
+ <label>
227
+ <?php printf( __( 'Select %s:', 'sportspress' ), __( 'Event', 'sportspress' ) ); ?>
228
+ <?php
229
+ $args = array(
230
+ 'post_type' => 'sp_event',
231
+ 'name' => 'id',
232
+ 'values' => 'ID',
233
+ );
234
+ sp_dropdown_pages( $args );
235
+ ?>
236
+ </label>
237
+ </p>
238
+ <?php do_action( 'sportspress_ajax_shortcode_form', 'event-officials' ); ?>
239
+ <p class="submit">
240
+ <input type="button" class="button-primary" value="<?php _e( 'Insert Shortcode', 'sportspress' ); ?>" onclick="insertSportsPress('event_officials');" />
241
+ <a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
242
+ </p>
243
+ </div>
244
+ <?php
245
+ self::scripts();
246
+ die();
247
+ }
248
+
249
+ /**
250
+ * AJAX event_teams shortcode
251
+ */
252
+ public function event_teams_shortcode() {
253
+ ?>
254
+ <div class="wrap sp-thickbox-content" id="sp-thickbox-event_teams">
255
+ <p>
256
+ <label>
257
+ <?php printf( __( 'Select %s:', 'sportspress' ), __( 'Event', 'sportspress' ) ); ?>
258
+ <?php
259
+ $args = array(
260
+ 'post_type' => 'sp_event',
261
+ 'name' => 'id',
262
+ 'values' => 'ID',
263
+ );
264
+ sp_dropdown_pages( $args );
265
+ ?>
266
+ </label>
267
+ </p>
268
+ <?php do_action( 'sportspress_ajax_shortcode_form', 'event-teams' ); ?>
269
+ <p class="submit">
270
+ <input type="button" class="button-primary" value="<?php _e( 'Insert Shortcode', 'sportspress' ); ?>" onclick="insertSportsPress('event_teams');" />
271
+ <a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
272
+ </p>
273
+ </div>
274
+ <?php
275
+ self::scripts();
276
+ die();
277
+ }
278
+
279
+ /**
280
+ * AJAX event_full shortcode
281
+ */
282
+ public function event_full_shortcode() {
283
+ ?>
284
+ <div class="wrap sp-thickbox-content" id="sp-thickbox-event_full">
285
+ <p>
286
+ <label>
287
+ <?php printf( __( 'Select %s:', 'sportspress' ), __( 'Event', 'sportspress' ) ); ?>
288
+ <?php
289
+ $args = array(
290
+ 'post_type' => 'sp_event',
291
+ 'name' => 'id',
292
+ 'values' => 'ID',
293
+ );
294
+ sp_dropdown_pages( $args );
295
+ ?>
296
+ </label>
297
+ </p>
298
+ <?php do_action( 'sportspress_ajax_shortcode_form', 'event-full' ); ?>
299
+ <p class="submit">
300
+ <input type="button" class="button-primary" value="<?php _e( 'Insert Shortcode', 'sportspress' ); ?>" onclick="insertSportsPress('event_full');" />
301
+ <a class="button-secondary" onclick="tb_remove();" title="<?php _e( 'Cancel', 'sportspress' ); ?>"><?php _e( 'Cancel', 'sportspress' ); ?></a>
302
+ </p>
303
+ </div>
304
+ <?php
305
+ self::scripts();
306
+ die();
307
+ }
308
 
309
  /**
310
  * AJAX event_calendar shortcode
771
  $args = array(
772
  'name' => 'date',
773
  'id' => 'date',
774
+ //'selected' => $date,
775
  );
776
  sp_dropdown_dates( $args );
777
  ?>
1072
  ?>
1073
  </label>
1074
  </p>
1075
+ <p>
1076
+ <label>
1077
+ <?php _e( 'Team:', 'sportspress' ); ?>
1078
+ <?php
1079
+ $args = array(
1080
+ 'post_type' => 'sp_team',
1081
+ 'show_option_all' => __( 'Default', 'sportspress' ),
1082
+ 'name' => 'team',
1083
+ 'values' => 'ID',
1084
+ );
1085
+ sp_dropdown_pages( $args );
1086
+ ?>
1087
+ </label>
1088
+ </p>
1089
+ <p>
1090
+ <label>
1091
+ <?php _e( 'League:', 'sportspress' ); ?>
1092
+ <?php
1093
+ $args = array(
1094
+ 'taxonomy' => 'sp_league',
1095
+ 'show_option_all' => __( 'Default', 'sportspress' ),
1096
+ 'name' => 'league',
1097
+ 'values' => 'term_id',
1098
+ );
1099
+ sp_dropdown_taxonomies( $args );
1100
+ ?>
1101
+ </label>
1102
+ </p>
1103
+ <p>
1104
+ <label>
1105
+ <?php _e( 'Season:', 'sportspress' ); ?>
1106
+ <?php
1107
+ $args = array(
1108
+ 'taxonomy' => 'sp_season',
1109
+ 'show_option_all' => __( 'Default', 'sportspress' ),
1110
+ 'name' => 'season',
1111
+ 'values' => 'term_id',
1112
+ );
1113
+ sp_dropdown_taxonomies( $args );
1114
+ ?>
1115
+ </label>
1116
+ </p>
1117
  <p>
1118
  <label>
1119
  <?php _e( 'Number of players to show:', 'sportspress' ); ?>
1358
  } else if ( 'player_list' == type ) {
1359
  args.title = $div.find('[name=title]').val();
1360
  args.number = $div.find('[name=number]').val();
1361
+ args.team = $div.find('[name=team]').val();
1362
+ args.seasons = $div.find('[name=season]').val();
1363
+ args.leagues = $div.find('[name=league]').val();
1364
  args.columns = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(',');
1365
  args.orderby = $div.find('[name=orderby]').val();
1366
  args.order = $div.find('[name=order]').val();
includes/class-sp-calendar.php CHANGED
@@ -8,7 +8,7 @@
8
  * https://wordpress.org/support/topic/timezone-issues-with-schedule-calendar-list/
9
  *
10
  * @class SP_Calendar
11
- * @version 2.6.8
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
@@ -39,6 +39,12 @@ class SP_Calendar extends SP_Secondary_Post {
39
 
40
  /** @var int The team ID. */
41
  public $team;
 
 
 
 
 
 
42
 
43
  /** @var int The player ID. */
44
  public $player;
@@ -122,6 +128,25 @@ class SP_Calendar extends SP_Secondary_Post {
122
  public function data() {
123
  global $pagenow;
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  $args = array(
126
  'post_type' => 'sp_event',
127
  'posts_per_page' => $this->number,
@@ -152,26 +177,86 @@ class SP_Calendar extends SP_Secondary_Post {
152
  break;
153
  case '+day':
154
  $date = new DateTime( date_i18n('Y-m-d') );
155
- $date->modify( '+1 day' );
156
  $args['year'] = $date->format('Y');
157
  $args['day'] = $date->format('j');
158
  $args['monthnum'] = $date->format('n');
159
  break;
160
  case '-w':
161
- $date = new DateTime( date_i18n('Y-m-d') );
162
- $date->modify( '-1 week' );
163
- $args['year'] = $date->format('Y');
164
- $args['w'] = $date->format('W');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  break;
166
  case 'w':
167
- $args['year'] = date_i18n('Y');
168
- $args['w'] = date_i18n('W');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  break;
170
  case '+w':
171
- $date = new DateTime( date_i18n('Y-m-d') );
172
- $date->modify( '+1 week' );
173
- $args['year'] = $date->format('Y');
174
- $args['w'] = $date->format('W');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  break;
176
  case 'range':
177
  if ( $this->relative ):
@@ -203,6 +288,24 @@ class SP_Calendar extends SP_Secondary_Post {
203
  );
204
  endif;
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  if ( $this->player ):
207
  $args['meta_query'][] = array(
208
  'key' => 'sp_player',
@@ -322,6 +425,17 @@ class SP_Calendar extends SP_Secondary_Post {
322
  else:
323
  $events = null;
324
  endif;
 
 
 
 
 
 
 
 
 
 
 
325
 
326
  // Remove any calendar selection filters
327
  remove_filter( 'posts_where', array( $this, 'range' ) );
8
  * https://wordpress.org/support/topic/timezone-issues-with-schedule-calendar-list/
9
  *
10
  * @class SP_Calendar
11
+ * @version 2.6.9
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
39
 
40
  /** @var int The team ID. */
41
  public $team;
42
+
43
+ /** @var array The teams IDs. */
44
+ public $teams_past;
45
+
46
+ /** @var string The event date. */
47
+ public $date_before;
48
 
49
  /** @var int The player ID. */
50
  public $player;
128
  public function data() {
129
  global $pagenow;
130
 
131
+ $weekday = array (
132
+ 0 => 'Sunday',
133
+ 1 => 'Monday',
134
+ 2 => 'Tuesday',
135
+ 3 => 'Wednesday',
136
+ 4 => 'Thursday',
137
+ 5 => 'Friday',
138
+ 6 => 'Saturday',
139
+ );
140
+
141
+ $start_of_week = get_option('start_of_week');
142
+
143
+ $firstday = $weekday[ $start_of_week ];
144
+ if ( $start_of_week != 0 ) {
145
+ $lastday = $weekday[ ( $start_of_week - 1 ) ];
146
+ }else{
147
+ $lastday = $weekday[6];
148
+ }
149
+
150
  $args = array(
151
  'post_type' => 'sp_event',
152
  'posts_per_page' => $this->number,
177
  break;
178
  case '+day':
179
  $date = new DateTime( date_i18n('Y-m-d') );
180
+ $date->modify( '+1 day' );
181
  $args['year'] = $date->format('Y');
182
  $args['day'] = $date->format('j');
183
  $args['monthnum'] = $date->format('n');
184
  break;
185
  case '-w':
186
+ if ( $start_of_week != '1' ) { //If start of week is not Monday
187
+ if ( date('w') == $start_of_week ) { //If today is start of Week
188
+ $after = date_i18n('Y-m-d', strtotime("$firstday last week"));
189
+ $before = date_i18n('Y-m-d', strtotime("$lastday this week")).' 23:59:59';
190
+ }elseif ( date('w') < $start_of_week ){
191
+ $after = date_i18n('Y-m-d', strtotime("$firstday -2 week"));
192
+ $before = date_i18n('Y-m-d', strtotime("$lastday last week")).' 23:59:59';
193
+ }else{
194
+ $after = date_i18n('Y-m-d', strtotime("$firstday last week"));
195
+ $before = date_i18n('Y-m-d', strtotime("$lastday this week")).' 23:59:59';
196
+ }
197
+ $args['date_query'] = array(
198
+ array(
199
+ 'after' => $after,
200
+ 'before' => $before,
201
+ 'inclusive' => true,
202
+ ),
203
+ );
204
+ }else{
205
+ $date = new DateTime( date_i18n('Y-m-d') );
206
+ $date->modify( '-1 week' );
207
+ $args['year'] = $date->format('Y');
208
+ $args['w'] = $date->format('W');
209
+ }
210
  break;
211
  case 'w':
212
+ if ( $start_of_week != '1' ) { //If start of week is not Monday
213
+ if ( date('w') == $start_of_week ) { //If today is start of Week
214
+ $after = date_i18n('Y-m-d');
215
+ $before = date_i18n('Y-m-d', strtotime("$lastday next week")).' 23:59:59';
216
+ }elseif ( date('w') < $start_of_week ){
217
+ $after = date_i18n('Y-m-d', strtotime("$firstday last week"));
218
+ $before = date_i18n('Y-m-d', strtotime("$lastday this week")).' 23:59:59';
219
+ }else{
220
+ $after = date_i18n('Y-m-d', strtotime("$firstday this week"));
221
+ $before = date_i18n('Y-m-d', strtotime("$lastday next week")).' 23:59:59';
222
+ }
223
+ $args['date_query'] = array(
224
+ array(
225
+ 'after' => $after,
226
+ 'before' => $before,
227
+ 'inclusive' => true,
228
+ ),
229
+ );
230
+ }else{
231
+ $args['year'] = date_i18n('Y');
232
+ $args['w'] = date_i18n('W');
233
+ }
234
  break;
235
  case '+w':
236
+ if ( $start_of_week != '1' ) { //If start of week is not Monday
237
+ if ( date('w') == $start_of_week ) { //If today is start of Week
238
+ $after = date_i18n('Y-m-d', strtotime("$firstday next week"));
239
+ $before = date_i18n('Y-m-d', strtotime("$lastday +1 week")).' 23:59:59';
240
+ }elseif ( date('w') < $start_of_week ){
241
+ $after = date_i18n('Y-m-d', strtotime("$firstday this week"));
242
+ $before = date_i18n('Y-m-d', strtotime("$lastday next week")).' 23:59:59';
243
+ }else{
244
+ $after = date_i18n('Y-m-d', strtotime("$firstday next week"));
245
+ $before = date_i18n('Y-m-d', strtotime("$lastday +1 week")).' 23:59:59';
246
+ }
247
+ $args['date_query'] = array(
248
+ array(
249
+ 'after' => $after,
250
+ 'before' => $before,
251
+ 'inclusive' => true,
252
+ ),
253
+ );
254
+ }else{
255
+ $date = new DateTime( date_i18n('Y-m-d') );
256
+ $date->modify( '+1 week' );
257
+ $args['year'] = $date->format('Y');
258
+ $args['w'] = $date->format('W');
259
+ }
260
  break;
261
  case 'range':
262
  if ( $this->relative ):
288
  );
289
  endif;
290
 
291
+ // If we are showing past meetings filter by team's id and current event date
292
+ if ( $this->teams_past ):
293
+ foreach ( $this->teams_past as $team_past ):
294
+ $args['meta_query'][] = array(
295
+ 'key' => 'sp_team',
296
+ 'value' => $team_past,
297
+ 'compare' => '=',
298
+ );
299
+ endforeach;
300
+ $args['date_query'] = array(
301
+ array(
302
+ 'before' => $this->date_before,
303
+ 'inclusive' => false,
304
+ )
305
+
306
+ );
307
+ endif;
308
+
309
  if ( $this->player ):
310
  $args['meta_query'][] = array(
311
  'key' => 'sp_player',
425
  else:
426
  $events = null;
427
  endif;
428
+
429
+ // Filter out unessecary events if we are showing past meetings
430
+ if ( $this->teams_past ){
431
+ $events_past = array();
432
+ foreach ( $events as $single_event ) {
433
+ if ( get_post_meta( $single_event->ID,'sp_team' ) === $this->teams_past ){
434
+ $events_past[] = $single_event;
435
+ }
436
+ }
437
+ $events = $events_past;
438
+ }
439
 
440
  // Remove any calendar selection filters
441
  remove_filter( 'posts_where', array( $this, 'range' ) );
includes/class-sp-event.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress event class handles individual event data.
6
  *
7
  * @class SP_Event
8
- * @version 2.6.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -579,11 +579,12 @@ class SP_Event extends SP_Custom_Post{
579
  $appointments = array();
580
 
581
  foreach ( $duties as $duty ) {
582
- $duty_appointments = sp_array_value( $officials, $duty->term_id, null );
583
 
584
  if ( ! $include_empty && empty( $duty_appointments ) ) continue;
585
 
586
  $appointed_officials = array();
 
587
  foreach ( $duty_appointments as $duty_appointment ) {
588
  $appointed_officials[ $duty_appointment ] = get_the_title( $duty_appointment );
589
  }
5
  * The SportsPress event class handles individual event data.
6
  *
7
  * @class SP_Event
8
+ * @version 2.6.9
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
579
  $appointments = array();
580
 
581
  foreach ( $duties as $duty ) {
582
+ $duty_appointments = sp_array_value( $officials, $duty->term_id, array() );
583
 
584
  if ( ! $include_empty && empty( $duty_appointments ) ) continue;
585
 
586
  $appointed_officials = array();
587
+
588
  foreach ( $duty_appointments as $duty_appointment ) {
589
  $appointed_officials[ $duty_appointment ] = get_the_title( $duty_appointment );
590
  }
includes/class-sp-modules.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress modules class stores available modules.
6
  *
7
  * @class SP_Modules
8
- * @version 2.6
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -57,6 +57,13 @@ class SP_Modules {
57
  'link' => 'https://www.themeboy.com/sportspress-extensions/match-stats/',
58
  'desc' => __( 'Display head-to-head team comparison charts in events.', 'sportspress' ),
59
  ),
 
 
 
 
 
 
 
60
  'timelines' => array(
61
  'label' => __( 'Timelines', 'sportspress' ),
62
  'class' => 'SportsPress_Timelines',
5
  * The SportsPress modules class stores available modules.
6
  *
7
  * @class SP_Modules
8
+ * @version 2.6.9
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
57
  'link' => 'https://www.themeboy.com/sportspress-extensions/match-stats/',
58
  'desc' => __( 'Display head-to-head team comparison charts in events.', 'sportspress' ),
59
  ),
60
+ 'past_meetings' => array(
61
+ 'label' => __( 'Past Meetings', 'sportspress' ),
62
+ 'class' => 'SportsPress_Past_Meetings',
63
+ 'icon' => 'sp-icon-history',
64
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/past-meetings/',
65
+ 'desc' => __( 'Display previous events between teams in list or blocks layout.', 'sportspress' ),
66
+ ),
67
  'timelines' => array(
68
  'label' => __( 'Timelines', 'sportspress' ),
69
  'class' => 'SportsPress_Timelines',
includes/class-sp-player-list.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
- * @version 2.6.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -35,11 +35,23 @@ class SP_Player_List extends SP_Secondary_Post {
35
  * @param bool $admin
36
  * @return array
37
  */
38
- public function data( $admin = false ) {
39
- $league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' );
40
- $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );
 
 
 
 
 
 
 
 
41
  $position_ids = sp_get_the_term_ids( $this->ID, 'sp_position' );
42
- $team = get_post_meta( $this->ID, 'sp_team', true );
 
 
 
 
43
  $era = get_post_meta( $this->ID, 'sp_era', true );
44
  $list_stats = (array)get_post_meta( $this->ID, 'sp_players', true );
45
  $adjustments = get_post_meta( $this->ID, 'sp_adjustments', true );
@@ -529,6 +541,7 @@ class SP_Player_List extends SP_Secondary_Post {
529
  if ( sizeof( $results ) ):
530
  foreach ( $results as $id => $team_results ):
531
  if ( $team_id == $id ) continue;
 
532
  unset( $team_results['outcome'] );
533
  foreach ( $team_results as $result_slug => $team_result ):
534
 
@@ -639,7 +652,7 @@ class SP_Player_List extends SP_Secondary_Post {
639
 
640
  // Rearrange data array to reflect values
641
  foreach( $merged as $key => $value ):
642
- if ( $crop && ! sp_array_value( $value, $orderby, 0 ) ) {
643
  // Crop
644
  unset( $merged[ $key ] );
645
  } else {
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
+ * @version 2.6.9
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
35
  * @param bool $admin
36
  * @return array
37
  */
38
+ public function data( $admin = false, $leagues = null, $seasons = null, $team_id = null ) {
39
+ if ( !is_null( $leagues ) && '0' != $leagues ) {
40
+ $league_ids = explode( ",", $leagues );
41
+ }else{
42
+ $league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' );
43
+ }
44
+ if ( !is_null( $seasons ) && '0' != $seasons ) {
45
+ $season_ids = explode( ",", $seasons );
46
+ }else{
47
+ $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );
48
+ }
49
  $position_ids = sp_get_the_term_ids( $this->ID, 'sp_position' );
50
+ if ( !is_null( $team_id ) && '0' != $team_id ) {
51
+ $team = $team_id;
52
+ }else{
53
+ $team = get_post_meta( $this->ID, 'sp_team', true );
54
+ }
55
  $era = get_post_meta( $this->ID, 'sp_era', true );
56
  $list_stats = (array)get_post_meta( $this->ID, 'sp_players', true );
57
  $adjustments = get_post_meta( $this->ID, 'sp_adjustments', true );
541
  if ( sizeof( $results ) ):
542
  foreach ( $results as $id => $team_results ):
543
  if ( $team_id == $id ) continue;
544
+ $team_results['outcome'] = null;
545
  unset( $team_results['outcome'] );
546
  foreach ( $team_results as $result_slug => $team_result ):
547
 
652
 
653
  // Rearrange data array to reflect values
654
  foreach( $merged as $key => $value ):
655
+ if ( $crop && ! ( float ) sp_array_value( $value, $orderby, 0 ) ) {
656
  // Crop
657
  unset( $merged[ $key ] );
658
  } else {
includes/class-sp-player.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress player class handles individual player data.
6
  *
7
  * @class SP_Player
8
- * @version 2.6.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -408,7 +408,7 @@ class SP_Player extends SP_Custom_Post {
408
 
409
  // Subtract minutes prior to substitution
410
  $substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), 'sub' ), 0, 0 );
411
- $played_minutes -= $substitution_time;
412
  else:
413
 
414
  // Starting lineup with possible substitution
5
  * The SportsPress player class handles individual player data.
6
  *
7
  * @class SP_Player
8
+ * @version 2.6.9
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
408
 
409
  // Subtract minutes prior to substitution
410
  $substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), 'sub' ), 0, 0 );
411
+ $played_minutes -= (int) $substitution_time;
412
  else:
413
 
414
  // Starting lineup with possible substitution
includes/class-sp-shortcodes.php CHANGED
@@ -3,7 +3,7 @@
3
  * SP_Shortcodes class.
4
  *
5
  * @class SP_Shortcodes
6
- * @version 2.5.5
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
@@ -19,6 +19,10 @@ class SP_Shortcodes {
19
  'event_results' => __CLASS__ . '::event_results',
20
  'event_details' => __CLASS__ . '::event_details',
21
  'event_performance' => __CLASS__ . '::event_performance',
 
 
 
 
22
  'countdown' => __CLASS__ . '::countdown',
23
  'player_details' => __CLASS__ . '::player_details',
24
  'player_statistics' => __CLASS__ . '::player_statistics',
@@ -101,6 +105,50 @@ class SP_Shortcodes {
101
  public static function event_performance( $atts ) {
102
  return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Performance', 'output' ), $atts );
103
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  /**
106
  * Countdown shortcode.
3
  * SP_Shortcodes class.
4
  *
5
  * @class SP_Shortcodes
6
+ * @version 2.6.9
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
19
  'event_results' => __CLASS__ . '::event_results',
20
  'event_details' => __CLASS__ . '::event_details',
21
  'event_performance' => __CLASS__ . '::event_performance',
22
+ 'event_venue' => __CLASS__ . '::event_venue',
23
+ 'event_officials' => __CLASS__ . '::event_officials',
24
+ 'event_teams' => __CLASS__ . '::event_teams',
25
+ 'event_full' => __CLASS__ . '::event_full',
26
  'countdown' => __CLASS__ . '::countdown',
27
  'player_details' => __CLASS__ . '::player_details',
28
  'player_statistics' => __CLASS__ . '::player_statistics',
105
  public static function event_performance( $atts ) {
106
  return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Performance', 'output' ), $atts );
107
  }
108
+
109
+ /**
110
+ * Event venue shortcode.
111
+ *
112
+ * @access public
113
+ * @param mixed $atts
114
+ * @return string
115
+ */
116
+ public static function event_venue( $atts ) {
117
+ return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Venue', 'output' ), $atts );
118
+ }
119
+
120
+ /**
121
+ * Event officials shortcode.
122
+ *
123
+ * @access public
124
+ * @param mixed $atts
125
+ * @return string
126
+ */
127
+ public static function event_officials( $atts ) {
128
+ return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Officials', 'output' ), $atts );
129
+ }
130
+
131
+ /**
132
+ * Event teams shortcode.
133
+ *
134
+ * @access public
135
+ * @param mixed $atts
136
+ * @return string
137
+ */
138
+ public static function event_teams( $atts ) {
139
+ return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Teams', 'output' ), $atts );
140
+ }
141
+
142
+ /**
143
+ * Event full info shortcode.
144
+ *
145
+ * @access public
146
+ * @param mixed $atts
147
+ * @return string
148
+ */
149
+ public static function event_full( $atts ) {
150
+ return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Full', 'output' ), $atts );
151
+ }
152
 
153
  /**
154
  * Countdown shortcode.
includes/shortcodes/class-sp-shortcode-event-full.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Event Full info Shortcode
4
+ *
5
+ * @author ThemeBoy
6
+ * @category Shortcodes
7
+ * @package SportsPress/Shortcodes/Event_Full
8
+ * @version 2.6.9
9
+ */
10
+ class SP_Shortcode_Event_Full {
11
+
12
+ /**
13
+ * Output the event full shortcode.
14
+ *
15
+ * @param array $atts
16
+ */
17
+ public static function output( $atts ) {
18
+
19
+ if ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) )
20
+ $atts['id'] = $atts[0];
21
+
22
+ $type = 'event';
23
+
24
+ $content = apply_filters( 'the_content', get_post_field( 'post_content', $atts['id'] ) );
25
+
26
+ // Get layout setting
27
+ $layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );
28
+
29
+ // Get templates
30
+ $templates = SP()->templates->$type;
31
+
32
+ // Combine layout setting with available templates
33
+ $templates = array_merge( array_flip( $layout ), $templates );
34
+
35
+ $templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );
36
+
37
+ // Split templates into sections and tabs
38
+ $slice = array_search( 'tabs', array_keys( $templates ) );
39
+ if ( $slice ) {
40
+ $section_templates = array_slice( $templates, 0, $slice );
41
+ $tab_templates = array_slice( $templates, $slice );
42
+ } else {
43
+ $section_templates = $templates;
44
+ $tab_templates = array();
45
+ }
46
+
47
+ ob_start();
48
+
49
+ // Before template hook
50
+ do_action( 'sportspress_before_single_' . $type );
51
+
52
+ // Loop through sections
53
+ if ( ! empty( $section_templates ) ) {
54
+ foreach ( $section_templates as $key => $template ) {
55
+ // Ignore templates that are unavailable or that have been turned off
56
+ if ( ! is_array( $template ) ) continue;
57
+ if ( ! isset( $template['option'] ) ) continue;
58
+ if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) continue;
59
+
60
+ // Render the template
61
+ echo '<div class="sp-section-content sp-section-content-' . $key . '">';
62
+ if ( 'content' === $key ) {
63
+ echo $content;
64
+ // Template content hook
65
+ do_action( 'sportspress_single_' . $type . '_content' );
66
+ } elseif ( 'excerpt' === $key ) {
67
+ sp_get_template( 'post-excerpt.php', $atts );
68
+ } else {
69
+ //call_user_func( $template['action'] );
70
+ sp_get_template( 'event-' . $key . '.php', $atts );
71
+ }
72
+ echo '</div>';
73
+ }
74
+ }
75
+
76
+ // After template hook
77
+ do_action( 'sportspress_after_single_' . $type );
78
+
79
+ $ob = ob_get_clean();
80
+
81
+ $tabs = '';
82
+
83
+ if ( ! empty( $tab_templates ) ) {
84
+ $i = 0;
85
+ $tab_content = '';
86
+
87
+ foreach ( $tab_templates as $key => $template ) {
88
+ // Ignore templates that are unavailable or that have been turned off
89
+ if ( ! is_array( $template ) ) continue;
90
+ if ( ! isset( $template['option'] ) ) continue;
91
+ if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) continue;
92
+
93
+ // Put tab content into buffer
94
+ ob_start();
95
+ if ( 'content' === $key ) {
96
+ echo $content;
97
+ // Template content hook
98
+ do_action( 'sportspress_single_' . $type . '_content' );
99
+ } elseif ( 'excerpt' === $key ) {
100
+ sp_get_template( 'post-excerpt.php', $atts );
101
+ } else {
102
+ //call_user_func( $template['action'] );
103
+ sp_get_template( 'event-' . $key . '.php', $atts );
104
+ }
105
+ $buffer = ob_get_clean();
106
+
107
+ // Trim whitespace from buffer
108
+ $buffer = trim( $buffer );
109
+
110
+ // Continue if tab content is empty
111
+ if ( empty( $buffer ) ) continue;
112
+
113
+ // Get template label
114
+ $label = sp_array_value( $template, 'label', $template['title'] );
115
+
116
+ // Add to tabs
117
+ $tabs .= '<li class="sp-tab-menu-item' . ( 0 === $i ? ' sp-tab-menu-item-active' : '' ) . '"><a href="#sp-tab-content-' . $key . '" data-sp-tab="' . $key . '">' . apply_filters( 'gettext', $label, $label, 'sportspress' ) . '</a></li>';
118
+
119
+ // Render the template
120
+ $tab_content .= '<div class="sp-tab-content sp-tab-content-' . $key . '" id="sp-tab-content-' . $key . '"' . ( 0 === $i ? ' style="display: block;"' : '' ) . '>' . $buffer . '</div>';
121
+
122
+ $i++;
123
+ }
124
+
125
+ $ob .= '<div class="sp-tab-group">';
126
+
127
+ if ( ! empty( $tabs ) ) {
128
+ $ob .= '<ul class="sp-tab-menu">' . $tabs . '</ul>';
129
+ }
130
+
131
+ $ob .= $tab_content;
132
+
133
+ $ob .= '</div>';
134
+ }
135
+
136
+ echo $ob;
137
+
138
+ }
139
+ }
includes/shortcodes/class-sp-shortcode-event-officials.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Event Officials Shortcode
4
+ *
5
+ * @author ThemeBoy
6
+ * @category Shortcodes
7
+ * @package SportsPress/Shortcodes/Event_Officials
8
+ * @version 2.6.9
9
+ */
10
+ class SP_Shortcode_Event_Officials {
11
+
12
+ /**
13
+ * Output the event officials shortcode.
14
+ *
15
+ * @param array $atts
16
+ */
17
+ public static function output( $atts ) {
18
+
19
+ if ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) )
20
+ $atts['id'] = $atts[0];
21
+
22
+ sp_get_template( 'event-officials.php', $atts );
23
+ }
24
+ }
includes/shortcodes/class-sp-shortcode-event-teams.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Event Teams Shortcode
4
+ *
5
+ * @author ThemeBoy
6
+ * @category Shortcodes
7
+ * @package SportsPress/Shortcodes/Event_Officials
8
+ * @version 2.6.9
9
+ */
10
+ class SP_Shortcode_Event_Teams {
11
+
12
+ /**
13
+ * Output the event teams shortcode.
14
+ *
15
+ * @param array $atts
16
+ */
17
+ public static function output( $atts ) {
18
+
19
+ if ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) )
20
+ $atts['id'] = $atts[0];
21
+
22
+ sp_get_template( 'event-logos.php', $atts );
23
+ }
24
+ }
includes/shortcodes/class-sp-shortcode-event-venue.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Event Venue Shortcode
4
+ *
5
+ * @author ThemeBoy
6
+ * @category Shortcodes
7
+ * @package SportsPress/Shortcodes/Event_Venue
8
+ * @version 2.6.9
9
+ */
10
+ class SP_Shortcode_Event_Venue {
11
+
12
+ /**
13
+ * Output the event venue shortcode.
14
+ *
15
+ * @param array $atts
16
+ */
17
+ public static function output( $atts ) {
18
+
19
+ if ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) )
20
+ $atts['id'] = $atts[0];
21
+
22
+ sp_get_template( 'event-venue.php', $atts );
23
+ }
24
+ }
includes/widgets/class-sp-widget-countdown.php CHANGED
@@ -15,6 +15,7 @@ class SP_Widget_Countdown extends WP_Widget {
15
  $id = empty($instance['id']) ? null : $instance['id'];
16
  $show_venue = empty($instance['show_venue']) ? false : $instance['show_venue'];
17
  $show_league = empty($instance['show_league']) ? false : $instance['show_league'];
 
18
 
19
  do_action( 'sportspress_before_widget', $args, $instance, 'countdown' );
20
  echo $before_widget;
@@ -25,7 +26,7 @@ class SP_Widget_Countdown extends WP_Widget {
25
  // Action to hook into
26
  do_action( 'sportspress_before_widget_template', $args, $instance, 'countdown' );
27
 
28
- sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league ) );
29
 
30
  // Action to hook into
31
  do_action( 'sportspress_after_widget_template', $args, $instance, 'countdown' );
@@ -43,6 +44,7 @@ class SP_Widget_Countdown extends WP_Widget {
43
  $instance['id'] = intval($new_instance['id']);
44
  $instance['show_venue'] = intval($new_instance['show_venue']);
45
  $instance['show_league'] = intval($new_instance['show_league']);
 
46
 
47
  // Filter to hook into
48
  $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'countdown' );
@@ -59,6 +61,7 @@ class SP_Widget_Countdown extends WP_Widget {
59
  $id = intval($instance['id']);
60
  $show_venue = intval($instance['show_venue']);
61
  $show_league = intval($instance['show_league']);
 
62
 
63
  // Action to hook into
64
  do_action( 'sportspress_before_widget_template_form', $this, $instance, 'countdown' );
@@ -129,6 +132,9 @@ class SP_Widget_Countdown extends WP_Widget {
129
  <p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_league'); ?>" name="<?php echo $this->get_field_name('show_league'); ?>" value="1" <?php checked( $show_league, 1 ); ?>>
130
  <label for="<?php echo $this->get_field_id('show_league'); ?>"><?php _e( 'Display league', 'sportspress' ); ?></label></p>
131
 
 
 
 
132
  <?php
133
  // Action to hook into
134
  do_action( 'sportspress_after_widget_template_form', $this, $instance, 'countdown' );
15
  $id = empty($instance['id']) ? null : $instance['id'];
16
  $show_venue = empty($instance['show_venue']) ? false : $instance['show_venue'];
17
  $show_league = empty($instance['show_league']) ? false : $instance['show_league'];
18
+ $show_date = empty($instance['show_date']) ? false : $instance['show_date'];
19
 
20
  do_action( 'sportspress_before_widget', $args, $instance, 'countdown' );
21
  echo $before_widget;
26
  // Action to hook into
27
  do_action( 'sportspress_before_widget_template', $args, $instance, 'countdown' );
28
 
29
+ sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league, 'show_date' => $show_date ) );
30
 
31
  // Action to hook into
32
  do_action( 'sportspress_after_widget_template', $args, $instance, 'countdown' );
44
  $instance['id'] = intval($new_instance['id']);
45
  $instance['show_venue'] = intval($new_instance['show_venue']);
46
  $instance['show_league'] = intval($new_instance['show_league']);
47
+ $instance['show_date'] = intval($new_instance['show_date']);
48
 
49
  // Filter to hook into
50
  $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'countdown' );
61
  $id = intval($instance['id']);
62
  $show_venue = intval($instance['show_venue']);
63
  $show_league = intval($instance['show_league']);
64
+ $show_date = intval($instance['show_date']);
65
 
66
  // Action to hook into
67
  do_action( 'sportspress_before_widget_template_form', $this, $instance, 'countdown' );
132
  <p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_league'); ?>" name="<?php echo $this->get_field_name('show_league'); ?>" value="1" <?php checked( $show_league, 1 ); ?>>
133
  <label for="<?php echo $this->get_field_id('show_league'); ?>"><?php _e( 'Display league', 'sportspress' ); ?></label></p>
134
 
135
+ <p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_date'); ?>" name="<?php echo $this->get_field_name('show_date'); ?>" value="1" <?php checked( $show_date, 1 ); ?>>
136
+ <label for="<?php echo $this->get_field_id('show_date'); ?>"><?php _e( 'Display date', 'sportspress' ); ?></label></p>
137
+
138
  <?php
139
  // Action to hook into
140
  do_action( 'sportspress_after_widget_template_form', $this, $instance, 'countdown' );
modules/sportspress-default-nationality.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: SportsPress Default Nationality
4
+ Plugin URI: http://themeboy.com/
5
+ Description: Add default nationality option to SportsPress Settings.
6
+ Author: ThemeBoy
7
+ Author URI: http://themeboy.com/
8
+ Version: 2.6.9
9
+ */
10
+
11
+ // Exit if accessed directly
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'SportsPress_Default_Nationality' ) ) :
15
+
16
+ /**
17
+ * Main SportsPress Default Nationality Class
18
+ *
19
+ * @class SportsPress_Default_Nationality
20
+ * @version 2.6.9
21
+ */
22
+ class SportsPress_Default_Nationality {
23
+
24
+ /**
25
+ * Constructor
26
+ */
27
+ public function __construct() {
28
+ // Define constants
29
+ $this->define_constants();
30
+
31
+ add_filter( 'sportspress_general_options', array( $this, 'add_general_options' ) );
32
+ }
33
+
34
+ /**
35
+ * Define constants.
36
+ */
37
+ private function define_constants() {
38
+ if ( !defined( 'SP_DEFAULT_NATIONALITY_VERSION' ) )
39
+ define( 'SP_DEFAULT_NATIONALITY_VERSION', '2.6.9' );
40
+
41
+ if ( !defined( 'SP_DEFAULT_NATIONALITY_URL' ) )
42
+ define( 'SP_DEFAULT_NATIONALITY_URL', plugin_dir_url( __FILE__ ) );
43
+
44
+ if ( !defined( 'SP_DEFAULT_NATIONALITY_DIR' ) )
45
+ define( 'SP_DEFAULT_NATIONALITY_DIR', plugin_dir_path( __FILE__ ) );
46
+ }
47
+
48
+ /**
49
+ * Add option to SportsPress General Settings.
50
+ */
51
+ public function add_general_options( $settings ) {
52
+ $countries[''] = __( '&mdash; None &mdash;', 'sportspress' );
53
+ $countries = array_merge ( $countries, SP()->countries->countries );
54
+ $settings[]=array(
55
+ 'title' => __( 'Default Nationality', 'sportspress' ),
56
+ 'id' => 'sportspress_default_nationality',
57
+ 'default' => '',
58
+ 'type' => 'select',
59
+ 'options' => $countries,
60
+ );
61
+ return $settings;
62
+ }
63
+ }
64
+
65
+ endif;
66
+
67
+ new SportsPress_Default_Nationality();
modules/sportspress-gutenberg.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: SportsPress Gutenberg
4
+ Plugin URI: http://themeboy.com/
5
+ Description: Add Gutenberg support to SportsPress.
6
+ Author: ThemeBoy
7
+ Author URI: http://themeboy.com/
8
+ Version: 2.6.9
9
+ */
10
+
11
+ // Exit if accessed directly
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'SportsPress_Gutenberg' ) ) :
15
+
16
+ /**
17
+ * Main SportsPress Gutenberg Class
18
+ *
19
+ * @class SportsPress_Gutenberg
20
+ * @version 2.6.9
21
+ */
22
+ class SportsPress_Gutenberg {
23
+
24
+ /**
25
+ * Constructor
26
+ */
27
+ public function __construct() {
28
+ // Define constants
29
+ $this->define_constants();
30
+
31
+ add_filter( 'gutenberg_can_edit_post_type', array( $this, 'can_edit_post_type' ), 10, 2 );
32
+ }
33
+
34
+ /**
35
+ * Define constants.
36
+ */
37
+ private function define_constants() {
38
+ if ( !defined( 'SP_GUTENBERG_VERSION' ) )
39
+ define( 'SP_GUTENBERG_VERSION', '2.6.9' );
40
+
41
+ if ( !defined( 'SP_GUTENBERG_URL' ) )
42
+ define( 'SP_GUTENBERG_URL', plugin_dir_url( __FILE__ ) );
43
+
44
+ if ( !defined( 'SP_GUTENBERG_DIR' ) )
45
+ define( 'SP_GUTENBERG_DIR', plugin_dir_path( __FILE__ ) );
46
+ }
47
+
48
+ /**
49
+ * Modify Gutenberg behavior for custom post types.
50
+ */
51
+ function can_edit_post_type( $enabled, $post_type ) {
52
+ return is_sp_post_type( $post_type ) ? false : $enabled;
53
+ }
54
+ }
55
+
56
+ endif;
57
+
58
+ new SportsPress_Gutenberg();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: calendars, club, club management, esports, events, fixtures, leagues, leag
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
- Stable tag: 2.6.8
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -18,7 +18,7 @@ Transform your WordPress blog into a fully configurable team, club, or league we
18
  [youtube http://www.youtube.com/watch?v=KQyga_C5a6M]
19
 
20
  = Industry Reviews =
21
- > "*There are number of professional sports club who likes to maintain their information and statistics online, SportsPress plugin makes this process really easy, cost effective and quick.*" — [IndexWP](http://www.indexwp.com/sportspress-plugin-review/)
22
  >
23
  > "*Script of the Day: While the WordPress repository holds various team and sports-related plugins, few of them come close to what you can achieve with SportsPress.*" — [Softpedia](http://news.softpedia.com/news/Script-of-the-Day-SportsPress-409247.shtml)
24
  >
@@ -237,6 +237,22 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
237
 
238
  == Changelog ==
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  = 2.6.8 =
241
  * Feature - Ability to add icons to player statistics.
242
  * Feature - Ability to display matchday in event blocks.
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
+ Stable tag: 2.6.9
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
18
  [youtube http://www.youtube.com/watch?v=KQyga_C5a6M]
19
 
20
  = Industry Reviews =
21
+ > "*Best WordPress Sports plugins: With premade templates for different sports, SportsPress pretty much covers the range of what almost everyone needs. It’s highly reviewed, and does exactly what it says it will do.*" — [Elegant Themes](https://www.elegantthemes.com/blog/resources/5-best-wordpress-sports-plugins)
22
  >
23
  > "*Script of the Day: While the WordPress repository holds various team and sports-related plugins, few of them come close to what you can achieve with SportsPress.*" — [Softpedia](http://news.softpedia.com/news/Script-of-the-Day-SportsPress-409247.shtml)
24
  >
237
 
238
  == Changelog ==
239
 
240
+ = 2.6.9 =
241
+ * Feature - New event shortcodes: venue, officials, teams, and full event info.
242
+ * Feature - Option to choose default nationality for faster data entry.
243
+ * Feature - Date and time display options in countdown widgets.
244
+ * Feature - Ability to filter player list shortcodes by league, season, and team.
245
+ * Tweak - Improve page load for new player lists.
246
+ * Tweak - Improve iCal feed by fixing wrapping issues.
247
+ * Tweak - Use lighter placeholder color to differentiate from entered values.
248
+ * Tweak - Preserve league, season, and position assignments when importing players.
249
+ * Fix - PHP warnings when using version 7.2 or later.
250
+ * Fix - Countdown timer format when event is 100 or more days away.
251
+ * Fix - Player list displaying zero values when formatted using decimal places.
252
+ * Fix - Start of the week filters for week-based calendars.
253
+ * Fix - Location picker freezing issue.
254
+ * Fix - Custom post types pages displaying blank page when Gutenberg is installed.
255
+
256
  = 2.6.8 =
257
  * Feature - Ability to add icons to player statistics.
258
  * Feature - Ability to display matchday in event blocks.
sportspress.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
- * Version: 2.6.8
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
- * @version 2.6.8
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.6.8';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
+ * Version: 2.6.9
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
+ * @version 2.6.9
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.6.9';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
templates/countdown.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -106,6 +106,18 @@ if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false,
106
  <?php echo $title; ?>
107
  </h3>
108
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
109
  if ( isset( $show_venue ) && $show_venue ):
110
  $venues = get_the_terms( $post->ID, 'sp_venue' );
111
  if ( $venues ):
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
106
  <?php echo $title; ?>
107
  </h3>
108
  <?php
109
+ if ( isset( $show_date ) && $show_date ):
110
+ //if ( isset( $event_date ) ):
111
+ ?>
112
+ <h5 class="event-date sp-event-date">
113
+ <?php
114
+ echo get_the_time( get_option( 'date_format', $post ) ).' '.get_the_time( get_option( 'time_format', $post ) ).' (local time)';
115
+ ?>
116
+ </h5>
117
+ <?php
118
+ //endif;
119
+ endif;
120
+
121
  if ( isset( $show_venue ) && $show_venue ):
122
  $venues = get_the_terms( $post->ID, 'sp_venue' );
123
  if ( $venues ):
templates/event-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -26,6 +26,8 @@ $defaults = array(
26
  'season' => null,
27
  'venue' => null,
28
  'team' => null,
 
 
29
  'player' => null,
30
  'number' => -1,
31
  'show_team_logo' => get_option( 'sportspress_event_blocks_show_logos', 'yes' ) == 'yes' ? true : false,
@@ -73,6 +75,10 @@ if ( $venue )
73
  $calendar->venue = $venue;
74
  if ( $team )
75
  $calendar->team = $team;
 
 
 
 
76
  if ( $player )
77
  $calendar->player = $player;
78
  if ( $order != 'default' )
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
26
  'season' => null,
27
  'venue' => null,
28
  'team' => null,
29
+ 'teams_past' => null,
30
+ 'date_before' => null,
31
  'player' => null,
32
  'number' => -1,
33
  'show_team_logo' => get_option( 'sportspress_event_blocks_show_logos', 'yes' ) == 'yes' ? true : false,
75
  $calendar->venue = $venue;
76
  if ( $team )
77
  $calendar->team = $team;
78
+ if ( $teams_past )
79
+ $calendar->teams_past = $teams_past;
80
+ if ( $date_before )
81
+ $calendar->date_before = $date_before;
82
  if ( $player )
83
  $calendar->player = $player;
84
  if ( $order != 'default' )
templates/event-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -25,6 +25,8 @@ $defaults = array(
25
  'season' => null,
26
  'venue' => null,
27
  'team' => null,
 
 
28
  'player' => null,
29
  'number' => -1,
30
  'show_team_logo' => get_option( 'sportspress_event_list_show_logos', 'no' ) == 'yes' ? true : false,
@@ -71,6 +73,10 @@ if ( $venue )
71
  $calendar->venue = $venue;
72
  if ( $team )
73
  $calendar->team = $team;
 
 
 
 
74
  if ( $player )
75
  $calendar->player = $player;
76
  if ( $order != 'default' )
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
25
  'season' => null,
26
  'venue' => null,
27
  'team' => null,
28
+ 'teams_past' => null,
29
+ 'date_before' => null,
30
  'player' => null,
31
  'number' => -1,
32
  'show_team_logo' => get_option( 'sportspress_event_list_show_logos', 'no' ) == 'yes' ? true : false,
73
  $calendar->venue = $venue;
74
  if ( $team )
75
  $calendar->team = $team;
76
+ if ( $teams_past )
77
+ $calendar->teams_past = $teams_past;
78
+ if ( $date_before )
79
+ $calendar->date_before = $date_before;
80
  if ( $player )
81
  $calendar->player = $player;
82
  if ( $order != 'default' )
templates/player-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -29,6 +29,9 @@ $defaults = array(
29
  'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
30
  'paginated' => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false,
31
  'rows' => get_option( 'sportspress_list_rows', 10 ),
 
 
 
32
  );
33
 
34
  extract( $defaults, EXTR_SKIP );
@@ -51,7 +54,7 @@ $list = new SP_Player_List( $id );
51
  if ( isset( $columns ) && null !== $columns ):
52
  $list->columns = $columns;
53
  endif;
54
- $data = $list->data();
55
 
56
  // The first row should be labels
57
  $labels = $data[0];
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
29
  'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
30
  'paginated' => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false,
31
  'rows' => get_option( 'sportspress_list_rows', 10 ),
32
+ 'leagues' => null,
33
+ 'seasons' => null,
34
+ 'team' => null,
35
  );
36
 
37
  extract( $defaults, EXTR_SKIP );
54
  if ( isset( $columns ) && null !== $columns ):
55
  $list->columns = $columns;
56
  endif;
57
+ $data = $list->data( false, $leagues, $seasons, $team );
58
 
59
  // The first row should be labels
60
  $labels = $data[0];
templates/post-excerpt.php CHANGED
@@ -4,12 +4,14 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 1.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
12
- $id = get_the_ID();
 
 
13
  $post = get_post( $id );
14
  $excerpt = $post->post_excerpt;
15
  if ( $excerpt ) {
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
12
+ if ( ! isset( $id ) )
13
+ $id = get_the_ID();
14
+
15
  $post = get_post( $id );
16
  $excerpt = $post->post_excerpt;
17
  if ( $excerpt ) {
templates/team-events.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -13,10 +13,11 @@ if ( ! isset( $id ) )
13
  $id = get_the_ID();
14
 
15
  $format = get_option( 'sportspress_team_events_format', 'blocks' );
16
- if ( 'calendar' === $format )
17
  sp_get_template( 'event-calendar.php', array( 'team' => $id ) );
18
- elseif ( 'list' === $format )
19
- sp_get_template( 'event-list.php', array(
 
20
  'team' => $id,
21
  'league' => apply_filters( 'sp_team_events_league', 0 ),
22
  'season' => apply_filters( 'sp_team_events_season', 0 ),
@@ -24,6 +25,9 @@ elseif ( 'list' === $format )
24
  'time_format' => 'separate',
25
  'columns' => array( 'event', 'time', 'results' ),
26
  'order' => 'DESC',
27
- ) );
28
- else
 
 
29
  sp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) );
 
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
  $id = get_the_ID();
14
 
15
  $format = get_option( 'sportspress_team_events_format', 'blocks' );
16
+ if ( 'calendar' === $format ) {
17
  sp_get_template( 'event-calendar.php', array( 'team' => $id ) );
18
+ }
19
+ elseif ( 'list' === $format ) {
20
+ $args = array(
21
  'team' => $id,
22
  'league' => apply_filters( 'sp_team_events_league', 0 ),
23
  'season' => apply_filters( 'sp_team_events_season', 0 ),
25
  'time_format' => 'separate',
26
  'columns' => array( 'event', 'time', 'results' ),
27
  'order' => 'DESC',
28
+ );
29
+ $args = apply_filters( 'sp_team_events_list_args', $args );
30
+ sp_get_template( 'event-list.php', $args );
31
+ } else {
32
  sp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) );
33
+ }