[
  {
    "path": ".gitignore",
    "content": ".htaccess\n*.log\n.DS_STORE\n.idea/"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# How to contribute\n\nCommunity made patches, bug reports, contributions, and translations are always welcome.\n\nWhen contributing please ensure you follow the guidelines below so that we can keep on top of things.\n\n__Note:__ \n\nGitHub is for *bug reports and contributions only* - if you have a support question or a request for a customization don't post here. Use [WordPress.org](http://wordpress.org/support/plugin/sportspress) for community support, and for customizations we recommend one of the following services:\n\n- [Elto](https://www.elto.com/)\n- [Codeable](https://codeable.io/ambassadors/themeboy/)\n\n## Getting Started\n\n* Make sure you have a [GitHub account](https://github.com/signup/free)\n* Submit a ticket for your issue, assuming one does not already exist.\n  * Clearly describe the issue including steps to reproduce when it is a bug.\n  * Make sure you fill in the earliest version that you know has the issue.\n\n## Making Changes\n\n* Fork the repository on GitHub.\n* Make the changes to your forked repository.\n  * **Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards).**\n  * Ensure you use LF line endings - no crazy windows line endings. :)\n* When committing, reference your issue (#1234) and include a note about the fix.\n* Push the changes to your fork and submit a pull request on the master branch of the SportsPress repository. Existing maintenance branches will be maintained by ThemeBoy.\n* Please don't modify the changelog, this will be maintained by ThemeBoy.\n\nAt this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.\n\n# Additional Resources\n\n* [General GitHub documentation](http://help.github.com/)\n* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)\n* [SportsPress plugin page on WordPress.org](http://wordpress.org/plugins/sportspress/)\n"
  },
  {
    "path": "README.md",
    "content": "# SportsPress - WP league management\n\nWelcome to the SportsPress repository on GitHub. Here you can browse the source, look at open issues and keep track of development.\n\nIf you are not a developer, please use the [SportsPress plugin page](http://wordpress.org/plugins/sportspress/) on WordPress.org.\n\n## Support\nThis repository is not suitable for support. Please don't use our issue tracker for support requests, but for core SportsPress issues only. Support can take place in the appropriate channels:\n\n* The [public support forums](http://wordpress.org/support/plugin/sportspress) on WordPress.org, where the community can help each other out.\n* The [ThemeBoy premium support portal](http://tboy.co/support) for customers who have purchased themes or extensions.\n\n\n## Contributing to SportsPress\nIf you have a patch, or stumbled upon an issue with SportsPress core, you can contribute this back to the code. Please read our [contributor guidelines](https://github.com/ThemeBoy/sportspress/blob/master/CONTRIBUTING.md) for more information how you can do this.\n\nTranslators can contribute new languages to SportsPress through [Transifex](https://www.transifex.com/projects/p/sportspress/)."
  },
  {
    "path": "assets/css/Control.Geocoder.css",
    "content": ".leaflet-control-geocoder {\n  border-radius: 4px;\n  background: white;\n  min-width: 26px;\n  min-height: 26px;\n}\n\n.leaflet-touch .leaflet-control-geocoder {\n  min-width: 30px;\n  min-height: 30px;\n}\n\n.leaflet-control-geocoder a,\n.leaflet-control-geocoder .leaflet-control-geocoder-icon {\n  border-bottom: none;\n  display: inline-block;\n}\n\n.leaflet-control-geocoder .leaflet-control-geocoder-alternatives a {\n  width: inherit;\n  height: inherit;\n  line-height: inherit;\n}\n\n.leaflet-control-geocoder a:hover,\n.leaflet-control-geocoder .leaflet-control-geocoder-icon:hover {\n  border-bottom: none;\n  display: inline-block;\n}\n\n.leaflet-control-geocoder-form {\n  display: none;\n  vertical-align: middle;\n}\n.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form {\n  display: inline-block;\n}\n.leaflet-control-geocoder-form input {\n  font-size: 120%;\n  border: 0;\n  background-color: transparent;\n  width: 246px;\n}\n\n.leaflet-control-geocoder-icon {\n  border-radius: 4px;\n  width: 26px;\n  height: 26px;\n  border: none;\n  background-color: white;\n  background-image: url(images/geocoder.png);\n  background-repeat: no-repeat;\n  background-position: center;\n  cursor: pointer;\n}\n\n.leaflet-touch .leaflet-control-geocoder-icon {\n  width: 30px;\n  height: 30px;\n}\n\n.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon {\n  background-image: url(images/throbber.gif);\n}\n\n.leaflet-control-geocoder-form-no-error {\n  display: none;\n}\n\n.leaflet-control-geocoder-form input:focus {\n  outline: none;\n}\n\n.leaflet-control-geocoder-form button {\n  display: none;\n}\n.leaflet-control-geocoder-error {\n  margin-top: 8px;\n  margin-left: 8px;\n  display: block;\n  color: #444;\n}\n.leaflet-control-geocoder-alternatives {\n  display: block;\n  width: 272px;\n  list-style: none;\n  padding: 0;\n  margin: 0;\n}\n\n.leaflet-control-geocoder-alternatives-minimized {\n  display: none;\n  height: 0;\n}\n.leaflet-control-geocoder-alternatives li {\n  white-space: nowrap;\n  display: block;\n  overflow: hidden;\n  padding: 5px 8px;\n  text-overflow: ellipsis;\n  border-bottom: 1px solid #ccc;\n  cursor: pointer;\n}\n\n.leaflet-control-geocoder-alternatives li a,\n.leaflet-control-geocoder-alternatives li a:hover {\n  width: inherit;\n  height: inherit;\n  line-height: inherit;\n  background: inherit;\n  border-radius: inherit;\n  text-align: left;\n}\n\n.leaflet-control-geocoder-alternatives li:last-child {\n  border-bottom: none;\n}\n.leaflet-control-geocoder-alternatives li:hover,\n.leaflet-control-geocoder-selected {\n  background-color: #f5f5f5;\n}\n.leaflet-control-geocoder-address-detail {\n}\n.leaflet-control-geocoder-address-context {\n  color: #666;\n}\n"
  },
  {
    "path": "assets/css/activation.css",
    "content": "/* Messages */\ndiv.sportspress-message {\n\tborder-left-color: #00a69c !important;\n}\n\ndiv.sportspress-message a.button-primary,\np.sportspress-actions input.button-primary,\np.sportspress-actions input.button-primary:active,\np.sportspress-actions a.button-primary,\np.sportspress-actions a.button-primary:active {\n\tbackground: #3bbab3;\n\tborder-color: #15a29a;\n\t-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1);\n\tbox-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1);\n\tcolor: #fff;\n\ttext-decoration: none;\n\ttext-shadow: 0 -1px 1px #15a29a,1px 0 1px #15a29a,0 1px 1px #15a29a,-1px 0 1px #15a29a;\n}\n\ndiv.sportspress-message a.button-primary:hover,\np.sportspress-actions input.button-primary:hover,\np.sportspress-actions input.button-primary:focus,\np.sportspress-actions a.button-primary:hover,\np.sportspress-actions a.button-primary:focus {\n\tbackground: #00a69c;\n\tborder-color: #009187;\n\t-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1);\n\tbox-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1);\n\tcolor: #fff;\n\ttext-decoration: none;\n}\n\n.sp-feature a {\n\ttext-decoration: none;\n}\n\n.sp-feature p.sportspress-actions {\n\tmargin-top: 16px;\n}\n\n.about-sportspress-wrap div.updated {\n\tdisplay: block!important;\n}\n\n.about-sportspress-wrap .changelog .sportspress-steps {\n\tmargin-top: 24px;\n}\n\n.about-sportspress-wrap .changelog .sportspress-steps li {\n\tline-height: 16px;\n\tlist-style-type: none;\n\tmargin-left: 0;\n}\n\n.about-sportspress-wrap .changelog .sportspress-steps li a {\n\tdisplay: block;\n\tpadding: 0 0 8px;\n\tbackground: transparent!important;\n}\n\n.sportspress-steps:before,\n.sportspress-steps:after {\n\tcontent: \" \";\n\tdisplay: table;\n}\n\n.sportspress-steps:after {\n\tclear: both;\n}\n\n.sportspress-steps {\n\t*zoom: 1;\n}\n\n.sportspress-steps .welcome-icon i:before {\n\tcolor: #888;\n}\n"
  },
  {
    "path": "assets/css/admin.css",
    "content": "/* SportsPress admin styles */\n#sp_formatdiv .post-format-icon {\n\tmargin-left: 0.5px;\n}\n\n.post-state-format.post-format-calendar:before, .post-format-icon.post-format-calendar:before, a.post-state-format.format-calendar:before {\n\tcontent: \"\\f145\";\n}\n\n.post-state-format.post-format-league:before, .post-format-icon.post-format-league:before, a.post-state-format.format-league:before {\n\tcontent: \"\\f332\";\n}\n\n.post-state-format.post-format-friendly:before, .post-format-icon.post-format-friendly:before, a.post-state-format.format-friendly:before {\n\tcontent: \"\\f328\";\n}\n\n.post-state-format.post-format-player:before, .post-format-icon.post-format-player:before, a.post-state-format.format-player:before,\n.post-state-format.post-format-roster:before, .post-format-icon.post-format-roster:before, a.post-state-format.format-roster:before {\n\tcontent: \"\\f307\";\n}\n\n.post-state-format.post-format-team:before, .post-format-icon.post-format-team:before, a.post-state-format.format-team:before {\n\tcontent: \"\\f334\";\n}\n\n.post-state-format.post-format-standings:before, .post-format-icon.post-format-standings:before, a.post-state-format.format-standings:before {\n\tcontent: \"\\f185\";\n}\n\n.post-state-format.post-format-list:before, .post-format-icon.post-format-list:before, a.post-state-format.format-list:before {\n\tcontent: \"\\f163\";\n}\n\n.post-state-format.post-format-blocks:before, .post-format-icon.post-format-blocks:before, a.post-state-format.format-blocks:before {\n\tcontent: \"\\f164\";\n}\n\n.sp-dummy {\n\tdisplay: none;\n}\n\n.sp-add-new-h2 {\n\ttop: 0;\n\tfloat: right;\n}\n\n.sp-tablenav-input {\n  height: 28px;\n  margin: 0 4px 0 0;\n}\n\n#sp_videodiv .inside > fieldset > p:first-child {\n\tmargin-top: 7px !important;\n}\n\n#sp_videodiv .inside > fieldset > p:last-child {\n\tmargin-bottom: 1px !important;\n}\n\n#sp_editordiv #wp-content-editor-tools {\n\tbackground: transparent;\n}\n\n#sp_editordiv .tmce-active .switch-html,\n#sp_editordiv .html-active .switch-tmce {\n\tbackground: #fdfdfd;\n}\n\n.post-type-sp_player .curtime #timestamp:before {\n\tfont-family: sportspress, dashicons;\n\tcontent: \"\\f453\";\n}\n\n.post-type-sp_event .sp-event-status:before {\n\tcolor: #82878c;\n\tfont: 400 20px/1 dashicons;\n\tspeak: none;\n\tdisplay: inline-block;\n\tpadding: 0 2px 0 0;\n\ttop: 0;\n\tleft: -1px;\n\tposition: relative;\n\tvertical-align: top;\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\ttext-decoration: none!important;\n\tcontent: \"\\f469\";\n}\n\n.post-type-sp_event .sp-event-status-select {\n\tline-height: 1.5em;\n\tmargin-top: 3px;\n}\n\n.sp-link:before {\n\tfont: normal 20px/1 dashicons;\n\tspeak: none;\n\tdisplay: inline-block;\n\tposition: relative;\n\tvertical-align: top;\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\ttext-decoration: none !important;\n\tcontent: \"\\f504\";\n}\n\n.fixed .column-sp_team .sp-result,\n.sp-calendar-table .sp-result {\n\tbackground: #888;\n\tcolor: #fff;\n\tfont-size: 11px;\n\tfont-weight: 600;\n\ttext-align: center;\n\theight: 1.4em;\n\tline-height: 1.4em;\n\tmin-width: .7em;\n\tpadding: 0 6px;\n\tdisplay: inline-block;\n\t-webkit-border-radius: 2px;\n\tborder-radius: 2px;\n\tcursor: pointer;\n}\n\n.fixed .column-sp_team .sp-result:hover,\n.sp-calendar-table .sp-result:hover {\n\tbackground: #2ea2cc;\n}\n\n.fixed .column-sp_team .sp-edit-result {\n\tfont-size: 11px;\n\tline-height: 1.4em;\n}\n\n.fixed .column-sp_team .sp-results {\n\tmargin-bottom: .2em;\n}\n\n.fixed .column-sp_format,\n.fixed .column-sp_icon,\n.fixed .column-sp_number {\n\twidth: 2.3em;\n\ttext-align: center;\n}\n\n.fixed tbody .column-sp_icon {\n\tpadding-top: 12px;\n}\n\n.fixed .column-sp_time {\n\twidth: 6%;\n}\n\n.post-type-sp_event .fixed .column-sp_time,\n.post-type-sp_event .fixed .column-sp_league,\n.post-type-sp_calendar .fixed .column-sp_league,\n.post-type-sp_event .fixed .column-sp_season,\n.post-type-sp_calendar .fixed .column-sp_season,\n.post-type-sp_event .fixed .column-sp_venue,\n.post-type-sp_calendar .fixed .column-sp_venue,\n.post-type-sp_event .fixed .column-sp_day,\n.post-type-sp_player .fixed .column-sp_position {\n\twidth: 10%;\n}\n\n.fixed td.column-sp_format .dashicons:before {\n\tcolor: #888;\n}\n\n.form-table td input.sp-number-input {\n\twidth: auto;\n}\n\n/* Settings */\n.sportspress table.form-table, .sportspress table.form-table .forminp-radio ul {\n\tmargin: 0;\n}\n\n.sportspress table.form-table .forminp-radio ul  li {\n\tdisplay: inline;\n\tmargin-right: 20px;\n}\n\n.sportspress table.form-table .forminp-radio ul  li label.post-format-icon {\n\tmargin-top: 0 !important;\n}\n\n.sportspress table.form-table fieldset {\n\tmargin-top: 4px;\n}\n\n.sportspress table.form-table fieldset:first-child {\n\tmargin-top: 0;\n}\n\n.sportspress table.form-table fieldset p.description {\n\tmargin-bottom: 8px;\n}\n\n.sp-admin-config-table .edit {\n\ttext-align: right;\n}\n\n.sportspress table.form-table .sp-color-option {\n\tmax-width: 225px;\n}\n\n.sportspress table.form-table .sp-color-option table {\n\toutline: 1px solid #ddd;\n}\n\n.sportspress table.form-table .sp-custom-colors {\n\tpadding: 5px 15px 15px;\n}\n\n.sportspress table.form-table .sp-color-box {\n\tborder: 1px solid #ccc;\n\tbox-shadow: 1px 1px 3px rgba(0,0,0,.2);\n\t-webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.2);\n\t-moz-box-shadow: 1px 1px 3px rgba(0,0,0,.2);\n\t-webkit-border-radius: 3px;\n\t-moz-border-radius: 3px;\n\tborder-radius: 3px;\n\tpadding: 4px 6px;\n\tfloat: left;\n\twidth: 90px;\n\tmargin: 0 10px 10px 0;\n}\n\n.sportspress table.form-table .sp-color-box strong {\n\ttext-align: left;\n\tdisplay: block;\n\tpadding: 0 0 2px;\n\tfont-size: .92em;\n\tword-wrap: break-word;\n}\n\n.sportspress table.form-table .sp-color-box input.colorpick {\n\twidth: 100%;\n\tmargin: 0;\n\tfont-family: monospace;\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\n.sportspress table.form-table .sp-color-box .iris-picker {\n\tz-index: 100;\n\tposition: absolute;\n\tdisplay: none;\n\tborder: 1px solid #ccc;\n\tbox-shadow: 1px 1px 3px rgba(0,0,0,.2);\n\t-webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.2);\n\t-moz-box-shadow: 1px 1px 3px rgba(0,0,0,.2);\n\t-webkit-border-radius: 3px;\n\t-moz-border-radius: 3px;\n\tborder-radius: 3px;\n\tmargin: 15px 0 0 -7px;\n}\n\n.sportspress table.form-table #sportspress_custom_css {\n\tfont-family: monospace;\n}\n\n.sportspress .submit,\n.sp-data-table-container {\n\tclear: both;\n}\n\n.sp-data-table-container::-webkit-scrollbar {\n\theight:12px;\n}\n.sp-data-table-container::-webkit-scrollbar-track {\n\tbox-shadow:0 0 2px rgba(0,0,0,0.15) inset;\n\tbackground:#f0f0f0;\n}\n.sp-data-table-container::-webkit-scrollbar-thumb {\n\tborder-radius:6px;\n\tbackground:#ccc;\n}\n\ntable.widefat.sp-data-table img {\n\tvertical-align: top;\n}\n\ntable.widefat.sp-data-table th.column-outcome,\ntable.widefat.sp-data-table th.column-position {\n\twidth: 10em;\n}\n\ntable.widefat.sp-data-table th,\ntable.widefat.sp-data-table td {\n\tpadding-right: 0;\n}\n\ntable.widefat.sp-data-table th:last-child,\ntable.widefat.sp-data-table td:last-child {\n\tpadding-right: 10px;\n}\n\ntable.widefat.sp-data-table td {\n\tline-height: 2;\n\toverflow: visible;\n\twhite-space: nowrap;\n}\n\ntable.widefat.sp-data-table th.icon,\ntable.widefat.sp-data-table td.icon {\n\twidth: 1px;\n}\n\ntable.widefat.sp-data-table th.icon span,\ntable.widefat.sp-data-table td.icon span {\n\tmargin-right: 0;\n}\n\ntable.widefat.sp-data-table input[type=\"text\"],\ntable.widefat.sp-data-table input[type=\"number\"] {\n\tmin-width: 1.25em;\n\twidth: 100%;\n\tmargin: 1px;\n\tpadding: 3px 5px;\n}\n\ntable.widefat.sp-data-table input[type=\"text\"]::placeholder,\ntable.widefat.sp-data-table input[type=\"number\"]::placeholder {\n\tcolor: silver;\n}\n\ntable.widefat.sp-data-table input.small-text {\n\twidth: 50px;\n\tmin-width: 0;\n}\n\ntable.widefat.sp-data-table input.tiny-text {\n\twidth: 25px;\n\tmin-width: 0;\n}\n\ntable.widefat.sp-data-table input.name {\n\tmin-width: 0;\n\twidth: auto;\n}\n\ntable.widefat.sp-data-table a.dashicons {\n\tcursor: pointer;\n\theight: 27px;\n\tline-height: 27px;\n}\n\ntable.widefat.sp-data-table a.sp-edit {\n\t-moz-opacity: 0;\n\topacity: 0;\n\t-ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)\";\n}\n\ntable.widefat.sp-data-table tr:hover a.sp-edit {\n\t-moz-opacity: 1;\n\topacity: 1;\n\t-ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)\";\n}\n\ntable.widefat.sp-data-table th.check-column {\n\tpadding: 10px 0 6px 2px;\n}\n\ntable.widefat.sp-data-table th:not(.check-column) input[type=checkbox] {\n\tmargin: -4px 1px 0;\n\tvertical-align: middle;\n}\n\ntable.widefat.sp-data-table tfoot th,\ntable.widefat.sp-data-table tfoot td {\n\tborder-top: 1px solid #e1e1e1;\n}\n\ntable.widefat.sp-data-table tfoot tr.sp-total {\n\tbackground: #f9f9f9;\n}\n\ntable.widefat select.sp-outcome,\ntable.widefat select.sp-position {\n\twidth: 100%;\n}\n\ntable.widefat.sp-sortable-table tbody tr {\n\tbackground-color: #fff;\n}\n\ntable.widefat.sp-sortable-table tbody tr:nth-child(2n-1) {\n\tbackground-color: #f9f9f9;\n}\n\ntable.widefat.sp-sortable-table tbody tr .icon {\n\tcursor: move;\n}\n\n.sp-not-found-container {\n\tdisplay: none;\n}\n\n.sp-settings-bar {\n\tfloat: none;\n\tclear: both;\n}\n\n.sp-settings-section {\n\tmargin-top: 20px;\n\tposition: relative;\n\tmax-width: 1050px;\n\tborder: 1px solid #e5e5e5;\n\t-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);\n\tbox-shadow: 0 1px 1px rgba(0,0,0,.04);\n\tbackground: #fff;\n}\n\n.sp-settings-section h3 {\n\tfont-size: 14px;\n\tpadding: 8px 12px;\n\tmargin: 0;\n\tline-height: 1.4;\n\tborder-bottom: 1px solid #e1e1e1;\n}\n\n.sp-settings-section > .form-table > tbody > tr > th {\n\tpadding: 13px 15px;\n\tfont-size: 13px;\n\tline-height: 1.4em;\n\tbackground: #f9f9f9;\n\twidth: 24%;\n\tborder-top: 1px solid #e1e1e1;\n}\n\n.sp-settings-section > .form-table > tbody > tr > td {\n\tborder-left: 1px solid #e1e1e1;\n\tborder-top: 1px solid #e1e1e1;\n\tpadding: 10px 15px;\n\tfont-size: 13px;\n\tline-height: 1.4em;\n}\n\n.sp-settings-section > .form-table > tbody > tr:first-child > th,\n.sp-settings-section > .form-table > tbody > tr:first-child > td {\n\tborder-top: none;\n}\n\n.sp-settings-section > p {\n\tborder-bottom: 1px solid #e1e1e1;\n\tpadding: 13px 15px;\n\tfont-size: 13px;\n\tbackground: #f9f9f9;\n\tmargin: 0;\n}\n\n.sp-admin-config-table th,\n.sp-admin-config-table td {\n\tpadding: 8px 10px;\n}\n\n.sp-admin-config-table th.radio,\n.sp-admin-config-table td.radio,\n.sp-admin-config-table th.icon,\n.sp-admin-config-table td.icon {\n\twidth: 1%;\n\ttext-align: center;\n}\n\n.sp-admin-config-table th.radio input[type=radio],\n.sp-admin-config-table td.radio input[type=radio] {\n\tmargin: 0;\n\tvertical-align: middle;\n}\n\n#sp_venue-adder h4,\n#sp_team-adder h4,\n#sp_season-adder h4,\n#sp_player-adder h4,\n#sp_position-adder h4 {\n\tmargin: 10px 0;\n}\n\n.form-field .sp-location-picker {\n\twidth: 95%;\n\theight: 320px;\n}\n\n/* Chosen */\n.chosen-container-single .chosen-single {\n\t-webkit-border-radius: 3px;\n\tborder-radius: 3px;\n\tcolor: #555;\n\tborder-color: #ccc;\n\tbackground: #f7f7f7;\n\t-webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);\n\tbox-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);\n}\n\n.chosen-container-active .chosen-single {\n\tborder-color: #999;\n\tbackground: #fff;\n}\n\n.chosen-container-active.chosen-with-drop .chosen-single {\n\tbackground: #fff;\n}\n\n.chosen-container-single .chosen-drop {\n\t-webkit-border-radius: 0 0 3px 3px;\n\tborder-radius: 0 0 3px 3px;\n}\n\n.chosen-container-multi .chosen-choices {\n\tbackground: #fff;\n\tcolor: #333;\n\tpadding: 3px 0;\n\tborder-color: #ddd;\n\tbox-shadow: inset 0 1px 2px rgba(0,0,0,.07);\n\tline-height: 2;\n}\n\n.chosen-container-multi .chosen-choices li.search-field input[type=\"text\"] {\n\tcolor: #a9a9a9;\n\theight: auto;\n}\n\n.chosen-container-multi .chosen-choices li.search-choice {\n\tcolor: #555;\n\tborder-color: #ccc;\n\tbackground: #f7f7f7;\n\t-webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);\n\tbox-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);\n\tvertical-align: top;\n}\n\n.chosen-container-multi .chosen-choices li.search-choice:hover {\n\tbackground: #fafafa;\n\tborder-color: #999;\n\tcolor: #222;\n}\n\n.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {\n\ttransition: none;\n\t-webkit-transition: none;\n}\n\n/* CodeMirror */\n\n.sp-settings-section .CodeMirror {\n\tborder: 1px solid #ddd;\n\tbox-shadow: inset 0 1px 2px rgba(0,0,0,.07);\n}\n\n.sp-settings-section .CodeMirror-gutters {\n\tbackground: #f9f9f9;\n\tborder-color: #e1e1e1;\n}\n\n/* Paragraph */\n.sp-para {\n\tmargin: 1em 0;\n}\n\n/* TipTip */\n.sp-tip,\n.sp-desc-tip {\n\tcursor: help;\n}\n\n.sp-desc-tip:before {\n\tcolor: #aaa;\n}\n\n.sp-desc-active:before {\n\tcolor: #7ad03a;\n}\n\n#tiptip_holder {\n\tdisplay: none;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tz-index: 99999;\n}\n\n#tiptip_holder.tip_top {\n\tpadding-bottom: 5px;\n}\n\n#tiptip_holder.tip_bottom {\n\tpadding-top: 5px;\n}\n\n#tiptip_holder.tip_right {\n\tpadding-left: 5px;\n}\n\n#tiptip_holder.tip_left {\n\tpadding-right: 5px;\n}\n\n#tiptip_content {\n\tfont-size: 11px;\n\tcolor: #fff;\n\tpadding: .5em;\n\tbackground: #464646;\n\t-webkit-border-radius: 3px;\n\t-moz-border-radius: 3px;\n\tborder-radius: 3px;\n\t-webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.1);\n\t-moz-box-shadow: 1px 1px 3px rgba(0,0,0,.1);\n\tbox-shadow: 1px 1px 3px rgba(0,0,0,.1);\n\ttext-align: center;\n}\n\n#tiptip_arrow, #tiptip_arrow_inner {\n\tposition: absolute;\n\tborder-color: transparent;\n\tborder-style: solid;\n\tborder-width: 6px;\n\theight: 0;\n\twidth: 0;\n}\n\n#tiptip_holder.tip_top #tiptip_arrow {\n\tborder-top-color: #fff;\n\tborder-top-color: rgba(255,255,255,0.25);\n}\n\n#tiptip_holder.tip_bottom #tiptip_arrow {\n\tborder-bottom-color: #fff;\n\tborder-bottom-color: rgba(255,255,255,0.25);\n}\n\n#tiptip_holder.tip_right #tiptip_arrow {\n\tborder-right-color: #fff;\n\tborder-right-color: rgba(255,255,255,0.25);\n}\n\n#tiptip_holder.tip_left #tiptip_arrow {\n\tborder-left-color: #fff;\n\tborder-left-color: rgba(255,255,255,0.25);\n}\n\n#tiptip_holder.tip_top #tiptip_arrow_inner {\n\tmargin-top: -7px;\n\tmargin-left: -6px;\n\tborder-top-color: #464646;\n}\n\n#tiptip_holder.tip_bottom #tiptip_arrow_inner {\n\tmargin-top: -5px;\n\tmargin-left: -6px;\n\tborder-bottom-color: #464646;\n}\n\n#tiptip_holder.tip_right #tiptip_arrow_inner {\n\tmargin-top: -6px;\n\tmargin-left: -5px;\n\tborder-right-color: #464646;\n}\n\n#tiptip_holder.tip_left #tiptip_arrow_inner {\n\tmargin-top: -6px;\n\tmargin-left: -7px;\n\tborder-left-color: #464646;\n}\n\n/* Toggle switches */\n.sp-toggle-switch {\n\tdisplay: none !important;\n}\n\n.sp-toggle-switch + label {\n\twidth: 32px;\n\theight: 16px;\n\tborder-radius: 16px;\n\tposition: absolute;\n\tright: 12px;\n\ttop: 13px;\n}\n\n.sp-toggle-switch + label:before,\n.sp-toggle-switch + label:after {\n\tdisplay: block;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbottom: 0;\n\tcontent: \"\";\n}\n\n.sp-toggle-switch + label:before {\n\tright: 1px;\n\tbackground-color: #e4e4e4;\n\tborder-radius: 16px;\n\ttransition: background 0.4s;\n}\n\n.sp-toggle-switch + label:after {\n\twidth: 16px;\n\tbackground-color: #fff;\n\tborder-radius: 100%;\n\t-webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n\ttransition: margin 0.4s;\n}\n\n.sp-toggle-switch:checked + label:before {\n  background-color: #00a0d2;\n}\n\n.sp-toggle-switch:checked + label:after {\n  margin-left: 16px;\n}\n\n.sp-toggle-switch:checked + label:hover:before {\n  background-color: #00b9eb;\n}\n\n/* Tab panels */\n.sp-tab-panel {\n\tmax-height: 500px;\n}\n\n/* Sortable lists */\n.sp-sortable-list {\n\tmargin: 0;\n\toverflow: hidden;\n\tpadding-top: 5px;\n\tmin-height: 50px;\n}\n\n.sp-sortable-list li {\n\tfloat: left;\n\tclear: both;\n\tmax-width: 382px;\n\twidth: 100%;\n\tbox-sizing: border-box;\n}\n\n.sp-sortable-list .sp-item-float + .sp-item-float {\n\tpadding-right: 0;\n}\n\n.sp-item-bar {\n\tclear: both;\n\tline-height: 1.5em;\n\tposition: relative;\n\tmargin: 9px 0 0;\n}\n\n.sp-item-bar .sp-item-handle {\n\tbackground: #fafafa;\n\tcolor: #23282d;\n\tborder: 1px solid #dfdfdf;\n\tposition: relative;\n\tpadding: 10px 15px;\n\theight: auto;\n\tmin-height: 20px;\n\tline-height: 30px;\n\toverflow: hidden;\n\tword-wrap: break-word;\n}\n\n.sp-item-bar .sp-item-handle:hover {\n\tborder-color: #999;\n\t-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.1);\n\tbox-shadow: 0 1px 2px rgba(0,0,0,.1);\n}\n\n.sp-item-bar .sp-item-title {\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tline-height: 20px;\n\tdisplay: block;\n\tmargin-right: 13em;\n}\n\n.sp-item-settings {\n\tdisplay: block;\n\tpadding: 10px 0 10px 15px;\n\tposition: relative;\n\tz-index: 10;\n\tbackground: #fff;\n\tborder: 1px solid #e5e5e5;\n\tborder-top: none;\n\t-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);\n\tbox-shadow: 0 1px 1px rgba(0,0,0,.04);\n}\n\n.js .sp-item-handle {\n\tcursor: move;\n}\n\n.sp-sortable-list .sp-item-placeholder {\n\tborder: 1px dashed #b4b9be;\n\tmargin: 9px auto 6px;\n\theight: 42px;\n}\n\n/* Logo */\n.sp-settings-logo {\n\twidth: auto;\n\theight: auto;\n\tmax-width: 100%;\n\tmax-height: 35px;\n}\n\n/* Modules */\n.sp-modules-wrapper {\n\tmargin-right: 300px;\n\tmax-width: 750px;\n}\n\n.sp-modules-main {\n\twidth: 100%;\n\tfloat: left;\n}\n\n.sp-modules-sidebar {\n\tfloat: right;\n\tmargin-right: -300px;\n\twidth: 280px;\n}\n\n.sp-modules-sidebar table th,\n.sp-modules-sidebar table td {\n\tpadding: 10px 14px;\n}\n\n.sp-modules-sidebar table th img {\n\tdisplay: block;\n}\n\n\n.sp-modules-sidebar table td p {\n\tmargin-top: 0;\n}\n\n.sp-modules-sidebar table td .sp-module-actions {\n\tpadding: 10px;\n\tclear: both;\n\tborder-top: 1px solid #ddd;\n\tbackground: #f9f9f9;\n\tmargin: 0 -14px;\n\ttext-align: right;\n}\n\n.sp-modules-sidebar table td .sp-module-actions:last-child {\n\tmargin-bottom: -10px;\n}\n\n.sp-modules-sidebar table td .sp-module-actions span {\n\tline-height: 28px;\n\tvertical-align: middle;\n\ttext-align: left;\n\tfloat: left;\n\tmargin-left: 4px;\n\tcolor: #999;\n}\n\n.sp-modules-sidebar table td ul {\n\tmargin: 2px 0 0.8em;\n}\n\n.sp-modules-sidebar table td ul:last-child {\n\tmargin-bottom: 0;\n}\n\n.sp-modules-sidebar table td ol {\n\tmargin: 2px 0 0.8em;\n\tlist-style-position: inside;\n}\n\n.sp-modules-sidebar table td span {\n\tcolor: #aaa;\n}\n\n.sp-modules-sidebar table td .sp-theme-screenshot {\n\tmargin: 4px 0;\n}\n\n.sp-modules-wrapper img {\n\tmax-width: 100%;\n}\n\n.sp-modules-wrapper table {\n\tmargin-top: 20px;\n}\n\ntable.sp-modules-table th {\n\tfont-weight: 600;\n}\n\ntable.sp-modules-table td {\n\tpadding: 10px 14px;\n\tline-height: 25px;\n\tborder-bottom: 1px solid #e1e1e1;\n\tposition: relative;\n}\n\ntable.sp-modules-table tr:last-child td {\n\tborder-bottom: none;\n}\n\ntable.sp-modules-table td > input[type=checkbox] {\n\tmargin-top: -4px;\n}\n\ntable.sp-modules-table td > input[type=checkbox][disabled=disabled] {\n\tcursor: default;\n}\n\ntable.sp-modules-table td .button {\n\tposition: absolute;\n\tright: 9px;\n\ttop: 9px;\n}\n\ntable.sp-modules-table .sp-desc {\n\tcolor: #aaa;\n\tfloat: right;\n}\n\ntable.sp-modules-table [class^=\"sp-icon-\"],\ntable.sp-modules-table [class*=\" sp-icon-\"],\ntable.sp-modules-table .dashicons {\n\tposition: relative;\n\ttop: 2px;\n\tleft: -0.5px;\n\tline-height: 1;\n}\n\ntable.sp-modules-table .sp-module-unavailable .sp-desc-tip {\n\tvertical-align: middle;\n\tcolor: #aaa;\n}\n\ntable.sp-modules-table .sp-module-unavailable span [class^=\"sp-icon-\"],\ntable.sp-modules-table .sp-module-unavailable span [class*=\" sp-icon-\"],\ntable.sp-modules-table .sp-module-unavailable span .dashicons {\n\t-moz-opacity: 0.8;\n\topacity: 0.8;\n\t-ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";\n}\n\n/* Licenses */\n\n.sp-licenses-wrapper {\n\tmax-width: 750px;\n}\n\n.sp-licenses-table th,\n.sp-licenses-table input {\n\tvertical-align: middle;\n}\n\n#debug-report {\n\tdisplay: none;\n\tmargin: 10px 0;\n\tpadding: 0;\n\tposition: relative;\n}\n\n#debug-report textarea {\n\tfont-family: monospace;\n\twidth: 100%;\n\tmargin: 0;\n\theight: 300px;\n\tpadding: 20px;\n\t-moz-border-radius: 0;\n\t-webkit-border-radius: 0;\n\tborder-radius: 0;\n\tresize: none;\n\tfont-size: 12px;\n\tline-height: 20px;\n\toutline: 0;\n}\n\ntable.sp-status-table td mark {\n\tbackground: transparent none;\n}\n\ntable.sp-status-table td mark.yes {\n\tcolor: #7ad03a;\n}\n\n/* Importers */\n#import-upload-form table.form-table th,\n#import-upload-form table.form-table td {\n\tpadding-bottom: 0;\n}\n#import-upload-form table.form-table tbody tr:last-child td {\n\tpadding-bottom: 20px;\n}\n.sp-import-table th,\n.sp-import-table td {\n\tpadding-right: 0;\n}\n.sp-import-table th:last-child,\n.sp-import-table td:last-child {\n\tpadding-right: 10px;\n}\n.sp-import-table tbody tr:nth-child(2n-1) {\n\tbackground: #f9f9f9;\n}\n.sp-import-table select {\n\tmax-width: 100%;\n}\n.sp-import-table .sp-actions-column {\n\twidth: 40px;\n\ttext-align: right;\n}\n.sp-import-table .sp-add-row {\n\tline-height: 1.5;\n}\n.sp-import-table .sp-delete-row {\n\tcolor: #a00;\n}\n.sp-import-table .sp-delete-row:hover {\n\tcolor: #f00;\n}\n\n/* Welcome Screen */\n.about-sportspress-wrap .sp-welcome-logo {\n\tdisplay: inline;\n}\n.about-sportspress-wrap .sp-welcome-logo img {\n\twidth: auto;\n\tborder: none;\n}\n.about-sportspress-wrap .sp-about-text {\n\tmin-height: 0;\n\tmargin-right: 165px;\n}\n.about-sportspress-wrap .sp-badge {\n\tfloat: right;\n\tbackground: #00cac4 url(../images/welcome/sp-badge.png) no-repeat center top;\n\ttext-rendering: optimizeLegibility;\n\tpadding-top: 10px;\n\theight: 150px;\n\twidth: 150px;\n\tfont-size: 14px;\n\tline-height: 1.75;\n\ttext-align: center;\n\tfont-weight: 600;\n\tcolor: #c4fffc;\n\tmargin: 5px 0 0 0;\n\t-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.2);\n\tbox-shadow: 0 1px 3px rgba(0,0,0,.2);\n}\n.about-sportspress-wrap .sportspress-actions .twitter-share-button {\n\tmargin-top: -3px;\n\tmargin-left: 3px;\n\tvertical-align: middle;\n}\n.about-sportspress-wrap .nav-tab-wrapper {\n\tclear: both;\n}\n.about-sportspress-wrap .sp-feature {\n\toverflow: visible !important;\n\t*zoom:1;\n}\n.about-sportspress-wrap .sp-feature > div {\n\tfloat: left;\n\twidth: 50%;\n}\n.about-sportspress-wrap .sp-feature > div.last-feature {\n\tfloat: right;\n}\n.about-sportspress-wrap .sp-feature:before,\n.about-sportspress-wrap .sp-feature:after {\n\tcontent: \" \";\n\tdisplay: table;\n}\n.about-sportspress-wrap .sp-feature:after {\n\tclear: both;\n}\n.about-sportspress-wrap div.icon {\n\twidth: 0 !important;\n\tpadding: 0;\n\tmargin: 0;\n}\n.about-sportspress-wrap .sp-feature div.icon:before {\n\tfont-family: sportspress !important;\n\tfont-weight: normal;\n\twidth: 100%;\n\tfont-size: 170px;\n\tline-height: 125px;\n\tcolor: #9c5d90;\n\tdisplay: inline-block;\n\tposition: relative;\n\ttext-align: center;\n\tspeak: none;\n\tmargin: <?php echo is_rtl() ? '0 -100px 0 0' : '0 0 0 -100px'; ?>;\n\tcontent: \"\\f111\";\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n}\n.about-sportspress-wrap .sp-theme-screenshot {\n\tfloat: left;\n\tmargin-right: 15px;\n}\n.about-sportspress-wrap .form-table th {\n\twidth: auto;\n}\n.about-sportspress-wrap .sp-top-translations {\n\tfloat: right;\n\tmargin-left: 20px;\n}\n.about-sportspress-wrap .sp-top-translations .hndle {\n\tfont-size: 14px;\n\tpadding: 8px 12px;\n\tmargin: 0;\n\tline-height: 1.4;\n\tcursor: auto;\n}\n.about-sportspress-wrap .sp-transifex-chart {\n\tpadding: 0 12px;\n\ttext-align: center;\n}\n.about-sportspress-wrap .sp-transifex-chart a {\n\tdisplay: inline-block;\n}\n\n/* Tutorials */\n.sp-tutorials-list {\n\tmargin: -6px;\n\twidth: 100%;\n}\n.sp-tutorials-list li {\n\tdisplay: inline-block;\n\twidth: 342px;\n\tmax-width: 100%;\n\tmargin: 6px;\n}\n.sp-tutorials-list li th {\n\tfont-weight: 600;\n}\n.sp-tutorials-list li strong {\n\tbackground: #aaa;\n\tdisplay: inline-block;\n\tcolor: #ffffff;\n\tpadding: 0 6px;\n\tborder-radius: 3px;\n\ttext-align: center;\n\tfont-size: 12px;\n\tmargin-right: 3px;\n}\n.sp-tutorials-list li:hover strong {\n\tbackground: #00a69c;\n}\n.sp-tutorials-list li .sp-popup {\n\tfloat: right;\n\tcolor: #aaa;\n}\n.sp-tutorials-list li:hover .sp-popup {\n\tcolor: #00a69c;\n}\n.sp-tutorials-list li iframe {\n\tdisplay: block;\n}\n\n/* Media Queries */\n@media only screen and (max-width: 960px) {\n\t.sportspress_page_sportspress-more iframe {\n\t\t/*padding-left: 36px;*/\n\t}\n}\n\n@media only screen and (max-width: 850px) {\n\t.sp-modules-wrapper {\n\t\tmargin-right: 0;\n\t}\n\n\t.sp-modules-main,\n\t.sp-modules-sidebar {\n\t\tmargin-right: 0;\n\t\twidth: 100%;\n\t}\n\n\t.sp-tab-panel {\n\t\tmax-height: 200px;\n\t}\n}\n\n@media only screen and (max-width: 782px) {\n\t.fixed .column-sp_time,\n\t.fixed .column-sp_team,\n\t.fixed .column-sp_league,\n\t.fixed .column-sp_season,\n\t.fixed .column-sp_venue,\n\t.fixed .column-sp_position,\n\t.fixed .column-sp_player {\n\t\tdisplay: none;\n\t}\n\n\t.form-field .sp-location-picker {\n\t\twidth: 99%;\n\t}\n\n\t.form-field td .sp-location-picker {\n\t\twidth: 100%;\n\t}\n\n\t.sp-settings-section > .form-table > tbody > tr > th {\n\t\twidth: auto;\n\t}\n\n\t.sp-settings-section > .form-table > tbody > tr > td,\n\t.sp-settings-section > .form-table > tbody > tr:first-child > td {\n\t\tborder-left: none;\n\t\tborder-top: 1px solid #e1e1e1;\n\t}\n\n\t.sp-settings-section .sp-configure-sport {\n\t\tmargin-top: 10px;\n\t}\n\n\ttable.sp-modules-table td .button {\n\t\tmargin: -3px -7px -3px 10px;\n\t}\n\n\t.about-sportspress-wrap .sp-top-translations {\n\t\tfloat: none;\n\t\tmargin-left: 0;\n\t}\n\n\t.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-sp_format,\n\t.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-sp_icon,\n\t.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-sp_number {\n\t\tdisplay: table-cell!important;\n\t}\n}\n\n@media only screen and (max-width: 600px) {\n\t.about-sportspress-wrap .sp-welcome-logo,\n\t.about-sportspress-wrap .sp-about-text {\n\t\tdisplay: block;\n\t\ttext-align: center;\n\t\tmargin-right: 0;\n\t\tpadding-right: 0;\n\t}\n\n\t.about-sportspress-wrap .sp-badge {\n\t\tfloat: none;\n\t\tmargin: 20px auto 10px;\n\t}\n}\n"
  },
  {
    "path": "assets/css/chosen.css",
    "content": "/*!\nChosen, a Select Box Enhancer for jQuery and Prototype\nby Patrick Filler for Harvest, http://getharvest.com\n\nVersion 1.1.0\nFull source at https://github.com/harvesthq/chosen\nCopyright (c) 2011 Harvest http://getharvest.com\n\nMIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md\nThis file is generated by `grunt build`, do not edit it by hand.\n*/\n\n/* @group Base */\n.chosen-container {\n  position: relative;\n  display: inline-block;\n  vertical-align: middle;\n  font-size: 13px;\n  zoom: 1;\n  *display: inline;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  user-select: none;\n}\n.chosen-container .chosen-drop {\n  position: absolute;\n  top: 100%;\n  left: -9999px;\n  z-index: 1010;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 100%;\n  border: 1px solid #aaa;\n  border-top: 0;\n  background: #fff;\n  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);\n}\n.chosen-container.chosen-with-drop .chosen-drop {\n  left: 0;\n}\n.chosen-container a {\n  cursor: pointer;\n}\n\n/* @end */\n/* @group Single Chosen */\n.chosen-container-single .chosen-single {\n  position: relative;\n  display: block;\n  overflow: hidden;\n  padding: 0 0 0 8px;\n  height: 23px;\n  border: 1px solid #aaa;\n  border-radius: 5px;\n  background-color: #fff;\n  background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));\n  background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);\n  background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);\n  background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);\n  background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);\n  background-clip: padding-box;\n  box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);\n  color: #444;\n  text-decoration: none;\n  white-space: nowrap;\n  line-height: 24px;\n}\n.chosen-container-single .chosen-default {\n  color: #999;\n}\n.chosen-container-single .chosen-single span {\n  display: block;\n  overflow: hidden;\n  margin-right: 26px;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n.chosen-container-single .chosen-single-with-deselect span {\n  margin-right: 38px;\n}\n.chosen-container-single .chosen-single abbr {\n  position: absolute;\n  top: 6px;\n  right: 26px;\n  display: block;\n  width: 12px;\n  height: 12px;\n  background: url('../images/chosen/chosen-sprite.png') -42px 1px no-repeat;\n  font-size: 1px;\n}\n.chosen-container-single .chosen-single abbr:hover {\n  background-position: -42px -10px;\n}\n.chosen-container-single.chosen-disabled .chosen-single abbr:hover {\n  background-position: -42px -10px;\n}\n.chosen-container-single .chosen-single div {\n  position: absolute;\n  top: 0;\n  right: 0;\n  display: block;\n  width: 18px;\n  height: 100%;\n}\n.chosen-container-single .chosen-single div b {\n  display: block;\n  width: 100%;\n  height: 100%;\n  background: url('../images/chosen/chosen-sprite.png') no-repeat 0px 2px;\n}\n.chosen-container-single .chosen-search {\n  position: relative;\n  z-index: 1010;\n  margin: 0;\n  padding: 3px 4px;\n  white-space: nowrap;\n}\n.chosen-container-single .chosen-search input[type=\"text\"] {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  margin: 1px 0;\n  padding: 4px 20px 4px 5px;\n  width: 100%;\n  height: auto;\n  outline: 0;\n  border: 1px solid #aaa;\n  background: white url('../images/chosen/chosen-sprite.png') no-repeat 100% -20px;\n  background: url('../images/chosen/chosen-sprite.png') no-repeat 100% -20px;\n  font-size: 1em;\n  font-family: sans-serif;\n  line-height: normal;\n  border-radius: 0;\n}\n.chosen-container-single .chosen-drop {\n  margin-top: -1px;\n  border-radius: 0 0 4px 4px;\n  background-clip: padding-box;\n}\n.chosen-container-single.chosen-container-single-nosearch .chosen-search {\n  position: absolute;\n  left: -9999px;\n}\n\n/* @end */\n/* @group Results */\n.chosen-container .chosen-results {\n  position: relative;\n  overflow-x: hidden;\n  overflow-y: auto;\n  margin: 0 4px 4px 0;\n  padding: 0 0 0 4px;\n  max-height: 240px;\n  -webkit-overflow-scrolling: touch;\n}\n.chosen-container .chosen-results li {\n  display: none;\n  margin: 0;\n  padding: 5px 6px;\n  list-style: none;\n  line-height: 15px;\n  -webkit-touch-callout: none;\n}\n.chosen-container .chosen-results li.active-result {\n  display: list-item;\n  cursor: pointer;\n}\n.chosen-container .chosen-results li.disabled-result {\n  display: list-item;\n  color: #ccc;\n  cursor: default;\n}\n.chosen-container .chosen-results li.highlighted {\n  background-color: #3875d7;\n  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));\n  background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);\n  background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);\n  background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);\n  background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);\n  color: #fff;\n}\n.chosen-container .chosen-results li.no-results {\n  display: list-item;\n  background: #f4f4f4;\n}\n.chosen-container .chosen-results li.group-result {\n  display: list-item;\n  font-weight: bold;\n  cursor: default;\n}\n.chosen-container .chosen-results li.group-option {\n  padding-left: 15px;\n}\n.chosen-container .chosen-results li em {\n  font-style: normal;\n  text-decoration: underline;\n}\n\n/* @end */\n/* @group Multi Chosen */\n.chosen-container-multi .chosen-choices {\n  position: relative;\n  overflow: hidden;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  height: auto !important;\n  height: 1%;\n  border: 1px solid #aaa;\n  background-color: #fff;\n  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));\n  background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);\n  background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);\n  background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);\n  background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);\n  cursor: text;\n}\n.chosen-container-multi .chosen-choices li {\n  float: left;\n  list-style: none;\n}\n.chosen-container-multi .chosen-choices li.search-field {\n  margin: 0;\n  padding: 0;\n  white-space: nowrap;\n}\n.chosen-container-multi .chosen-choices li.search-field input[type=\"text\"] {\n  margin: 1px 0;\n  padding: 5px;\n  height: 15px;\n  outline: 0;\n  border: 0 !important;\n  background: transparent !important;\n  box-shadow: none;\n  color: #666;\n  font-size: 100%;\n  font-family: sans-serif;\n  line-height: normal;\n  border-radius: 0;\n}\n.chosen-container-multi .chosen-choices li.search-field .default {\n  color: #999;\n}\n.chosen-container-multi .chosen-choices li.search-choice {\n  position: relative;\n  margin: 3px 0 3px 5px;\n  padding: 3px 20px 3px 5px;\n  border: 1px solid #aaa;\n  border-radius: 3px;\n  background-color: #e4e4e4;\n  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));\n  background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);\n  background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);\n  background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);\n  background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);\n  background-clip: padding-box;\n  box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);\n  color: #333;\n  line-height: 13px;\n  cursor: default;\n}\n.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {\n  position: absolute;\n  top: 4px;\n  right: 3px;\n  display: block;\n  width: 12px;\n  height: 12px;\n  background: url('../images/chosen/chosen-sprite.png') -42px 1px no-repeat;\n  font-size: 1px;\n}\n.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {\n  background-position: -42px -10px;\n}\n.chosen-container-multi .chosen-choices li.search-choice-disabled {\n  padding-right: 5px;\n  border: 1px solid #ccc;\n  background-color: #e4e4e4;\n  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));\n  background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);\n  background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);\n  background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);\n  background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);\n  color: #666;\n}\n.chosen-container-multi .chosen-choices li.search-choice-focus {\n  background: #d4d4d4;\n}\n.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {\n  background-position: -42px -10px;\n}\n.chosen-container-multi .chosen-results {\n  margin: 0;\n  padding: 0;\n}\n.chosen-container-multi .chosen-drop .result-selected {\n  display: list-item;\n  color: #ccc;\n  cursor: default;\n}\n\n/* @end */\n/* @group Active  */\n.chosen-container-active .chosen-single {\n  border: 1px solid #5897fb;\n  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);\n}\n.chosen-container-active.chosen-with-drop .chosen-single {\n  border: 1px solid #aaa;\n  -moz-border-radius-bottomright: 0;\n  border-bottom-right-radius: 0;\n  -moz-border-radius-bottomleft: 0;\n  border-bottom-left-radius: 0;\n  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));\n  background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);\n  background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);\n  background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);\n  background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);\n  box-shadow: 0 1px 0 #fff inset;\n}\n.chosen-container-active.chosen-with-drop .chosen-single div {\n  border-left: none;\n  background: transparent;\n}\n.chosen-container-active.chosen-with-drop .chosen-single div b {\n  background-position: -18px 2px;\n}\n.chosen-container-active .chosen-choices {\n  border: 1px solid #5897fb;\n  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);\n}\n.chosen-container-active .chosen-choices li.search-field input[type=\"text\"] {\n  color: #111 !important;\n}\n\n/* @end */\n/* @group Disabled Support */\n.chosen-disabled {\n  opacity: 0.5 !important;\n  cursor: default;\n}\n.chosen-disabled .chosen-single {\n  cursor: default;\n}\n.chosen-disabled .chosen-choices .search-choice .search-choice-close {\n  cursor: default;\n}\n\n/* @end */\n/* @group Right to Left */\n.chosen-rtl {\n  text-align: right;\n}\n.chosen-rtl .chosen-single {\n  overflow: visible;\n  padding: 0 8px 0 0;\n}\n.chosen-rtl .chosen-single span {\n  margin-right: 0;\n  margin-left: 26px;\n  direction: rtl;\n}\n.chosen-rtl .chosen-single-with-deselect span {\n  margin-left: 38px;\n}\n.chosen-rtl .chosen-single div {\n  right: auto;\n  left: 3px;\n}\n.chosen-rtl .chosen-single abbr {\n  right: auto;\n  left: 26px;\n}\n.chosen-rtl .chosen-choices li {\n  float: right;\n}\n.chosen-rtl .chosen-choices li.search-field input[type=\"text\"] {\n  direction: rtl;\n}\n.chosen-rtl .chosen-choices li.search-choice {\n  margin: 3px 5px 3px 0;\n  padding: 3px 5px 3px 19px;\n}\n.chosen-rtl .chosen-choices li.search-choice .search-choice-close {\n  right: auto;\n  left: 4px;\n}\n.chosen-rtl.chosen-container-single-nosearch .chosen-search,\n.chosen-rtl .chosen-drop {\n  left: 9999px;\n}\n.chosen-rtl.chosen-container-single .chosen-results {\n  margin: 0 0 4px 4px;\n  padding: 0 4px 0 0;\n}\n.chosen-rtl .chosen-results li.group-option {\n  padding-right: 15px;\n  padding-left: 0;\n}\n.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {\n  border-right: none;\n}\n.chosen-rtl .chosen-search input[type=\"text\"] {\n  padding: 4px 5px 4px 20px;\n  background: white url('../images/chosen/chosen-sprite.png') no-repeat -30px -20px;\n  background: url('../images/chosen/chosen-sprite.png') no-repeat -30px -20px;\n  direction: rtl;\n}\n.chosen-rtl.chosen-container-single .chosen-single div b {\n  background-position: 6px 2px;\n}\n.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {\n  background-position: -12px 2px;\n}\n\n/* @end */\n/* @group Retina compatibility */\n@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {\n  .chosen-rtl .chosen-search input[type=\"text\"],\n  .chosen-container-single .chosen-single abbr,\n  .chosen-container-single .chosen-single div b,\n  .chosen-container-single .chosen-search input[type=\"text\"],\n  .chosen-container-multi .chosen-choices .search-choice .search-choice-close,\n  .chosen-container .chosen-results-scroll-down span,\n  .chosen-container .chosen-results-scroll-up span {\n\tbackground-image: url('../images/chosen/chosen-sprite@2x.png') !important;\n\tbackground-size: 52px 37px !important;\n\tbackground-repeat: no-repeat !important;\n  }\n}\n/* @end */\n"
  },
  {
    "path": "assets/css/customize.css",
    "content": "#available-widgets [class*=sp_] .widget-title:before {\n\tfont-family: 'sportspress';\n}\n#available-widgets [class*=sp_countdown] .widget-title:before {\n\tcontent: \"\\f469\";\n}\n#available-widgets [class*=sp_event_calendar] .widget-title:before,\n#available-widgets [class*=sp_event_list] .widget-title:before {\n\tcontent: \"\\f145\";\n}\n#available-widgets [class*=sp_league_table] .widget-title:before {\n\tcontent: \"\\f334\";\n}\n#available-widgets [class*=sp_player_list] .widget-title:before,\n#available-widgets [class*=sp_player_gallery] .widget-title:before {\n\tcontent: \"\\f307\";\n}\n#available-widgets [class*=sp_countdown] .widget-title:before {\n\tcontent: \"\\f469\";\n}\n"
  },
  {
    "path": "assets/css/dashboard.css",
    "content": "/* SportsPress dashboard styles */\n\n#sportspress_dashboard_status .inside {\n\tpadding: 0;\n\tmargin: 0;\n}\n\n\n#dashboard_right_now .sp_event-count a:before,\n#dashboard_right_now .sp_event-count span:before,\n#dashboard_right_now .sp_team-count a:before,\n#dashboard_right_now .sp_team-count span:before,\n#dashboard_right_now .sp_player-count a:before,\n#dashboard_right_now .sp_player-count span:before,\n#dashboard_right_now .sp_staff-count a:before,\n#dashboard_right_now .sp_staff-count span:before,\n#dashboard_right_now .sp_official-count a:before,\n#dashboard_right_now .sp_official-count span:before {\n\tfont-family: 'sportspress';\n}\n\n#dashboard_right_now .sp_event-count a:before,\n#dashboard_right_now .sp_event-count span:before {\n\tcontent: \"\\f145\";\n}\n\n#dashboard_right_now .sp_team-count a:before,\n#dashboard_right_now .sp_team-count span:before {\n\tcontent: \"\\f334\";\n}\n\n#dashboard_right_now .sp_player-count a:before,\n#dashboard_right_now .sp_player-count span:before {\n\tcontent: \"\\f307\";\n}\n\n#dashboard_right_now .sp_staff-count a:before,\n#dashboard_right_now .sp_staff-count span:before {\n\tcontent: \"\\f338\";\n}\n\n#dashboard_right_now .sp_official-count a:before,\n#dashboard_right_now .sp_official-count span:before {\n\tcontent: \"\\f227\";\n}\n\n#sportspress_dashboard_status .sp_status_list {\n\toverflow: hidden;\n\tmargin: 0;\n}\n\n#sportspress_dashboard_status .sp_status_list li {\n\twidth: 50%;\n\tfloat: left;\n\tpadding: 0;\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n\tmargin: 0;\n\tcolor: #aaa;\n}\n\n#sportspress_dashboard_status .sp_status_list li.countdown {\n\twidth: 100%;\n\tborder-bottom: 1px solid #ececec;\n}\n\n#sportspress_dashboard_status .sp_status_list li.events-scheduled {\n\tborder-right: 1px solid #ececec;\n}\n\n#sportspress_dashboard_status .sp_status_list li a {\n\tdisplay: block;\n\tcolor: #aaa;\n\tpadding: 9px 12px;\n\t-webkit-transition: all ease .5s;\n\tposition: relative;\n\tfont-size: 12px;\n}\n\n#sportspress_dashboard_status .sp_status_list li a:before {\n\tfont-family: sportspress, dashicons;\n\tspeak: none;\n\tfont-weight: 400;\n\tfont-variant: normal;\n\ttext-transform: none;\n\t-webkit-font-smoothing: antialiased;\n\tmargin: 0;\n\ttext-indent: 0;\n\ttop: 0;\n\tleft: 0;\n\theight: 100%;\n\ttext-align: center;\n\tcontent: \"\\f145\";\n\tfont-size: 2em;\n\tposition: relative;\n\twidth: auto;\n\tline-height: 1.2em;\n\tcolor: #464646;\n\tfloat: left;\n\tmargin-right: 12px;\n\tmargin-bottom: 12px;\n}\n\n#sportspress_dashboard_status .sp_status_list li.countdown a:before {\n\tcontent: \"\\f469\";\n}\n\n#sportspress_dashboard_status .sp_status_list li.events-scheduled a:before,\n#sportspress_dashboard_status .sp_status_list li.events-published a:before {\n\tcolor: #999;\n\tfont-size: 2.5em;\n\tline-height: 1em;\n\tmargin-left: -3px;\n\tmargin-right: 9px;\n}\n\n#sportspress_dashboard_status .sp_status_list li.events-scheduled a:before {\n\tcolor: #f9af4b;\n}\n\n#sportspress_dashboard_status .sp_status_list li.events-published a:before {\n\tcolor: #00a69c;\n}\n\n#sportspress_dashboard_status .sp_status_list li strong {\n\tfont-size: 18px;\n\tline-height: 1.2em;\n\tfont-weight: 400;\n\tdisplay: block;\n\tcolor: #21759b;\n}\n\n#sportspress_dashboard_status .sp_status_list li a:hover,\n#sportspress_dashboard_status .sp_status_list li a:hover strong,\n#sportspress_dashboard_status .sp_status_list li a:hover:before {\n\tcolor: #2ea2cc;\n}\n"
  },
  {
    "path": "assets/css/datepicker.css",
    "content": "/*!\njQuery UI Datepicker Skins for WordPress\nDeveloped for the WordPress Community by the Superheroes X-Team.\n\nUpdated on 2014-08-20\nFull source at https://github.com/x-team/wp-jquery-ui-datepicker-skins\n\nReleased under the GPLv2\n*/\n/* Date Picker Default Styles */\n.ui-datepicker {\n\tpadding: 0;\n\tborder: 1px solid #ddd;\n\t-webkit-border-radius: 0;\n\t-moz-border-radius: 0;\n\tborder-radius: 0;\n}\n.ui-datepicker * {\n\tpadding: 0;\n\tfont-family: \"Open Sans\", sans-serif;\n\t-webkit-border-radius: 0;\n\t-moz-border-radius: 0;\n\tborder-radius: 0;\n}\n.ui-datepicker table {\n\tfont-size: 13px;\n\tmargin: 0;\n}\n.ui-datepicker .ui-datepicker-header {\n\tborder: none;\n\tbackground: #222;\n\tcolor: #fff;\n\tfont-weight: normal;\n}\n.ui-datepicker .ui-datepicker-header .ui-state-hover {\n\tbackground: #222;\n\tborder-color: transparent;\n\tcursor: pointer;\n\t-webkit-border-radius: 0;\n\t-moz-border-radius: 0;\n\tborder-radius: 0;\n}\n.ui-datepicker thead {\n\tbackground: #222;\n\tcolor: #fff;\n}\n.ui-datepicker .ui-datepicker-title {\n\tmargin-top: .4em;\n\tmargin-bottom: .3em;\n\tcolor: #fff;\n\tfont-size: 14px;\n}\n.ui-datepicker .ui-datepicker-prev-hover,\n.ui-datepicker .ui-datepicker-next-hover,\n.ui-datepicker .ui-datepicker-next,\n.ui-datepicker .ui-datepicker-prev {\n\theight: 1em;\n\ttop: .9em;\n\tborder: none;\n}\n.ui-datepicker .ui-datepicker-prev-hover {\n\tleft: 2px;\n}\n.ui-datepicker .ui-datepicker-next-hover {\n\tright: 2px;\n}\n.ui-datepicker .ui-datepicker-next span,\n.ui-datepicker .ui-datepicker-prev span {\n\tbackground-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAAAEgAAABIAEbJaz4AABe4SURBVHja7V1diCXHdf56vbZmVl6nxwKFO2yyq1mM4qAwM7oDsR6C7iYIKesH3V1QHgyBu5YYJwHjrB9NQCuByIthHbAga6TZxeBgHMJKISZ+SDIb1oQgRtoVgtjGyD8PmSGQMIpfJmCLk4f+q6o+daq6+965P1VfM3Pv7VN16ud8Vd1dp6o6IUSEjBPTzkDEdBEJEDgiAXT0QOhNOxPHiUgAFT3sA9gPiQLjJsD0208Pbe9rM/OvwkaBQvP0yzhG6ASQO0AqDwmu9mOPT3nqPWsYV9qFEduVIDP/QU4BSfMC9REqAcbRAa520FDELdphc3SJCyRIcADgAAkSQXOXMs4ckrIxFEUs2oENBNSqR0WmJ2kVv2hltvRdaVPHvPtqdpVxjlD1AHIH6AupDbovH1nqkgllLd3apnQJUjV362dmDEnjOya5FUltsEqqbdtxa5Dbppx3uQ+sNLv6mblCcwLIoKlXTQ/7rQkmX4IKzdMv4xgxbgLMO3rYXyTzuhEJEDjiSGDgiAQIHJEAgSMSIHBEAgSOSIDAEQkQOOJ8ADPutPN/zGgyH8BvRoDLGdMT5wPIKbjN02U+gNsdnuV9oUjSbD6AnwdMrkK7gVYt3311u8zv0r5vfNq1L8xsgPp8gAz20fAilORvs8tdsX3mA0i5k1N3x5dBue7icyGgzwfgvus48OoF+DDu9ukzH0Bqf355s9OHnLMNmqQ0F2jjDJIcrrM+H0Ail6v/KUoe3cECpl85XecDTDv/x4zoDg4ccSAocEQCBI5IgMARCRA4IgECRyRA4IgECBwnp52BmQNNcZS/+1hp4/yf7BZ9IpUwzRyQMwftXUHumFMouX4JIED09fvsD0AtJE3RNg1X/jPTJ6IWNznaxvYrgU+oBnFPaAFcxU88CmCPn3hUkE8RSHD2+OQvEWT6Z7M0Com7BuQSygQiR2zA1Yi1/KuXAN/i22bruCspGUMHT6In0nUV7ZIDKmMnrFRNnUulaF72PJAgl3VXpZObgZrLBGh6E0gerccVyoed7dq4n3ETD+2SgXz0tq0BqQn66HbXQU3e5DGw6uJ8QvEyuQt0M1jW4epi/bpoVwtype5zE9kWboq75VoOTHdw6E8B851+i8fIOB8gcMSRwMARCRA4IgECRyRA4IgECByRAIEjEiBw6ItDi81Spwf3fuCThE8N+HhE28VzrY32TaURKgIUC6N8tntvVwHjQztdrpz71YC01Wzljes1jp35KYvDXoZe6xogI5cA+MWh8hJOH492jzk3PgrYdPltDWHPv18N2NLoGctre41iVyVw9UDdlqbXFujqQ8E+26m7lmDbFoj6zaRx58Cmx72FuzvnfhvS8z63umkTQ+5aWF4Zh1ufSJpm2WFsc1gn9TBNCeBfAUmDuH45kKvQJ3332n57+q7YLgK460A2oJsAMoEsBGj2FFBVQBuPVaLo4LWT9iml3wZVvtveQ0ipr+bS4grO7yAgpV/E5O8BXJqrvRuk9c1mLhvOB5AqQL+BkYovZ04qoqRDLZp72hdnAjcBpRIcGBtIHDTW4AfJvAfla2/8commlwA/XzU5t4iQr4JdYvtVL18Ov2tw9yltkp72L7Vx3wOwiPMBVPScb0xaOEQCBI44FBw4IgECRyRA4IgECByRAIEjEmDcmLPHKnM+gAuSv8qn6L2O/u5Jo3vuEsdg94yVvT4fQILkMfcZJSw8dqseC0zt6Lq4Sl4enjiXv7oNbIsvaZ8SqoEgNVvu3X7rg43q0sh2b//2HWgGJI+dK3ZiDaeetXk7pcWj5CX1L+mxgL8HsE06kP1V1aWhzaSFrOW4p03Z9zAg+Pr6kgZnuXS59N0rm2cS5vsCqips+gZu8xKSNIhbSP2WQLsXb7ffQkIyo6uH8Ncs7RFwzKh6ANVR2CZrrjcJuJ2tXa+OidKD8D2E/smFGE8r5lLQe48ZMb9+CTgoM8V14FkHn0334nEgzgfw8fa7t4eQUc0F4KdUyFVfXYTsu4sUIZOGUjVE2wk1EwHvDSRrB+7jLLXdBI7D2eo3a7HtjabPTSQAB0Fnxrg+iO5gHTPTNR8XIgECRxwKDhyRAIEjEiBwRAIEjkiAwDF7BEhny1u26DAJ4OfLllw25CW1hUhxeCxP4tPeB2Fm0Gy7eJ/tpBOsdMjPIQqSpGK4tlvWV1igN4B3gU4AeZRaHu0uWnWKQ5YCVA6U8mv3sq5/pQxxaIlffGu3qbra+/i9an7BURFA3+69jsofbtsyPUGSm/8DNi25a8+6/g+wIqydLVLn09dnFJha/LaPCA7FULDf6nYJxVwbm/nNuThmL+L6LZ2tS8xw5vYR0lvOg4I6JSxB3Uwm7FMZ/CZE2CeVmQSyTcngc+jaPkEn+IK9Ar4LqhdGqFVm32DE/dYL39dK2OQZBah2H1E4gvld+fX8+Lw2IgIAtz+A38r1ul/evUONJM1uHuUQurbE61wB9w5CgcL/hRH6rNjq+7hhv4voBv/tI4LCrM0HmJT5IyyYNQJEHDNmzxcQcayIBAgckQCBIxIgcCwSAfqlJ6A/Ef0nsZQfzd63OtPICDDMK24Xw9aaXnZ4+l0g3NBmCzQ1Yh975fc9Nna/Ez1O4ld4FEc4wqP4FUuBvjP3a7l0zZKGXe6KCTxnHHIKxtwOoqs0oAENSUUVtjo/JFgOKj+3tbhqCF57doyor8lHmrRPJvqN5HoOudytGfHXDPkSrRPREi0R0TotCTXAp1GHVEP+EjXEtncZyxAFk+8BAO5YJnPcxpdxD0CK2+W5O7hgZeMXLCOKy+W3o5rsJr4htL89ZBtLZNgHYU9LYQ9bSg8AbBlyN95Xcpfl0Ix/H8t4EEAf942wej6BLUbim5suL5+XsYb3y++lpoIA9/NPdRqGmuV7AH6EI3G2z1L+ecMa4qNC7Ct4D9uC/JLmSr6kUDHD2woFtvC2ISWoizP5FYYfxS/K759g8/AgPoEEp4RcXhRkpkeSl/MvoE4YLc0IXpj/D/DP6unqWnboUPAjHNXC6FnICLAiaLO1G8DVAwBvlRQgXMJbTIiCAnXzZ0iNz3rufl3M6Qb+G38I4B+xwcZ/GygpxOdgK++p9N7qOFCY/4+wrFPA936WM3+9AgG5o8razk9ZmasHKCgAi/mRpw7rTd5549PEEn6efzvLSB/Eu9jAfQAbeBcP4f8MuTkLqe0yU3dH7wrxOfxN7Vxm/i/gQQD/AADFBdz/MbBufrOAp3AKp7CMU9ZO8gE8gAcAcC3spsP8QA9v4RIu4S3LdM4+DjDEEAct7/OX8Vv5sVzLXw9nQPgFNrCBEyCcEaeUblmMf075s2EJLrhCfIs5l5H+Bj6G7wAALuBOJmj/RFsv4rIzzg+FkK4eoIcDIG/7B0z19zU5R4HfMD7NKspayQayOyK9n3gY9wH8pPx9HxvCjKIuHfxRxxD8hNmf5OXL7s9K86N8DEwdj1HuR5iXNfnL1scV+2PMjQk+BhYPSdWnLRd95hGQe4hzPeg1fQwGjayl9wmhlpDXXzwEDtSzs+MO7gP4HeX3e5YbqcmCAJxXWvr4tWeYztSUNbyvtX7E+QDBY5F8AREtEAkQOCIBAkckQOCIBFgsvIJXmkXQCZCC4FqYbQeVjoyujxZ9cB71LeXxte5vGxqPvUNDvm3IuUEn1Vu+NgE5APylo34GGLSut9P4Cr6C045QI4wwKn8pdZISUZ/6RJTWBhF2aSkfRrhG6zRkh0Fu5AMR23TDkMuebPPos+G3FE82EdEWOxBSHPX47oGcLMw6rdP6hORFmGxQx5QMqBiQS83hmtw6RNuEvHQpo/suERHdFWu3GEwa0TkCQU+gn4+h1dUT9RqNg3FyENGf5X9XrRXUp2wCSt+iH5YUXAYmAv07ge4R6N+InzJBtJ5L1gU5RPlpWqLTFnlR/SMaNa7BAtusfLsWe5tNf0hEI0qrkUTVHVw4Kfew1WqjFnWuAO85fAL7+DF+gJ/jPYtPsI89XMIbVpduF/wTfhffwwa+hyfwL9ZQ2Vj6hijXxyx1/LLmJ6wwwk0AyP/X6+9Q+8WDn21x1uMMAHwJwEp+eUzxAcoe4IYxmt6nG417ALWDs/UAV4noL4joFbaF9InY1j+uHuBvCfRdAn2Llpj0H3X0AIUcotzeA4y03JmXgIGS6wyDRuX7qib7KlOD5+hcPXUziX5OhHr1j4MAn6HfpM/R+fyvifn1WXE2AqRElFKaXy9N+XeI6Nv539/V5EX5bNfwSv64Q87Hr6692XG+IQFMd10q1JDsatLOmwrUT122RENCyaEBE0ImQN1f18T8ZvFkAvDys/Rdeph26WH6e/q0IV+t5W5trPLK/LAeuolTUW6T3s1vBE35iIpr/25bAsBxUJ6N1DM8b+C+Vb5lVDD3FJCWRecJYidghsccuesih8P8Pi73ggIpI3uKPsxv/LbpQ3qKIcBVGtXj+ibvNqh+H8rfg0qTlmXzmxTYqkld07plORFRz2GcLvKR0/yux8CKAqkl9nPl9+dqsa09kK87eB3v+gWM6IgBoHvsx4QRAOCWeTrOBwgc0RcQOCIBAkckQOCIBAgc4REgcxsPGMmgfDZ61EOPbTfFOburVgmwXlbAemt9NLUqSEHYyb/vwDar4Vq+qHS3RoHfxy4u4zI+hU/hh/h0LWZWO1fzX9mepeq+55v4LAhP4AkQPovNWnx5+4ph7cF+6JC7QgxraRgjQObZdSLapSEN6ZAqpwc34CENZpAzRPtjlOdrnR1UybBDoB1rLorhkHPsUNep8vgYOxa6Q8M8B5meAZO+fRyv8FKklmEw+UwVO7XoycYa+7k3B0z51BjrxXc1QDZKvENEh1YjTpMAxVgWn0Zh9uqzruGaONZ5gj5CCSX0ETrBGmRIIKJB6dPncicTQPWHmCuXMm9Iv6zjOgGgzaKoEyDTul2OyXIEOEOr+cEQYJhX4w4748dFAHJWgdu4cvx1Rcb1UDuKnDN/KuonSspjjUn9eh5rlx9SpWz3kOLgCWBPn8oZV7wGKn2cQwKdYwkAhQB8n7JOm7RZ+isZAuzkVcdP+XIxXA7RTMoTyOVTk1p/NeMpw8CQf5uI1vKD6DqjYVC6bLn0iU53IsBD+dmHyv9m7KL/GhLROUsPYK+/PhGdoTO0Smdok4iuZefV9wV8gBQ38fn8FknecR9OubSbuFvKpbBe7mOSrdE38U38cfn9+/g9TZYqM56AK/UxcazjS8qvl/EzIfWslszyrwD4EADwS2aDGcKKNs/KfMHFI9p5ws8MuT5f6Ca+bMzayrbwzybL7jHb+RMeB/BfAID/VGpX62APaUhD2qXZvAksWh+fxjfL1p/hrhG3n7f71Kp/s2w759jUd+gqUd4Odxh59vmQ5UbPnGhjtt/H6DHjv9x/NL8HGFKfNmmTNolos34JUK+xNvPP/lPAXSrmxnLVM3CksEPbtM1Op0IeO6MQRwESfpln12ohhrUOfGjEPFc7mt0DEA3Lw0IA31Y4LQLIR6q0+rtkes2z1uFTOlv+s57lkFIqbieTWtzP02eoJ9QSEZT7DF22lD8FZP/NbejqBDEpMhSlaum0MkZ3sIqH8BKAF/E/rHSEFdzM32aQ4n/xa9qbDVz3SIC+meUk5j23QCRA4AjPFxChIRIgcEQCBA6TAEPrfuEXcau8obwlbokaMU/QHhRuExHRbeYB5ou1h5AvTuVhLx5jPtQfz5TGfcYIdlF7eixwkVG4R0R71uR+6jkgA48Qx3/sKfTfm3puJkCA21T4nMw+4DWWAK8xCuWBoNowhNX8HEncy6tcIVxyor1yuGiPlfvlf46O6uszmoH1PsCGpgQAgV24WTd/vZ9Q19byBnSFGBHR07RET1s1+JVuQQmQXf8Lr7PeB+gFl6phm2zLwlTz7zKSQfnJXyZcxkFu+DQnAid/Ov/2tKBhT0hjgQkwIBOqAfwJwHfeuqZ7jEeuiGczvy8BUrL3MVSOsNf99RXsBOgT0R7t0R75+BXm5DArwPzelACuozBS3fyZ2W3mn4UeYIFvAqv2nyp+58oMX2cJ8HVGoasHsB1qD8THn/49gJuCc3hwRasX8ilW+hSj0FU5dqnU+nUDj1qH6PoUkIWZutHGT4A91sBqFTxfkz5vNeNASFCiR9ve43iPBSOAvzv4SQzx5/n3r+EN/Ou0xzCnhLbvAppRxPkAgSN6AwNHJEDgiAQIHJEAgSMSIHBEApgYgFpL5xAqAYjZNkEHYVyvhJgWbgjvNgeAAXZbS+cTxigd0a4wGqd6A0xJES+1ahjQbu4IGtCuoAGEfHmTLt/WNLVx1w4cg80Dj9hFDdi1zNXBV5/NhBIB1Hj1ah6UcQb5CntZg50Atvg+BJCksqOnLl2QIWFbIflpHS4CZCasfutSEErjuTTYCGCP7yZAUxPbpfwGDHN58DeBd3AB32hxPbmDC7iAbJ3cBWXMPFHOXhB3wi002OCKfzxYJG9AjeWLfA/gOgK8B1CdQYQ7eElsX5Szv/icL6hPLrbcZ/f57aRziegNNDHArmBiWTqHiAQIHHEkMHBEAgSOSIDAEQkQOCIBAodJAFJeLB4RACoCpPlWqWdx1rLXfjZ0dM0ijZhLFARIcVhuDvMIDlkjb+ACvoYXcejxQglzeGHbGIHcPmZ5hA15je0Q0V8RiOhFyvbFtY0ep+JewtWovOt3/1jl8bAchVGJ7hEI9CINCHSPbG+n3qFzlDllU6tSfqfapXw79dP5n7nT7WmSNlwv5CTKl8q/pdYOocCOkwCA8wDeBAC8BAB4Exs4X9vKdAObuIkreASXcIgruN6oq/mk0ukkqI9Afzz/S8Avvzqd/30S/ObyHwewkstXFmu8fpLIfAEpDnFfedHRPWxgRdsJt0CKQ9zBBezgClvJlO9UX9+t/re13/9h7JU7aXmEDXlXsEvVoukR8Zu4ZL7w7H0VtpfK2ObL6O8Wr883mrQ8Hpaj8AZm78O4jzfxLDbAv5Gjmg1wAWDcomrrX7A1tIuLyh28jmv5g+AbuBZfFh8K4nyAwBF9AYEjEiBwRAIEjkiAwFERwPU+gK7yJ3G9lF/Hk8cun3T5pi1vi1yn630AXeWubeYmLZ90+aYtb31kHxeJQ/U+gK5y10aTk5ZPunzTlnc4skvA5bJDSJQRvMvMNxWm/IU8boIXDPmzin4wZ5/l1FvkSYv4l9n4XPlc5Vfz3zz+20iUELb4klzNBW+VhsgGgqrRoKT2S5dzGSnkCYDnAbyunRmffp/4bv1qiKbxE/ALzKjBb1K01OV/AgD4a2v9FWc38Q7GskhNJYD+Lup6Blxy4AW8DuB5vCZWsK2C3PoTVpuvAdz6ZQJ0r5+kPN9O/jjeUcw/FgKc7K5CwYfK/+YgZ48gQ12O3kZDony2iU8ecV1usj8VZI/jnmb+sWDcl4ARgFtofwno3sXb81fX0K4Ll/T79SCuHsqW/uO4p5l/DD1AdhP4Kit7lfkmyZ8HcBM382+q/HUlFjFnX1ekLjlEOVi5nn+qnX1Vk7jkbeunKB+1lr+jmZ9PtSmCeAyb9mPopOWdxwEWfyBm2gNRk5Z3JgDoSbpeKr9OT9aCdpVfpFul/BYziDFp+aTLN215yyNOCAkc0RsYOCIBAkckQOCIBAgckQCBIxIgcKjOoLrTUcesyyNaQPcGLpffjtjQXeURM4f6JaCb6Y6cGrq13KSzhggNJgFcBjzCkShfxpHSD9ThMqA6JYoDtfT1R1hgEmAZEA24jGVRfoRlkSAEecJE7qGwIq47HjPql4DlFlr02LKGbu3XRaCIhtDfF6BJamFnXR7RAtEbGDjiQFDgiAQIHJEAgSMSIHBEAgSOSIDAMb8E6MUBoXFAJ0D3cTZCH4T+xPPdwz5WJ55KANAJsJr/TRuu1p2Z/2Da2VwE6ATYz/+mC1frjuYfI3x7AEKv9tcMzKokFpl57TQszB/vAcYCfUbQPhLss26WhPlrhi2vUIX5V0X5QbwHGBd0Akg9wGppmuKvWSe8VztTJ1FP0c9RTDd/vAiMAbPUA0TzTwG+PUB3uN/f0cz8PUu4iEbw7QGOA1Lvwpk/3gOMAfqEkB4O0JvJzpXyTt/8jOiIOCMocMyvLyBiLPh/gj9Qphd3t8gAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTMtMDItMDFUMDU6MzM6MTAtMDg6MDApYMCSAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDEzLTAyLTAxVDA1OjMzOjEwLTA4OjAwWD14LgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=');\n\tbackground-position: -32px 0;\n\tmargin-top: 0;\n\ttop: 0;\n\tfont-weight: normal;\n}\n.ui-datepicker .ui-datepicker-prev span {\n\tbackground-position: -96px 0;\n}\n.ui-datepicker th {\n\tpadding: 0.75em 0;\n\tcolor: #fff;\n\tfont-weight: normal;\n\tborder: none;\n\tborder-top: 1px solid #333;\n}\n.ui-datepicker td {\n\tbackground: #f1f1f1;\n\tborder: none;\n\tpadding: 0;\n}\n.ui-datepicker td .ui-state-default {\n\tbackground: transparent;\n\tborder: none;\n\ttext-align: center;\n\tpadding: .5em;\n\tmargin: 0;\n\tfont-weight: normal;\n\tcolor: #333;\n}\n.ui-datepicker td .ui-state-active,\n.ui-datepicker td .ui-state-hover {\n\tbackground: #0074a2;\n\tcolor: #fff;\n}\n.ui-datepicker td.ui-state-disabled,\n.ui-datepicker td.ui-state-disabled .ui-state-default {\n\topacity: 1;\n\tcolor: #999;\n}\n/* Other Datepicker Color Schemes */\n/* Blue */\n.admin-color-blue .ui-datepicker .ui-datepicker-header,\n.admin-color-blue .ui-datepicker .ui-datepicker-header .ui-state-hover,\n.admin-color-blue .ui-datepicker thead {\n\tbackground: #4796b3;\n}\n.admin-color-blue .ui-datepicker th {\n\tborder-color: #52accc;\n}\n.admin-color-blue .ui-datepicker td .ui-state-active,\n.admin-color-blue .ui-datepicker td .ui-state-hover {\n\tbackground: #096484;\n}\n/* Coffee */\n.admin-color-coffee .ui-datepicker .ui-datepicker-header,\n.admin-color-coffee .ui-datepicker .ui-datepicker-header .ui-state-hover,\n.admin-color-coffee .ui-datepicker thead {\n\tbackground: #46403c;\n}\n.admin-color-coffee .ui-datepicker th {\n\tborder-color: #59524c;\n}\n.admin-color-coffee .ui-datepicker td .ui-state-active,\n.admin-color-coffee .ui-datepicker td .ui-state-hover {\n\tbackground: #c7a589;\n}\n/* Ectoplasm */\n.admin-color-ectoplasm .ui-datepicker .ui-datepicker-header,\n.admin-color-ectoplasm .ui-datepicker .ui-datepicker-header .ui-state-hover,\n.admin-color-ectoplasm .ui-datepicker thead {\n\tbackground: #413256;\n}\n.admin-color-ectoplasm .ui-datepicker th {\n\tborder-color: #523f6d;\n}\n.admin-color-ectoplasm .ui-datepicker td .ui-state-active,\n.admin-color-ectoplasm .ui-datepicker td .ui-state-hover {\n\tbackground: #a3b745;\n}\n/* Midnight */\n.admin-color-midnight .ui-datepicker .ui-datepicker-header,\n.admin-color-midnight .ui-datepicker .ui-datepicker-header .ui-state-hover,\n.admin-color-midnight .ui-datepicker thead {\n\tbackground: #26292c;\n}\n.admin-color-midnight .ui-datepicker th {\n\tborder-color: #363b3f;\n}\n.admin-color-midnight .ui-datepicker td .ui-state-active,\n.admin-color-midnight .ui-datepicker td .ui-state-hover {\n\tbackground: #e14d43;\n}\n/* Ocean */\n.admin-color-ocean .ui-datepicker .ui-datepicker-header,\n.admin-color-ocean .ui-datepicker .ui-datepicker-header .ui-state-hover,\n.admin-color-ocean .ui-datepicker thead {\n\tbackground: #627c83;\n}\n.admin-color-ocean .ui-datepicker th {\n\tborder-color: #738e96;\n}\n.admin-color-ocean .ui-datepicker td .ui-state-active,\n.admin-color-ocean .ui-datepicker td .ui-state-hover {\n\tbackground: #9ebaa0;\n}\n/* Sunrise */\n.admin-color-sunrise .ui-datepicker .ui-datepicker-header,\n.admin-color-sunrise .ui-datepicker .ui-datepicker-header .ui-state-hover,\n.admin-color-sunrise .ui-datepicker thead {\n\tbackground: #be3631;\n}\n.admin-color-sunrise .ui-datepicker th {\n\tborder-color: #cf4944;\n}\n.admin-color-sunrise .ui-datepicker td .ui-state-active,\n.admin-color-sunrise .ui-datepicker td .ui-state-hover {\n\tbackground: #dd823b;\n}\n/* Light */\n.admin-color-light .ui-datepicker .ui-datepicker-header,\n.admin-color-light .ui-datepicker .ui-datepicker-header .ui-state-hover,\n.admin-color-light .ui-datepicker thead {\n\tbackground: #e5e5e5;\n}\n.admin-color-light .ui-datepicker td {\n\tbackground: #fff;\n}\n.admin-color-light .ui-datepicker .ui-datepicker-next span,\n.admin-color-light .ui-datepicker .ui-datepicker-prev span {\n\tbackground-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAYAAADvl7rLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMUIxRjI2RjhCODYxMUUzQTEyNERCMDU1QzdBQ0EyMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMUIxRjI3MDhCODYxMUUzQTEyNERCMDU1QzdBQ0EyMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjExQjFGMjZEOEI4NjExRTNBMTI0REIwNTVDN0FDQTIwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjExQjFGMjZFOEI4NjExRTNBMTI0REIwNTVDN0FDQTIwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+kKfR4AAAHcRJREFUeNrsXWuMXsdZnuMu4CUN2S0t0a6o4sQqAaooTncrKGrUNbe2qSC2uQqpqtexbCqI0xaQEBclKUL8qts6stqNkuwWiYqbajtqS9oAuyEISrubrLmUFnBSfmRXFa12KT+cKk2GM9mZ7ng858w7l3PmnO88jzQ633e+8565vs+8M9+8MwXnnAEAMEzsQREAAAgAAIABYkx9OHXqFEoDMDFVho0yTJdhE8UxOjhz5gwsAICk/Exep1AkGAK0DY6G93L+eUblnw4gATPNqMceEsBURMVxSwhFbO8TEj838j4V8B6eQHF1RWyzDnTl3zRIIDTNsCJ6RABdMf+mM6XBjNfsDXP1wm2hkEGN+ze1eyFpngYJ9IcAYs0/vQEVkenz7X1SwRZv2xNhqeJNVRcxac5Vj0AAAcSYf13pBVMMPfS8xyhhaFpy9pqhQ6CqNOe0ZgBPAgg1/7rcC8aQQJEx7lzkGzoEqkpz7noEPOcAmhhPxjTGzcA42zR/m0jDZkSPGZPvmCFQVZqh/B3EWMfTV6CKvm2F5LJAQhYCmWlGPYIAAJAPMMQhAAAAIAAAAEAAAACAAAAAAAEAAAACAAAABAAAAAhAA/zI8+wHoMcL772BEkBsA0i1J0CsM0yIAvGa0CZ55doPIIU7uF7uIJKeEUCKBpDS6yumEW4kTPt0S+mOVf7YtG84voekHXsB9IQAUlXeZgMk0JYC2dIe6swS2vBTK79P2mMdmTZayBPQEAGkrLyUJDDdkvLb0h7ryRZCAtOZlD/F8G264TwBDRJAURNYJhLwbcSpepqU+wFs9KDcqhR1OkHa4Q7cQbTlDRjjVRa6H0BuFInKbTqQ0IpE8YYqrl7n8CgcOAHkVKK+I+d+ACj/AQ4BAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAeg1sCw64IJYBFwPNt4li1Mp/DJUPBSAoQUwZ8AwKlCLOQdT5HmLlh1ZCikM6eUsyOXqUJvMRW/660hcRaUlBHDyjEqdsuzxTW+O+BJCi8lOdyRcSf5GoAaWqhJAelCcsvyKB8sQocmzeU7SBWAuorbabmjxqy3+spcrnERkPbUhFR8z3UAVIMQ7NVQbcEneRIO/UvBSW/PuWAw+U54naQJFgCFZVlgV1DiDH2LlI/K5UzNlmL55ScYtEaQ9VoFTpbbsNhHaCqdKdoh045fe0pPxFBiKJnXtIwcAx6SgSpD+VCR3bA8XmPdUkZB+sv9TzGLV135QFUHTgXTl7z5Tx5yzH0PynznvRkTJscx4lZvhHjnesw4XXFRTIP/I/qvFiJSAADBggAAAAAQAAAAIAAAAEAAAACAAAABAAAABDIwB1suvQT3WNXU3YZ6RqA6m8QtuML/Zk6N60P8rhoBs9bABdJZO2G05omadsA0Vg/DZvuKkW4lZyKY7GM9Ocwx14inm6A28Q7zVdCSGVzztKAr7pmkqYh5DyT9kGeIDy1x1QO9Vg3E1YQDmPRXceklt3OGjV91w9H6Ugiw5aAr6706Q42Ti2/FO1gZCdeTYqLBkfIoptBzEWUGia60z/UEvOVZaNTwKGNIC6sVdo5fNMSp9SAXwbQS4yrMt7G+vbiwTtILUV7Itp4r1G5gCaVP62HCtiG38KBs6xFx5FCbpo9VQ1dNv4e7qFdhBjAcWmWcA8Xj3FMe/WuYw9HWwAdZMvoZWfk4FTKUCKrb24R/2lMEFD0rtZU9Z9PCo+9nj1IlDeVZaNEkATPb5vQcb0eKkYOCQdmyy9uedbH6kIkEeUv82nfbPFNKQq981Ew+DQ4V/tMe9jDTJnFzazYJEkkGszkk2WvucqPOOf1sa9PgTYtf0D+riZSGvx4mAQoE0SAjoGLAUGABAAAAAgAAAAQAAAAIAAAAAAAQBAVnAUQfsEkMobLdSjKlWl6/GjIYUpX+6yCz0hCfUeSACpvNFCPapSnYmnxy/eN83SHFLat14s9njwgsUf8JpCgXlLaR88AVR5o/n6NKf2KQ+NX5GJz8KWlCfqhnok8kRxhypwEdgTV3kDxigwi6w7kECCOQDfjQ1iPKpsCt/WxgrcQn4pThj2aYS2k3lTmNJNPEvNrw+BxJ7KDEQQQJ0LYRs+0dNaXLEbK8QoSpHAjCwSKVauHoxnym/Kd6QYjgyKAKq80dpi4VhvuBSurLlNxqLCAuEtNvqu9cQ8sO5SHfM+qCGAbbzssyXSlFFpIRsihO4HkMqVNbbx8wQkEDoOjm30tmGQ7xCCB86rxMjWkQCD8l8NH2/AjcAKjPGlZwHviXFlTWmG6uWQwowtAuOPSXusK23oxjAxsk0ORwZNAG1MIqV6X1dcWYvM70mhwLn86aGwGYcAAAAlBAEAAAACAAAABAAAAAgAAAAQAAAAIIDRxwTD8lFgoASQ0g871LGGJ5T1fYdQ/i02On+HxZ50CwyIAGIP1kzpCDOZqXy2LEQyEamAOWR1bIAEAAoBxKyfjlnPbfbUqhee9FAUcxmpz9l6usk/aXnHlmf85r0YQk1lPW2g6QNVBMAjeyCbPzj3JBSlbLryb0dYH769vpLflnGHnCxr5t0n/3V7ErjSkmo7N2AAGCOY/TygF09hRTCL8ucYi2+zdA41VOWvKjdX+ZvbsBUV9TuNpg/YCMBstFWffUzQWK+0WMSOu32tj7q8u8qhqpenluFGTb4LTfk30fQBGwHUKV0R0fCLSDLIRSCFQQKcMBfBa4ZCrrzUlU8XdtcBBjAH4OqNQhXWd0+8mP34YuQnLbJbWh62CUpW1NwriKQTgqrt3KD4gDcBxI7fQ7elKioCi5APGfPrsqn+hiwSP2cidjs1AEOA6IZYJG7UOREzB5ALmww9PpCIAIYOKBIw2CEAAAAgAAAAQAAAAIAAAAAAAQDNYoZdvZZhpkfpF5PLe42ACeeOE8Aho8Ety3tt4/0szoc/FiKuBVa9l8BMC8q/arm/6hH3TEbyEIr+rTLcXIbLMtws740Fpj8kHzcZsjd55iNEPjZOgV9whJg8XKVLeoWcK8P7yvC0/D4h79lg+3vskOX5w2U475no32dXH8t1kvktB64jDNc75svwL2U4UfH7LWVY81ReHbMR8qsOef250KPNRKO5VPP7/jI84yCA15dhvQzj8p4ggQNl+LIkAuaZfp98VNX9JY82wCxlcIkgFyJj4s/l9aTsiFLWY1FHAExTfoEV5rcCjkog4r0HA5jRlwTGLfcuE+QWy/BgYO+3qhW0uSJPnXa8WpMHpeCrNeSxyppdn3Cpouz0MnTFr5T/Go3Y1h3vrStPlXcKmjiVqm+Hy1aROLextVlxOrY8C1kp/5dlQwldQrvX+L4Q8I7vCIzbZQG4cLiCqLj87ZxDfq2CBCg9P69ogL7nFIqy+4bl/vd4lMM18nkR33cHluUdEcO4GIIIdYcviGkpWlT+nyjD39SZa4yo9FQo5Xe9pyASwGRg2sYD0x9jAQh83kICSvk/T3yHSQIU5dcx4fhOKbvrI8pUmPtfK8Pb5fe/kveYR/6ZhYR8ymDWsKhmCcOzvsNU/l+UdVZJAqlnZqnK76O8oeaU3us826IFYJIA81R+G0n6TuLtd3ynWGD/bdy7waPnvygVfl0jBHHve8vwPLH3rduZqs0l2inM+dh3/EoZPu45b3FSG4J9Urt/xfC7ib8Btzwadp3yqjCuffbBd2nBpwdbjFR+gSmNBJTy+2zEKRReOPUckmGTtTuTL8rpB40wTig/kcfvl439G1LxD8h2xuVvoRuSznoq/r6Ka+xwNMc7/iSA+MWw+TvZ7qSiUv6VJi2AVJM04wni+VLgO2MtgCm2u+OO3utvEhv/TI08lQRe6/juakSXDHNenx+qsya+T3vO9k/BunxfyI5Eucz3y5nf4bMvxzNG/S3UKX8oAcxGmDkU5f8DqYBVv6UimSbmACjjzNkG5XVFrPvuakT63MWYTJPr7z+dJFzPuCbSeIK6/cuKK7UTWKy43+Y7QvCMhcStyv9yYXK+U9anTp1iwBXj7VsqfhfktDaQsuBar/9MT9OeqmPoG9SEoFX5z5w5k20I0HWsGdcho0Dae4tnKGUAXwAAGDBAAAAAAgAAAAQAAAAIAACATuAPZchCAOqU3NgjsUNg+i23vSeADcpHnbIYZ5bZ/bAp/+EfYtV7EXDm3qPhhEOeusCpypf8pp7IK/xRZPuZk6FtXFuG35Hh2sh3HdXCFRirUf4trcFST+gVm4gIBxB95dP9bMcD7kZ5pfhzi4U4a1qlndQUsKiRUygaUH61QMfljivK7AtGWlTaxP03svrFPue0PJtYIJShy3NygdEWOqmFJLoTzzqj+7jnllf4baNNCCVYIij9smzzy/LepNSDykU1hu6oOnxQku6C9h7KOROfNj7fHqH85oIkkf6vvFwoloVAuvLr3mirhMSLlwk/+Lrz50M3dPCRV0r3a2U4q13FfgWnPRvQjCQjteGJyzOv6mBPah4oPVVByP/nyvCjbMdF+7Yy/EMZfozRnWk423XiUTK3MvdKPpu8Qoi8+D/7BbbjonyTh7zZ+NUKvMWG26Ape9JCykWN9eYi8JOMvlJVtVmR9/NSr8XnpbqFQKbyq15vVv7WxgKLqn0EfLwM3ySJ6D/L8O9sx7tNrOJ71lP5Rd7Vzka+brm58Ndl+JEyPCaV6DFZHn8bOBzTFTJUXuCWAHmh/M8HyJk936Jn+9vybJuhFpmOGxI9o3CPluZDhpWybZsDWGDV69EVCSy00IC3ZdiSYZv5H8/1j2X4uTJ8VjaGT0r2PBeg/Oc0S6AP+Em2s/b9bdJ8FFfhTkrdYONmS2/lQ/ymvAqvCJAXPf9e5rfBy9EahXetxZ8zlN88X3KrwTmB3y3DB2p+/4B8xoV9Mqh0npblMS+HP9tVcwAnLeNZphHCWsXYtItQFsBXy/BP0pQU138LUP6Ynp+zMH/wSW3uxdcCEi6gP1+GP5VKL66/xGhuqcJj8UvamFu59CrzPUReKP6LEfL6HICv8psK/2QL1utWgHWr8Jtl+I2a30LIr5K8Xb4AIY1+SzOZ9xkm98EWFH+WoGwfb0n5Y0nAtIqo+C22sxmEmNi5Xl7Ffgq/V4YjNXJi/uY5456pdPs7LG9T/iXPcl4xlJhbFHjbUU9VJECZANT/cft7eX2zabo78q+P+VfqImvCGeh5trsT8Fci5wxC9hRci4xTWTuhyi9m+b9QMxZ+Y8PKr8qdSetHv/6MQ+45Y7z+r57x5pZf1Ig2RPkplhZlHsxGAtTZf9E+XirDu9nuZJ+YHPyI/O1xot6oMf9hXwKo2hBR78maxMmantJn+GGm1TftoT3/ag0JuP4CVD3cJa3xbHn0gLp83e8uiJ54M6IOc8nPJ1B+ZakuG0qs/w1IJW19GEclcTHp+ctl+Avt3oPyPS8Q33FaK4/aeFPvByDGiRcZAIwO5rShQR9wVPtcSYJN7QcA5QdGDSs9S6+X5QNfAAAYMEAAAAACAAAABAAAAAgAGCno7sVzRJk5drUb7s2J0uPzV2wX3MAHSQC3WhrArRnSxwfYCNQ+DI8Y9x9h/nsz3Meu9H1YJpDAj8vnjsjwOhnE8twfIsSpt533Vih/YQQdwnPxHVL+TTJwee82QvwzlrZLPVDFtReDaz8GinzsOw556g2v0yPbOgC15nulDB+W9xZlwzPdOykJ8WV9m3zMO3LgqCwzVV6qTCkLVPQ8i3cck8o/71kWKg0KYj+GZwnyIv5rLPe/VYZvMporrYj3UUk+qgz09NT51KdwBzdXkFK9WDmju5tT47Zhy/EOtZpR30BmVbtfEPJvi+Pb7thqHYDNAlDKLypJLOn9Wba7BnmdARQsamV5VCu3RQ9ZJpXeVH6qW+s+47uPG/TzUtkvy/BNSQBUPMp2l4NPsqv98ldaqIP9bNeblHlaA+buT75W6LbMp+7J6uPRyo20zBDJ0YQ4i3FaC/9DHQJ8WDM71RFH8y0pT5W50sZwgBODCwcqFJbiT3+MVXuzKYuAMoy4N7IcXtK+v8Toh2t+SPb8qpzuNZR/ifCO8Yrgg1XP+wp72ZW7P+3V4qce8inK/7Rm0jPmdzhpETF/UkjiEW3tNWzHGew1WrgCdSsBdeU/Rhx7VLFUm6Z8ivMJY3GRXX023LzH8OlYpPLbNnVhmvldhz+TCm/6DFySyu2CGPdfsMw5+KzPF77/L7A8uMby/Wvy86uJ73iP9lmQofIsvZFoBfAKsqJ0Pspa+LpG3nuk8j/Fdrboq50D4DKRE0ajU5XZxpZeLOIdvEFZah6qfOepcyh/XIZ3Wu4L99DbA5WfqoAi7fdU/PZ+tutp6Jt3KoHp4+gXtfsvyOEIdQ6gapztGsPfWPM8Z/UernrcVcO797UwB/AG+fmr2v3n9LZbNwdwQBvzPyp7fqX8B4jKYc7uVs34UuV93lE4QowsNQ/rFSb8eoDy61aE8At/0jG5pCv/QdkgC4/eVxDUAzLdeqAov8qjauhM63HUfAZ1DC3C/7GdM+5f4WF+zzK/reNMvFKGZ+X1WuNzDKjD6Ng5gBukbl+vBSaJgbuGABeloq+zK/9C8v0HYMhQ5r8qs6fZ7r8ALrzT6PFFr/k6trspxJuJY1/X7rV1eFqm/3Py+w8QlV8nsRU5Dl6RQ4ctLf/HPN71dc+0rzH75itiQ1HXCcfCVNePprd9PkwYgt3o+J3SCXKP+za8lmTKNnw8+FD/BoyBMuNNc/9Jqfx1vuVc6wXXEtWdb/nr/1psa+NefbvsPTUNWd2/qwxfZDubuW4GtCVlKt9kmcsoHJOAr2e7e2Ay7bPYTq5ug9JDjLbnpNoxK+QddbKUoewVQ4CmjwcvMsv3EdsV+b695fJ6tWa++/yjIHr3v5NEtaiRldog43/LcB1hMuzhyPRXbQ3nOpzleXb1rlLUcj2foA7Ot6k3YwwAqk3vXw+UXaohN+ZQ/lQktsaG2YF4Ab4AAAACAAAABAAAAAhAwyFGXwGocIccA5rLZ5cY/WQaAAAyE8A5I1Bwdxk+VYZ3WX57l/ztbhQ7AHSbAN5m9PyH5D1Xz3/GuGdbOXfGwxJYldbDakDenjUskLkE5TWHJuNVb2ZYRdH0gwDUARyTbHddtutQjiMe8VKfnTGuPthnfF9OoPzLRBI4ajT8owHxxb4jVl4p7IxFuV2Y9bwPdIgA9N5f92F2WQF3VTQiTnw2NZT1MZngXXMagbhIQCia6bO/6KmAse9Q8qK+xuV1MYAEZiy9+QzUZrQJQO/pJ9iVa5dPBiphKE4GxqunXy0/XQk08+cM68G1xn7R837ds/OSwOY936GU/zNsZ2XbZzQS8MUa1GQ4BDBnjP31HVWUFdDmOPg/jKsvVNqFI85hovLrPbyv8qfGeWmBnQ+QfcLxndVYbLGbrsxo5LGmkQish44TwDKhB19uMX0rMv5YpTvI3GvPbWZ+TuVXhDvB/P+KFXiL43udxRa7hHZBU3jdnXUBKtddApirMKEnCGaywFmPeKnPzrG4GXzVmCm7sKywK3fLCVX+ec/7dc8uSitm0fMd4rnHyvBWtuPd9lb5PWRbt5mEMrAAOkwAyxUmtG1zBduzF2pMSsqzrCaeUKvD15w1SSCk51+yKJrvcdWx71jSSOCypvxLnuUnTPdZwzKgzAmYlkQqywJokADWPBuGicfLcJwge1w+SzXdGaOfyZ5q2HEw0uxfMhr9UoZ3xMoXzL6vAP7KGyGMJa5Y4cP9X3LM+h7jN7ErjJjMesJTGWN6jSKCBNBbAYMigFR4Qob3ongBEGl/hgAAAIAAAAAAAQAAAAIAAAAEAAAACAAYIOZYuG9AjCyQkQBEpVF931nNO3jNd6B5LLC49fdzLHwVZows0AELQFVgLBH4koYZ30RAGlTaJyz3eEAaFE4Q5U/UpIl7lIXvseRmfCdkmOuI8nOGXZV6NwRomwjM+IQjz0FNeeYIJucy2/UADEl/yjznIFJmKKCPInOtDEOtvirZAlZBf+cAVEM+0eLYc1lrMIXWmHlNz20+G6N4ZhpClLBtxWc15ZMTGP71nABWZK/6YEtpU/EdNBrQQWZfXlpUPBvjx2+mwRex8Y8SsCS4pwSw0nJDNuOb0Ex61+YgKxoRqDmAkPSnzPNKBiIoKoKP7MGIeA/WWAEHoXYdYuWK48G5bKz3RzRa8zjn2KPCgXhz27fs5yzDqjZkgYbhOh48RYUVMAF7b26vaNZUm7JAB+cAgGFihWFfBRAAAAAgAAAAQAAAAIAAAAAAAQAAMJoEEHqyLQAAPSUAsXruHu37DTJMeLxX92C7z1MWAIBMBKBO0zXPortR3qcq8gG2swhEnAVwr5S9NUF6XQ4lJ5jdjVaFEyMuDwBeMFcCnpbXfzbur2i/HyO896ImJ5YTn2M7J/Qe0H5rAmLzi8JBIPpptaMmDwDBFoDo3eeloqohgDDf1Uk+6/J3ihWgeqxH5PPKEWY9cDjg40oqDsO8Vl71z+I6XoZVh/y1Mj79HSr4yvMI+b2WK0UeAIIsgP3yqh/ceb/2+YLswfcTeiDx3G1s51TbeTmEOCyHAuL7BxvM06sqCKQgEskrjWthvIMRFFi/vsqTxFS8k4b8JMOyWqBBC+CSvN5Z8eydxnOuIcCS1ogFEWzL6+mGen6F6yxhQl43mPsMRPHsD7Pdo9H1dzxHkL9OyutXJe8bv/4eavwAEGQBbEszfY7t/PW3pP12VPbqK/I5quIWsucXcwD7yvAoCzujnoqTZfii4/e1EZYHAC+Y+wHcKsfpasx/Qfb8BzTT/qInAajvaiOIZYIpq5vstisAABGo2g/golTy+9jOX4FK8c/Le9QZ/Lq9AAoP+aorAACJhwA6CRxG0QDA6AO+AAAAAgAAAAQAAAAIAACA4RLAHWxnDYDpiLIkf3Mht/xb2M5KQ1P+g/K3UZfve/0NXb5VmOsA7i7DGYeMePCBit9yy99Vhocc8sfL8PCIyve9/oYu3xrUOgCdAAQ7fYoo/44yfNrCfDnlf6oMnyXK/3QZHh8x+b7X39DlsxCAPgQ4YrMQmH3xzRHivSq45I+zqxcPHXfI31mRfkZ89k6P9PvIFy3Ff8Qjfmr9FQnkWab411j1sWi+8RcJ2n8RqCutDQF4TaI5oXJ9HXfq5AvNJGaaycs948+V/lTxp0h/1Tuajr8gposFps8n/iKg/Yjff1X7/tGA9mc+Kzxkn3KQY6sWAPVosMJTSaoyR5XnxliXMjZ2pYdHKHcIScRWcJE4/b7vSJl2lqD9hKSfW0jABx8xCMAHb5DKblP+zmCMdRcvVnxuAzyBhZBKgXIrcEgHkKL8U8Qb60D27kA5ofxPd1356wggtgJ4ogZ4VF6X2O5fKzENKpQEeCISaav8eKTyxhIgz0AaLgskxIL6aGD+n9JIoLPKL6BPAp71kDtLvBcqr8b+izLo96rkH/ZQpoeJ93gCeRYhzzzkz3oQCqX+eEL5ttuPWX88g/xTNcp/tosEcMFDAS4Q71XBJf+QpQE+5JD/hIcCfoJ4jyWQ5y3Ff8Ejfmr98QTyLEP83EFATcvrJMAidaU1AhD/Kx8nyBxnV/8H3QV58b/qKYL8KWb/D7bv8n2vv6HLZycAZVrOsZ39/E18SP72sMM0zSkvVliJRRYfs/z2MfnbAyMs3/f6G7p8+5MlxlJgAAAGANtKQAAABgYQAACAAAAAAAEAAAACAAAABAAAwIjD5QtgA2V9O+Tj5AEgKwEIjFvuXfZ4d255AAASDAFyKt3lBGnI2ePiSDOg1wQQq4CXtRCCcSk7nkkBq7aEokI/1BQAekcA4zXmOFWBxyPkL2skEKqAjMXtI8BZvg0pACD7EGA8Y/rGE6QhZ+/LO5AGAKjEWINj/9zyAAAEEkDKDS0hDwA9HgIAAAACAAAABAAAAAgAAAAQAAAAIAAAAEAAAAVTDAuDgB4QQBdWsYm4Z7TrKCj/Rhmm0fSArhPAtHFFzx1Hhrryb6I4ga4TwIZxHbryx/TcUH5gEBYA13rKumvTwwZXCFXejQTKjzkAoDMYc1gAhXaloCBem8RsQz1/iAVgU37MAQC9IIBQC2DaojTmtUkzeNWDqHyV34cM65QfwwAAFkCHLQAoPwALIMAC6ALWEryjSeWf8nwfAPTGAhgVhFouVOXHHAAACyBAEbsO08x3fQeAvD0d5/hHCgCGCvgCAMCA8f8CDABatG6NN+gY2wAAAABJRU5ErkJggg==');\n}\n.admin-color-light .ui-datepicker th {\n\tborder-color: #fff;\n}\n.admin-color-light .ui-datepicker .ui-datepicker-title,\n.admin-color-light .ui-datepicker td .ui-state-default,\n.admin-color-light .ui-datepicker th {\n\tcolor: #555;\n}\n.admin-color-light .ui-datepicker td .ui-state-active,\n.admin-color-light .ui-datepicker td .ui-state-hover {\n\tcolor: #fff;\n\tbackground: #888;\n}\n.admin-color-light .ui-datepicker td.ui-state-disabled,\n.admin-color-light .ui-datepicker td.ui-state-disabled .ui-state-default {\n\tcolor: #ccc;\n}\n"
  },
  {
    "path": "assets/css/equation.css",
    "content": ".sp-equation-builder .button {\n\tmargin: 2px;\n\tpadding: 0 10px 1px;\n}\n\n.sp-equation {\n\tbackground: #f9f9f9;\n\tborder: 1px solid #ddd;\n\t-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.07);\n\tbox-shadow: inset 0 1px 2px rgba(0,0,0,0.07);\n\ttransition: .05s border-color ease-in-out;\n\tmargin-top: 6px;\n\tpadding: 23px;\n}\n\n.sp-equation:hover,\n.sp-equation.ui-state-active {\n\tbackground: #fff;\n}\n\n.sp-equation.ui-state-hover {\n\tborder-color: #5b9dd9;\n\t-webkit-box-shadow: 0 0 2px rgba(30,140,190,0.8);\n\tbox-shadow: 0 0 2px rgba(30,140,190,0.8);\n}\n\n.sp-equation-variable {\n\tfont-weight: bold;\n\tfont-size: 14px;\n\tline-height: 32px;\n}\n\n.sp-equation-formula .ui-sortable-placeholder {\n\tvisibility: visible !important;\n\tmargin: 2px;\n\tpadding: 1 10px 1px;\n\tborder: 1px dashed #bbb;\n\tbackground: transparent;\n\theight: 28px;\n}\n\n.sp-equation-formula .button {\n\tposition: relative;\n\tmargin: 2px 4px;\n}\n\n.sp-equation-formula .button .remove {\n\tfont-weight: bold;\n\tfont-size: 14px;\n\tposition: absolute;\n\ttop: -10px;\n\tright: -8px;\n\tcolor: #999;\n\tborder: 1px solid #ccc;\n\tbackground: #f7f7f7;\n\tdisplay: block;\n\twidth: 16px;\n\theight: 16px;\n\tline-height: 16px;\n\ttext-align: center;\n\tborder-radius: 50%;\n\tdisplay: none;\n}\n\n.sp-equation-formula .button:hover .remove {\n\tdisplay: block;\n}\n\n.sp-equation-formula .button.ui-sortable-helper .remove,\n.sp-equation-formula .button.ui-sortable-helper:hover .remove {\n\tdisplay: none;\n}\n\n.sp-equation-formula .button .remove:hover {\n\tcolor: #d00;\n}\n"
  },
  {
    "path": "assets/css/icons.css",
    "content": "/* SportsPress icons */\n@font-face {\n\tfont-family: 'sportspress';\n\tsrc:url('../fonts/sportspress.eot?ddphik2');\n\tsrc:url('../fonts/sportspress.eot?#iefixddphik2') format('embedded-opentype'),\n\t\turl('../fonts/sportspress.woff2?ddphik2') format('woff2'),\n\t\turl('../fonts/sportspress.ttf?ddphik2') format('truetype'),\n\t\turl('../fonts/sportspress.woff?ddphik2') format('woff'),\n\t\turl('../fonts/sportspress.svg?ddphik2#sportspress') format('svg');\n\tfont-weight: normal;\n\tfont-style: normal;\n}\n\n[class^=\"sp-icon-\"], [class*=\" sp-icon-\"] {\n\tfont-family: sportspress, dashicons;\n\tspeak: none;\n\tfont-style: normal;\n\tfont-weight: normal;\n\tfont-variant: normal;\n\ttext-transform: none;\n\tline-height: 1;\n\tdisplay: inline-block;\n\twidth: 20px;\n\theight: 20px;\n\tfont-size: 20px;\n\tvertical-align: top;\n\n\t/* Better Font Rendering =========== */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n}\n\n/* Performance Icons */\n.sp-icon-sub:before {\n\tcontent: \"\\f503\";\n}\n.sp-icon-star-filled:before {\n\tcontent: \"\\f155\";\n}\n.sp-icon-update:before {\n\tcontent: \"\\f113\";\n}\n.sp-icon-undo:before {\n\tcontent: \"\\f171\";\n}\n.sp-icon-redo:before {\n\tcontent: \"\\f172\";\n}\n.sp-icon-marker:before {\n\tcontent: \"\\f159\";\n}\n.sp-icon-no:before {\n\tcontent: \"\\f158\";\n}\n.sp-icon-heart:before {\n\tcontent: \"\\f487\";\n}\n\n/* Performance Icons - Sports */\n.sp-icon-soccerball:before {\n\tcontent: \"\\e700\";\n}\n.sp-icon-baseball:before {\n\tcontent: \"\\e701\";\n}\n.sp-icon-basketball:before {\n\tcontent: \"\\e602\";\n}\n.sp-icon-golfball:before {\n\tcontent: \"\\e603\";\n}\n.sp-icon-cricketball:before {\n\tcontent: \"\\e604\";\n}\n.sp-icon-bowling:before {\n\tcontent: \"\\e605\";\n}\n.sp-icon-ice-hockey:before {\n\tcontent: \"\\e606\";\n}\n.sp-icon-football:before {\n\tcontent: \"\\e607\";\n}\n.sp-icon-poolball:before {\n\tcontent: \"\\e608\";\n}\n.sp-icon-table-tennis:before {\n\tcontent: \"\\e609\";\n}\n.sp-icon-tennis:before {\n\tcontent: \"\\e610\";\n}\n.sp-icon-racing-flag:before {\n\tcontent: \"\\e611\";\n}\n.sp-icon-volleyball:before {\n\tcontent: \"\\e612\";\n}\n\n/* Performance Icons - Sports (Alt) */\n.sp-icon-soccerball-alt:before {\n\tcontent: \"\\e600\";\n}\n.sp-icon-baseball-alt:before {\n\tcontent: \"\\e601\";\n}\n\n/* Performance Icons - Misc */\n.sp-icon-shoe:before {\n\tcontent: \"\\e800\";\n}\n.sp-icon-card:before {\n\tcontent: \"\\e801\";\n}\n.sp-icon-league:before {\n\tcontent: \"\\f332\";\n}\n.sp-icon-shield:before {\n\tcontent: \"\\f334\";\n}\n.sp-icon-tshirt:before,\n.sp-icon-sp_player:before {\n\tcontent: \"\\f307\";\n}\n.sp-icon-whistle:before {\n\tcontent: \"\\f227\";\n}\n.sp-icon-time:before {\n\tcontent: \"\\f469\";\n}\n.sp-icon-friendly:before {\n\tcontent: \"\\f328\";\n}\n"
  },
  {
    "path": "assets/css/leaflet.css",
    "content": "/* required styles */\n\n.leaflet-pane,\n.leaflet-tile,\n.leaflet-marker-icon,\n.leaflet-marker-shadow,\n.leaflet-tile-container,\n.leaflet-pane > svg,\n.leaflet-pane > canvas,\n.leaflet-zoom-box,\n.leaflet-image-layer,\n.leaflet-layer {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\t}\n.leaflet-container {\n\toverflow: hidden;\n\t}\n.leaflet-tile,\n.leaflet-marker-icon,\n.leaflet-marker-shadow {\n\t-webkit-user-select: none;\n\t   -moz-user-select: none;\n\t        user-select: none;\n\t  -webkit-user-drag: none;\n\t}\n/* Prevents IE11 from highlighting tiles in blue */\n.leaflet-tile::selection {\n\tbackground: transparent;\n}\n/* Safari renders non-retina tile on retina better with this, but Chrome is worse */\n.leaflet-safari .leaflet-tile {\n\timage-rendering: -webkit-optimize-contrast;\n\t}\n/* hack that prevents hw layers \"stretching\" when loading new tiles */\n.leaflet-safari .leaflet-tile-container {\n\twidth: 1600px;\n\theight: 1600px;\n\t-webkit-transform-origin: 0 0;\n\t}\n.leaflet-marker-icon,\n.leaflet-marker-shadow {\n\tdisplay: block;\n\t}\n/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */\n/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */\n.leaflet-container .leaflet-overlay-pane svg {\n\tmax-width: none !important;\n\tmax-height: none !important;\n\t}\n.leaflet-container .leaflet-marker-pane img,\n.leaflet-container .leaflet-shadow-pane img,\n.leaflet-container .leaflet-tile-pane img,\n.leaflet-container img.leaflet-image-layer,\n.leaflet-container .leaflet-tile {\n\tmax-width: none !important;\n\tmax-height: none !important;\n\twidth: auto;\n\tpadding: 0;\n\t}\n\n.leaflet-container img.leaflet-tile {\n\t/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */\n\tmix-blend-mode: plus-lighter;\n}\n\n.leaflet-container.leaflet-touch-zoom {\n\t-ms-touch-action: pan-x pan-y;\n\ttouch-action: pan-x pan-y;\n\t}\n.leaflet-container.leaflet-touch-drag {\n\t-ms-touch-action: pinch-zoom;\n\t/* Fallback for FF which doesn't support pinch-zoom */\n\ttouch-action: none;\n\ttouch-action: pinch-zoom;\n}\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\n\t-ms-touch-action: none;\n\ttouch-action: none;\n}\n.leaflet-container {\n\t-webkit-tap-highlight-color: transparent;\n}\n.leaflet-container a {\n\t-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\n}\n.leaflet-tile {\n\tfilter: inherit;\n\tvisibility: hidden;\n\t}\n.leaflet-tile-loaded {\n\tvisibility: inherit;\n\t}\n.leaflet-zoom-box {\n\twidth: 0;\n\theight: 0;\n\t-moz-box-sizing: border-box;\n\t     box-sizing: border-box;\n\tz-index: 800;\n\t}\n/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */\n.leaflet-overlay-pane svg {\n\t-moz-user-select: none;\n\t}\n\n.leaflet-pane         { z-index: 400; }\n\n.leaflet-tile-pane    { z-index: 200; }\n.leaflet-overlay-pane { z-index: 400; }\n.leaflet-shadow-pane  { z-index: 500; }\n.leaflet-marker-pane  { z-index: 600; }\n.leaflet-tooltip-pane   { z-index: 650; }\n.leaflet-popup-pane   { z-index: 700; }\n\n.leaflet-map-pane canvas { z-index: 100; }\n.leaflet-map-pane svg    { z-index: 200; }\n\n.leaflet-vml-shape {\n\twidth: 1px;\n\theight: 1px;\n\t}\n.lvml {\n\tbehavior: url(#default#VML);\n\tdisplay: inline-block;\n\tposition: absolute;\n\t}\n\n\n/* control positioning */\n\n.leaflet-control {\n\tposition: relative;\n\tz-index: 800;\n\tpointer-events: visiblePainted; /* IE 9-10 doesn't have auto */\n\tpointer-events: auto;\n\t}\n.leaflet-top,\n.leaflet-bottom {\n\tposition: absolute;\n\tz-index: 1000;\n\tpointer-events: none;\n\t}\n.leaflet-top {\n\ttop: 0;\n\t}\n.leaflet-right {\n\tright: 0;\n\t}\n.leaflet-bottom {\n\tbottom: 0;\n\t}\n.leaflet-left {\n\tleft: 0;\n\t}\n.leaflet-control {\n\tfloat: left;\n\tclear: both;\n\t}\n.leaflet-right .leaflet-control {\n\tfloat: right;\n\t}\n.leaflet-top .leaflet-control {\n\tmargin-top: 10px;\n\t}\n.leaflet-bottom .leaflet-control {\n\tmargin-bottom: 10px;\n\t}\n.leaflet-left .leaflet-control {\n\tmargin-left: 10px;\n\t}\n.leaflet-right .leaflet-control {\n\tmargin-right: 10px;\n\t}\n\n\n/* zoom and fade animations */\n\n.leaflet-fade-anim .leaflet-popup {\n\topacity: 0;\n\t-webkit-transition: opacity 0.2s linear;\n\t   -moz-transition: opacity 0.2s linear;\n\t        transition: opacity 0.2s linear;\n\t}\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\n\topacity: 1;\n\t}\n.leaflet-zoom-animated {\n\t-webkit-transform-origin: 0 0;\n\t    -ms-transform-origin: 0 0;\n\t        transform-origin: 0 0;\n\t}\nsvg.leaflet-zoom-animated {\n\twill-change: transform;\n}\n\n.leaflet-zoom-anim .leaflet-zoom-animated {\n\t-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\n\t   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\n\t        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);\n\t}\n.leaflet-zoom-anim .leaflet-tile,\n.leaflet-pan-anim .leaflet-tile {\n\t-webkit-transition: none;\n\t   -moz-transition: none;\n\t        transition: none;\n\t}\n\n.leaflet-zoom-anim .leaflet-zoom-hide {\n\tvisibility: hidden;\n\t}\n\n\n/* cursors */\n\n.leaflet-interactive {\n\tcursor: pointer;\n\t}\n.leaflet-grab {\n\tcursor: -webkit-grab;\n\tcursor:    -moz-grab;\n\tcursor:         grab;\n\t}\n.leaflet-crosshair,\n.leaflet-crosshair .leaflet-interactive {\n\tcursor: crosshair;\n\t}\n.leaflet-popup-pane,\n.leaflet-control {\n\tcursor: auto;\n\t}\n.leaflet-dragging .leaflet-grab,\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\n.leaflet-dragging .leaflet-marker-draggable {\n\tcursor: move;\n\tcursor: -webkit-grabbing;\n\tcursor:    -moz-grabbing;\n\tcursor:         grabbing;\n\t}\n\n/* marker & overlays interactivity */\n.leaflet-marker-icon,\n.leaflet-marker-shadow,\n.leaflet-image-layer,\n.leaflet-pane > svg path,\n.leaflet-tile-container {\n\tpointer-events: none;\n\t}\n\n.leaflet-marker-icon.leaflet-interactive,\n.leaflet-image-layer.leaflet-interactive,\n.leaflet-pane > svg path.leaflet-interactive,\nsvg.leaflet-image-layer.leaflet-interactive path {\n\tpointer-events: visiblePainted; /* IE 9-10 doesn't have auto */\n\tpointer-events: auto;\n\t}\n\n/* visual tweaks */\n\n.leaflet-container {\n\tbackground: #ddd;\n\toutline-offset: 1px;\n\t}\n.leaflet-container a {\n\tcolor: #0078A8;\n\t}\n.leaflet-zoom-box {\n\tborder: 2px dotted #38f;\n\tbackground: rgba(255,255,255,0.5);\n\t}\n\n\n/* general typography */\n.leaflet-container {\n\tfont-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\n\tfont-size: 12px;\n\tfont-size: 0.75rem;\n\tline-height: 1.5;\n\t}\n\n\n/* general toolbar styles */\n\n.leaflet-bar {\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\n\tborder-radius: 4px;\n\t}\n.leaflet-bar a {\n\tbackground-color: #fff;\n\tborder-bottom: 1px solid #ccc;\n\twidth: 26px;\n\theight: 26px;\n\tline-height: 26px;\n\tdisplay: block;\n\ttext-align: center;\n\ttext-decoration: none;\n\tcolor: black;\n\t}\n.leaflet-bar a,\n.leaflet-control-layers-toggle {\n\tbackground-position: 50% 50%;\n\tbackground-repeat: no-repeat;\n\tdisplay: block;\n\t}\n.leaflet-bar a:hover,\n.leaflet-bar a:focus {\n\tbackground-color: #f4f4f4;\n\t}\n.leaflet-bar a:first-child {\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\t}\n.leaflet-bar a:last-child {\n\tborder-bottom-left-radius: 4px;\n\tborder-bottom-right-radius: 4px;\n\tborder-bottom: none;\n\t}\n.leaflet-bar a.leaflet-disabled {\n\tcursor: default;\n\tbackground-color: #f4f4f4;\n\tcolor: #bbb;\n\t}\n\n.leaflet-touch .leaflet-bar a {\n\twidth: 30px;\n\theight: 30px;\n\tline-height: 30px;\n\t}\n.leaflet-touch .leaflet-bar a:first-child {\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n\t}\n.leaflet-touch .leaflet-bar a:last-child {\n\tborder-bottom-left-radius: 2px;\n\tborder-bottom-right-radius: 2px;\n\t}\n\n/* zoom control */\n\n.leaflet-control-zoom-in,\n.leaflet-control-zoom-out {\n\tfont: bold 18px 'Lucida Console', Monaco, monospace;\n\ttext-indent: 1px;\n\t}\n\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {\n\tfont-size: 22px;\n\t}\n\n\n/* layers control */\n\n.leaflet-control-layers {\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\n\tbackground: #fff;\n\tborder-radius: 5px;\n\t}\n.leaflet-control-layers-toggle {\n\tbackground-image: url(images/layers.png);\n\twidth: 36px;\n\theight: 36px;\n\t}\n.leaflet-retina .leaflet-control-layers-toggle {\n\tbackground-image: url(images/layers-2x.png);\n\tbackground-size: 26px 26px;\n\t}\n.leaflet-touch .leaflet-control-layers-toggle {\n\twidth: 44px;\n\theight: 44px;\n\t}\n.leaflet-control-layers .leaflet-control-layers-list,\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\n\tdisplay: none;\n\t}\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\n\tdisplay: block;\n\tposition: relative;\n\t}\n.leaflet-control-layers-expanded {\n\tpadding: 6px 10px 6px 6px;\n\tcolor: #333;\n\tbackground: #fff;\n\t}\n.leaflet-control-layers-scrollbar {\n\toverflow-y: scroll;\n\toverflow-x: hidden;\n\tpadding-right: 5px;\n\t}\n.leaflet-control-layers-selector {\n\tmargin-top: 2px;\n\tposition: relative;\n\ttop: 1px;\n\t}\n.leaflet-control-layers label {\n\tdisplay: block;\n\tfont-size: 13px;\n\tfont-size: 1.08333em;\n\t}\n.leaflet-control-layers-separator {\n\theight: 0;\n\tborder-top: 1px solid #ddd;\n\tmargin: 5px -10px 5px -6px;\n\t}\n\n/* Default icon URLs */\n.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */\n\tbackground-image: url(images/marker-icon.png);\n\t}\n\n\n/* attribution and scale controls */\n\n.leaflet-container .leaflet-control-attribution {\n\tbackground: #fff;\n\tbackground: rgba(255, 255, 255, 0.8);\n\tmargin: 0;\n\t}\n.leaflet-control-attribution,\n.leaflet-control-scale-line {\n\tpadding: 0 5px;\n\tcolor: #333;\n\tline-height: 1.4;\n\t}\n.leaflet-control-attribution a {\n\ttext-decoration: none;\n\t}\n.leaflet-control-attribution a:hover,\n.leaflet-control-attribution a:focus {\n\ttext-decoration: underline;\n\t}\n.leaflet-attribution-flag {\n\tdisplay: inline !important;\n\tvertical-align: baseline !important;\n\twidth: 1em;\n\theight: 0.6669em;\n\t}\n.leaflet-left .leaflet-control-scale {\n\tmargin-left: 5px;\n\t}\n.leaflet-bottom .leaflet-control-scale {\n\tmargin-bottom: 5px;\n\t}\n.leaflet-control-scale-line {\n\tborder: 2px solid #777;\n\tborder-top: none;\n\tline-height: 1.1;\n\tpadding: 2px 5px 1px;\n\twhite-space: nowrap;\n\t-moz-box-sizing: border-box;\n\t     box-sizing: border-box;\n\tbackground: rgba(255, 255, 255, 0.8);\n\ttext-shadow: 1px 1px #fff;\n\t}\n.leaflet-control-scale-line:not(:first-child) {\n\tborder-top: 2px solid #777;\n\tborder-bottom: none;\n\tmargin-top: -2px;\n\t}\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\n\tborder-bottom: 2px solid #777;\n\t}\n\n.leaflet-touch .leaflet-control-attribution,\n.leaflet-touch .leaflet-control-layers,\n.leaflet-touch .leaflet-bar {\n\tbox-shadow: none;\n\t}\n.leaflet-touch .leaflet-control-layers,\n.leaflet-touch .leaflet-bar {\n\tborder: 2px solid rgba(0,0,0,0.2);\n\tbackground-clip: padding-box;\n\t}\n\n\n/* popup */\n\n.leaflet-popup {\n\tposition: absolute;\n\ttext-align: center;\n\tmargin-bottom: 20px;\n\t}\n.leaflet-popup-content-wrapper {\n\tpadding: 1px;\n\ttext-align: left;\n\tborder-radius: 12px;\n\t}\n.leaflet-popup-content {\n\tmargin: 13px 24px 13px 20px;\n\tline-height: 1.3;\n\tfont-size: 13px;\n\tfont-size: 1.08333em;\n\tmin-height: 1px;\n\t}\n.leaflet-popup-content p {\n\tmargin: 17px 0;\n\tmargin: 1.3em 0;\n\t}\n.leaflet-popup-tip-container {\n\twidth: 40px;\n\theight: 20px;\n\tposition: absolute;\n\tleft: 50%;\n\tmargin-top: -1px;\n\tmargin-left: -20px;\n\toverflow: hidden;\n\tpointer-events: none;\n\t}\n.leaflet-popup-tip {\n\twidth: 17px;\n\theight: 17px;\n\tpadding: 1px;\n\n\tmargin: -10px auto 0;\n\tpointer-events: auto;\n\n\t-webkit-transform: rotate(45deg);\n\t   -moz-transform: rotate(45deg);\n\t    -ms-transform: rotate(45deg);\n\t        transform: rotate(45deg);\n\t}\n.leaflet-popup-content-wrapper,\n.leaflet-popup-tip {\n\tbackground: white;\n\tcolor: #333;\n\tbox-shadow: 0 3px 14px rgba(0,0,0,0.4);\n\t}\n.leaflet-container a.leaflet-popup-close-button {\n\tposition: absolute;\n\ttop: 0;\n\tright: 0;\n\tborder: none;\n\ttext-align: center;\n\twidth: 24px;\n\theight: 24px;\n\tfont: 16px/24px Tahoma, Verdana, sans-serif;\n\tcolor: #757575;\n\ttext-decoration: none;\n\tbackground: transparent;\n\t}\n.leaflet-container a.leaflet-popup-close-button:hover,\n.leaflet-container a.leaflet-popup-close-button:focus {\n\tcolor: #585858;\n\t}\n.leaflet-popup-scrolled {\n\toverflow: auto;\n\t}\n\n.leaflet-oldie .leaflet-popup-content-wrapper {\n\t-ms-zoom: 1;\n\t}\n.leaflet-oldie .leaflet-popup-tip {\n\twidth: 24px;\n\tmargin: 0 auto;\n\n\t-ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";\n\tfilter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\n\t}\n\n.leaflet-oldie .leaflet-control-zoom,\n.leaflet-oldie .leaflet-control-layers,\n.leaflet-oldie .leaflet-popup-content-wrapper,\n.leaflet-oldie .leaflet-popup-tip {\n\tborder: 1px solid #999;\n\t}\n\n\n/* div icon */\n\n.leaflet-div-icon {\n\tbackground: #fff;\n\tborder: 1px solid #666;\n\t}\n\n\n/* Tooltip */\n/* Base styles for the element that has a tooltip */\n.leaflet-tooltip {\n\tposition: absolute;\n\tpadding: 6px;\n\tbackground-color: #fff;\n\tborder: 1px solid #fff;\n\tborder-radius: 3px;\n\tcolor: #222;\n\twhite-space: nowrap;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\tpointer-events: none;\n\tbox-shadow: 0 1px 3px rgba(0,0,0,0.4);\n\t}\n.leaflet-tooltip.leaflet-interactive {\n\tcursor: pointer;\n\tpointer-events: auto;\n\t}\n.leaflet-tooltip-top:before,\n.leaflet-tooltip-bottom:before,\n.leaflet-tooltip-left:before,\n.leaflet-tooltip-right:before {\n\tposition: absolute;\n\tpointer-events: none;\n\tborder: 6px solid transparent;\n\tbackground: transparent;\n\tcontent: \"\";\n\t}\n\n/* Directions */\n\n.leaflet-tooltip-bottom {\n\tmargin-top: 6px;\n}\n.leaflet-tooltip-top {\n\tmargin-top: -6px;\n}\n.leaflet-tooltip-bottom:before,\n.leaflet-tooltip-top:before {\n\tleft: 50%;\n\tmargin-left: -6px;\n\t}\n.leaflet-tooltip-top:before {\n\tbottom: 0;\n\tmargin-bottom: -12px;\n\tborder-top-color: #fff;\n\t}\n.leaflet-tooltip-bottom:before {\n\ttop: 0;\n\tmargin-top: -12px;\n\tmargin-left: -6px;\n\tborder-bottom-color: #fff;\n\t}\n.leaflet-tooltip-left {\n\tmargin-left: -6px;\n}\n.leaflet-tooltip-right {\n\tmargin-left: 6px;\n}\n.leaflet-tooltip-left:before,\n.leaflet-tooltip-right:before {\n\ttop: 50%;\n\tmargin-top: -6px;\n\t}\n.leaflet-tooltip-left:before {\n\tright: 0;\n\tmargin-right: -12px;\n\tborder-left-color: #fff;\n\t}\n.leaflet-tooltip-right:before {\n\tleft: 0;\n\tmargin-left: -12px;\n\tborder-right-color: #fff;\n\t}\n\n/* Printing */\n\n@media print {\n\t/* Prevent printers from removing background-images of controls. */\n\t.leaflet-control {\n\t\t-webkit-print-color-adjust: exact;\n\t\tprint-color-adjust: exact;\n\t\t}\n\t}\n"
  },
  {
    "path": "assets/css/menu.css",
    "content": "/* SportsPress menu styles */\n@font-face {\n\tfont-family: 'sportspress';\n\tsrc:url('../fonts/sportspress.eot?42ynjo');\n\tsrc:url('../fonts/sportspress.eot?#iefix42ynjo') format('embedded-opentype'),\n\t\turl('../fonts/sportspress.woff2?42ynjo') format('woff2'),\n\t\turl('../fonts/sportspress.ttf?42ynjo') format('truetype'),\n\t\turl('../fonts/sportspress.woff?42ynjo') format('woff'),\n\t\turl('../fonts/sportspress.svg?42ynjo#sportspress') format('svg');\n\tfont-weight: normal;\n\tfont-style: normal;\n}\n\n[class^=\"sp-icon-\"], [class*=\" sp-icon-\"] {\n\tfont-family: sportspress, dashicons;\n\tspeak: none;\n\tfont-style: normal;\n\tfont-weight: normal;\n\tfont-variant: normal;\n\ttext-transform: none;\n\tline-height: 1;\n\tdisplay: inline-block;\n\twidth: 20px;\n\theight: 20px;\n\tfont-size: 20px;\n\tvertical-align: top;\n\n\t/* Better Font Rendering =========== */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n}\n\n.sp-icon-archive:before {\n\tcontent: \"\\f322\";\n}\n.sp-icon-availability:before {\n\tcontent: \"\\f508\";\n}\n.sp-icon-blocks:before {\n\tcontent: \"\\f164\"\n}\n.sp-icon-book:before {\n\tcontent: \"\\f330\";\n}\n.sp-icon-bracket:before {\n\tcontent: \"\\f325\"\n}\n.sp-icon-bracket-center:before {\n\tcontent: \"\\f181\"\n}\n.sp-icon-buddypress:before {\n\tcontent: \"\\f507\";\n}\n.sp-icon-calculator:before {\n\tcontent: \"\\f108\";\n}\n.sp-icon-calendar:before,\n.sp-icon-sp_event:before {\n\tcontent: \"\\f145\";\n}\n.sp-icon-cake:before {\n\tcontent: \"\\f453\";\n}\n.sp-icon-cancel:before {\n\tcontent: \"\\f335\";\n}\n.sp-icon-chart:before {\n\tcontent: \"\\f185\";\n}\n.sp-icon-clipboard:before {\n\tcontent: \"\\f481\";\n}\n.sp-icon-color:before {\n\tcontent: \"\\f309\";\n}\n.sp-icon-copy:before {\n\tcontent: \"\\f105\";\n}\n.sp-icon-edit:before {\n\tcontent: \"\\f464\";\n}\n.sp-icon-export:before {\n\tcontent: \"\\f317\";\n}\n.sp-icon-eye:before {\n\tcontent: \"\\f147\";\n}\n.sp-icon-friendly:before {\n\tcontent: \"\\f328\";\n}\n.sp-icon-globe:before {\n\tcontent: \"\\f319\";\n}\n.sp-icon-history:before {\n  content: \"\\f321\";\n}\n.sp-icon-import:before {\n\tcontent: \"\\f316\";\n}\n.sp-icon-league:before {\n\tcontent: \"\\f332\";\n}\n.sp-icon-list:before {\n\tcontent: \"\\f163\"\n}\n.sp-icon-location:before {\n  content: \"\\f231\";\n}\n.sp-icon-matrix:before {\n  content: \"\\f314\";\n}\n.sp-icon-megaphone:before {\n\tcontent: \"\\f488\";\n}\n.sp-icon-menu:before {\n\tcontent: \"\\f116\";\n}\n.sp-icon-minimal:before {\n\tcontent: \"\\f237\";\n}\n.sp-icon-popup:before {\n\tcontent: \"\\f504\";\n}\n.sp-icon-shield:before {\n\tcontent: \"\\f334\";\n}\n.sp-icon-sponsor:before {\n\tcontent: \"\\f488\";\n}\n.sp-icon-sportspress:before {\n\tcontent: \"\\f111\";\n}\n.sp-icon-staff:before {\n\tcontent: \"\\f338\";\n}\n.sp-icon-statistics:before {\n\tcontent: \"\\f489\";\n}\n.sp-icon-time:before {\n\tcontent: \"\\f469\";\n}\n.sp-icon-timeline:before {\n\tcontent: \"\\f203\";\n}\n.sp-icon-ticket:before {\n\tcontent: \"\\f524\";\n}\n.sp-icon-tournament:before {\n\tcontent: \"\\f313\";\n}\n.sp-icon-scoreboard:before {\n\tcontent: \"\\f509\";\n}\n.sp-icon-tshirt:before,\n.sp-icon-sp_player:before {\n\tcontent: \"\\f307\";\n}\n.sp-icon-trash:before {\n\tcontent: \"\\f182\";\n}\n.sp-icon-whistle:before {\n\tcontent: \"\\f227\";\n}\n.sp-icon-key:before {\n\tcontent: \"\\f112\";\n}\n.sp-icon-user-scores:before {\n  content: \"\\f101\";\n}\n.sp-icon-woo:before {\n  content: \"\\f174\";\n}\n.sp-icon-wordpay:before {\n  content: \"\\f526\";\n}\n.sp-icon-yoast:before {\n\tcontent: \"\\f179\";\n}\n.sp-icon-sub:before {\n\tcontent: \"\\f503\";\n}\n.sp-icon-star-filled:before {\n\tcontent: \"\\f155\";\n}\n.sp-icon-update:before {\n\tcontent: \"\\f113\";\n}\n.sp-icon-undo:before {\n\tcontent: \"\\f171\";\n}\n.sp-icon-redo:before {\n\tcontent: \"\\f172\";\n}\n.sp-icon-marker:before {\n\tcontent: \"\\f159\";\n}\n.sp-icon-no:before {\n\tcontent: \"\\f158\";\n}\n.sp-icon-heart:before {\n\tcontent: \"\\f487\";\n}\n\n/* Performance Icons - Sports */\n.sp-icon-soccerball:before {\n\tcontent: \"\\e700\";\n}\n.sp-icon-baseball:before {\n\tcontent: \"\\e701\";\n}\n.sp-icon-basketball:before {\n\tcontent: \"\\e602\";\n}\n.sp-icon-golfball:before {\n\tcontent: \"\\e603\";\n}\n.sp-icon-cricketball:before {\n\tcontent: \"\\e604\";\n}\n.sp-icon-bowling:before {\n\tcontent: \"\\e605\";\n}\n.sp-icon-ice-hockey:before {\n\tcontent: \"\\e606\";\n}\n.sp-icon-football:before {\n\tcontent: \"\\e607\";\n}\n.sp-icon-poolball:before {\n\tcontent: \"\\e608\";\n}\n.sp-icon-table-tennis:before {\n\tcontent: \"\\e609\";\n}\n.sp-icon-tennis:before {\n\tcontent: \"\\e610\";\n}\n.sp-icon-racing-flag:before {\n\tcontent: \"\\e611\";\n}\n.sp-icon-volleyball:before {\n\tcontent: \"\\e612\";\n}\n\n/* Performance Icons - Sports (Alt) */\n.sp-icon-soccerball-alt:before {\n\tcontent: \"\\e600\";\n}\n.sp-icon-baseball-alt:before {\n\tcontent: \"\\e601\";\n}\n\n/* Performance Icons - Misc */\n.sp-icon-shoe:before {\n\tcontent: \"\\e800\";\n}\n.sp-icon-card:before {\n\tcontent: \"\\e801\";\n}\n.sp-icon-card:before {\n\tcontent: \"\\e801\";\n}\n\n#adminmenu #toplevel_page_sportspress .toplevel_page_sportspress div.wp-menu-image:before,\n#adminmenu #toplevel_page_themeboy .toplevel_page_themeboy div.wp-menu-image:before,\n#adminmenu #menu-posts-sp_event .menu-icon-sp_event div.wp-menu-image:before,\n#adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before,\n#adminmenu #menu-posts-sp_player .menu-icon-sp_player div.wp-menu-image:before,\n#adminmenu #menu-posts-sp_staff .menu-icon-sp_staff div.wp-menu-image:before,\n#adminmenu #menu-posts-sp_official .menu-icon-sp_official div.wp-menu-image:before,\n#sp_formatdiv #post-formats-select .post-format-icon:before,\n#sp_modediv #post-formats-select .post-format-icon:before {\n\tfont-family: sportspress, dashicons;\n\twidth: 20px;\n\ttext-align: center;\n}\n\n/* Widgets */\n[id*=\"sportspress-\"] .widget-title h3:before,\n[id*=\"sportspress-\"] .widget-title h4:before {\n\tfont-family: sportspress, dashicons;\n\tcolor: #aaa;\n\tfont-size: 20px;\n\tcontent: '\\f111';\n\tspeak: none;\n\tfont-style: normal;\n\tfont-weight: normal;\n\tfont-variant: normal;\n\ttext-transform: none;\n\tline-height: 0;\n\tposition: relative;\n\ttop: 4px;\n\tmargin-right: 4px;\n\n\t/* Better Font Rendering =========== */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n}\n\n/* Prefs */\n.sp-prefs .button {\n\tmargin: 0 3px 4px 0;\n\tpadding: 0 7px 1px 5px;\n}\n\n.sp-prefs .button input[type=checkbox] {\n\tbackground: transparent;\n\tborder: none;\n\t-webkit-box-shadow: none;\n\tbox-shadow: none;\n}\n\n.sp-prefs .button input[type=checkbox]:before {\n\tfont: 400 14px/22px sportspress, dashicons;\n\twidth: 22px;\n}\n\n.sp-prefs .button input[type=checkbox]:not(:checked):before {\n\tfloat: left;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tspeak: none;\n\tcontent: '\\f147';\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\tmargin: -3px 0 0 -4px;\n\tcolor: #ccc;\n}\n\n/* Icons */\n.sp-icons .button {\n\tmargin: 0 3px 4px 0;\n\tpadding: 0 7px 1px 5px;\n}\n\n.sp-icons .button i {\n\tmargin: 3px 0;\n}\n\n.sp-color-box-for-icon input[type=text] {\n\tcolor: #fff;\n}\n\n.wp-admin .sp-icons label input[type=radio] {\n\tmargin-top: -3px;\n}\n\n@media screen and (max-width: 782px) {\n\t.wp-admin .sp-icons label input[type=radio] {\n\t\tmargin-top: 1px;\n\t}\n}\n\n/* TinyMCE */\n.mce-toolbar i.mce-i-sp_shortcodes_button, .mce-toolbar span.mce_sp_shortcodes_button {\n\tmargin-right: -5px;\n}\ni.mce-i-sp_shortcodes_button:before, span.mce_sp_shortcodes_button:before {\n\tfont-family: 'sportspress';\n\tspeak: none;\n\tfont-style: normal;\n\tfont-weight: normal;\n\tfont-variant: normal;\n\ttext-transform: none;\n\tline-height: 1;\n\n\t/* Better Font Rendering =========== */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\n\ttext-align: center;\n\tcontent: \"\\f111\";\n\tfont-size: 20px;\n}\n"
  },
  {
    "path": "assets/css/setup.css",
    "content": ".sp-setup-content p,\n.sp-setup-content table {\n\tfont-size: 1em;\n\tline-height: 1.75em;\n\tcolor: #666;\n}\n\nbody {\n\tmargin: 100px auto 24px;\n\tbox-shadow: none;\n\tbackground: #f1f1f1;\n\tpadding: 0;\n}\n\n#sp-logo {\n\tborder: 0;\n\tmargin: 24px 0;\n\tpadding: 0;\n\ttext-align: center;\n}\n\n#sp-logo img {\n\twidth: auto;\n\theight: auto;\n\tmax-width: 100%;\n\tmax-height: 50px;\n}\n\n.sp-setup-content {\n\tbox-shadow: 0 1px 3px rgba(0, 0, 0, .13);\n\tpadding: 24px 24px 0;\n\tbackground: #fff;\n\tzoom: 1;\n}\n\n.sp-setup-content:after {\n\tcontent: \"\";\n\tdisplay: table;\n\tclear: both;\n}\n\n.sp-setup-content h1,\n.sp-setup-content h2,\n.sp-setup-content h3,\n.sp-setup-content table {\n\tmargin: 0 0 24px;\n\tborder: 0;\n\tpadding: 0;\n\tcolor: #666;\n\tclear: none;\n}\n\n.sp-setup-content p {\n\tmargin: 0 0 24px;\n}\n\n.sp-setup-content a {\n\tcolor: #00a69c;\n}\n\n.sp-setup-content a:focus,\n.sp-setup-content a:hover {\n\tcolor: #111;\n}\n\n.sp-setup-content .form-table {\n\twidth: 100%;\n\tborder-top: 1px solid #eee;\n}\n\n.sp-setup-content .form-table th {\n\twidth: 30%;\n\tvertical-align: top;\n\tfont-weight: 700;\n}\n\n.sp-setup-content .form-table td {\n\tvertical-align: top;\n}\n\n.sp-setup-content .form-table td input,\n.sp-setup-content .form-table td select {\n\twidth: 100%;\n\tbox-sizing: border-box;\n}\n\n.sp-setup-content .form-table td input[size] {\n\twidth: auto;\n}\n\n.sp-setup-content .form-table td ol,\n.sp-setup-content .form-table td ul {\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.sp-setup-content .form-table td ul {\n\tlist-style: none;\n}\n\n.sp-setup-content .form-table td li {\n\tmargin-bottom: 10px;\n}\n\n.sp-setup-content .form-table td li:last-child {\n\tmargin-bottom: 0;\n}\n\n.sp-setup-content .form-table td .description {\n\tline-height: 1.5em;\n\tdisplay: block;\n\tmargin: .25em 0 0;\n\tcolor: #999;\n\tfont-style: italic;\n}\n\n.sp-setup-content .form-table td .input-checkbox,\n.sp-setup-content .form-table td .input-radio {\n\twidth: auto;\n\tbox-sizing: inherit;\n\tpadding: inherit;\n\tmargin: 0 .5em 0 0;\n\tbox-shadow: none;\n}\n\n.sp-setup-content .form-table .section_title td {\n\tpadding: 0;\n}\n\n.sp-setup-content .form-table .section_title td h2,\n.sp-setup-content .form-table .section_title td p {\n\tmargin: 12px 0 0;\n}\n\n.sp-setup-content .form-table td,\n.sp-setup-content .form-table th {\n\tpadding: 14px 0;\n\tmargin: 0;\n\tborder: 0;\n\tborder-bottom: 1px solid #eee;\n}\n\n.sp-setup-content .form-table td:first-child,\n.sp-setup-content .form-table th:first-child {\n\tpadding-right: 9px;\n}\n\n.sp-setup-content .form-table th .sp-desc-tip {\n\tline-height: 1.4;\n}\n\n.sp-setup-content .form-table .sp-chosen-container {\n\tdisplay: block;\n}\n\n.sp-setup-content .form-table .sp-location-picker {\n\twidth: 100%;\n\theight: 320px;\n\tmargin: 0.5em 0 0;\n}\n\n.sp-setup-content .twitter-share-button {\n\tfloat: right;\n}\n\n.sp-setup-content .sp-banner {\n\tmargin: 0 -24px 24px;\n}\n\n.sp-setup-content .sp-banner img {\n\tdisplay: block;\n\twidth: auto;\n\theight: auto;\n\tmax-width: 100%;\n}\n\n.sp-setup-content .sp-setup-next-steps {\n\toverflow: hidden;\n\tmargin: 0 0 24px;\n}\n\n.sp-setup-content .sp-setup-next-steps h2 {\n\tmargin-bottom: 12px;\n}\n\n.sp-setup-content .sp-setup-next-steps .sp-setup-next-steps-first {\n\tfloat: left;\n\twidth: 50%;\n\tbox-sizing: border-box;\n}\n\n.sp-setup-content .sp-setup-next-steps .sp-setup-next-steps-last {\n\tfloat: right;\n\twidth: 50%;\n\tbox-sizing: border-box;\n}\n\n.sp-setup-content .sp-setup-next-steps ul {\n\tpadding: 0 2em 0 0;\n\tlist-style: none;\n\tmargin: 0;\n}\n\n.sp-setup-content .sp-setup-next-steps ul li .button {\n\tdisplay: block;\n\tpadding: 0 0 .75em;\n}\n\n.sp-setup-content .sp-setup-next-steps ul li .button-first-event {\n\tbackground-color: #3bbab3;\n\tborder-color: #15a29a;\n\t-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;\n\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;\n\ttext-shadow: 0 -1px 1px #15a29a, 1px 0 1px #15a29a, 0 1px 1px #15a29a, -1px 0 1px #15a29a;\n\tfont-size: 1em;\n\theight: auto;\n\tline-height: 1.75em;\n\tmargin: 0 0 .75em;\n\topacity: 1;\n\tpadding: 1em;\n\ttext-align: center;\n}\n\n.sp-setup-content .sp-setup-next-steps ul li .button-first-event:active,\n.sp-setup-content .sp-setup-next-steps ul li .button-first-event:focus,\n.sp-setup-content .sp-setup-next-steps ul li .button-first-event:hover {\n\tbackground: #15a29a;\n\tborder-color: #15a29a;\n\t-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;\n\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;\n}\n\n.sp-setup-content .sp-setup-next-steps ul li a:before {\n\tcolor: #82878c;\n\tfont: 400 20px/1 dashicons;\n\tspeak: none;\n\tdisplay: inline-block;\n\tpadding: 0 10px 0 0;\n\ttop: 1px;\n\tposition: relative;\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\ttext-decoration: none!important;\n\tvertical-align: top;\n}\n\n.sp-setup-content .sp-setup-next-steps ul .learn-more a:before {\n\tcontent: \"\\f105\";\n}\n\n.sp-setup-content .sp-setup-next-steps ul .video-walkthrough a:before {\n\tcontent: \"\\f126\";\n}\n\n.sp-setup-content .sp-setup-next-steps ul .newsletter a:before {\n\tcontent: \"\\f465\";\n}\n\n.sp-setup-content .updated {\n\tpadding: 24px 24px 0;\n\tmargin: 0 0 24px;\n\toverflow: hidden;\n\tbackground: #f5f5f5;\n}\n\n.sp-setup-content .updated p {\n\tpadding: 0;\n\tmargin: 0 0 12px;\n}\n\n.sp-setup-content .updated p:last-child {\n\tmargin: 0 0 24px;\n}\n\n.sp-setup-steps {\n\tpadding: 0 0 24px;\n\tmargin: 0;\n\tlist-style: none;\n\toverflow: hidden;\n\tcolor: #ccc;\n\twidth: 100%;\n\tdisplay: -webkit-inline-flex;\n\tdisplay: -ms-inline-flexbox;\n\tdisplay: inline-flex;\n}\n\n.sp-setup-steps li {\n\twidth: 20%;\n\tfloat: left;\n\tpadding: 0 0 .8em;\n\tmargin: 0;\n\ttext-align: center;\n\tposition: relative;\n\tborder-bottom: 4px solid #ccc;\n\tline-height: 1.4em;\n}\n\n.sp-setup-steps li:before {\n\tcontent: \"\";\n\tborder: 4px solid #ccc;\n\tborder-radius: 100%;\n\twidth: 4px;\n\theight: 4px;\n\tposition: absolute;\n\tbottom: 0;\n\tleft: 50%;\n\tmargin-left: -6px;\n\tmargin-bottom: -8px;\n\tbackground: #fff;\n}\n\n.sp-setup-steps li.active {\n\tborder-color: #00a69c;\n\tcolor: #00a69c;\n}\n\n.sp-setup-steps li.active:before {\n\tborder-color: #00a69c;\n}\n\n.sp-setup-steps li.done {\n\tborder-color: #00a69c;\n\tcolor: #00a69c;\n}\n\n.sp-setup-steps li.done:before {\n\tborder-color: #00a69c;\n\tbackground: #00a69c;\n}\n\n.sp-setup .sp-setup-actions:after {\n\tcontent: \"\";\n\tdisplay: table;\n\tclear: both;\n}\n\n.sp-setup .sp-setup-actions .button {\n\tfloat: right;\n\tfont-size: 1.25em;\n\tpadding: .5em 1em;\n\tline-height: 1em;\n\tmargin-right: .5em;\n\tmargin-bottom: 2px;\n\theight: auto;\n\tborder-radius: 4px;\n}\n\n.sp-setup .sp-setup-actions .button-primary {\n\tbackground-color: #3bbab3;\n\tborder-color: #15a29a;\n\t-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;\n\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;\n\ttext-shadow: 0 -1px 1px #15a29a, 1px 0 1px #15a29a, 0 1px 1px #15a29a, -1px 0 1px #15a29a;\n\tfloat: right;\n\tmargin: 0 0 0 1em;\n\topacity: 1;\n}\n\n.sp-setup .sp-setup-actions .button-primary:active,\n.sp-setup .sp-setup-actions .button-primary:focus,\n.sp-setup .sp-setup-actions .button-primary:hover {\n\tbackground: #15a29a;\n\tborder-color: #15a29a;\n\t-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;\n\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a;\n}\n\n.sp-setup .sp-setup-actions .button-muted {\n\tborder: none;\n\tbackground: transparent;\n\t-webkit-box-shadow: none;\n\tbox-shadow: none;\n\tpadding: 0;\n\tmargin: .55em 0.05em 0.65em;\n\tcolor: #ccc;\n}\n\n.sp-setup .sp-setup-actions .button-muted:hover {\n\tcolor: #999;\n}\n\n.sp-return-to-dashboard {\n\tfont-size: .85em;\n\tmargin: 1.18em 0;\n\tdisplay: block;\n\ttext-align: center;\n}\n\n.sp-return-to-dashboard a {\n\tcolor: #b5b5b5;\n}\n\n.sp-return-to-dashboard a:hover {\n\tcolor: #888;\n}\n\n/* Media Queries */\n\n@media screen and (max-width: 782px) {\n\t.sp-setup-content .form-table tbody th {\n\t\twidth: auto\n\t};\n}\n\n@media screen and (min-width: 783px) {\n\t.sp-setup-content .form-table td li input {\n\t\twidth: 40%;\n\t}\n\n\t.sp-setup-content .form-table td .player input {\n\t\twidth: 40%;\n\t}\n\n\t.sp-setup-content .form-table td .player .player-number {\n\t\twidth: 11%;\n\t}\n\n\t.sp-setup-content .form-table td .staff .staff-name {\n\t\twidth: 52%;\n\t}\n}\n"
  },
  {
    "path": "assets/css/slickmap.css",
    "content": "/*!\nAdapted from SlickMap CSS by Matt Everson of Astuteo, LLC\nhttp://astuteo.com/slickmap\n\nVersion 1.1\nCopyright (c) 2009 Astuteo, LLC http://astuteo.com\n*/\n\n.sportspress-overview-wrap {\n\tmargin-right: 0;\n}\n\n.sp-sitemap {\n\tmargin: 40px 0;\n\tfloat: left;\n\twidth: 100%;\n\tposition: relative;\n}\n\n/* ------------------------------------------------------------\n\tReset Styles (adapted from meyerweb.com)\n------------------------------------------------------------ */\n\n.sp-sitemap div, .sp-sitemap span, .sp-sitemap applet, .sp-sitemap object, .sp-sitemap iframe, .sp-sitemap\nh1, .sp-sitemap h2, .sp-sitemap h3, .sp-sitemap h4, .sp-sitemap h5, .sp-sitemap h6, .sp-sitemap p, .sp-sitemap blockquote, .sp-sitemap pre, .sp-sitemap\na, .sp-sitemap abbr, .sp-sitemap acronym, .sp-sitemap address, .sp-sitemap big, .sp-sitemap cite, .sp-sitemap code, .sp-sitemap\ndel, .sp-sitemap dfn, .sp-sitemap em, .sp-sitemap font, .sp-sitemap img, .sp-sitemap ins, .sp-sitemap kbd, .sp-sitemap q, .sp-sitemap s, .sp-sitemap samp, .sp-sitemap\nsmall, .sp-sitemap strike, .sp-sitemap strong, .sp-sitemap sub, .sp-sitemap sup, .sp-sitemap tt, .sp-sitemap var, .sp-sitemap\ndl, .sp-sitemap dt, .sp-sitemap dd, .sp-sitemap ol, .sp-sitemap ul, .sp-sitemap li, .sp-sitemap\nfieldset, .sp-sitemap form, .sp-sitemap label, .sp-sitemap legend, .sp-sitemap\ntable, .sp-sitemap caption, .sp-sitemap tbody, .sp-sitemap tfoot, .sp-sitemap thead, .sp-sitemap tr, .sp-sitemap th, .sp-sitemap td {\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\toutline: 0;\n\tvertical-align: baseline;\n}\n\n/* ------------------------------------------------------------\n\tNumber of Columns\n------------------------------------------------------------ */\n\n.sp-sitemap li {\n\twidth: 12.5%;\n}\n\n.sp-sitemap li ul li {\n\twidth:100% !important;\n}\n\n.sp-sitemap .sp-primary { max-width: 1600px; }\n.sp-sitemap .col0 { max-width: 200px; }\n.sp-sitemap .col1 { max-width: 200px; }\n.sp-sitemap .col2 { max-width: 400px; }\n.sp-sitemap .col3 { max-width: 600px; }\n.sp-sitemap .col4 { max-width: 800px; }\n.sp-sitemap .col5 { max-width: 1000px; }\n.sp-sitemap .col6 { max-width: 1200px; }\n.sp-sitemap .col7 { max-width: 1400px; }\n.sp-sitemap .col8 { max-width: 1600px; }\n\n.sp-sitemap .col1 li { width:99.9%; }\n.sp-sitemap .col2 li { width:50%; }\n.sp-sitemap .col3 li { width:33.3%; }\n.sp-sitemap .col4 li { width:25%; }\n.sp-sitemap .col5 li { width:20%; }\n.sp-sitemap .col6 li { width:16.6%; }\n.sp-sitemap .col7 li { width:14.2%; }\n.sp-sitemap .col8 li { width:12.5%; }\n\n/* ------------------------------------------------------------\n\tGeneral Styles\n------------------------------------------------------------ */\n\n.sp-sitemap h1 {\n\tfont-weight: bold;\n\ttext-transform: uppercase;\n\tfont-size: 20px;\n\tmargin: 0 0 5px 0;\n}\n.sp-sitemap h2 {\n\tfont-size: 10px;\n\tcolor: #777777;\n\tmargin: 0 0 20px 0;\n}\n.sp-sitemap a {\n\ttext-decoration: none;\n}\n.sp-sitemap ol, .sp-sitemap ul {\n\tlist-style: none;\n}\n.sp-sitemap li {\n\tmargin: 0;\n}\n.sp-sitemap li a.button {\n\twhite-space: normal;\n\tposition: relative;\n\ttext-align: center;\n\tpadding: 10px 0;\n}\n.sp-sitemap li a.action {\n\twhite-space: normal;\n\tposition: relative;\n\ttext-align: center;\n\tpadding: 10px 28px;\n}\n.sp-sitemap li a.button span {\n\tposition: absolute;\n\tleft: 9px;\n\ttop: 9px;\n}\n.sp-sitemap li a.button span.dashicons-plus {\n\ttop: 12px;\n}\n.sp-sitemap li a.button-primary span {\n\topacity: 0.55;\n}\n\n\n/* ------------------------------------------------------------\n\tSite Map Styles\n------------------------------------------------------------ */\n\n/* --------\tTop Level --------- */\n\n.sp-sitemap .sp-primary .sp-home {\n\tdisplay: block;\n\tfloat: none;\n\tbackground: #f1f1f1 url('../images/slickmap/L1-left.png') center bottom no-repeat;\n\tposition: relative;\n\tz-index: 2;\n\tpadding: 0 0 30px 0;\n}\n.sp-sitemap .sp-primary .sp-breadcrumb {\n\tdisplay: block;\n\tfloat: none;\n\tbackground: #f1f1f1 url('../images/slickmap/vertical-line.png') center bottom repeat-y;\n\tposition: relative;\n\tz-index: 2;\n\tpadding: 0 0 30px 0;\n\tmargin-bottom: 30px;\n}\n.sp-sitemap .sp-primary li {\n\tmin-width: 149px;\n\tfloat: left;\n\tbackground: url('../images/slickmap/L1-center.png') center top no-repeat;\n\tpadding: 30px 0;\n\tmargin-top: -30px;\n}\n.sp-sitemap .sp-primary li a.button {\n\tmargin: 0 20px 0 0;\n\tdisplay: block;\n\tfont-size: 13px;\n\tfont-weight: bold;\n\theight: auto;\n\tline-height: normal;\n}\n.sp-sitemap .sp-primary li:last-child {\n\tbackground: url('../images/slickmap/L1-right.png') center top no-repeat;\n}\n\n/* --------\tSecond Level --------- */\n\n.sp-sitemap .sp-primary li li {\n\twidth: 100%;\n\tclear: left;\n\tmargin-top: 0;\n\tpadding: 10px 0 0 0;\n\tbackground: url('../images/slickmap/vertical-line.png') center bottom repeat-y;\n}\n.sp-sitemap .sp-primary li li:first-child {\n\tpadding-top: 30px;\n}\n.sp-sitemap .sp-primary li li:last-child {\n\tbackground: url('../images/slickmap/vertical-line.png') center bottom repeat-y;\n}\n\n/* --------\tThird Level --------- */\n\n.sp-sitemap .sp-primary li li ul {\n\tmargin: 10px 0 0 0;\n\twidth: 100%;\n\tfloat: right;\n\tpadding: 9px 0 10px 0;\n\tbackground: #f1f1f1 url('../images/slickmap/L3-ul-top.png') center top no-repeat;\n}\n.sp-sitemap .sp-primary li li li {\n\tbackground: url('../images/slickmap/L3-center.png') left center no-repeat;\n\tpadding: 5px 0;\n}\n.sp-sitemap .sp-primary li li li a {\n\twidth: 80%;\n\tfloat: right;\n}\n.sp-sitemap .sp-primary li li li:first-child {\n\tpadding: 15px 0 5px 0;\n\tbackground: url('../images/slickmap/L3-li-top.png') left center no-repeat;\n}\n.sp-sitemap .sp-primary li li li:last-child {\n\tbackground: url('../images/slickmap/L3-bottom.png') left center no-repeat;\n}\n\n\n/* ------------------------------------------------------------\n\tUtility Navigation\n------------------------------------------------------------ */\n\n.sp-sitemap .sp-utility {\n\tfloat: right;\n\tmax-width: 80%;\n\tmargin-top: -30px;\n\tmargin-right: 10px;\n}\n.sp-sitemap .sp-utility li {\n\tfloat: left;\n\tmargin-bottom: 10px;\n\twidth: auto;\n}\n.sp-sitemap .sp-utility li a.button {\n\tmargin: 0 10px 0 0;\n\tpadding: 10px 16px;\n\tdisplay: block;\n\tfont-size: 13px;\n\tfont-weight: bold;\n\theight: auto;\n\tline-height: normal;\n\tposition: relative;\n\tz-index: 10;\n}\n.sp-sitemap .sp-utility li a:link:before,\n.sp-sitemap .sp-utility li a:visited:before {\n\tmargin-bottom: 3px;\n}\n\n@media screen and ( max-width: 782px ) {\n\t.sp-sitemap .sp-primary {\n\t\tclear: both;\n\t\tpadding-top: 50px;\n\t}\n\t.sp-sitemap .sp-utility {\n\t\tmax-width: none;\n\t}\n}\n"
  },
  {
    "path": "assets/css/sportspress-rtl.css",
    "content": "/* SportsPress RTL */\n\n/* Thumbnails and Details */\n.sp-template-logo,\n.sp-template-photo {\n\tfloat: right;\n\tmargin-right: 0;\n\tmargin-left: 2em;\n}\n\n/* Profile selector */\n.sp-template-profile-selector {\n\ttext-align: left;\n}\n\n/* Data Tables */\n.sp-data-table .data-name {\n\ttext-align: right !important;\n}\n\n/* Pagination */\n.sp-table-wrapper .dataTables_paginate .previous {\n\tfloat: right;\n\tmargin-left: 0.5em;\n\tmargin-right: 0;\n}\n.sp-table-wrapper .dataTables_paginate .next {\n\tfloat: left;\n\tmargin-right: 0.5em;\n\tmargin-left: 0;\n}\n\n/* League Table and Player List */\n.sp-player-list .data-name .player-photo,\n.sp-player-list .data-name .player-flag {\n\tmargin-right: 0;\n\tmargin-left: 0.5em;\n}\n\n/* Event Performance (Icons) */\n.sp-event-performance-teams .sp-template-event-performance-icons {\n  float: right;\n  clear: right;\n  padding-right: 0;\n  padding-left: 10px;\n}\n\n.sp-event-performance-teams .sp-template-event-performance-icons:nth-child(2n) {\n  float: left;\n  clear: left;\n  padding-left: 0;\n  padding-right: 10px;\n}\n\n/* Event Calendar */\n.sp-event-calendar #next {\n\ttext-align: left;\n}\n.sp-event-calendar #prev {\n\ttext-align: right;\n}\n\n/* Event List */\n.sp-event-list .data-article a .dashicons {\n\tpadding-right: 0;\n\tpadding-left: 3px;\n}\n.sp-event-list .data-home {\n\ttext-align: left;\n}\n.sp-event-list .data-away {\n\ttext-align: right;\n}\n.sp-event-list .data-home img {\n\tfloat: left;\n\tmargin-left: 0;\n\tmargin-right: 8px;\n}\n.sp-event-list .data-away img {\n\tfloat: right;\n\tmargin-right: 0;\n\tmargin-left: 8px;\n}\n\n/* Event Blocks */\n.sp-event-blocks .logo-odd {\n\tfloat: right;\n}\n.sp-event-blocks .logo-even {\n\tfloat: left;\n}\n\n@media only screen and (min-width: 601px) {\n\t.sp-template-logo + .sp-post-content {\n\t\tclear: right;\n\t}\n}\n"
  },
  {
    "path": "assets/css/sportspress-style-ltr.css",
    "content": "/* SportsPress Templates LTR */\n\n/*\n * Note: !important everything to enforce overrides.\n * This stylesheet can be disabled via SportsPress General Settings.\n */\n\n.sp-tournament-bracket .sp-team .sp-team-name:before {\n\tborder-left-color: #e5e5e5 !important;\n\tborder-right-color: #e5e5e5 !important;\n\tleft: -10px !important;\n}\n\n.sp-tournament-bracket .sp-team-flip .sp-team-name:before {\n\tleft: auto !important;\n\tright: -10px !important;\n}\n\n.sp-tournament-bracket .sp-team.sp-first-round .sp-team-name {\n\tmargin-left: -1px !important;\n}\n\n.sp-tournament-bracket .sp-team.sp-last-round .sp-team-name {\n\tmargin-right: -1px !important;\n}\n\n.sp-template-event-performance-icons .sp-performance-icons {\n\ttext-align: right !important;\n}\n\n.sp-data-table .data-name {\n\ttext-align: left !important;\n}\n"
  },
  {
    "path": "assets/css/sportspress-style-rtl.css",
    "content": "/* SportsPress Templates RTL */\n\n/*\n * Note: !important everything to enforce overrides.\n * This stylesheet can be disabled via SportsPress General Settings.\n */\n\n.sp-tournament-bracket .sp-team .sp-team-name:before {\n\tborder-right-color: #e5e5e5 !important;\n\tborder-left-color: #e5e5e5 !important;\n\tright: -10px !important;\n}\n\n.sp-tournament-bracket .sp-team-flip .sp-team-name:before {\n\tright: auto !important;\n\tleft: -10px !important;\n}\n\n.sp-tournament-bracket .sp-team.sp-first-round .sp-team-name {\n\tmargin-right: -1px !important;\n}\n\n.sp-tournament-bracket .sp-team.sp-last-round .sp-team-name {\n\tmargin-left: -1px !important;\n}\n\n.sp-template-event-performance-icons .sp-performance-icons {\n\ttext-align: left !important;\n}\n\n.sp-data-table .data-name {\n\ttext-align: right !important;\n}\n"
  },
  {
    "path": "assets/css/sportspress-style.css",
    "content": "/* SportsPress Templates */\n\n.sp-template,\n.sp-data-table,\n.sp-table-caption {\n\tfont-family: \"Roboto\", \"Helvetica\", sans-serif;\n}\n\n.sp-template {\n\tclear: both;\n\toverflow: hidden;\n}\n\n/*\n * Note: !important everything below to enforce overrides.\n * This stylesheet can be disabled via SportsPress General Settings.\n */\n\n.sp-template h1,\n.sp-template h2,\n.sp-template h3,\n.sp-template h4,\n.sp-template h5,\n.sp-template h6,\n.sp-data-table h1,\n.sp-data-table h2,\n.sp-data-table h3,\n.sp-data-table h4,\n.sp-data-table h5,\n.sp-data-table h6,\n.sp-table-caption h1,\n.sp-table-caption h2,\n.sp-table-caption h3,\n.sp-table-caption h4,\n.sp-table-caption h5,\n.sp-table-caption h6 {\n\tfont-family: \"Roboto\", \"Helvetica\", sans-serif !important;\n}\n\n.sp-template {\n\tmargin-bottom: 20px !important;\n}\n\n.sp-template *,\n.sp-data-table *,\n.sp-table-caption {\n\tbox-sizing: border-box !important;\n\tfont-weight: 400 !important;\n\ttext-transform: none !important;\n\tletter-spacing: normal !important;\n\tcolor: #333 !important;\n}\n\n.sp-table-caption {\n\tmargin: 0 !important;\n\tpadding: 15px !important;\n\tbackground: #fff !important;\n\tborder: 1px solid #e5e5e5 !important;\n\tborder-bottom: none !important;\n\tfont-size: 20px !important;\n\tfont-weight: 400 !important;\n\tline-height: 1.5 !important;\n\tdisplay: table !important;\n\twidth: 100% !important;\n}\n\n/* Color Resets */\n\n.sp-template input,\n.sp-data-table input,\n.sp-template .sp-event-logos,\n.sp-template .sp-event-staff {\n\tcolor: initial !important;\n}\n\n/* Links */\n\n.sp-template a,\n.sp-data-table a {\n\tbox-shadow: none !important;\n\tborder: none !important;\n\ttext-decoration: none !important;\n\tfont-weight: inherit !important;\n\tcolor: #00a69c !important;\n}\n\n.sp-template a:hover,\n.sp-data-table a:hover {\n\ttext-decoration: underline !important;\n}\n\n.sp-template a:hover .dashicons,\n.sp-template a:hover [class^=\"sp-icon-\"], [class*=\" sp-icon-\"],\n.sp-data-table a:hover .dashicons,\n.sp-data-table a:hover [class^=\"sp-icon-\"], [class*=\" sp-icon-\"] {\n\ttext-decoration: none !important;\n}\n\n.sp-view-all-link {\n\tpadding: 10px 15px !important;\n\tmargin: 0 !important;\n\tbackground: #fff !important;\n\tborder: 1px solid #e5e5e5 !important;\n\tborder-top: none !important;\n\toverflow: hidden !important;\n\tdisplay: table !important;\n\twidth: 100% !important;\n\ttext-align: right !important;\n}\n\n.sp-view-all-link a {\n\tfont-size: 12px !important;\n\tfont-weight: 400 !important;\n\tline-height: 1.5 !important;\n\ttext-decoration: none !important;\n\tcolor: rgba(51,51,51,0.5) !important;\n}\n\n.sp-view-all-link a:hover {\n\tcolor: #333 !important;\n\ttext-decoration: none !important;\n}\n\n.sp-form-events a:hover {\n\tcolor: #fff !important;\n\ttext-decoration: none !important;\n}\n\n/* Images */\n\n.sp-template img {\n\tdisplay: inline-block !important;\n\tbox-shadow: none !important;\n}\n\n/* Tables */\n\n.sp-data-table {\n\tmargin: 0 !important;\n\tbackground: #fff !important;\n\tborder-collapse: collapse !important;\n\tborder: 1px solid #e5e5e5 !important;\n\twidth: 100% !important;\n}\n\n.sp-data-table tr {\n\tborder: none !important;\n}\n\n.sp-data-table th,\n.sp-data-table td {\n\tfont-size: 13px !important;\n\tfont-weight: 400 !important;\n\tline-height: 1.5 !important;\n\tborder: 1px solid #e5e5e5 !important;\n\tpadding: 5px 10px !important;\n\ttext-align: center !important;\n}\n\n.sp-data-table th {\n\tfont-size: 12px !important;\n\tfont-weight: 500 !important;\n\tbackground: #fff !important;\n\tcolor: #999 !important;\n\tborder: none !important;\n}\n\n.sp-data-table th a {\n\tcolor: inherit !important;\n}\n\n.sp-data-table .sp-highlight,\n.sp-data-table .highlighted td {\n\tfont-weight: 500 !important;\n\tbackground: #f9f9f9 !important;\n}\n\n/* Galleries */\n\n.sp-template-gallery .sp-gallery-wrapper {\n\tborder: 1px solid #e5e5e5 !important;\n\tbackground: #fff !important;\n\tdisplay: table !important;\n\twidth: 100% !important;\n}\n\n.sp-template-gallery .gallery-item {\n\tpadding: 0 !important;\n\tmargin: 0 !important;\n\tposition: relative !important;\n}\n\n.sp-template-gallery .gallery-item a {\n\tdisplay: block !important;\n\tcolor: #999 !important;\n}\n\n.sp-template-gallery .gallery-item img {\n\tdisplay: block !important;\n\tborder: none !important;\n\tpadding: 0 !important;\n\tmargin: 0 !important;\n\tborder-radius: 0 !important;\n}\n\n.sp-template-gallery .gallery-caption {\n\tpadding: 0 !important;\n\tmargin: 0 !important;\n\tfont-size: 12px !important;\n\tfont-style: normal !important;\n\tfont-weight: 500 !important;\n\ttext-align: center !important;\n\tcolor: #999 !important;\n\tline-height: 1.5 !important;\n\tpadding: 5px 10px !important;\n}\n\n.sp-template-gallery .gallery-caption strong {\n\tcolor: #fff !important;\n\tbackground: #00a69c !important;\n\tdisplay: block !important;\n\tfont-weight: 400 !important;\n\tfont-size: 13px !important;\n\tline-height: 1.5 !important;\n\tposition: absolute !important;\n\tleft: 0 !important;\n\ttop: 0 !important;\n\tpadding: 5px 10px !important;\n}\n\n.sp-template-staff-gallery .gallery-caption strong {\n\tdisplay: none !important;\n}\n\n.sp-template-gallery .sp-gallery-group-name {\n\tmargin: 0 !important;\n\tpadding: 15px !important;\n\tbackground: #fff !important;\n\tborder-bottom: 1px solid #e5e5e5 !important;\n\tfont-size: 20px !important;\n\tfont-weight: 400 !important;\n\tline-height: 1.5 !important;\n\tdisplay: block !important;\n}\n\n/* Countdowns */\n\n.sp-template-countdown .sp-event-name,\n.sp-template-countdown .sp-event-venue,\n.sp-template-countdown .sp-event-league,\n.sp-template-countdown .sp-event-date {\n\tmargin: 0 !important;\n\tpadding: 5px 10px !important;\n\ttext-align: center !important;\n\tline-height: 1.5 !important;\n\tdisplay: table !important;\n\twidth: 100% !important;\n\tbackground: #fff !important;\n\tborder: 1px solid #e5e5e5 !important;\n\tborder-bottom: none !important;\n}\n\n.sp-template-countdown .sp-event-name {\n\tfont-size: 13px !important;\n\tfont-weight: 400 !important;\n\tcolor: #333 !important;\n}\n\n.sp-template-countdown .sp-event-venue,\n.sp-template-countdown .sp-event-league,\n.sp-template-countdown .sp-event-date {\n\tfont-size: 12px !important;\n\tfont-weight: 500 !important;\n\tbackground: #fff !important;\n\tcolor: #999 !important;\n}\n\n.sp-template-countdown .sp-event-venue a,\n.sp-template-countdown .sp-event-league a {\n\tcolor: inherit !important;\n}\n\n.sp-countdown time {\n\tdisplay: table !important;\n\tbackground: #fff !important;\n\tborder: 1px solid #e5e5e5 !important;\n\tborder-collapse: collapse !important;\n\twidth: 100% !important;\n}\n\n.sp-countdown span {\n\tfont-size: 20px !important;\n\tfont-weight: 400 !important;\n\tline-height: 1.5 !important;\n\tdisplay: table-cell !important;\n\tborder: 1px solid #e5e5e5 !important;\n\tpadding: 10px 5px !important;\n\ttext-align: center !important;\n}\n\n.sp-countdown span small {\n\tfont-size: 12px !important;\n\tfont-weight: 400 !important;\n\tline-height: 1.5 !important;\n\tfont-weight: 500 !important;\n\tcolor: rgba(51,51,51,0.5) !important;\n\tdisplay: block !important;\n}\n\n/* Event Calendars */\n\n.sp-template-event-calendar .sp-table-caption {\n\tdisplay: table-caption !important;\n}\n\n.sp-template-event-calendar td {\n\tpadding: 10px 5px !important;\n}\n\n.sp-template-event-calendar tfoot td {\n\tpadding: 10px 15px !important;\n\tborder: none !important;\n}\n\n.sp-template-event-calendar .sp-previous-month {\n\ttext-align: left !important;\n}\n\n.sp-template-event-calendar .sp-next-month {\n\ttext-align: right !important;\n}\n\n.sp-template-event-calendar tfoot a {\n\tfont-size: 12px !important;\n\tfont-weight: 400 !important;\n\tline-height: 1.5 !important;\n\ttext-decoration: none !important;\n\tcolor: rgba(51,51,51,0.5) !important;\n}\n\n.sp-template-event-calendar tfoot a:hover {\n\tcolor: #333 !important;\n\ttext-decoration: none !important;\n}\n\n.sp-template-event-calendar tbody td {\n\tposition: relative !important;\n}\n\n.sp-template-event-calendar tbody td a:before {\n\tcontent: '•' !important;\n\tposition: absolute !important;\n\tfont-size: 20px !important;\n\tline-height: 1 !important;\n\twidth: 1em !important;\n\ttop: 0 !important;\n\tright: 0 !important;\n}\n\n/* Event Lists */\n\n.sp-template-event-list .data-home {\n\ttext-align: right !important;\n}\n\n.sp-template-event-list .data-away {\n\ttext-align: left !important;\n}\n\n/* Event Blocks */\n\n.sp-template-event-blocks td {\n\tpadding: 0 !important;\n}\n\n.sp-template-event-blocks .sp-event-date {\n\tcolor: rgba(51,51,51,0.5) !important;\n\tfont-weight: 500 !important;\n\tfont-size: 12px !important;\n\tmargin: 10px !important;\n}\n\n.sp-template-event-blocks .sp-event-date a,\n.sp-template-event-blocks .sp-event-date a:hover {\n\tcolor: inherit !important;\n}\n\n.sp-template-event-blocks .sp-event-results {\n\tfont-size: 20px !important;\n\tfont-weight: 400 !important;\n\tpadding: 0 !important;\n\tmargin: 0 !important;\n\tcolor: #333 !important;\n}\n\n.sp-template-event-blocks .sp-event-results a {\n\tcolor: inherit !important;\n}\n\n.sp-template-event-blocks .sp-event-results a:hover {\n\tcolor: inherit !important;\n\ttext-decoration: none !important;\n}\n\n.sp-template-event-blocks .sp-event-title,\n.sp-template-event-blocks .sp-event-status {\n\tdisplay: block !important;\n\tpadding: 0 !important;\n\tmargin: 10px !important;\n\tfont-size: 13px !important;\n\tfont-weight: 400 !important;\n}\n\n/* Event Logos */\n\n.sp-template-event-logos .sp-team-name,\n.sp-template-event-logos .sp-team-result {\n\tfont-size: 20px !important;\n\tfont-weight: 400 !important;\n\tpadding: 0 !important;\n\tmargin: 0 !important;\n\tcolor: #333 !important;\n}\n\n.sp-template-event-logos a,\n.sp-template-event-logos a:hover {\n\tborder: none !important;\n\ttext-decoration: none !important;\n}\n\n/* Event Performance */\n\n.sp-template-event-performance-icons td {\n\tborder: none !important;\n}\n\n.sp-template-event-performance-icons tr:first-child td {\n\tborder-top: 1px solid #e5e5e5 !important;\n}\n\n/* Videos */\n.sp-template-event-video iframe {\n\twidth: 100% !important;\n}\n\n/*  Match Stats */\n\n.sp-template-event-statistics .sp-statistic-label {\n\tfont-size: 12px !important;\n\tfont-weight: 500 !important;\n\tcolor: inherit !important;\n\topacity: 0.5 !important;\n}\n\n.sp-event-statistics {\n\tbackground: transparent !important;\n\tmargin: 0 0 10px !important;\n}\n\n.sp-event-statistics,\n.sp-event-statistics tr,\n.sp-event-statistics td {\n\tborder: none !important;\n}\n\n.sp-event-statistics .sp-statistic-ratio {\n\tpadding: 0 !important;\n}\n\n.sp-event-statistics .sp-statistic-bar {\n\tborder: 1px solid #e5e5e5 !important;\n\tbackground: #f9f9f9 !important;\n}\n\n/* Venues */\n\n.sp-event-venue-map-row td {\n\tpadding: 0 !important;\n}\n\n.sp-event-venue-map-row .sp-google-map {\n\tdisplay: block !important;\n\tmargin: 0 !important;\n}\n\n/* Teams */\n\n.sp-template-logo {\n\tfloat: right !important;\n\tmargin: 0 0 20px 20px !important;\n\tclear: none !important;\n}\n\n/* Profiles */\n\n.sp-template-details dl {\n\tmargin: 0 0 20px !important;\n\tpadding: 15px !important;\n\tborder: 1px solid #e5e5e5 !important;\n\tbackground: #fff !important;\n}\n\n.sp-template-details dt,\n.sp-template-details dd {\n\tmargin: 0 !important;\n\tpadding: 0 !important;\n}\n\n.sp-template-details dt {\n\tfont-size: 12px !important;\n\tfont-weight: 500 !important;\n\tcolor: rgba(51,51,51,0.5) !important;\n}\n\n.sp-template-details dd {\n\tfont-size: 16px !important;\n\tfont-weight: 400 !important;\n\tcolor: #333 !important;\n\tmargin-bottom: 10px !important;\n}\n\n.sp-template-details dd:last-child {\n\tmargin-bottom: 0 !important;\n}\n\n/* Twitter */\n\n.sp-tweets {\n\tborder: 1px solid #e5e5e5 !important;\n\tborder-top: none !important;\n}\n\n/* Scoreboards */\n\n.sp-header-scoreboard .sp-template-scoreboard {\n\tmargin-bottom: 0 !important;\n}\n\n.sp-template-scoreboard td {\n\tpadding: 0 !important;\n}\n\n.sp-template-scoreboard td:hover {\n\tbackground: #f9f9f9 !important;\n}\n\n.sp-template-scoreboard a,\n.sp-template-scoreboard a:hover {\n\ttext-decoration: none !important;\n\tcolor: #333 !important;\n}\n\n.sp-template-scoreboard .sp-scoreboard-date {\n\tfont-size: 12px !important;\n\tfont-weight: 500 !important;\n\tcolor: rgba(51,51,51,0.5) !important;\n}\n\n.sp-template-scoreboard .sp-scoreboard-nav {\n\tcolor: #fff !important;\n\tbackground: #00a69c !important;\n}\n\n/* Timelines */\n\n.sp-template-timeline .sp-timeline * {\n\tcolor: initial !important;\n}\n\n/* Tournaments */\n\n.sp-tournament-bracket {\n\tcolor: #333 !important;\n\tbackground: transparent !important;\n\twidth: 100% !important;\n\tborder-collapse: separate !important;\n}\n\n.sp-tournament-bracket a,\n.sp-tournament-bracket a:hover {\n\ttext-decoration: none !important;\n\tcolor: inherit !important;\n\tborder: none! important;\n}\n\n.sp-tournament-bracket tr,\n.sp-tournament-bracket th,\n.sp-tournament-bracket td {\n\tborder: none !important;\n}\n\n.sp-tournament-bracket thead th {\n\tfont-size: 12px !important;\n\tfont-weight: 500 !important;\n\tcolor: rgba(51,51,51,0.5) !important;\n\ttext-align: center !important;\n\tborder-bottom: 1px solid #e5e5e5 !important;\n}\n\n.sp-tournament-bracket .sp-team-name {\n\tfont-size: 13px !important;\n\tfont-weight: 400 !important;\n\ttext-align: center !important;\n\tbackground: #fff !important;\n\tborder: 1px solid #e5e5e5 !important;\n}\n\n.sp-tournament-bracket .sp-team-name:hover {\n\tborder: 1px solid #e5e5e5 !important;\n}\n\n.sp-tournament-bracket .sp-heading,\n.sp-tournament-bracket .sp-heading:hover {\n\tcolor: #fff !important;\n\tbackground: #00a69c !important;\n\tborder-color: #00a69c !important;\n}\n\n.sp-tournament-bracket .sp-event {\n\tborder-color: #e5e5e5 !important;\n\tborder-width: 1px !important;\n}\n\n.sp-tournament-bracket .sp-event .sp-event-title {\n\tfont-size: 12px !important;\n\tfont-weight: 400 !important;\n\tcolor: rgba(51,51,51,0.5) !important;\n\ttext-align: center !important;\n}\n\n.sp-tournament-bracket .sp-event .sp-event-title:hover {\n\tcolor: #333 !important;\n}\n\n/* Tabs */\n\n.sp-tab-menu {\n\tdisplay: block !important;\n\tclear: both !important;\n\tmargin: 0 0 20px !important;\n\tpadding: 0 !important;\n\tlist-style: none !important;\n}\n\n.sp-tab-menu-item {\n\tdisplay: inline-block !important;\n\tmargin: 0 !important;\n\tpadding: 0 !important;\n}\n\n.sp-tab-menu-item a {\n\tmargin: 0 !important;\n\tpadding: 5px 10px;\n\tborder-bottom: 2px solid transparent !important;\n\tbox-shadow: none !important;\n}\n\n.sp-tab-menu-item a:hover {\n\ttext-decoration: none !important;\n}\n\n.sp-tab-menu-item-active a,\n.sp-tab-menu-item-active a:hover {\n\tcolor: #00a69c !important;\n\tborder-bottom-color: #00a69c !important;\n}\n\n/* Messages */\n.sp-template .sp-message {\n\tcolor: #00a69c !important;\n\tborder-color: #00a69c !important;\n}\n\n/* Post Content */\n\n.single-sp_team .has-post-thumbnail .sp-post-content {\n\tclear: none;\n}\n\n/* Media Queries */\n\n@media screen and (min-width: 601px) {\n\t.sp-template-event-calendar tbody td {\n\t\tpadding: 15px 5px !important;\n\t}\n\n\t.sp-template-event-calendar tbody td a:before {\n\t\tfont-size: 25px !important;\n\t}\n\n\t.widget .sp-template-event-calendar tbody td {\n\t\tpadding: 10px 5px !important;\n\t}\n\n\t.widget .sp-template-event-calendar tbody td a:before {\n\t\tfont-size: 20px !important;\n\t}\n}\n\n@media screen and (min-width: 801px) {\n\t.sp-template-event-calendar tbody td {\n\t\tpadding: 20px 5px !important;\n\t}\n\n\t.sp-template-event-calendar tbody td a:before {\n\t\tfont-size: 30px !important;\n\t}\n\n\t.widget .sp-template-event-calendar tbody td {\n\t\tpadding: 10px 5px !important;\n\t}\n\n\t.widget .sp-template-event-calendar tbody td a:before {\n\t\tfont-size: 20px !important;\n\t}\n\n\t.sp-template-event-performance-icons.sp-template-event-performance-section:nth-child(2n) {\n\t\tpadding-top: 61px !important;\n\t}\n}\n"
  },
  {
    "path": "assets/css/sportspress.css",
    "content": "/* SportsPress */\n\n.sp-align-left {\n\ttext-align: left;\n}\n\n.sp-align-right {\n\ttext-align: right;\n}\n\n.sp-align-center {\n\ttext-align: center;\n}\n\n/* Header */\n.sp-header {\n\tposition: relative;\n\toverflow: visible;\n\tz-index: 10000;\n}\n\n/* Templates */\n.sp-template {\n\tmargin-bottom: 1.5em;\n}\n.sp-template-profile-selector {\n\tclear: both;\n\toverflow: hidden;\n}\n.sp-template-logo,\n.sp-template-photo {\n\tfloat: left;\n\tmargin-bottom: 2em;\n\tmargin-right: 2em;\n\tmax-width: 50%;\n}\n.sp-template-event-logos {\n\ttext-align: center;\n}\n.sp-template-details {\n\tdisplay: inline;\n}\n.sp-template-details dl {\n\toverflow: hidden;\n}\n\n/* Tabs */\n.sp-tab-menu {\n\tdisplay: block;\n\tclear: both;\n\tpadding: 0 5px;\n\tmargin: 0 0 1.5em;\n\tlist-style: none;\n}\n.sp-tab-menu-item {\n\tdisplay: inline-block;\n\tmargin: 0;\n}\n.sp-tab-menu-item a {\n\tdisplay: block;\n\tmargin: 0 10px;\n\tcolor: inherit;\n\topacity: 0.5;\n\ttransition: all .3s;\n}\n.sp-tab-menu-item a:focus {\n\toutline: none;\n}\n.sp-tab-menu-item-active a,\n.sp-tab-menu-item a:hover {\n\tcolor: inherit;\n\topacity: 1;\n}\n.sp-tab-content {\n\tdisplay: none;\n}\n\n/* Profile selector */\n.sp-template-profile-selector {\n\ttext-align: right;\n\tmargin-bottom: 0.5em;\n}\n\n/* Data Tables */\n.sp-scrollable-table-wrapper {\n\twidth: 100%;\n\toverflow: hidden;\n\toverflow-x: auto;\n}\n.sp-data-table {\n\twidth: 100%;\n\ttable-layout: auto;\n\tborder-spacing: 0;\n}\n.sp-paginated-table {\n\tmargin-bottom: 0;\n}\n.sp-data-table thead th {\n\twhite-space: nowrap;\n}\n.sp-data-table thead .sorting,\n.sp-data-table thead .sorting_asc,\n.sp-data-table thead .sorting_desc,\n.sp-data-table thead .sorting_asc_disabled,\n.sp-data-table thead .sorting_desc_disabled {\n\tcursor: pointer;\n\tposition: relative;\n}\n.sp-data-table tbody a {\n\ttext-decoration: none;\n}\n.sp-data-table .sorting:after,\n.sp-data-table .sorting_asc:after,\n.sp-data-table .sorting_desc:after {\n\tfont-family: dashicons;\n\tmargin: 0 -.2em;\n}\n.sp-data-table .sorting:after {\n\tcontent: \"\\f156\";\n\tcolor: transparent;\n\tposition: absolute;\n}\n.sp-data-table .sorting_asc:after {\n\tcontent: \"\\f142\";\n\tposition: absolute;\n}\n.sp-data-table .sorting_desc:after {\n\tcontent: \"\\f140\";\n\tposition: absolute;\n}\n.sp-data-table .data-name {\n\ttext-align: left;\n}\n.sp-data-table .data-number,\n.sp-data-table .data-rank {\n\twidth: 1px;\n}\n.sp-data-table .sp-checkbox {\n\tfont-family: sportspress;\n\tvertical-align: bottom;\n}\n\n/* Post Content */\n.sp-post-content {\n\tclear: both;\n}\n\n/* Pagination */\n.sp-table-wrapper .dataTables_paginate {\n\ttext-align: center;\n}\n.sp-table-wrapper .dataTables_paginate .paginate_button {\n\tmargin: 0.5em;\n\tcursor: pointer;\n\tdisplay: inline-block;\n}\n.sp-table-wrapper .dataTables_paginate .previous {\n\tfloat: left;\n\tmargin-left: 0;\n}\n.sp-table-wrapper .dataTables_paginate .next {\n\tfloat: right;\n\tmargin-right: 0;\n}\n.sp-table-wrapper .dataTables_paginate .current {\n\topacity: 0.5;\n\tcolor: inherit;\n\tcursor: default;\n}\n.sp-table-wrapper .dataTables_paginate .disabled {\n\topacity: 0;\n\tcursor: default;\n}\n\n/* Post Excerpt */\n.sp-excerpt {\n\tdisplay: block;\n\tmargin-bottom: 1em;\n}\n\n/* League Table */\n.sp-league-table td.has-logo {\n\tline-height: 2em;\n}\n.sp-league-table .team-logo {\n\twidth: 2em;\n\theight: 2em;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\ttext-align: center;\n}\n.sp-league-table .data-name .team-logo {\n\tmargin-right: 0.5em;\n}\n.sp-league-table .team-logo img {\n\twidth: auto;\n\theight: auto;\n\tmax-width: 2em;\n\tmax-height: 2em;\n}\n\n/* Team Gallery */\n.sp-template-team-gallery img {\n  padding: 1em;\n}\n\n/* Player List */\n.sp-player-list td {\n\tline-height: 2em;\n}\n.sp-player-list .data-name .player-photo,\n.sp-player-list .data-name .player-flag,\n.sp-player-list .data-team .team-logo {\n\twidth: 2em;\n\theight: 2em;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\ttext-align: center;\n}\n.sp-player-list .data-name .player-photo,\n.sp-player-list .data-name .player-flag {\n\tmargin-right: 0.5em;\n}\n.sp-player-list .data-name .player-photo img,\n.sp-player-list .data-name .player-flag img,\n.sp-player-list .data-team .team-logo img {\n\twidth: auto;\n\theight: auto;\n\tmax-width: 2em;\n\tmax-height: 2em;\n}\n\n/* Staff */\n.sp-staff-role-delimiter {\n\tmargin: 0 0.125em;\n}\n\n/* Button */\n.sp-button {\n\tborder: none;\n\tcursor: pointer;\n}\n\n/* Messages */\n.sp-message {\n\tpadding: 1em;\n\tborder: 1px solid transparent;\n\ttext-align: center;\n}\n\n/* Event Logos */\n.sp-event-logos a {\n\ttext-decoration: none;\n\tcolor: inherit;\n}\n\n.sp-event-logos img {\n\tdisplay: inline !important;\n\tvertical-align: middle;\n}\n\n/* Events */\n.sp-event-overview,\n.sp-event-performance-tables {\n\toverflow: hidden;\n\tclear: both;\n}\n\n/* Event Logos */\n.sp-event-logos .sp-team-logo {\n\twhite-space: nowrap;\n\tdisplay: block;\n}\n\n.sp-event-logos .sp-team-logo .sp-team-result {\n\tdisplay: block;\n\tmargin: 0.5em 0;\n}\n\n/* Event Venue */\n.sp-event-venue thead th {\n\twhite-space: normal;\n}\n\n/* Event Performance */\n.sp-template-event-performance-icons thead {\n\tdisplay: none;\n}\n.sp-event-performance .sub {\n\tbackground: rgba(0,0,0,0.05);\n}\n.sp-event-performance .sub-in,\n.sp-event-performance .sub-out {\n\tcursor: default;\n}\n.sp-event-performance .sub-in:before,\n.sp-event-performance .sub-out:before {\n\tfont-family: dashicons;\n}\n.sp-event-performance .sub-in:before {\n\tcontent: \"\\f140\";\n}\n.sp-event-performance .sub-out:before {\n\tcontent: \"\\f142\";\n}\n.sp-event-performance .sp-performance-icons {\n\twidth: 25%;\n}\n.sp-event-performance .sp-event-star {\n\tcolor: #f4d014;\n}\n.sp-event-performance .sp-event-star-number {\n\tmargin-left: -20px;\n\twidth: 20px;\n\ttext-align: center;\n\tdisplay: inline-block;\n\tfont-size: smaller;\n\tline-height: 20px;\n}\n\n/* Event Performance (Icons) */\n.sp-event-performance-teams .sp-template-event-performance-icons {\n\tbox-sizing: border-box;\n\twidth: 50%;\n\tfloat: left;\n\tclear: left;\n\tpadding-right: 10px;\n}\n\n.sp-event-performance-teams .sp-template-event-performance-icons:nth-child(2n) {\n\tfloat: right;\n\tclear: right;\n\tpadding-right: 0;\n\tpadding-left: 10px;\n}\n\n.sp-template-event-performance-icons .sp-player-position {\n\tdisplay: block;\n}\n\n/* Event Calendar */\n.sp-event-calendar {\n\tborder-spacing: 0;\n}\n.sp-event-calendar a {\n\ttext-decoration: none;\n}\n.sp-event-calendar tbody td,\n.sp-event-calendar thead th {\n\ttext-align: center;\n}\n.sp-event-calendar #next {\n\ttext-align: right;\n}\n.sp-event-calendar #prev {\n\ttext-align: left;\n}\n\n/* Event List */\n.sp-event-list .data-date date,\n.sp-event-list .data-time date {\n\tdisplay: none !important;\n}\n.sp-event-list .data-article {\n\twhite-space: nowrap;\n}\n.sp-event-list .data-article a .dashicons {\n\tpadding-right: 3px;\n}\n.sp-event-list .data-time,\n.sp-event-list .data-results {\n\twhite-space: nowrap;\n}\n.sp-event-list .data-home {\n\ttext-align: right;\n}\n.sp-event-list .data-away {\n\ttext-align: left;\n}\n.sp-event-list td.has-logo {\n\tline-height: 2em;\n}\n.sp-event-list .team-logo {\n\twidth: 2em;\n\theight: 2em;\n\tmargin-right: 0.5em;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\ttext-align: center;\n}\n.sp-event-list .team-logo img {\n\twidth: auto;\n\theight: auto;\n\tmax-width: 2em;\n\tmax-height: 2em;\n}\n.sp-event-list .data-home img,\n.sp-event-list .data-away img {\n\tdisplay: inline-block;\n\tvertical-align: middle;\n}\n.sp-event-list .data-home img {\n\tmargin-left: 8px;\n}\n.sp-event-list .data-away img {\n\tmargin-right: 8px;\n}\n.sp-event-list-format-homeaway .data-time {\n\ttext-align: center;\n\tpadding-left: 1em;\n\tpadding-right: 1em;\n}\n\n/* Event Blocks */\n.sp-event-blocks thead {\n\tdisplay: none;\n}\n.sp-event-blocks .sp-event-date,\n.sp-event-blocks .sp-event-time,\n.sp-event-blocks .sp-event-results,\n.sp-event-blocks .sp-event-title {\n\ttext-align: center;\n\tdisplay: block;\n\tmargin: 10px 0;\n\tclear: none;\n}\n.sp-event-blocks .sp-event-league,\n.sp-event-blocks .sp-event-season,\n.sp-event-blocks .sp-event-venue {\n\ttext-align: center;\n\tmargin: 0 20%;\n\tpadding: 0 20px;\n}\n.sp-event-blocks .team-logo {\n\tmargin: 10px;\n\twidth: 20%;\n\theight: 4em;\n\tmax-width: 6em;\n\ttext-align: center;\n}\n.sp-event-blocks .logo-odd {\n\tfloat: left;\n}\n.sp-event-blocks .logo-even {\n\tfloat: right;\n}\n.sp-event-blocks .team-logo img {\n\tmax-width: 100%;\n\tmax-height: 100%;\n\twidth: auto;\n\theight: auto;\n}\n.sp-fixtures-results {\n\tclear: both;\n}\n.widget .sp-event-blocks .sp-event-title {\n\tmargin: 10px;\n\tpadding: 0;\n\tclear: both;\n}\n\nspan.sp_event_spec_label {\n\tfont-weight: bold;\n}\n\n/* Event Logos Block */\n.sp-template-event-logos-block .team-logo {\n\tfloat: none;\n\tmax-width: none;\n\twidth: 100%;\n\theight: auto;\n\tcolor: inherit;\n}\n\n.sp-template-event-logos-block .team-logo img {\n\tvertical-align: middle;\n}\n\n.sp-template-event-logos-block .sp-team-name {\n\tdisplay: block;\n\tclear: both;\n\tvertical-align: middle;\n\tfont-size: 28px;\n}\n\n.sp-template-event-logos-block .sp-event-results {\n\tfont-size: 36px;\n}\n\n/* Event Form */\n.sp-form-events {\n\ttext-align: center;\n}\n\n.sp-form-events .sp-form-event-link {\n\tdisplay: inline-block;\n\ttext-align: center;\n\tvertical-align: text-top;\n\tline-height: 1.5em;\n\twidth: 1.5em;\n\tmargin: 0 0 0.25em;\n\tcolor: #fff !important;\n\tfont-weight: normal;\n}\n\n.sp-form-events .sp-form-event-link:hover {\n\tcolor: #fff !important;\n}\n\n/* Countdowns */\n.sp-template-countdown .event-image img {\n\tdisplay: block;\n\tmargin: 0 auto;\n}\n.sp-template-countdown .event-name {\n\tclear: both;\n\toverflow: hidden;\n}\n.sp-template-countdown .team-logo {\n\twidth: 20%;\n\theight: auto;\n\tmax-width: 4em;\n}\n.sp-template-countdown .logo-odd {\n\tfloat: left;\n\tmargin-right: 10px;\n}\n.sp-template-countdown .logo-even {\n\tfloat: right;\n\tmargin-left: 10px;\n}\n.sp-template-countdown .team-logo img {\n\tmax-width: 100%;\n\tmax-height: 100%;\n\twidth: auto;\n\theight: auto;\n}\n.sp-template-countdown .sp-countdown {\n\tclear: both;\n}\n\n/* Google Maps */\n.sp-google-map-container {\n\tposition: relative;\n}\n.sp-google-map {\n\twidth: 100%;\n\theight: 320px;\n}\n.sp-google-map-link {\n\tcontent: '';\n\tdisplay: block;\n\tposition: absolute;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tbackground: url(../images/maps/pin.png) no-repeat center center;\n\tbackground-size: 26px 82px;\n}\n.sp-google-map img {\n\tmax-width: none !important;\n}\n.sp-venue-map {\n\tmargin-bottom: 4em;\n}\n\n/* View All */\n.sp-view-all-link {\n\tdisplay: block;\n\tmargin-top: 0.5em;\n}\n\n/* Highlight & Heading */\n.sp-highlight,\n.sp-heading {\n\tfont-weight: bold;\n}\n\n/* Hidden Responsive Element */\n.sp-desktop {\n\tdisplay: none;\n}\n\n/* Admin Bar */\n#wpadminbar #wp-admin-bar-sportspress>.ab-item:before {\n\tfont-family: sportspress, dashicons;\n}\n\n#wpadminbar #wp-admin-bar-sportspress>.ab-item:before {\n\tcontent: \"\\f111\";\n\ttop: 2px;\n}\n\n/* Media Queries */\n@media screen and (min-width: 801px) {\n\t/* Widget Alignment */\n\t.sp-widget-align-none {\n\t\tclear: both;\n\t}\n\t.sp-widget-align-left {\n\t\twidth: 50%;\n\t\tfloat: left;\n\t\tclear: left;\n\t\tpadding-right: 10px;\n\t\tbox-sizing: border-box;\n\t}\n\t.sp-widget-align-right {\n\t\twidth: 50%;\n\t\tfloat: right;\n\t\tclear: right;\n\t\tpadding-left: 10px;\n\t\tbox-sizing: border-box;\n\t}\n\n\t/* Hidden Responsive Element */\n\t.sp-desktop {\n\t\tdisplay: block;\n\t}\n\t.sp-mobile {\n\t\tdisplay: none;\n\t}\n}\n\n@media screen and (min-width: 601px) {\n\t.sp-event-logos .sp-team-logo {\n\t\tdisplay: inline-block;\n\t}\n\n\t.sp-event-logos-2 .sp-team-logo {\n\t\tdisplay: inline;\n\t}\n\n\t.sp-event-logos-2 .sp-team-logo .sp-team-result {\n\t\tdisplay: inline-block;\n\t\tmargin: 0 0.25em;\n\t}\n\n\t.sp-template-logo + .sp-post-content {\n\t\tclear: left;\n\t}\n\n\t.sp-template-photo + .sp-post-content {\n\t\tclear: none;\n\t}\n\n\t.sp-template-event-logos-block .team-logo {\n\t\twidth: 33%;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t.sp-template-event-logos-block .team-logo img {\n\t\theight: 100px;\n\t}\n\n\t.sp-template-event-logos-block .logo-odd {\n\t\ttext-align: left;\n\t\tfloat: left;\n\t}\n\n\t.sp-template-event-logos-block .logo-even {\n\t\ttext-align: right;\n\t\tfloat: right;\n\t}\n\n\t.sp-template-event-logos-block .logo-odd img {\n\t\tmargin-right: 10px;\n\t}\n\n\t.sp-template-event-logos-block .logo-even img {\n\t\tmargin-left: 10px;\n\t}\n\n\t.sp-template-event-logos-block .sp-team-name {\n\t\tdisplay: inline;\n\t\tclear: none;\n\t}\n}\n"
  },
  {
    "path": "assets/css/themes/twentyfourteen.css",
    "content": "/*\n * Theme-specific stylesheet.\n *\n * This stylesheet will automatically be loaded when a theme with the same name is active. Use the folder name of the theme as the stylesheet name. For example, twentyfourteen.css will be loaded with the Twenty Fourteen theme.\n */\n\n.sportspress-page .entry-content h4:first-child {\n\tmargin-top: 36px;\n}\n"
  },
  {
    "path": "assets/js/admin/colorpicker.js",
    "content": "jQuery( document ).ready(\n\tfunction($){\n\n\t\t// Color picker\n\t\t$( '.colorpick' ).iris(\n\t\t\t{\n\t\t\t\tchange: function(event, ui){\n\t\t\t\t\t$( this ).css( { backgroundColor: ui.color.toString() } );\n\t\t\t\t},\n\t\t\t\thide: true,\n\t\t\t\tborder: true\n\t\t\t}\n\t\t).each(\n\t\t\tfunction() {\n\t\t\t\t$( this ).css( { backgroundColor: $( this ).val() } );\n\t\t\t}\n\t\t)\n\t\t.click(\n\t\t\tfunction(){\n\t\t\t\t$( '.iris-picker' ).hide();\n\t\t\t\t$( this ).closest( '.sp-color-box, td' ).find( '.iris-picker' ).show();\n\t\t\t}\n\t\t);\n\n\t\t$( 'body' ).click(\n\t\t\tfunction() {\n\t\t\t\t$( '.iris-picker' ).hide();\n\t\t\t}\n\t\t);\n\n\t\t$( '.sp-color-box, .colorpick' ).click(\n\t\t\tfunction(event){\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t);\n\n\t}\n);\n"
  },
  {
    "path": "assets/js/admin/dashboard.js",
    "content": "jQuery( document ).ready(\n\tfunction($){\n\n\t\t// Dashboard countdown\n\t\t$( \"#sportspress_dashboard_status .sp_status_list li.countdown\" ).each(\n\t\t\tfunction() {\n\t\t\t\tvar $this = $( this ), finalDate = $( this ).data( 'countdown' );\n\t\t\t\t$this.countdown(\n\t\t\t\t\tfinalDate,\n\t\t\t\t\tfunction(event) {\n\t\t\t\t\t\t$this.find( 'strong' ).html( event.strftime( \"%D \" + localized_strings.days + \" %H:%M:%S\" ) );\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t}\n);\n"
  },
  {
    "path": "assets/js/admin/editor-lang.php",
    "content": "<?php\n\n$shortcodes = '';\n\n$options = array(\n\t'event'  => array(\n\t\t'details',\n\t\t'results',\n\t\t'performance',\n\t\t'venue',\n\t\t'officials',\n\t\t'teams',\n\t\t'full',\n\t),\n\t'team'   => array(),\n\t'player' => array(\n\t\t'details',\n\t\t'statistics',\n\t),\n);\n\n$options = apply_filters( 'sportspress_shortcodes', $options );\n\nforeach ( $options as $name => $group ) {\n\tif ( empty( $group ) ) {\n\t\tcontinue;\n\t}\n\t$shortcodes .= $name . '[' . implode( '|', $group ) . ']';\n}\n\n$raw = apply_filters(\n\t'sportspress_tinymce_strings',\n\tarray(\n\t\t'shortcodes'  => $shortcodes,\n\t\t'insert'      => esc_attr__( 'SportsPress Shortcodes', 'sportspress' ),\n\t\t'auto'        => esc_attr__( 'Auto', 'sportspress' ),\n\t\t'manual'      => esc_attr__( 'Manual', 'sportspress' ),\n\t\t'select'      => esc_attr__( 'Select...', 'sportspress' ),\n\t\t'event'       => esc_attr__( 'Event', 'sportspress' ),\n\t\t'details'     => esc_attr__( 'Details', 'sportspress' ),\n\t\t'results'     => esc_attr__( 'Results', 'sportspress' ),\n\t\t'countdown'   => esc_attr__( 'Countdown', 'sportspress' ),\n\t\t'performance' => esc_attr__( 'Box Score', 'sportspress' ),\n\t\t'venue'       => esc_attr__( 'Venue', 'sportspress' ),\n\t\t'officials'   => esc_attr__( 'Officials', 'sportspress' ),\n\t\t'teams'       => esc_attr__( 'Teams', 'sportspress' ),\n\t\t'full'        => esc_attr__( 'Full Info', 'sportspress' ),\n\t\t'calendar'    => esc_attr__( 'Calendar', 'sportspress' ),\n\t\t'statistics'  => esc_attr__( 'Statistics', 'sportspress' ),\n\t\t'team'        => esc_attr__( 'Team', 'sportspress' ),\n\t\t'standings'   => esc_attr__( 'League Table', 'sportspress' ),\n\t\t'player'      => esc_attr__( 'Player', 'sportspress' ),\n\t\t'list'        => esc_attr__( 'List', 'sportspress' ),\n\t\t'blocks'      => esc_attr__( 'Blocks', 'sportspress' ),\n\t\t'gallery'     => esc_attr__( 'Gallery', 'sportspress' ),\n\t)\n);\n\n$formatted = array();\n\nforeach ( $raw as $key => $value ) {\n\t$formatted[] = $key . ': \"' . esc_js( $value ) . '\"';\n}\n\n$strings = 'tinyMCE.addI18n({' . _WP_Editors::$mce_locale . ':{\n    sportspress:{\n        ' . implode( ', ', $formatted ) . '\n    }\n}})';\n"
  },
  {
    "path": "assets/js/admin/editor.js",
    "content": "/* global tinymce */\n( function () {\n\ttinymce.PluginManager.add(\n\t\t'sp_shortcodes_button',\n\t\tfunction( editor, url ) {\n\t\t\tvar ed = tinymce.activeEditor;\n\n\t\t\tvar groups = ed.getLang( 'sportspress.shortcodes' ).split( \"]\" );\n\t\t\tvar menu   = new Array();\n\n\t\t\tgroups.forEach(\n\t\t\t\tfunction(g) {\n\t\t\t\t\tif ( \"\" == g ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar p          = g.split( \"[\" );\n\t\t\t\t\tvar label      = p.shift();\n\t\t\t\t\tvar variations = p.shift();\n\t\t\t\t\tvar shortcodes = typeof variations !== 'undefined' ? variations.split( \"|\" ) : [];\n\t\t\t\t\tvar submenu    = new Array();\n\t\t\t\t\tshortcodes.forEach(\n\t\t\t\t\t\tfunction(s) {\n\t\t\t\t\t\t\tsubmenu.push(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttext: ed.getLang( 'sportspress.' + s ),\n\t\t\t\t\t\t\t\t\tonclick: function() {\n\t\t\t\t\t\t\t\t\t\t// triggers the thickbox\n\t\t\t\t\t\t\t\t\t\tvar width = jQuery( window ).width(), H = jQuery( window ).height(), W = ( 720 < width ) ? 720 : width;\n\t\t\t\t\t\t\t\t\t\tW         = W - 80;\n\t\t\t\t\t\t\t\t\t\tH         = H - 84;\n\t\t\t\t\t\t\t\t\t\ttb_show( ed.getLang( 'sportspress.' + label ) + ' - ' + ed.getLang( 'sportspress.' + s ), 'admin-ajax.php?action=sportspress_' + label + '_' + s + '_shortcode&width=' + W + '&height=' + H );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tmenu.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: ed.getLang( 'sportspress.' + label ),\n\t\t\t\t\t\t\tmenu: submenu\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\teditor.addButton(\n\t\t\t\t'sp_shortcodes_button',\n\t\t\t\t{\n\t\t\t\t\ttitle: ed.getLang( 'sportspress.insert' ),\n\t\t\t\t\ttext: false,\n\t\t\t\t\ticon: false,\n\t\t\t\t\ttype: 'menubutton',\n\t\t\t\t\tmenu: menu\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n})();\n"
  },
  {
    "path": "assets/js/admin/equationbuilder.js",
    "content": "jQuery( document ).ready(\n\tfunction($){\n\t\t$( \"#title\" ).keyup(\n\t\t\tfunction() {\n\t\t\t\tval = $( this ).val();\n\t\t\t\tif ( val == '' ) {\n\t\t\t\t\tval = 'f(x)';\n\t\t\t\t}\n\t\t\t\t$( \".sp-equation-variable\" ).text( val + ' =' );\n\t\t\t}\n\t\t);\n\n\t\t$( \".sp-equation-parts .button\" ).draggable(\n\t\t\t{\n\t\t\t\tappendTo: \"body\",\n\t\t\t\thelper: \"clone\",\n\t\t\t\tcursor: \"move\",\n\t\t\t\tdistance: 10,\n\t\t\t\tcontainment: \"#sp_equationdiv\",\n\t\t\t}\n\t\t).click(\n\t\t\tfunction() {\n\t\t\t\t$( \"<label class='button'></label>\" ).text( $( this ).text() ).append( \"<span class='remove'>&times;</span><input name='sp_equation[]' type='hidden' value='\" + $( this ).data( \"variable\" ) + \"'>\" ).appendTo( $( \".sp-equation-formula\" ) );\n\t\t\t}\n\t\t);\n\n\t\t$( \".sp-equation\" ).droppable(\n\t\t\t{\n\t\t\t\tactiveClass: \"ui-state-active\",\n\t\t\t\thoverClass: \"ui-state-hover\",\n\t\t\t\taccept: \".button:not(.ui-sortable-helper)\",\n\t\t\t\tdrop: function( event, ui ) {\n\t\t\t\t\t$( \"<label class='button'></label>\" ).text( ui.draggable.text() ).append( \"<span class='remove'>&times;</span><input name='sp_equation[]' type='hidden' value='\" + ui.draggable.data( \"variable\" ) + \"'>\" ).appendTo( $( \".sp-equation-formula\" ) );\n\t\t\t\t}\n\t\t\t}\n\t\t).sortable(\n\t\t\t{\n\t\t\t\titems: \".button\",\n\t\t\t\ttolerance: \"pointer\",\n\t\t\t\tcontainment: \"#sp_equationdiv\",\n\t\t\t\tsort: function() {\n\t\t\t\t\t$( this ).removeClass( \"ui-state-active\" );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t$( \".sp-equation-formula\" ).on(\n\t\t\t\"click\",\n\t\t\t\".button .remove\",\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \".button\" ).remove();\n\t\t\t}\n\t\t);\n\t}\n);\n"
  },
  {
    "path": "assets/js/admin/iconpicker.js",
    "content": "jQuery( document ).ready(\n\tfunction($){\n\n\t\t// Icon picker\n\t\t$( '.sp-icons input' ).on(\n\t\t\t'change',\n\t\t\tfunction() {\n\t\t\t\tif ('' == $( this ).val()) {\n\t\t\t\t\t$( '.sp-custom-colors' ).hide();\n\t\t\t\t\t$( '.sp-custom-thumbnail' ).show();\n\t\t\t\t} else {\n\t\t\t\t\t$( '.sp-custom-thumbnail' ).hide();\n\t\t\t\t\t$( '.sp-custom-colors' ).show();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Color picker\n\t\t$( '.colorpick' ).iris(\n\t\t\t{\n\t\t\t\tchange: function(event, ui){\n\t\t\t\t\t$( this ).css( { backgroundColor: ui.color.toString() } );\n\t\t\t\t},\n\t\t\t\thide: true,\n\t\t\t\tborder: true\n\t\t\t}\n\t\t).each(\n\t\t\tfunction() {\n\t\t\t\t$( this ).css( { backgroundColor: $( this ).val() } );\n\t\t\t}\n\t\t)\n\t\t.click(\n\t\t\tfunction(){\n\t\t\t\t$( '.iris-picker' ).hide();\n\t\t\t\t$( this ).closest( '.sp-color-box-for-icon, td' ).find( '.iris-picker' ).show();\n\t\t\t}\n\t\t);\n\n\t\t$( 'body' ).click(\n\t\t\tfunction() {\n\t\t\t\t$( '.iris-picker' ).hide();\n\t\t\t}\n\t\t);\n\n\t\t$( '.sp-color-box-for-icon, .colorpick' ).click(\n\t\t\tfunction(event){\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t);\n\n\t}\n);\n"
  },
  {
    "path": "assets/js/admin/quickeditor.js",
    "content": "(function($) {\n\n\t// we create a copy of the WP inline edit post function\n\tvar $wp_inline_edit = inlineEditPost.edit;\n\n\t// and then we overwrite the function with our own code\n\tinlineEditPost.edit = function( id ) {\n\n\t\t// \"call\" the original WP edit function\n\t\t// we don't want to leave WordPress hanging\n\t\t$wp_inline_edit.apply( this, arguments );\n\n\t\t// now we take care of our business\n\n\t\t// get the post ID\n\t\tvar $post_id = 0;\n\t\tif ( typeof( id ) == 'object' ) {\n\t\t\t$post_id = parseInt( this.getId( id ) );\n\t\t}\n\n\t\tif ( $post_id > 0 ) {\n\t\t\t// define the edit row\n\t\t\tvar $edit_row = $( '#edit-' + $post_id );\n\t\t\tvar $post_row = $( '#post-' + $post_id );\n\n\t\t\t// get the data\n\t\t\tvar $number        = $( '.column-sp_number', $post_row ).text();\n\t\t\tvar $current_teams = String( $( '.column-sp_team', $post_row ).find( '.sp-player-teams' ).data( 'current-teams' ) ).split( ',' );\n\t\t\tvar $past_teams    = String( $( '.column-sp_team', $post_row ).find( '.sp-player-teams' ).data( 'past-teams' ) ).split( ',' );\n\n\t\t\t// populate the data\n\t\t\t$( ':input[name=\"sp_number\"]', $edit_row ).val( $number );\n\t\t\t$( ':input[name=\"sp_current_team[]\"]', $edit_row ).each(\n\t\t\t\tfunction() {\n\t\t\t\t\t$( this ).prop( \"checked\", ($.inArray( $( this ).val(), $current_teams ) != -1) );\n\t\t\t\t}\n\t\t\t);\n\t\t\t$( ':input[name=\"sp_past_team[]\"]', $edit_row ).each(\n\t\t\t\tfunction() {\n\t\t\t\t\t$( this ).prop( \"checked\", ($.inArray( $( this ).val(), $past_teams ) != -1) );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\t$( document ).on(\n\t\t'click',\n\t\t'#bulk_edit',\n\t\tfunction() {\n\t\t\t// define the bulk edit row\n\t\t\tvar $bulk_row = $( '#bulk-edit' );\n\n\t\t\t// get the selected post ids that are being edited\n\t\t\tvar $post_ids = new Array();\n\t\t\t$bulk_row.find( '#bulk-titles' ).children().each(\n\t\t\t\tfunction() {\n\t\t\t\t\t$post_ids.push( $( this ).attr( 'id' ).replace( /^(ttle)/i, '' ) );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// get the data\n\t\t\tvar $current_teams = [];\n\t\t\t$bulk_row.find( 'input[name=\"sp_current_team[]\"]:checked' ).each(\n\t\t\t\tfunction() {\n\t\t\t\t\t$current_teams.push( $( this ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tvar $past_teams = [];\n\t\t\t$bulk_row.find( 'input[name=\"sp_past_team[]\"]:checked' ).each(\n\t\t\t\tfunction() {\n\t\t\t\t\t$past_teams.push( $( this ).val() );\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// save the data\n\t\t\t$.ajax(\n\t\t\t\t{\n\t\t\t\t\turl: ajaxurl, // this is a variable that WordPress has already defined for us\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tasync: false,\n\t\t\t\t\tcache: false,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'save_bulk_edit_sp_player',\n\t\t\t\t\t\tpost_ids: $post_ids,\n\t\t\t\t\t\tcurrent_teams: $current_teams,\n\t\t\t\t\t\tpast_teams: $past_teams,\n\t\t\t\t\t\tnonce: $( \"#sp_player_edit_nonce\" ).val()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n})( jQuery );\n"
  },
  {
    "path": "assets/js/admin/settings.js",
    "content": "jQuery( document ).ready(\n\tfunction($){\n\n\t\t// Display custom sport name field as needed\n\t\t$( \"body.toplevel_page_sportspress #sportspress_sport\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$target = $( \"#sportspress_custom_sport_name\" );\n\t\t\t\tif ( $( this ).val() == \"custom\" ) {\n\t\t\t\t\t$target.show();\n\t\t\t\t} else {\n\t\t\t\t\t$target.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Color picker\n\t\t$( '.colorpick' ).iris(\n\t\t\t{\n\t\t\t\tchange: function(event, ui){\n\t\t\t\t\t$( this ).css( { backgroundColor: ui.color.toString() } );\n\t\t\t\t},\n\t\t\t\thide: true,\n\t\t\t\tborder: true\n\t\t\t}\n\t\t).each(\n\t\t\tfunction() {\n\t\t\t\t$( this ).css( { backgroundColor: $( this ).val() } );\n\t\t\t}\n\t\t)\n\t\t.click(\n\t\t\tfunction(){\n\t\t\t\t$( '.iris-picker' ).hide();\n\t\t\t\t$( this ).closest( '.sp-color-box, td' ).find( '.iris-picker' ).show();\n\t\t\t}\n\t\t);\n\n\t\t$( 'body' ).click(\n\t\t\tfunction() {\n\t\t\t\t$( '.iris-picker' ).hide();\n\t\t\t}\n\t\t);\n\n\t\t$( '.sp-color-box, .colorpick' ).click(\n\t\t\tfunction(event){\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t);\n\n\t\t// Chosen select\n\t\t$( \".chosen-select\" ).chosen(\n\t\t\t{\n\t\t\t\tallow_single_deselect: true,\n\t\t\t\tsingle_backstroke_delete: false,\n\t\t\t\tplaceholder_text_multiple: localized_strings.none\n\t\t\t}\n\t\t);\n\n\t\t// Preset field modifier\n\t\t$( \".sp-custom-input-wrapper .preset\" ).click(\n\t\t\tfunction() {\n\t\t\t\tval = $( this ).val();\n\t\t\t\tif (val == \"\\\\c\\\\u\\\\s\\\\t\\\\o\\\\m\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\texample = $( this ).attr( \"data-example\" );\n\t\t\t\t$( this ).closest( \".sp-custom-input-wrapper\" ).find( \".value\" ).val( val ).siblings( \".example\" ).html( example );\n\t\t\t}\n\t\t);\n\n\t\t// Select custom preset when field is brought to focus\n\t\t$( \".sp-custom-input-wrapper .value\" ).focus(\n\t\t\tfunction() {\n\t\t\t\t$( this ).siblings( \"label\" ).find( \".preset\" ).prop( \"checked\", true );\n\t\t\t}\n\t\t);\n\n\t\t// Adjust example field when custom preset is entered\n\t\t$( \".sp-custom-input-wrapper .value\" ).on(\n\t\t\t\"keyup\",\n\t\t\tfunction() {\n\t\t\t\tval = $( this ).val();\n\t\t\t\tif ( val === undefined ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tformat  = $( this ).attr( \"data-example-format\" );\n\t\t\t\texample = format.replace( /__val__/g, val );\n\t\t\t\t$( this ).siblings( \".example\" ).html( example );\n\t\t\t}\n\t\t);\n\n\t}\n);\n"
  },
  {
    "path": "assets/js/admin/sp-geocoder.js",
    "content": "// Get variables form input values\nlatitude  = document.getElementById( 'term_meta[sp_latitude]' ).value;\nlongitude = document.getElementById( 'term_meta[sp_longitude]' ).value;\n\n// Initialize the map and add the Search control box\nvar map      = L.map( 'sp-location-picker' ).setView( [latitude, longitude], 15 ),\n\tgeocoder = L.Control.Geocoder.nominatim(),\n\tcontrol  = L.Control.geocoder(\n\t\t{\n\t\t\tgeocoder: geocoder,\n\t\t\tcollapsed: false,\n\t\t\tdefaultMarkGeocode: false\n\t\t}\n\t).addTo( map ),\n\t// Add a marker to use from the begining\n\tmarker = L.marker( [latitude, longitude],{draggable: true, autoPan: true} ).addTo( map );\n\nL.tileLayer(\n\t'http://{s}.tile.osm.org/{z}/{x}/{y}.png',\n\t{\n\t\tattribution: '&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\n\t}\n).addTo( map );\n\n// Pass the values to the fields after dragging\nmarker.on(\n\t'dragend',\n\tfunction (e) {\n\t\tdocument.getElementById( 'term_meta[sp_latitude]' ).value  = marker.getLatLng().lat;\n\t\tdocument.getElementById( 'term_meta[sp_longitude]' ).value = marker.getLatLng().lng;\n\t\tgeocoder.reverse(\n\t\t\tmarker.getLatLng(),\n\t\t\tmap.options.crs.scale( map.getZoom() ),\n\t\t\tfunction(results) {\n\t\t\t\tvar r = results[0];\n\t\t\t\tif (r) {\n\t\t\t\t\tdocument.getElementById( 'term_meta[sp_address]' ).value = r.name;\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\t}\n);\n\n// After searching\ncontrol.on(\n\t'markgeocode',\n\tfunction(e) {\n\t\tvar center  = e.geocode.center;\n\t\tvar address = e.geocode.name;\n\t\tmap.setView( [center.lat, center.lng], 15 ); // Center map to the new place\n\t\tmap.removeLayer( marker ); // Remove previous marker\n\t\tmarker = L.marker( [center.lat, center.lng],{draggable: true, autoPan: true} ).addTo( map ); // Add new marker to use\n\t\t// Pass the values to the fields after searching\n\t\tdocument.getElementById( 'term_meta[sp_latitude]' ).value  = center.lat;\n\t\tdocument.getElementById( 'term_meta[sp_longitude]' ).value = center.lng;\n\t\tdocument.getElementById( 'term_meta[sp_address]' ).value   = address;\n\t\t// Pass the values to the fields after dragging\n\t\tmarker.on(\n\t\t\t'dragend',\n\t\t\tfunction (e) {\n\t\t\t\tdocument.getElementById( 'term_meta[sp_latitude]' ).value  = marker.getLatLng().lat;\n\t\t\t\tdocument.getElementById( 'term_meta[sp_longitude]' ).value = marker.getLatLng().lng;\n\t\t\t\tgeocoder.reverse(\n\t\t\t\t\tmarker.getLatLng(),\n\t\t\t\t\tmap.options.crs.scale( map.getZoom() ),\n\t\t\t\t\tfunction(results) {\n\t\t\t\t\t\tvar r = results[0];\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\tdocument.getElementById( 'term_meta[sp_address]' ).value = r.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t);\n\t}\n).addTo( map );\n"
  },
  {
    "path": "assets/js/admin/sp-setup-geocoder.js",
    "content": "// Get variables form input values\nlatitude  = document.getElementById( 'sp_latitude' ).value;\nlongitude = document.getElementById( 'sp_longitude' ).value;\n\n// Initialize the map and add the Search control box\nvar map      = L.map( 'sp-location-picker' ).setView( [latitude, longitude], 15 ),\n\tgeocoder = L.Control.Geocoder.nominatim(),\n\tcontrol  = L.Control.geocoder(\n\t\t{\n\t\t\tgeocoder: geocoder,\n\t\t\tcollapsed: false,\n\t\t\tdefaultMarkGeocode: false\n\t\t}\n\t).addTo( map ),\n\t// Add a marker to use from the begining\n\tmarker = L.marker( [latitude, longitude],{draggable: true, autoPan: true} ).addTo( map );\n\nL.tileLayer(\n\t'http://{s}.tile.osm.org/{z}/{x}/{y}.png',\n\t{\n\t\tattribution: '&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\n\t}\n).addTo( map );\n\n// Pass the values to the fields after dragging\nmarker.on(\n\t'dragend',\n\tfunction (e) {\n\t\tdocument.getElementById( 'sp_latitude' ).value  = marker.getLatLng().lat;\n\t\tdocument.getElementById( 'sp_longitude' ).value = marker.getLatLng().lng;\n\t\tgeocoder.reverse(\n\t\t\tmarker.getLatLng(),\n\t\t\tmap.options.crs.scale( map.getZoom() ),\n\t\t\tfunction(results) {\n\t\t\t\tvar r = results[0];\n\t\t\t\tif (r) {\n\t\t\t\t\tdocument.getElementById( 'sp_address' ).value = r.name;\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\t}\n);\n\n// After searching\ncontrol.on(\n\t'markgeocode',\n\tfunction(e) {\n\t\tvar center  = e.geocode.center;\n\t\tvar address = e.geocode.name;\n\t\tmap.setView( [center.lat, center.lng], 15 ); // Center map to the new place\n\t\tmap.removeLayer( marker ); // Remove previous marker\n\t\tmarker = L.marker( [center.lat, center.lng],{draggable: true, autoPan: true} ).addTo( map ); // Add new marker to use\n\t\t// Pass the values to the fields after searching\n\t\tdocument.getElementById( 'sp_latitude' ).value  = center.lat;\n\t\tdocument.getElementById( 'sp_longitude' ).value = center.lng;\n\t\tdocument.getElementById( 'sp_address' ).value   = address;\n\t\t// Pass the values to the fields after dragging\n\t\tmarker.on(\n\t\t\t'dragend',\n\t\t\tfunction (e) {\n\t\t\t\tdocument.getElementById( 'sp_latitude' ).value  = marker.getLatLng().lat;\n\t\t\t\tdocument.getElementById( 'sp_longitude' ).value = marker.getLatLng().lng;\n\t\t\t\tgeocoder.reverse(\n\t\t\t\t\tmarker.getLatLng(),\n\t\t\t\t\tmap.options.crs.scale( map.getZoom() ),\n\t\t\t\t\tfunction(results) {\n\t\t\t\t\t\tvar r = results[0];\n\t\t\t\t\t\tif (r) {\n\t\t\t\t\t\t\tdocument.getElementById( 'sp_address' ).value = r.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t);\n\t}\n).addTo( map );\n"
  },
  {
    "path": "assets/js/admin/sportspress-admin.js",
    "content": "jQuery( document ).ready(\n\tfunction($){\n\n\t\t// Tiptip\n\t\t$( \".sp-tip\" ).tipTip(\n\t\t\t{\n\t\t\t\tdelay: 200,\n\t\t\t\tfadeIn: 100,\n\t\t\t\tfadeOut: 100\n\t\t\t}\n\t\t);\n\t\t$( \".sp-desc-tip\" ).tipTip(\n\t\t\t{\n\t\t\t\tdelay: 200,\n\t\t\t\tfadeIn: 100,\n\t\t\t\tfadeOut: 100,\n\t\t\t\tdefaultPosition: 'right'\n\t\t\t}\n\t\t);\n\n\t\t// Chosen select\n\t\t$( document ).on(\n\t\t\t\"postbox-toggled\",\n\t\t\tfunction() {\n\t\t\t\t$( \".chosen-select\" ).filter( \":visible\" ).chosen(\n\t\t\t\t\t{\n\t\t\t\t\t\tallow_single_deselect: true,\n\t\t\t\t\t\tsearch_contains: true,\n\t\t\t\t\t\tsingle_backstroke_delete: false,\n\t\t\t\t\t\tdisable_search_threshold: 10,\n\t\t\t\t\t\tplaceholder_text_multiple: localized_strings.none\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t).trigger( \"postbox-toggled\" );\n\n\t\t// Auto key placeholder\n\t\t$( \"#poststuff #title\" ).on(\n\t\t\t\"keyup\",\n\t\t\tfunction() {\n\t\t\t\tval = $( this ).val()\n\t\t\t\tlc  = val.replace( /[^a-z]/gi,\"\" ).toLowerCase();\n\t\t\t\t$( \"#sp_key\" ).attr( \"placeholder\", lc );\n\t\t\t\t$( \"#sp_default_key\" ).val( lc );\n\t\t\t\t$( \"#sp_singular\" ).attr( \"placeholder\", val );\n\t\t\t}\n\t\t);\n\n\t\t// Activate auto key placeholder\n\t\t$( \"#poststuff #title\" ).keyup();\n\n\t\t// Radio input toggle\n\t\t$( \".sp-radio-toggle\" ).click(\n\t\t\tfunction() {\n\t\t\t\tif ($( this ).data( \"sp-checked\" )) {\n\t\t\t\t\t$( this ).prop( \"checked\", false );\n\t\t\t\t\t$( this ).data( \"sp-checked\", false );\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).data( \"sp-checked\", true );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Table switcher\n\t\t$( \".sp-table-panel\" ).siblings( \".sp-table-bar\" ).find( \"a\" ).click(\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \"li\" ).find( \"a\" ).addClass( \"current\" ).closest( \"li\" ).siblings().find( \"a\" ).removeClass( \"current\" ).closest( \".sp-table-bar\" ).siblings( $( this ).attr( \"href\" ) ).show().siblings( \".sp-table-panel\" ).hide();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t// Tab switcher\n\t\t$( \".sp-tab-panel\" ).siblings( \".sp-tab-bar\" ).find( \"a\" ).click(\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \"li\" ).addClass( \"tabs\" ).siblings().removeClass( \"tabs\" ).closest( \".sp-tab-bar\" ).siblings( $( this ).attr( \"href\" ) ).show().trigger( 'checkCheck' ).siblings( \".sp-tab-panel\" ).hide();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t// Tab filter\n\t\t$( \".sp-tab-filter-panel\" ).siblings( \".sp-tab-select\" ).find( \"select\" ).change(\n\t\t\tfunction() {\n\t\t\t\tvar val      = $( this ).val();\n\t\t\t\tvar filter   = \".sp-filter-\" + val;\n\t\t\t\tvar $filters = $( this ).closest( \".sp-tab-select\" ).siblings( \".sp-tab-select\" );\n\t\t\t\tif ($filters.length) {\n\t\t\t\t\t$filters.each(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tfilterval = $( this ).find( \"select\" ).val();\n\t\t\t\t\t\t\tif (filterval !== undefined) {\n\t\t\t\t\t\t\t\tfilter += \".sp-filter-\" + filterval;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t$panel = $( this ).closest( \".sp-tab-select\" ).siblings( \".sp-tab-panel\" );\n\t\t\t\t$panel.each(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\t$( this ).find( \".sp-post\" ).hide(\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t$( this ).find( \"input\" ).prop( \"disabled\", true );\n\t\t\t\t\t\t\t\t$( this ).filter( filter ).show(\n\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t$( this ).find( \"input\" ).prop( \"disabled\", false );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ($( this ).find( \".sp-post:visible\" ).length > 0) {\n\t\t\t\t\t\t\t$( this ).find( \".sp-select-all-container\" ).show();\n\t\t\t\t\t\t\t$( this ).find( \".sp-show-all-container\" ).show();\n\t\t\t\t\t\t\t$( this ).find( \".sp-not-found-container\" ).hide();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$( this ).find( \".sp-select-all-container\" ).hide();\n\t\t\t\t\t\t\t$( this ).find( \".sp-show-all-container\" ).hide();\n\t\t\t\t\t\t\t$( this ).find( \".sp-not-found-container\" ).show();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Trigger tab filter\n\t\t$( \".sp-tab-filter-panel\" ).siblings( \".sp-tab-select\" ).find( \"select\" ).change();\n\n\t\t// Dropdown filter\n\t\t$( \".sp-dropdown-target\" ).siblings( \".sp-dropdown-filter\" ).find( \"select\" ).change(\n\t\t\tfunction() {\n\t\t\t\tvar val      = $( this ).val();\n\t\t\t\tvar filter   = \".sp-filter-\" + val;\n\t\t\t\tvar $filters = $( this ).closest( \".sp-dropdown-filter\" ).siblings( \".sp-dropdown-filter\" );\n\t\t\t\tif ($filters.length) {\n\t\t\t\t\t$filters.each(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tfilterval = $( this ).find( \"select\" ).val();\n\t\t\t\t\t\t\tif (filterval !== undefined) {\n\t\t\t\t\t\t\t\tfilter += \".sp-filter-\" + filterval;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t$target = $( this ).closest( \".sp-dropdown-filter\" ).siblings( \".sp-dropdown-target\" ).find( \"select\" );\n\t\t\t\t$target.find( \".sp-post\" ).prop( \"disabled\", true ).each(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\t$( this ).filter( filter ).prop( \"disabled\", false );\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Trigger dropdown filter\n\t\t$( \".sp-dropdown-target\" ).siblings( \".sp-dropdown-filter\" ).find( \"select\" ).change();\n\n\t\t// Filter show all action links\n\t\t$( \".sp-tab-panel\" ).find( \".sp-post input:checked\" ).each(\n\t\t\tfunction() {\n\t\t\t\t$( this ).prop( \"disabled\", false ).closest( \"li\" ).show().siblings( \".sp-not-found-container\" ).hide().siblings( \".sp-show-all-container\" ).show();\n\t\t\t}\n\t\t);\n\n\t\t// Show all filter\n\t\t$( \".sp-tab-panel\" ).on(\n\t\t\t\"click\",\n\t\t\t\".sp-show-all\",\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \"li\" ).hide().siblings( \".sp-post, .sp-select-all-container\" ).show().find( \"input\" ).prop( \"disabled\", false );\n\t\t\t}\n\t\t);\n\n\t\t// Self-cloning\n\t\t$( \".sp-clone:last\" ).find( \"select\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \".sp-clone\" ).siblings().find( \"select\" ).change(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tif ($( this ).val() == \"0\") {\n\t\t\t\t\t\t\t$( this ).closest( \".sp-clone\" ).remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t).find( \"option:first\" ).text( localized_strings.remove_text );\n\t\t\t\tif ($( this ).val() != \"0\") {\n\t\t\t\t\t$original = $( this ).closest( \".sp-clone\" );\n\t\t\t\t\t$original.before( $original.clone().find( \"select\" ).attr( \"name\", $original.attr( \"data-clone-name\" ) + \"[]\" ).val( $( this ).val() ).closest( \".sp-clone\" ) ).attr( \"data-clone-num\", parseInt( $original.attr( \"data-clone-num\" ) ) + 1 ).find( \"select\" ).val( \"0\" ).change();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Activate self-cloning\n\t\t$( \".sp-clone:last\" ).find( \"select\" ).change();\n\n\t\t// Custom value editor\n\t\t$( \".sp-data-table .sp-default-value\" ).click(\n\t\t\tfunction() {\n\t\t\t\t$( this ).hide().siblings( \".sp-custom-value\" ).show().find( \".sp-custom-value-input\" ).focus();\n\t\t\t}\n\t\t);\n\n\t\t// Define custom value editor saving\n\t\t$( \".sp-data-table .sp-custom-value .sp-custom-value-input\" ).on(\n\t\t\t\"saveInput\",\n\t\t\tfunction() {\n\t\t\t\t$val = $( this ).val();\n\t\t\t\tif ($val == \"\") {\n\t\t\t\t\t$val = $( this ).attr( \"placeholder\" );\n\t\t\t\t}\n\t\t\t\t$( this ).closest( \".sp-custom-value\" ).hide().siblings( \".sp-default-value\" ).show().find( \".sp-default-value-input\" ).html( $val );\n\t\t\t}\n\t\t);\n\n\t\t// Define custom value editor cancellation\n\t\t$( \".sp-data-table .sp-custom-value .sp-custom-value-input\" ).on(\n\t\t\t\"cancelInput\",\n\t\t\tfunction() {\n\t\t\t\t$val = $( this ).closest( \".sp-custom-value\" ).siblings( \".sp-default-value\" ).find( \".sp-default-value-input\" ).html();\n\t\t\t\tif ($val == $( this ).attr( \"placeholder\" )) {\n\t\t\t\t\t$( this ).val( \"\" );\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).val( $val );\n\t\t\t\t}\n\t\t\t\t$( this ).closest( \".sp-custom-value\" ).hide().siblings( \".sp-default-value\" ).show();\n\t\t\t}\n\t\t);\n\n\t\t// Custom value editor save\n\t\t$( \".sp-data-table .sp-custom-value .sp-save\" ).click(\n\t\t\tfunction() {\n\t\t\t\t$( this ).siblings( \".sp-custom-value-input\" ).trigger( \"saveInput\" );\n\t\t\t}\n\t\t);\n\n\t\t// Custom value editor cancel\n\t\t$( \".sp-data-table .sp-custom-value .sp-cancel\" ).click(\n\t\t\tfunction() {\n\t\t\t\t$( this ).siblings( \".sp-custom-value-input\" ).trigger( \"cancelInput\" );\n\t\t\t}\n\t\t);\n\n\t\t// Prevent custom value editor input from submitting form\n\t\t$( \".sp-data-table .sp-custom-value .sp-custom-value-input\" ).keypress(\n\t\t\tfunction(event) {\n\t\t\t\tif (event.keyCode == 13) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t$( this ).trigger( \"saveInput\" );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Cancel custom value editor form on escape\n\t\t$( \".sp-data-table .sp-custom-value .sp-custom-value-input\" ).keyup(\n\t\t\tfunction(event) {\n\t\t\t\tif (event.keyCode == 27) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t$( this ).trigger( \"cancelInput\" );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Data table adjustments\n\t\t$( \".sp-table-adjustments input\" ).change(\n\t\t\tfunction() {\n\t\t\t\tmatrix             = $( this ).attr( \"data-matrix\" );\n\t\t\t\t$el                = $( this ).closest( \".sp-table-adjustments\" ).siblings( \".sp-table-values\" ).find( \"input[data-matrix=\" + matrix + \"]\" );\n\t\t\t\tplaceholder        = $el.attr( \"data-placeholder\" );\n\t\t\t\tcurrent_adjustment = parseFloat( $el.attr( \"data-adjustment\" ) );\n\t\t\t\tadjustment         = parseFloat( $( this ).val() );\n\t\t\t\tif ( ! isNaN( adjustment ) && adjustment != 0) {\n\t\t\t\t\tplaceholder = parseFloat( placeholder );\n\t\t\t\t\tif (isNaN( placeholder )) {\n\t\t\t\t\t\tplaceholder = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (isNaN( current_adjustment )) {\n\t\t\t\t\t\tcurrent_adjustment = 0;\n\t\t\t\t\t}\n\t\t\t\t\tplaceholder += adjustment - current_adjustment;\n\t\t\t\t}\n\t\t\t\t$el.attr( \"placeholder\", placeholder );\n\t\t\t}\n\t\t).change();\n\n\t\t// Data table keyboard navigation\n\t\t$( \".sp-data-table tbody tr td input:text\" ).keydown(\n\t\t\tfunction(event) {\n\t\t\t\tif ( ! $( this ).parent().hasClass( \"chosen-search\" ) && [37,38,39,40].indexOf( event.keyCode ) > -1) {\n\t\t\t\t\t$el     = $( this ).closest( \"td\" );\n\t\t\t\t\tvar col = $el.parent().children().index( $el ) + 1;\n\t\t\t\t\tvar row = $el.parent().parent().children().index( $el.parent() ) + 1;\n\t\t\t\t\tif (event.keyCode == 37) {\n\t\t\t\t\t\tif ( $( this ).caret().start != 0 ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcol -= 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.keyCode == 38) {\n\t\t\t\t\t\trow -= 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.keyCode == 39) {\n\t\t\t\t\t\tif ( $( this ).caret().start != $( this ).val().length ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcol += 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.keyCode == 40) {\n\t\t\t\t\t\trow += 1;\n\t\t\t\t\t}\n\t\t\t\t\t$el.closest( \"tbody\" ).find( \"tr:nth-child(\" + row + \") td:nth-child(\" + col + \") input:text\" ).first().focus();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Prevent data table from submitting form\n\t\t$( \".sp-data-table tbody tr td input:text\" ).keypress(\n\t\t\tfunction(event) {\n\t\t\t\tif ( ! $( this ).parent().hasClass( \"chosen-search\" ) && event.keyCode == 13) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t$el     = $( this ).closest( \"td\" );\n\t\t\t\t\tvar col = $el.parent().children().index( $el ) + 1;\n\t\t\t\t\tvar row = $el.parent().parent().children().index( $el.parent() ) + 2;\n\t\t\t\t\t$el.closest( \"tbody\" ).find( \"tr:nth-child(\" + row + \") td:nth-child(\" + col + \") input:text\" ).focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Total stats calculator\n\t\t$( \".sp-data-table .sp-total input[data-sp-format=number][data-sp-total-type!=average]\" ).on(\n\t\t\t\"updateTotal\",\n\t\t\tfunction() {\n\t\t\t\tindex   = $( this ).parent().index();\n\t\t\t\tvar sum = 0;\n\t\t\t\t$( this ).closest( \".sp-data-table\" ).find( \".sp-post\" ).each(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tval = $( this ).find( \"td\" ).eq( index ).find( \"input\" ).val();\n\t\t\t\t\t\tif (val == \"\") {\n\t\t\t\t\t\t\tval = $( this ).find( \"td\" ).eq( index ).find( \"input\" ).attr( \"placeholder\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($.isNumeric( val )) {\n\t\t\t\t\t\t\tsum += parseFloat( val, 10 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t$( this ).attr( \"placeholder\", sum );\n\t\t\t}\n\t\t);\n\n\t\t// Activate total stats calculator\n\t\tif ($( \".sp-data-table .sp-total\" ).length) {\n\t\t\t$( \".sp-data-table .sp-post td input\" ).on(\n\t\t\t\t\"keyup\",\n\t\t\t\tfunction() {\n\t\t\t\t\t$( this ).closest( \".sp-data-table\" ).find( \".sp-total td\" ).eq( $( this ).parent().index() ).find( \"input[data-sp-format=number][data-sp-total-type!=average]\" ).trigger( \"updateTotal\" );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Trigger total stats calculator\n\t\t$( \".sp-data-table .sp-total input[data-sp-format=number][data-sp-total-type!=average]\" ).trigger( \"updateTotal\" );\n\n\t\t// Sync inputs\n\t\t$( \".sp-sync-input\" ).on(\n\t\t\t\"keyup\",\n\t\t\tfunction() {\n\t\t\t\tname = $( this ).attr( \"name\" );\n\t\t\t\t$el  = $( \"input[name='\" + name + \"']\" );\n\t\t\t\tif ( $el.length > 1 ) {\n\t\t\t\t\tval = $( this ).val();\n\t\t\t\t\t$el.val( val );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Sync selects\n\t\t$( \".sp-sync-select\" ).on(\n\t\t\t\"change\",\n\t\t\tfunction() {\n\t\t\t\tname = $( this ).attr( \"name\" );\n\t\t\t\t$el  = $( \"select[name='\" + name + \"']\" )\n\t\t\t\tif ( $el.length > 1 ) {\n\t\t\t\t\tval = $( this ).val();\n\t\t\t\t\t$el.val( val );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Select all checkboxes\n\t\t$( \".sp-select-all-range\" ).on(\n\t\t\t\"change\",\n\t\t\t\".sp-select-all\",\n\t\t\tfunction() {\n\t\t\t\t$range = $( this ).closest( \".sp-select-all-range\" );\n\t\t\t\t$range.find( \"input[type=checkbox]\" ).prop( \"checked\", $( this ).prop( \"checked\" ) );\n\t\t\t}\n\t\t);\n\n\t\t// Check if all checkboxes are checked already\n\t\t$( \".sp-select-all-range\" ).on(\n\t\t\t\"checkCheck\",\n\t\t\tfunction() {\n\t\t\t\t$( this ).each(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\t$( this ).find( \".sp-select-all\" ).prop( \"checked\", $( this ).find( \"input[type=checkbox]:checked:not(.sp-select-all)\" ).length != 0 && $( this ).find( \"input[type=checkbox]:checked:not(.sp-select-all)\" ).length == $( this ).find( \"input[type=checkbox]:visible:not(.sp-select-all)\" ).length );\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Activate check check when a checkbox is checked\n\t\t$( \".sp-select-all-range input[type=checkbox]:not(.sp-select-all)\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \".sp-select-all-range\" ).trigger( \"checkCheck\" );\n\t\t\t}\n\t\t);\n\n\t\t// Activate check check on page load\n\t\t$( \".sp-select-all-range\" ).trigger( \"checkCheck\" );\n\n\t\t// Trigger check check\n\t\t$( \".sp-data-table\" ).trigger( \"checkCheck\" );\n\n\t\t// Sortable tables\n\t\t$( \".sp-sortable-table tbody\" ).sortable(\n\t\t\t{\n\t\t\t\thandle: \".icon\",\n\t\t\t\taxis: \"y\"\n\t\t\t}\n\t\t);\n\n\t\t// Sortable lists\n\t\t$( \".sp-sortable-list\" ).sortable(\n\t\t\t{\n\t\t\t\thandle: \".sp-item-handle\",\n\t\t\t\tplaceholder: \"sp-item-placeholder\",\n\t\t\t\tconnectWith: \".sp-connected-list\"\n\t\t\t}\n\t\t);\n\n\t\t// Autosave\n\t\t$( \".sp-autosave\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$( this ).attr( \"readonly\", true ).closest( \"form\" ).submit();\n\t\t\t}\n\t\t);\n\n\t\t// Video embed\n\t\t$( \".sp-add-video\" ).click(\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \"fieldset\" ).hide().siblings( \".sp-video-field\" ).show();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t// Removing video embed\n\t\t$( \".sp-remove-video\" ).click(\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \"fieldset\" ).hide().siblings( \".sp-video-adder\" ).show().siblings( \".sp-video-field\" ).find( \"input\" ).val( null );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t// Equation selector\n\t\t$( \".sp-equation-selector select:last\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$( this ).siblings().change(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tif ($( this ).val() == \"\") {\n\t\t\t\t\t\t\t$( this ).remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t).find( \"option:first\" ).text( localized_strings.remove_text );\n\t\t\t\tif ($( this ).val() != \"\") {\n\t\t\t\t\t$( this ).before( $( this ).clone().val( $( this ).val() ) ).val( \"\" ).change();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Trigger equation selector\n\t\t$( \".sp-equation-selector select:last\" ).change().siblings().change();\n\n\t\t// Order selector\n\t\t$( \".sp-order-selector select:first\" ).change(\n\t\t\tfunction() {\n\t\t\t\tif ($( this ).val() == \"0\") {\n\t\t\t\t\t$( this ).siblings().prop( \"disabled\", true );\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).siblings().prop( \"disabled\", false )\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Trigger order selector\n\t\t$( \".sp-order-selector select:first\" ).change();\n\n\t\t// Format selector\n\t\t$( \".sp-format-selector select:first\" ).change(\n\t\t\tfunction() {\n\n\t\t\t\t$precisiondiv   = $( \"#sp_precisiondiv\" );\n\t\t\t\t$precisioninput = $( \"#sp_precision\" );\n\t\t\t\t$timeddiv       = $( \"#sp_timeddiv\" );\n\t\t\t\t$equationdiv    = $( \"#sp_equationdiv\" );\n\n\t\t\t\t// Equation settings\n\t\t\t\tif ($( this ).val() == \"equation\") {\n\t\t\t\t\t$equationdiv.show();\n\t\t\t\t\t$precisiondiv.show();\n\t\t\t\t\t$timeddiv.hide();\n\t\t\t\t\t$precisioninput.prop( \"disabled\", false );\n\t\t\t\t} else if ($( this ).val() == \"number\") {\n\t\t\t\t\t$equationdiv.hide();\n\t\t\t\t\t$precisiondiv.hide();\n\t\t\t\t\t$timeddiv.show();\n\t\t\t\t\t$precisioninput.prop( \"disabled\", true );\n\t\t\t\t} else {\n\t\t\t\t\t$equationdiv.hide();\n\t\t\t\t\t$precisiondiv.hide();\n\t\t\t\t\t$timeddiv.hide();\n\t\t\t\t\t$precisioninput.prop( \"disabled\", true );\n\t\t\t\t}\n\n\t\t\t}\n\t\t);\n\n\t\t// Trigger format selector\n\t\t$( \".sp-format-selector select:first\" ).change();\n\n\t\t// Team era selector\n\t\t$( \".sp-team-era-selector select:first-child\" ).change(\n\t\t\tfunction() {\n\n\t\t\t\t$subselector = $( this ).siblings();\n\n\t\t\t\t// Sub settings\n\t\t\t\tif ($( this ).val() == 0) {\n\t\t\t\t\t$subselector.hide();\n\t\t\t\t} else {\n\t\t\t\t\t$subselector.show();\n\t\t\t\t}\n\n\t\t\t}\n\t\t);\n\n\t\t// Trigger team era selector\n\t\t$( \".sp-team-era-selector select:first-child\" ).change();\n\n\t\t// Status selector\n\t\t$( \".sp-status-selector select:first-child\" ).change(\n\t\t\tfunction() {\n\n\t\t\t\t$subselector = $( this ).siblings();\n\n\t\t\t\t// Sub settings\n\t\t\t\tif ($( this ).val() == \"sub\") {\n\t\t\t\t\t$subselector.show();\n\t\t\t\t} else {\n\t\t\t\t\t$subselector.hide();\n\t\t\t\t}\n\n\t\t\t}\n\t\t);\n\n\t\t// Trigger status selector\n\t\t$( \".sp-status-selector select:first-child\" ).change();\n\n\t\t// Preset field modifier\n\t\t$( \".sp-custom-input-wrapper .preset\" ).click(\n\t\t\tfunction() {\n\t\t\t\tval = $( this ).val();\n\t\t\t\tif (val == \"\\\\c\\\\u\\\\s\\\\t\\\\o\\\\m\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\texample = $( this ).attr( \"data-example\" );\n\t\t\t\t$( this ).closest( \".sp-custom-input-wrapper\" ).find( \".value\" ).val( val ).siblings( \".example\" ).html( example );\n\t\t\t}\n\t\t);\n\n\t\t// Select custom preset when field is brought to focus\n\t\t$( \".sp-custom-input-wrapper .value\" ).focus(\n\t\t\tfunction() {\n\t\t\t\t$( this ).siblings( \"label\" ).find( \".preset\" ).prop( \"checked\", true );\n\t\t\t}\n\t\t);\n\n\t\t// Adjust example field when custom preset is entered\n\t\t$( \".sp-custom-input-wrapper .value\" ).on(\n\t\t\t\"keyup\",\n\t\t\tfunction() {\n\t\t\t\tval = $( this ).val();\n\t\t\t\tif ( val === undefined ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tformat  = $( this ).attr( \"data-example-format\" );\n\t\t\t\texample = format.replace( \"__val__\", val );\n\t\t\t\t$( this ).siblings( \".example\" ).html( example );\n\t\t\t}\n\t\t);\n\n\t\t// Prevent address input from submitting form\n\t\t$( \".sp-address\" ).keypress(\n\t\t\tfunction(event) {\n\t\t\t\treturn event.keyCode != 13;\n\t\t\t}\n\t\t);\n\n\t\t// Dashboard countdown\n\t\t$( \"#sportspress_dashboard_status .sp_status_list li.countdown\" ).each(\n\t\t\tfunction() {\n\t\t\t\tvar $this = $( this );\n\t\t\t\t// Get countdown time\n\t\t\t\tvar countDownDate = new Date( $( this ).data( 'countdown' ) ).getTime();\n\t\t\t\t// Iterate every second\n\t\t\t\tvar x = setInterval(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// Get todays date and time\n\t\t\t\t\t\tvar now = new Date();\n\n\t\t\t\t\t\t// Convert curent date and time to UTC\n\t\t\t\t\t\tvar tzDifference = now.getTimezoneOffset();\n\t\t\t\t\t\tvar nowutc       = new Date( now.getTime() + tzDifference * 60 * 1000 );\n\n\t\t\t\t\t\t// Find the distance between now and the count down date\n\t\t\t\t\t\tvar distance = countDownDate - nowutc;\n\t\t\t\t\t\tif ( distance < 0 ) {\n\t\t\t\t\t\t\tdistance = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Time calculations for days, hours, minutes and seconds\n\t\t\t\t\t\tvar days    = Math.floor( distance / (1000 * 60 * 60 * 24) );\n\t\t\t\t\t\tvar hours   = Math.floor( (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) );\n\t\t\t\t\t\tvar minutes = Math.floor( (distance % (1000 * 60 * 60)) / (1000 * 60) );\n\t\t\t\t\t\tvar seconds = Math.floor( (distance % (1000 * 60)) / 1000 );\n\n\t\t\t\t\t\t// Output the result\n\t\t\t\t\t\t$this.find( 'strong' ).html( days + \" \" + localized_strings.days + \" \" + ('0' + hours).slice( -2 ) + \":\" + ('0' + minutes).slice( -2 ) + \":\" + ('0' + seconds).slice( -2 ) );\n\t\t\t\t\t},\n\t\t\t\t\t1000\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Event format affects data\n\t\t$( \".post-type-sp_event #post-formats-select\" ).change(\n\t\t\tfunction() {\n\t\t\t\tlayout = $( \".post-type-sp_event #post-formats-select input:checked\" ).val();\n\t\t\t\tif ( layout == \"friendly\" ) {\n\t\t\t\t\t$( \".sp_event-sp_league-field\" ).hide().find( \"select\" ).prop( \"disabled\", true );\n\t\t\t\t\t$( \".sp_event-sp_season-field\" ).hide().find( \"select\" ).prop( \"disabled\", true );\n\t\t\t\t} else {\n\t\t\t\t\t$( \".sp_event-sp_league-field\" ).show().find( \"select\" ).prop( \"disabled\", false );\n\t\t\t\t\t$( \".sp_event-sp_season-field\" ).show().find( \"select\" ).prop( \"disabled\", false );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Trigger event format change\n\t\t$( \".post-type-sp_event #post-formats-select\" ).trigger( \"change\" );\n\n\t\t// Calendar layout affects data\n\t\t$( \".post-type-sp_calendar #post-formats-select\" ).change(\n\t\t\tfunction() {\n\t\t\t\tlayout = $( \".post-type-sp_calendar #post-formats-select input:checked\" ).val();\n\t\t\t\t$( \".sp-calendar-table tr\" ).each(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tif ( layout == \"list\" ) {\n\t\t\t\t\t\t\t$( this ).find( \"th input[type=checkbox]\" ).show();\n\t\t\t\t\t\t\t$( this ).find( \"th select\" ).prop( \"disabled\", false );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$( this ).find( \"th input[type=checkbox]\" ).hide();\n\t\t\t\t\t\t\t$( this ).find( \"th select\" ).prop( 'selectedIndex', 0 ).prop( \"disabled\", true );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Trigger calendar layout change\n\t\t$( \".post-type-sp_calendar #post-formats-select\" ).trigger( \"change\" );\n\n\t\t// Player list layout affects data\n\t\t$( \".post-type-sp_list #post-formats-select\" ).change(\n\t\t\tfunction() {\n\t\t\t\tlayout = $( \".post-type-sp_list #post-formats-select input:checked\" ).val();\n\t\t\t\t$( \".sp-player-list-table tr\" ).each(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tif ( layout == \"list\" ) {\n\t\t\t\t\t\t\t$( this ).find( \"th input[type=checkbox]\" ).show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$( this ).find( \"th input[type=checkbox]\" ).hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Trigger player list layout change\n\t\t$( \".post-type-sp_list #post-formats-select\" ).trigger( \"change\" );\n\n\t\t// Configure primary result option (Ajax)\n\t\t$( \".sp-admin-config-table\" ).on(\n\t\t\t\"click\",\n\t\t\t\".sp-primary-result-option\",\n\t\t\tfunction() {\n\t\t\t\t$.post(\n\t\t\t\t\tajaxurl,\n\t\t\t\t\t{\n\t\t\t\t\t\taction:         \"sp-save-primary-result\",\n\t\t\t\t\t\tprimary_result: $( this ).val(),\n\t\t\t\t\t\tnonce:          $( \"#sp-primary-result-nonce\" ).val()\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Configure primary performance option (Ajax)\n\t\t$( \".sp-admin-config-table\" ).on(\n\t\t\t\"click\",\n\t\t\t\".sp-primary-performance-option\",\n\t\t\tfunction() {\n\t\t\t\t$.post(\n\t\t\t\t\tajaxurl,\n\t\t\t\t\t{\n\t\t\t\t\t\taction:              \"sp-save-primary-performance\",\n\t\t\t\t\t\tprimary_performance: $( this ).val(),\n\t\t\t\t\t\tnonce:               $( \"#sp-primary-performance-nonce\" ).val()\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Update importer post count\n\t\t$( \".sp-import-table\" ).on(\n\t\t\t\"updatePostCount\",\n\t\t\tfunction() {\n\t\t\t\t$( \".sp-post-count\" ).text( localized_strings.displaying_posts.replace( \"%s\", 1 ).replace( /%s/g, count = $( this ).find( \"tbody tr\" ).length ) );\n\t\t\t}\n\t\t);\n\n\t\t// Delete importer row\n\t\t$( \".sp-import-table\" ).on(\n\t\t\t\"click\",\n\t\t\t\".sp-delete-row\",\n\t\t\tfunction() {\n\t\t\t\t$self = $( this );\n\t\t\t\t$self.closest( \"tr\" ).css( \"background-color\", \"#f99\" ).fadeOut(\n\t\t\t\t\t400,\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\t$table = $self.closest( \".sp-import-table\" );\n\t\t\t\t\t\t$( this ).remove();\n\t\t\t\t\t\t$table.trigger( \"updatePostCount\" );\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t// Add importer row\n\t\t$( \".sp-import-table\" ).on(\n\t\t\t\"click\",\n\t\t\t\".sp-add-row\",\n\t\t\tfunction() {\n\t\t\t\t$self  = $( this );\n\t\t\t\t$table = $self.closest( \".sp-import-table\" );\n\t\t\t\tif ( $self.hasClass( \"sp-add-first\" ) ) {\n\t\t\t\t\t$tr  = $table.find( \"tbody tr:first-child\" );\n\t\t\t\t\t$row = $tr.clone();\n\t\t\t\t\t$row.insertBefore( $tr ).find( \"input\" ).val( \"\" );\n\t\t\t\t} else {\n\t\t\t\t\t$tr  = $self.closest( \"tr\" );\n\t\t\t\t\t$row = $tr.clone();\n\t\t\t\t\t$tr.find( \"input\" ).val( \"\" );\n\t\t\t\t\t$row.insertBefore( $tr );\n\t\t\t\t}\n\t\t\t\t$table.trigger( \"updatePostCount\" );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t// Enable or disable importer inputs based on column label\n\t\t$( \".sp-import-table\" ).on(\n\t\t\t\"change\",\n\t\t\t\"select\",\n\t\t\tfunction() {\n\t\t\t\t$self  = $( this );\n\t\t\t\t$table = $self.closest( \".sp-import-table\" );\n\t\t\t\tindex  = parseInt( $self.data( \"index\" ) );\n\t\t\t\tif ( $self.val() == 0 ) {\n\t\t\t\t\t$table.find( \"tbody tr td:nth-child(\" + parseInt( index + 1 ) + \") input\" ).prop( \"disabled\", true );\n\t\t\t\t} else {\n\t\t\t\t\t$table.find( \"tbody tr td:nth-child(\" + parseInt( index + 1 ) + \") input\" ).prop( \"disabled\", false );\n\t\t\t\t\t$self.closest( \"th\" ).siblings().find( \"select\" ).each(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tif ( $( this ).val() == $self.val() ) {\n\t\t\t\t\t\t\t\t$( this ).val( \"0\" ).trigger( \"change\" );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Datepicker\n\t\t$( \".sp-datepicker\" ).datepicker(\n\t\t\t{\n\t\t\t\tdateFormat : \"yy-mm-dd\"\n\t\t\t}\n\t\t);\n\t\t$( \".sp-datepicker-from\" ).datepicker(\n\t\t\t{\n\t\t\t\tdateFormat : \"yy-mm-dd\",\n\t\t\t\tonClose: function( selectedDate ) {\n\t\t\t\t\t$( this ).closest( \".sp-date-selector\" ).find( \".sp-datepicker-to\" ).datepicker( \"option\", \"minDate\", selectedDate );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t$( \".sp-datepicker-to\" ).datepicker(\n\t\t\t{\n\t\t\t\tdateFormat : \"yy-mm-dd\",\n\t\t\t\tonClose: function( selectedDate ) {\n\t\t\t\t\t$( this ).closest( \".sp-date-selector\" ).find( \".sp-datepicker-from\" ).datepicker( \"option\", \"maxDate\", selectedDate );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Show or hide datepicker\n\t\t$( \".sp-date-selector select\" ).change(\n\t\t\tfunction() {\n\t\t\t\tif ( $( this ).val() == \"range\" ) {\n\t\t\t\t\t$( this ).closest( \".sp-date-selector\" ).find( \".sp-date-range\" ).show();\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).closest( \".sp-date-selector\" ).find( \".sp-date-range\" ).hide();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t$( \".sp-date-selector select\" ).trigger( \"change\" );\n\n\t\t// Toggle date range selectors\n\t\t$( \".sp-date-relative input\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$relative = $( this ).closest( \".sp-date-relative\" ).siblings( \".sp-date-range-relative\" ).toggle( 0, $( this ).attr( \"checked\" ) );\n\t\t\t\t$absolute = $( this ).closest( \".sp-date-relative\" ).siblings( \".sp-date-range-absolute\" ).toggle( 0, $( this ).attr( \"checked\" ) );\n\n\t\t\t\tif ( $( this ).is( \":checked\" ) ) {\n\t\t\t\t\t$relative.show();\n\t\t\t\t\t$absolute.hide();\n\t\t\t\t} else {\n\t\t\t\t\t$absolute.show();\n\t\t\t\t\t$relative.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t$( \".sp-date-selector input\" ).trigger( \"change\" );\n\n\t\t// Apply color scheme\n\t\t$( \".sp-color-option\" ).on(\n\t\t\t\"click\",\n\t\t\tfunction() {\n\t\t\t\tcolors = $( this ).find( \"label\" ).data( \"sp-colors\" ).split( \",\" );\n\t\t\t\t$( \".sp-custom-colors\" ).find( \".sp-color-box\" ).each(\n\t\t\t\t\tfunction(index) {\n\t\t\t\t\t\t$( this ).find( \"input\" ).val( \"#\" + colors[index] ).css( \"background-color\", \"#\" + colors[index] );\n\t\t\t\t\t}\n\t\t\t\t);;\n\t\t\t}\n\t\t);\n\n\t\t// Edit inline results\n\t\t$( \"#the-list\" ).on(\n\t\t\t\"click, focus\",\n\t\t\t\".sp-result, .sp-edit-results\",\n\t\t\tfunction(){\n\t\t\t\tteam    = $( this ).data( \"team\" );\n\t\t\t\t$column = $( this ).closest( \".column-sp_team\" );\n\t\t\t\t$column.find( \".sp-result, .sp-row-actions\" ).hide();\n\t\t\t\t$column.find( \".sp-edit-result, .sp-inline-edit-save\" ).show();\n\t\t\t\tif ( team != undefined ) {\n\t\t\t\t\t$column.find( \".sp-edit-result[data-team='\" + team + \"']\" ).select();\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t// Cancel inline results\n\t\t$( \"#the-list\" ).on(\n\t\t\t\"click\",\n\t\t\t\".sp-inline-edit-save .cancel\",\n\t\t\tfunction(){\n\t\t\t\t$column = $( this ).closest( \".column-sp_team\" );\n\t\t\t\t$column.find( \".sp-edit-result, .sp-inline-edit-save\" ).hide();\n\t\t\t\t$column.find( \".sp-result, .sp-row-actions\" ).show();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\t// Save inline results\n\t\t$( \"#the-list\" ).on(\n\t\t\t\"click\",\n\t\t\t\".sp-inline-edit-save .save\",\n\t\t\tfunction(){\n\t\t\t\t$column = $( this ).closest( \".column-sp_team\" );\n\t\t\t\tresults = {};\n\t\t\t\t$column.find( \".sp-edit-result\" ).each(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tid          = $( this ).data( \"team\" );\n\t\t\t\t\t\tresult      = $( this ).val();\n\t\t\t\t\t\tresults[id] = result;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t$.post(\n\t\t\t\t\tajaxurl,\n\t\t\t\t\t{\n\t\t\t\t\t\taction:         \"sp-save-inline-results\",\n\t\t\t\t\t\tpost_id: \t\t$column.find( \"input[name='sp_post_id']\" ).val(),\n\t\t\t\t\t\tresults: \t\tresults,\n\t\t\t\t\t\tnonce:          $( \"#sp-inline-nonce\" ).val()\n\t\t\t\t\t},\n\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\t$column.find( \".sp-edit-result\" ).each(\n\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\tval = $( this ).val();\n\t\t\t\t\t\t\t\t$column.find( \".sp-result[data-team='\" + $( this ).data( \"team\" ) + \"']\" ).html( val == '' ? '-' : val );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$column.find( \".sp-edit-result, .sp-inline-edit-save\" ).hide();\n\t\t\t\t\t\t$column.find( \".sp-result, .sp-row-actions\" ).show();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Override inline form submission\n\t\t$( \"#the-list\" ).on(\n\t\t\t\"keypress\",\n\t\t\t\".sp-edit-result\",\n\t\t\tfunction(e) {\n\t\t\t\tif ( e.which == 13 ) {\n\t\t\t\t\t$( this ).closest( \".column-sp_team\" ).find( \".sp-inline-edit-save .save\" ).trigger( \"click\" );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Fitvids\n\t\t$( \".sp-fitvids\" ).fitVids();\n\n\t\t// Display configure sport button\n\t\t$( \".sp-select-sport\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$( \".sp-configure-sport\" ).hide();\n\t\t\t}\n\t\t);\n\n\t\t// Ajax checklist\n\t\t$( \".sp-ajax-checklist\" ).siblings( \".sp-tab-select\" ).find( \"select\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \".sp-tab-select\" ).siblings( \".sp-ajax-checklist\" ).find( \"ul\" ).html( \"<li>\" + localized_strings.loading + \"</li>\" );\n\t\t\t\t$.post(\n\t\t\t\t\tajaxurl,\n\t\t\t\t\t{\n\t\t\t\t\t\taction:         \"sp-get-players\",\n\t\t\t\t\t\tteam: \t\t\t$( this ).val(),\n\t\t\t\t\t\tleague: \t\t('yes' == localized_strings.option_filter_by_league) ? $( \"select[name=\\\"tax_input[sp_league][]\\\"]\" ).val() : null,\n\t\t\t\t\t\tseason: \t\t('yes' == localized_strings.option_filter_by_season) ? $( \"select[name=\\\"tax_input[sp_season][]\\\"]\" ).val() : null,\n\t\t\t\t\t\tindex: \t\t\t$( this ).closest( \".sp-instance\" ).index(),\n\t\t\t\t\t\tnonce:          $( \"#sp-get-players-nonce\" ).val()\n\t\t\t\t\t}\n\t\t\t\t).done(\n\t\t\t\t\tfunction( response ) {\n\t\t\t\t\t\tindex   = response.data.index;\n\t\t\t\t\t\t$target = $( \".sp-instance\" ).eq( index ).find( \".sp-ajax-checklist ul\" );\n\t\t\t\t\t\tif ( response.success ) {\n\t\t\t\t\t\t\t$target.html( \"\" );\n\t\t\t\t\t\t\ti = 0;\n\t\t\t\t\t\t\tif (-1 == response.data.sections) {\n\t\t\t\t\t\t\t\tif (response.data.players.length) {\n\t\t\t\t\t\t\t\t\t$target.eq( 0 ).append( \"<li class=\\\"sp-select-all-container\\\"><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" class=\\\"sp-select-all\\\"><strong>\" + localized_strings.select_all + \"</strong></li>\" );\n\t\t\t\t\t\t\t\t\t$( response.data.players ).each(\n\t\t\t\t\t\t\t\t\t\tfunction( key, value ) {\n\t\t\t\t\t\t\t\t\t\t\t$target.eq( 0 ).append( \"<li><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" value=\\\"\" + value.ID + \"\\\" name=\\\"sp_player[\" + index + \"][]\\\">\" + value.post_title + \"</li>\" );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$target.eq( 0 ).append( \"<li class=\\\"sp-ajax-show-all-container\\\"><a class=\\\"sp-ajax-show-all\\\" href=\\\"#show-all-sp_players\\\">\" + localized_strings.show_all + \"</a></li>\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$target.eq( 0 ).html( \"<li>\" + localized_strings.no_results_found + \" <a class=\\\"sp-ajax-show-all\\\" href=\\\"#show-all-sp_players\\\">\" + localized_strings.show_all + \"</a></li>\" );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ( 1 == response.data.sections ) {\n\t\t\t\t\t\t\t\t\tdefense = i;\n\t\t\t\t\t\t\t\t\toffense = i + 1;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toffense = i;\n\t\t\t\t\t\t\t\t\tdefense = i + 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (response.data.players.length) {\n\t\t\t\t\t\t\t\t\t$target.eq( offense ).append( \"<li class=\\\"sp-select-all-container\\\"><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" class=\\\"sp-select-all\\\"><strong>\" + localized_strings.select_all + \"</strong></li>\" );\n\t\t\t\t\t\t\t\t\t$target.eq( defense ).append( \"<li class=\\\"sp-select-all-container\\\"><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" class=\\\"sp-select-all\\\"><strong>\" + localized_strings.select_all + \"</strong></li>\" );\n\t\t\t\t\t\t\t\t\t$( response.data.players ).each(\n\t\t\t\t\t\t\t\t\t\tfunction( key, value ) {\n\t\t\t\t\t\t\t\t\t\t\t$target.eq( offense ).append( \"<li><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" value=\\\"\" + value.ID + \"\\\" name=\\\"sp_offense[\" + index + \"][]\\\">\" + value.post_title + \"</li>\" );\n\t\t\t\t\t\t\t\t\t\t\t$target.eq( defense ).append( \"<li><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" value=\\\"\" + value.ID + \"\\\" name=\\\"sp_defense[\" + index + \"][]\\\">\" + value.post_title + \"</li>\" );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$target.eq( offense ).append( \"<li class=\\\"sp-ajax-show-all-container\\\"><a class=\\\"sp-ajax-show-all\\\" href=\\\"#show-all-sp_offense\\\">\" + localized_strings.show_all + \"</a></li>\" );\n\t\t\t\t\t\t\t\t\t$target.eq( defense ).append( \"<li class=\\\"sp-ajax-show-all-container\\\"><a class=\\\"sp-ajax-show-all\\\" href=\\\"#show-all-sp_defense\\\">\" + localized_strings.show_all + \"</a></li>\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$target.eq( offense ).html( \"<li>\" + localized_strings.no_results_found + \" <a class=\\\"sp-ajax-show-all\\\" href=\\\"#show-all-sp_offense\\\">\" + localized_strings.show_all + \"</a></li>\" );\n\t\t\t\t\t\t\t\t\t$target.eq( defense ).html( \"<li>\" + localized_strings.no_results_found + \" <a class=\\\"sp-ajax-show-all\\\" href=\\\"#show-all-sp_defense\\\">\" + localized_strings.show_all + \"</a></li>\" );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tif (response.data.staff.length) {\n\t\t\t\t\t\t\t\t$target.eq( i ).append( \"<li class=\\\"sp-select-all-container\\\"><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" class=\\\"sp-select-all\\\"><strong>\" + localized_strings.select_all + \"</strong></li>\" );\n\t\t\t\t\t\t\t\t$( response.data.staff ).each(\n\t\t\t\t\t\t\t\t\tfunction( key, value ) {\n\t\t\t\t\t\t\t\t\t\t$target.eq( i ).append( \"<li><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" value=\\\"\" + value.ID + \"\\\" name=\\\"sp_staff[\" + index + \"][]\\\">\" + value.post_title + \"</li>\" );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$target.eq( i ).append( \"<li class=\\\"sp-ajax-show-all-container\\\"><a class=\\\"sp-ajax-show-all\\\" href=\\\"#show-all-sp_staffs\\\">\" + localized_strings.show_all + \"</a></li>\" );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$target.eq( i ).html( \"<li>\" + localized_strings.no_results_found + \" <a class=\\\"sp-ajax-show-all\\\" href=\\\"#show-all-sp_staffs\\\">\" + localized_strings.show_all + \"</a></li>\" );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$target.html( \"<li>\" + localized_strings.no_results_found + \"</li>\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Activate Ajax trigger\n\t\t$( \".sp-ajax-trigger\" ).change(\n\t\t\tfunction() {\n\t\t\t\t$( \".sp-ajax-checklist\" ).siblings( \".sp-tab-select\" ).find( \"select\" ).change();\n\t\t\t}\n\t\t);\n\n\t\t// Ajax show all filter\n\t\t$( \".sp-tab-panel\" ).on(\n\t\t\t\"click\",\n\t\t\t\".sp-ajax-show-all\",\n\t\t\tfunction() {\n\t\t\t\tindex = $( this ).closest( \".sp-instance\" ).index();\n\t\t\t\t$( this ).parent().html( localized_strings.loading );\n\t\t\t\t$.post(\n\t\t\t\t\tajaxurl,\n\t\t\t\t\t{\n\t\t\t\t\t\taction:         \"sp-get-players\",\n\t\t\t\t\t\tindex: \t\t\tindex,\n\t\t\t\t\t\tnonce:          $( \"#sp-get-players-nonce\" ).val()\n\t\t\t\t\t}\n\t\t\t\t).done(\n\t\t\t\t\tfunction( response ) {\n\t\t\t\t\t\tindex = response.data.index;\n\t\t\t\t\t\tconsole.log( index );\n\t\t\t\t\t\t$target = $( \".sp-instance\" ).eq( index ).find( \".sp-ajax-checklist ul\" );\n\t\t\t\t\t\t$target.find( \".sp-ajax-show-all-container\" ).hide();\n\t\t\t\t\t\tif ( response.success ) {\n\t\t\t\t\t\t\ti = 0;\n\t\t\t\t\t\t\tconsole.log( response.data.sections );\n\t\t\t\t\t\t\tif ( -1 == response.data.sections ) {\n\t\t\t\t\t\t\t\tif (response.data.players.length) {\n\t\t\t\t\t\t\t\t\t$( response.data.players ).each(\n\t\t\t\t\t\t\t\t\t\tfunction( key, value ) {\n\t\t\t\t\t\t\t\t\t\t\tif ($target.eq( i ).find( \"input[value=\" + value.ID + \"]\" ).length) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$target.eq( i ).append( \"<li><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" value=\\\"\" + value.ID + \"\\\" name=\\\"sp_player[\" + index + \"][]\\\"> \" + value.post_title + \"</li>\" );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$target.eq( i ).html( \"<li>\" + localized_strings.no_results_found + \"</li>\" );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (response.data.players.length) {\n\t\t\t\t\t\t\t\t\tif ( 1 == response.data.sections ) {\n\t\t\t\t\t\t\t\t\t\tdefense = i;\n\t\t\t\t\t\t\t\t\t\toffense = i + 1;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toffense = i;\n\t\t\t\t\t\t\t\t\t\tdefense = i + 1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$( response.data.players ).each(\n\t\t\t\t\t\t\t\t\t\tfunction( key, value ) {\n\t\t\t\t\t\t\t\t\t\t\t$target.eq( offense ).append( \"<li><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" value=\\\"\" + value.ID + \"\\\" name=\\\"sp_offense[\" + index + \"][]\\\"> \" + value.post_title + \"</li>\" );\n\t\t\t\t\t\t\t\t\t\t\t$target.eq( defense ).append( \"<li><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" value=\\\"\" + value.ID + \"\\\" name=\\\"sp_defense[\" + index + \"][]\\\"> \" + value.post_title + \"</li>\" );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$target.eq( offense ).html( \"<li>\" + localized_strings.no_results_found + \"</li>\" );\n\t\t\t\t\t\t\t\t\t$target.eq( defense ).html( \"<li>\" + localized_strings.no_results_found + \"</li>\" );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tif (response.data.staff.length) {\n\t\t\t\t\t\t\t\t$( response.data.staff ).each(\n\t\t\t\t\t\t\t\t\tfunction( key, value ) {\n\t\t\t\t\t\t\t\t\t\t$target.eq( i ).append( \"<li><label class=\\\"selectit\\\"><input type=\\\"checkbox\\\" value=\\\"\" + value.ID + \"\\\" name=\\\"sp_staff[\" + index + \"][]\\\"> \" + value.post_title + \"</li>\" );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$target.eq( i ).html( \"<li>\" + localized_strings.no_results_found + \"</li>\" );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$target.html( \"<li>\" + localized_strings.no_results_found + \"</li>\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\t// Event status selector\n\t\t$( '.sp-edit-event-status' ).click(\n\t\t\tfunction(e) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$select = $( this ).siblings( '.sp-event-status-select' );\n\t\t\t\tif ( $select.is( ':hidden' ) ) {\n\t\t\t\t\t$select.slideDown(\n\t\t\t\t\t\t'fast',\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t$select.find( 'input[type=\"radio\"]' ).first().focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$( this ).hide();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t$( '.sp-save-event-status' ).click(\n\t\t\tfunction(e) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$select = $( this ).closest( '.sp-event-status-select' );\n\t\t\t\t$input  = $select.find( 'input[name=sp_status]:checked' );\n\t\t\t\tval     = $input.val();\n\t\t\t\tlabel   = $input.data( 'sp-event-status' );\n\t\t\t\t$select.slideUp( 'fast' ).siblings( '.sp-edit-event-status' ).show().siblings( '.sp-event-status' ).find( '.sp-event-status-display' ).data( 'sp-event-status', val ).html( label );\n\t\t\t}\n\t\t);\n\n\t\t$( '.sp-cancel-event-status' ).click(\n\t\t\tfunction(e) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$select = $( this ).closest( '.sp-event-status-select' );\n\t\t\t\tval     = $select.siblings( '.sp-event-status' ).find( '.sp-event-status-display' ).data( 'sp-event-status' );\n\t\t\t\t$select.find( 'input[value=' + val + ']' ).attr( 'checked', true );\n\t\t\t\t$select.slideUp( 'fast' ).siblings( '.sp-edit-event-status' ).show();\n\t\t\t}\n\t\t);\n\n\t\t// Box score time converter\n\t\t$( '.sp-convert-time-input' ).change(\n\t\t\tfunction() {\n\t\t\t\tvar s   = 0;\n\t\t\t\tvar val = $( this ).val();\n\t\t\t\tif (val === '') {\n\t\t\t\t\t$( this ).siblings( '.sp-convert-time-output' ).val( '' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar a = val.split( ':' ).reverse();\n\t\t\t\t$.each(\n\t\t\t\t\ta,\n\t\t\t\t\tfunction( index, value ) {\n\t\t\t\t\t\ts += parseInt( value ) * Math.pow( 60, index );\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t$( this ).siblings( '.sp-convert-time-output' ).val( s );\n\t\t\t}\n\t\t);\n\n\t\t// Trigger box score time converter\n\t\t$( '.sp-convert-time-input' ).change();\n\n\t\t// Trigger show/hide of team table ordering\n\t\t$( '#sp_orderby' ).change(\n\t\t\tfunction(){\n\t\t\t\tif ($( '#sp_orderby' ).val() == 'default') {\n\t\t\t\t\t$( \"#sp_order\" ).hide();\n\t\t\t\t} else {\n\t\t\t\t\t$( '#sp_order' ).show();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n);\n"
  },
  {
    "path": "assets/js/admin/sportspress-setup.js",
    "content": "jQuery( document ).ready(\n\tfunction($){\n\n\t\t// Tiptip\n\t\t$( \".sp-tip\" ).tipTip(\n\t\t\t{\n\t\t\t\tdelay: 200,\n\t\t\t\tfadeIn: 100,\n\t\t\t\tfadeOut: 100\n\t\t\t}\n\t\t);\n\t\t$( \".sp-desc-tip\" ).tipTip(\n\t\t\t{\n\t\t\t\tdelay: 200,\n\t\t\t\tfadeIn: 100,\n\t\t\t\tfadeOut: 100,\n\t\t\t\tdefaultPosition: 'right'\n\t\t\t}\n\t\t);\n\n\t\t// Chosen select\n\t\t$( \".chosen-select, #poststuff #post_author_override\" ).chosen(\n\t\t\t{\n\t\t\t\tallow_single_deselect: true,\n\t\t\t\tsearch_contains: true,\n\t\t\t\tsingle_backstroke_delete: false,\n\t\t\t\tdisable_search_threshold: 10,\n\t\t\t\tplaceholder_text_multiple: localized_strings.none\n\t\t\t}\n\t\t);\n\t}\n);\n"
  },
  {
    "path": "assets/js/admin/widgets.js",
    "content": "jQuery( document ).ready(\n\tfunction($){\n\n\t\t// Orderby affects order select in widget options\n\t\t$( \"body\" ).on(\n\t\t\t\"change\",\n\t\t\t\".sp-select-orderby\",\n\t\t\tfunction() {\n\t\t\t\t$( this ).closest( \".widget-content\" ).find( \".sp-select-order\" ).prop( \"disabled\", $( this ).val() == \"default\" );\n\t\t\t}\n\t\t);\n\n\t\t// Calendar affects view all link checkbox in widget options\n\t\t$( \"body\" ).on(\n\t\t\t\"change\",\n\t\t\t\".sp-event-calendar-select\",\n\t\t\tfunction() {\n\t\t\t\t$el = $( this ).closest( \".widget-content\" ).find( \".sp-event-calendar-show-all-toggle\" );\n\t\t\t\tif ($( this ).val() == 0) {\n\t\t\t\t\t$el.hide();\n\t\t\t\t} else {\n\t\t\t\t\t$el.show();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// Show or hide datepicker\n\t\t$( \"body\" ).on(\n\t\t\t\"change\",\n\t\t\t\".sp-date-selector select\",\n\t\t\tfunction() {\n\t\t\t\tif ( $( this ).val() == \"range\" ) {\n\t\t\t\t\t$( this ).closest( \".sp-date-selector\" ).find( \".sp-date-range\" ).show();\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).closest( \".sp-date-selector\" ).find( \".sp-date-range\" ).hide();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t$( \".sp-date-selector select\" ).trigger( \"change\" );\n\n\t\t// Toggle date range selectors\n\t\t$( \"body\" ).on(\n\t\t\t\"change\",\n\t\t\t\".sp-date-relative input\",\n\t\t\tfunction() {\n\t\t\t\t$relative = $( this ).closest( \".sp-date-relative\" ).siblings( \".sp-date-range-relative\" ).toggle( 0, $( this ).attr( \"checked\" ) );\n\t\t\t\t$absolute = $( this ).closest( \".sp-date-relative\" ).siblings( \".sp-date-range-absolute\" ).toggle( 0, $( this ).attr( \"checked\" ) );\n\n\t\t\t\tif ( $( this ).is( \":checked\" ) ) {\n\t\t\t\t\t$relative.show();\n\t\t\t\t\t$absolute.hide();\n\t\t\t\t} else {\n\t\t\t\t\t$absolute.show();\n\t\t\t\t\t$relative.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t$( \".sp-date-selector input\" ).trigger( \"change\" );\n\t}\n);\n"
  },
  {
    "path": "assets/js/blocks/event-calendar.js",
    "content": "import apiFetch from '@wordpress/api-fetch';\nconsole.log( wp.api.collections.Posts() );\n\nwp.blocks.registerBlockType(\n\t'sportspress/event-calendar',\n\t{\n\t\ttitle: strings.event_calendar,\n\t\ticon: 'calendar',\n\t\tcategory: 'sportspress',\n\t\tattributes: {\n\t\t\ttitle: {\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\tid: {\n\t\t\t\ttype: 'number'\n\t\t\t},\n\t\t\tstatus: {\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\tdate: {\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\tdate_from: {\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\tdate_to: {\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\tdate_past: {\n\t\t\t\ttype: 'number'\n\t\t\t},\n\t\t\tdate_future: {\n\t\t\t\ttype: 'number'\n\t\t\t},\n\t\t\tdate_relative: {\n\t\t\t\ttype: 'number'\n\t\t\t},\n\t\t\tday: {\n\t\t\t\ttype: 'string'\n\t\t\t},\n\t\t\tshow_all_events_link: {\n\t\t\t\ttype: 'number'\n\t\t\t},\n\n\t\t\tcontent: {type: 'string'},\n\t\t\tcolor: {type: 'string'}\n\t\t},\n\n\t\tedit: function(props) {\n\t\t\tfunction updateContent(event) {\n\t\t\t\tprops.setAttributes( {content: event.target.value} )\n\t\t\t}\n\t\t\tfunction updateColor(value) {\n\t\t\t\tprops.setAttributes( {color: value.hex} )\n\t\t\t}\n\t\t\treturn React.createElement(\n\t\t\t\twp.components.Panel,\n\t\t\t\t{header: strings.event_calendar},\n\t\t\t\tReact.createElement(\n\t\t\t\t\twp.components.PanelBody,\n\t\t\t\t\t{title: strings.properties},\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\twp.components.TextControl,\n\t\t\t\t\t\t{label: strings.title, type: \"text\", value: props.attributes.title}\n\t\t\t\t\t),\n\t\t\t\t\tReact.createElement(\n\t\t\t\t\t\twp.components.SelectControl,\n\t\t\t\t\t\t{label: strings.select_calendar, options: [{label: strings.all, value: 0}].concat(\n\t\t\t\t\t\t\tposts.events.map(\n\t\t\t\t\t\t\t\tpost => {\n                                return {label: post.post_title, value: post.ID}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)}\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t},\n\n\t\tsave: function(props) {\n\t\t\treturn wp.element.createElement(\n\t\t\t\t\"h3\",\n\t\t\t\t{ style: { border: \"3px solid \" + props.attributes.color } },\n\t\t\t\tprops.attributes.content\n\t\t\t);\n\t\t}\n\t}\n)\n"
  },
  {
    "path": "assets/js/jquery.fitvids.js",
    "content": "/*global jQuery */\n/*jshint browser:true */\n/*!\n* FitVids 1.1\n*\n* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com\n* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/\n* Released under the WTFPL license - http://sam.zoy.org/wtfpl/\n*\n*/\n\n(function( $ ){\n\n  'use strict';\n\n  $.fn.fitVids = function( options ) {\n    var settings = {\n      customSelector: null,\n      ignore: null\n    };\n\n    if(!document.getElementById('fit-vids-style')) {\n      // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js\n      var head = document.head || document.getElementsByTagName('head')[0];\n      var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';\n      var div = document.createElement(\"div\");\n      div.innerHTML = '<p>x</p><style id=\"fit-vids-style\">' + css + '</style>';\n      head.appendChild(div.childNodes[1]);\n    }\n\n    if ( options ) {\n      $.extend( settings, options );\n    }\n\n    return this.each(function(){\n      var selectors = [\n        'iframe[src*=\"player.vimeo.com\"]',\n        'iframe[src*=\"youtube.com\"]',\n        'iframe[src*=\"youtube-nocookie.com\"]',\n        'iframe[src*=\"kickstarter.com\"][src*=\"video.html\"]',\n        'object',\n        'embed'\n      ];\n\n      if (settings.customSelector) {\n        selectors.push(settings.customSelector);\n      }\n\n      var ignoreList = '.fitvidsignore';\n\n      if(settings.ignore) {\n        ignoreList = ignoreList + ', ' + settings.ignore;\n      }\n\n      var $allVideos = $(this).find(selectors.join(','));\n      $allVideos = $allVideos.not('object object'); // SwfObj conflict patch\n      $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.\n\n      $allVideos.each(function(){\n        var $this = $(this);\n        if($this.parents(ignoreList).length > 0) {\n          return; // Disable FitVids on this video.\n        }\n        if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }\n        if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))\n        {\n          $this.attr('height', 9);\n          $this.attr('width', 16);\n        }\n        var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),\n            width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),\n            aspectRatio = height / width;\n        if(!$this.attr('id')){\n          var videoID = 'fitvid' + Math.floor(Math.random()*999999);\n          $this.attr('id', videoID);\n        }\n        $this.wrap('<div class=\"fluid-width-video-wrapper\"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');\n        $this.removeAttr('height').removeAttr('width');\n      });\n    });\n  };\n// Works with either jQuery or Zepto\n})( window.jQuery || window.Zepto );"
  },
  {
    "path": "assets/js/leaflet.js",
    "content": "/* @preserve\n * Leaflet 1.9.4+v1.d15112c, a JS library for interactive maps. https://leafletjs.com\n * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade\n */\n!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],e):e((t=\"undefined\"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,function(t){\"use strict\";function l(t){for(var e,i,n=1,o=arguments.length;n<o;n++)for(e in i=arguments[n])t[e]=i[e];return t}var R=Object.create||function(t){return N.prototype=t,new N};function N(){}function a(t,e){var i,n=Array.prototype.slice;return t.bind?t.bind.apply(t,n.call(arguments,1)):(i=n.call(arguments,2),function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)})}var D=0;function h(t){return\"_leaflet_id\"in t||(t._leaflet_id=++D),t._leaflet_id}function j(t,e,i){var n,o,s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)};return r}function H(t,e,i){var n=e[1],e=e[0],o=n-e;return t===n&&i?t:((t-e)%o+o)%o+e}function u(){return!1}function i(t,e){return!1===e?t:(e=Math.pow(10,void 0===e?6:e),Math.round(t*e)/e)}function W(t){return t.trim?t.trim():t.replace(/^\\s+|\\s+$/g,\"\")}function F(t){return W(t).split(/\\s+/)}function c(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,\"options\")||(t.options=t.options?R(t.options):{}),e)t.options[i]=e[i];return t.options}function U(t,e,i){var n,o=[];for(n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+\"=\"+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf(\"?\")?\"&\":\"?\")+o.join(\"&\")}var V=/\\{ *([\\w_ -]+) *\\}/g;function q(t,i){return t.replace(V,function(t,e){e=i[e];if(void 0===e)throw new Error(\"No value provided for variable \"+t);return e=\"function\"==typeof e?e(i):e})}var d=Array.isArray||function(t){return\"[object Array]\"===Object.prototype.toString.call(t)};function G(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var K=\"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=\";function Y(t){return window[\"webkit\"+t]||window[\"moz\"+t]||window[\"ms\"+t]}var X=0;function J(t){var e=+new Date,i=Math.max(0,16-(e-X));return X=e+i,window.setTimeout(t,i)}var $=window.requestAnimationFrame||Y(\"RequestAnimationFrame\")||J,Q=window.cancelAnimationFrame||Y(\"CancelAnimationFrame\")||Y(\"CancelRequestAnimationFrame\")||function(t){window.clearTimeout(t)};function x(t,e,i){if(!i||$!==J)return $.call(window,a(t,e));t.call(e)}function r(t){t&&Q.call(window,t)}var tt={__proto__:null,extend:l,create:R,bind:a,get lastId(){return D},stamp:h,throttle:j,wrapNum:H,falseFn:u,formatNum:i,trim:W,splitWords:F,setOptions:c,getParamString:U,template:q,isArray:d,indexOf:G,emptyImageUrl:K,requestFn:$,cancelFn:Q,requestAnimFrame:x,cancelAnimFrame:r};function et(){}et.extend=function(t){function e(){c(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var i,n=e.__super__=this.prototype,o=R(n);for(i in(o.constructor=e).prototype=o,this)Object.prototype.hasOwnProperty.call(this,i)&&\"prototype\"!==i&&\"__super__\"!==i&&(e[i]=this[i]);if(t.statics&&l(e,t.statics),t.includes){var s=t.includes;if(\"undefined\"!=typeof L&&L&&L.Mixin){s=d(s)?s:[s];for(var r=0;r<s.length;r++)s[r]===L.Mixin.Events&&console.warn(\"Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.\",(new Error).stack)}l.apply(null,[o].concat(t.includes))}return l(o,t),delete o.statics,delete o.includes,o.options&&(o.options=n.options?R(n.options):{},l(o.options,t.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;t<e;t++)o._initHooks[t].call(this)}},e},et.include=function(t){var e=this.prototype.options;return l(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},et.mergeOptions=function(t){return l(this.prototype.options,t),this},et.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i=\"function\"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var e={on:function(t,e,i){if(\"object\"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if(\"object\"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=F(t);for(var o=1===arguments.length,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],e,i)}else delete this._events;return this},_on:function(t,e,i,n){\"function\"!=typeof e?console.warn(\"wrong listener type: \"+typeof e):!1===this._listens(t,e,i)&&(e={fn:e,ctx:i=i===this?void 0:i},n&&(e.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e))},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(1===arguments.length){if(this._firingCount)for(o=0,s=n.length;o<s;o++)n[o].fn=u;delete this._events[t]}else\"function\"!=typeof e?console.warn(\"wrong listener type: \"+typeof e):!1!==(e=this._listens(t,e,i))&&(i=n[e],this._firingCount&&(i.fn=u,this._events[t]=n=n.slice()),n.splice(e,1))},fire:function(t,e,i){if(this.listens(t,i)){var n=l({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,r=o.length;s<r;s++){var a=o[s],h=a.fn;a.once&&this.off(t,h,a.ctx),h.call(a.ctx||this,n)}this._firingCount--}}i&&this._propagateEvent(n)}return this},listens:function(t,e,i,n){\"string\"!=typeof t&&console.warn('\"string\" type argument expected');var o=e,s=(\"function\"!=typeof e&&(n=!!e,i=o=void 0),this._events&&this._events[t]);if(s&&s.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var r in this._eventParents)if(this._eventParents[r].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(this._events){var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,s=n.length;o<s;o++)if(n[o].fn===e&&n[o].ctx===i)return o}return!1},once:function(t,e,i){if(\"object\"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[h(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[h(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,l({layer:t.target,propagatedFrom:t.target},t),!0)}},it=(e.addEventListener=e.on,e.removeEventListener=e.clearAllEventListeners=e.off,e.addOneTimeEventListener=e.once,e.fireEvent=e.fire,e.hasEventListeners=e.listens,et.extend(e));function p(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var nt=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function m(t,e,i){return t instanceof p?t:d(t)?new p(t[0],t[1]):null==t?t:\"object\"==typeof t&&\"x\"in t&&\"y\"in t?new p(t.x,t.y):new p(t,e,i)}function f(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function _(t,e){return!t||t instanceof f?t:new f(t,e)}function s(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function g(t,e){return t instanceof s?t:new s(t,e)}function v(t,e,i){if(isNaN(t)||isNaN(e))throw new Error(\"Invalid LatLng object: (\"+t+\", \"+e+\")\");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function w(t,e,i){return t instanceof v?t:d(t)&&\"object\"!=typeof t[0]?3===t.length?new v(t[0],t[1],t[2]):2===t.length?new v(t[0],t[1]):null:null==t?t:\"object\"==typeof t&&\"lat\"in t?new v(t.lat,\"lng\"in t?t.lng:t.lon,t.alt):void 0===e?null:new v(t,e,i)}p.prototype={clone:function(){return new p(this.x,this.y)},add:function(t){return this.clone()._add(m(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(m(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new p(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new p(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=nt(this.x),this.y=nt(this.y),this},distanceTo:function(t){var e=(t=m(t)).x-this.x,t=t.y-this.y;return Math.sqrt(e*e+t*t)},equals:function(t){return(t=m(t)).x===this.x&&t.y===this.y},contains:function(t){return t=m(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return\"Point(\"+i(this.x)+\", \"+i(this.y)+\")\"}},f.prototype={extend:function(t){var e,i;if(t){if(t instanceof p||\"number\"==typeof t[0]||\"x\"in t)e=i=m(t);else if(e=(t=_(t)).min,i=t.max,!e||!i)return this;this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone())}return this},getCenter:function(t){return m((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return m(this.min.x,this.max.y)},getTopRight:function(){return m(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t=(\"number\"==typeof t[0]||t instanceof p?m:_)(t))instanceof f?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>=e.x&&n.x<=i.x,t=t.y>=e.y&&n.y<=i.y;return o&&t},overlaps:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>e.x&&n.x<i.x,t=t.y>e.y&&n.y<i.y;return o&&t},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,t=Math.abs(e.y-i.y)*t;return _(m(e.x-n,e.y-t),m(i.x+n,i.y+t))},equals:function(t){return!!t&&(t=_(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},s.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof v)i=e=t;else{if(!(t instanceof s))return t?this.extend(w(t)||g(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new v(e.lat,e.lng),this._northEast=new v(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,t=Math.abs(e.lng-i.lng)*t;return new s(new v(e.lat-n,e.lng-t),new v(i.lat+n,i.lng+t))},getCenter:function(){return new v((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new v(this.getNorth(),this.getWest())},getSouthEast:function(){return new v(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t=(\"number\"==typeof t[0]||t instanceof v||\"lat\"in t?w:g)(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof s?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>=e.lat&&n.lat<=i.lat,t=t.lng>=e.lng&&n.lng<=i.lng;return o&&t},overlaps:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>e.lat&&n.lat<i.lat,t=t.lng>e.lng&&n.lng<i.lng;return o&&t},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(\",\")},equals:function(t,e){return!!t&&(t=g(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}};var ot={latLngToPoint:function(t,e){t=this.projection.project(t),e=this.scale(e);return this.transformation._transform(t,e)},pointToLatLng:function(t,e){e=this.scale(e),t=this.transformation.untransform(t,e);return this.projection.unproject(t)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){var e;return this.infinite?null:(e=this.projection.bounds,t=this.scale(t),new f(this.transformation.transform(e.min,t),this.transformation.transform(e.max,t)))},infinite:!(v.prototype={equals:function(t,e){return!!t&&(t=w(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return\"LatLng(\"+i(this.lat,t)+\", \"+i(this.lng,t)+\")\"},distanceTo:function(t){return st.distance(this,w(t))},wrap:function(){return st.wrapLatLng(this)},toBounds:function(t){var t=180*t/40075017,e=t/Math.cos(Math.PI/180*this.lat);return g([this.lat-t,this.lng-e],[this.lat+t,this.lng+e])},clone:function(){return new v(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var e=this.wrapLng?H(t.lng,this.wrapLng,!0):t.lng;return new v(this.wrapLat?H(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,e=e.lng-i.lng;return 0==n&&0==e?t:(i=t.getSouthWest(),t=t.getNorthEast(),new s(new v(i.lat-n,i.lng-e),new v(t.lat-n,t.lng-e)))}},st=l({},ot,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),e=Math.sin((e.lng-t.lng)*i/2),t=s*s+Math.cos(n)*Math.cos(o)*e*e,i=2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t));return this.R*i}}),rt=6378137,rt={R:rt,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,i=Math.max(Math.min(i,t.lat),-i),i=Math.sin(i*e);return new p(this.R*t.lng*e,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(t){var e=180/Math.PI;return new v((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:new f([-(rt=rt*Math.PI),-rt],[rt,rt])};function at(t,e,i,n){d(t)?(this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3]):(this._a=t,this._b=e,this._c=i,this._d=n)}function ht(t,e,i,n){return new at(t,e,i,n)}at.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new p((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var lt=l({},st,{code:\"EPSG:3857\",projection:rt,transformation:ht(lt=.5/(Math.PI*rt.R),.5,-lt,.5)}),ut=l({},lt,{code:\"EPSG:900913\"});function ct(t){return document.createElementNS(\"http://www.w3.org/2000/svg\",t)}function dt(t,e){for(var i,n,o,s,r=\"\",a=0,h=t.length;a<h;a++){for(i=0,n=(o=t[a]).length;i<n;i++)r+=(i?\"L\":\"M\")+(s=o[i]).x+\" \"+s.y;r+=e?b.svg?\"z\":\"x\":\"\"}return r||\"M0 0\"}var _t=document.documentElement.style,pt=\"ActiveXObject\"in window,mt=pt&&!document.addEventListener,n=\"msLaunchUri\"in navigator&&!(\"documentMode\"in document),ft=y(\"webkit\"),gt=y(\"android\"),vt=y(\"android 2\")||y(\"android 3\"),yt=parseInt(/WebKit\\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),yt=gt&&y(\"Google\")&&yt<537&&!(\"AudioNode\"in window),xt=!!window.opera,wt=!n&&y(\"chrome\"),bt=y(\"gecko\")&&!ft&&!xt&&!pt,Pt=!wt&&y(\"safari\"),Lt=y(\"phantom\"),o=\"OTransition\"in _t,Tt=0===navigator.platform.indexOf(\"Win\"),Mt=pt&&\"transition\"in _t,zt=\"WebKitCSSMatrix\"in window&&\"m11\"in new window.WebKitCSSMatrix&&!vt,_t=\"MozPerspective\"in _t,Ct=!window.L_DISABLE_3D&&(Mt||zt||_t)&&!o&&!Lt,Zt=\"undefined\"!=typeof orientation||y(\"mobile\"),St=Zt&&ft,Et=Zt&&zt,kt=!window.PointerEvent&&window.MSPointerEvent,Ot=!(!window.PointerEvent&&!kt),At=\"ontouchstart\"in window||!!window.TouchEvent,Bt=!window.L_NO_TOUCH&&(At||Ot),It=Zt&&xt,Rt=Zt&&bt,Nt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),Dt=function(){var t=!1;try{var e=Object.defineProperty({},\"passive\",{get:function(){t=!0}});window.addEventListener(\"testPassiveEventSupport\",u,e),window.removeEventListener(\"testPassiveEventSupport\",u,e)}catch(t){}return t}(),jt=!!document.createElement(\"canvas\").getContext,Ht=!(!document.createElementNS||!ct(\"svg\").createSVGRect),Wt=!!Ht&&((Wt=document.createElement(\"div\")).innerHTML=\"<svg/>\",\"http://www.w3.org/2000/svg\"===(Wt.firstChild&&Wt.firstChild.namespaceURI));function y(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var b={ie:pt,ielt9:mt,edge:n,webkit:ft,android:gt,android23:vt,androidStock:yt,opera:xt,chrome:wt,gecko:bt,safari:Pt,phantom:Lt,opera12:o,win:Tt,ie3d:Mt,webkit3d:zt,gecko3d:_t,any3d:Ct,mobile:Zt,mobileWebkit:St,mobileWebkit3d:Et,msPointer:kt,pointer:Ot,touch:Bt,touchNative:At,mobileOpera:It,mobileGecko:Rt,retina:Nt,passiveEvents:Dt,canvas:jt,svg:Ht,vml:!Ht&&function(){try{var t=document.createElement(\"div\"),e=(t.innerHTML='<v:shape adj=\"1\"/>',t.firstChild);return e.style.behavior=\"url(#default#VML)\",e&&\"object\"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Wt,mac:0===navigator.platform.indexOf(\"Mac\"),linux:0===navigator.platform.indexOf(\"Linux\")},Ft=b.msPointer?\"MSPointerDown\":\"pointerdown\",Ut=b.msPointer?\"MSPointerMove\":\"pointermove\",Vt=b.msPointer?\"MSPointerUp\":\"pointerup\",qt=b.msPointer?\"MSPointerCancel\":\"pointercancel\",Gt={touchstart:Ft,touchmove:Ut,touchend:Vt,touchcancel:qt},Kt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&O(e);ee(t,e)},touchmove:ee,touchend:ee,touchcancel:ee},Yt={},Xt=!1;function Jt(t,e,i){return\"touchstart\"!==e||Xt||(document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,Qt,!0),document.addEventListener(Vt,te,!0),document.addEventListener(qt,te,!0),Xt=!0),Kt[e]?(i=Kt[e].bind(this,i),t.addEventListener(Gt[e],i,!1),i):(console.warn(\"wrong event specified:\",e),u)}function $t(t){Yt[t.pointerId]=t}function Qt(t){Yt[t.pointerId]&&(Yt[t.pointerId]=t)}function te(t){delete Yt[t.pointerId]}function ee(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||\"mouse\")){for(var i in e.touches=[],Yt)e.touches.push(Yt[i]);e.changedTouches=[e],t(e)}}var ie=200;function ne(t,i){t.addEventListener(\"dblclick\",i);var n,o=0;function e(t){var e;1!==t.detail?n=t.detail:\"mouse\"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((e=Ne(t)).some(function(t){return t instanceof HTMLLabelElement&&t.attributes.for})&&!e.some(function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement})||((e=Date.now())-o<=ie?2===++n&&i(function(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return(t=n).type=\"dblclick\",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):n=1,o=e))}return t.addEventListener(\"click\",e),{dblclick:i,simDblclick:e}}var oe,se,re,ae,he,le,ue=we([\"transform\",\"webkitTransform\",\"OTransform\",\"MozTransform\",\"msTransform\"]),ce=we([\"webkitTransition\",\"transition\",\"OTransition\",\"MozTransition\",\"msTransition\"]),de=\"webkitTransition\"===ce||\"OTransition\"===ce?ce+\"End\":\"transitionend\";function _e(t){return\"string\"==typeof t?document.getElementById(t):t}function pe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];return\"auto\"===(i=i&&\"auto\"!==i||!document.defaultView?i:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:i}function P(t,e,i){t=document.createElement(t);return t.className=e||\"\",i&&i.appendChild(t),t}function T(t){var e=t.parentNode;e&&e.removeChild(t)}function me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ve(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=xe(t)).length&&new RegExp(\"(^|\\\\s)\"+e+\"(\\\\s|$)\").test(t)}function M(t,e){var i;if(void 0!==t.classList)for(var n=F(e),o=0,s=n.length;o<s;o++)t.classList.add(n[o]);else ve(t,e)||ye(t,((i=xe(t))?i+\" \":\"\")+e)}function z(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,W((\" \"+xe(t)+\" \").replace(\" \"+e+\" \",\" \")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function xe(t){return void 0===(t=t.correspondingElement?t.correspondingElement:t).className.baseVal?t.className:t.className.baseVal}function C(t,e){if(\"opacity\"in t.style)t.style.opacity=e;else if(\"filter\"in t.style){var i=!1,n=\"DXImageTransform.Microsoft.Alpha\";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=\" progid:\"+n+\"(opacity=\"+e+\")\"}}function we(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function be(t,e,i){e=e||new p(0,0);t.style[ue]=(b.ie3d?\"translate(\"+e.x+\"px,\"+e.y+\"px)\":\"translate3d(\"+e.x+\"px,\"+e.y+\"px,0)\")+(i?\" scale(\"+i+\")\":\"\")}function Z(t,e){t._leaflet_pos=e,b.any3d?be(t,e):(t.style.left=e.x+\"px\",t.style.top=e.y+\"px\")}function Pe(t){return t._leaflet_pos||new p(0,0)}function Le(){S(window,\"dragstart\",O)}function Te(){k(window,\"dragstart\",O)}function Me(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ze(),le=(he=t).style.outlineStyle,t.style.outlineStyle=\"none\",S(window,\"keydown\",ze))}function ze(){he&&(he.style.outlineStyle=le,le=he=void 0,k(window,\"keydown\",ze))}function Ce(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function Ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}ae=\"onselectstart\"in document?(re=function(){S(window,\"selectstart\",O)},function(){k(window,\"selectstart\",O)}):(se=we([\"userSelect\",\"WebkitUserSelect\",\"OUserSelect\",\"MozUserSelect\",\"msUserSelect\"]),re=function(){var t;se&&(t=document.documentElement.style,oe=t[se],t[se]=\"none\")},function(){se&&(document.documentElement.style[se]=oe,oe=void 0)});pt={__proto__:null,TRANSFORM:ue,TRANSITION:ce,TRANSITION_END:de,get:_e,getStyle:pe,create:P,remove:T,empty:me,toFront:fe,toBack:ge,hasClass:ve,addClass:M,removeClass:z,setClass:ye,getClass:xe,setOpacity:C,testProp:we,setTransform:be,setPosition:Z,getPosition:Pe,get disableTextSelection(){return re},get enableTextSelection(){return ae},disableImageDrag:Le,enableImageDrag:Te,preventOutline:Me,restoreOutline:ze,getSizedParentNode:Ce,getScale:Ze};function S(t,e,i,n){if(e&&\"object\"==typeof e)for(var o in e)ke(t,o,e[o],i);else for(var s=0,r=(e=F(e)).length;s<r;s++)ke(t,e[s],i,n);return this}var E=\"_leaflet_events\";function k(t,e,i,n){if(1===arguments.length)Se(t),delete t[E];else if(e&&\"object\"==typeof e)for(var o in e)Oe(t,o,e[o],i);else if(e=F(e),2===arguments.length)Se(t,function(t){return-1!==G(e,t)});else for(var s=0,r=e.length;s<r;s++)Oe(t,e[s],i,n);return this}function Se(t,e){for(var i in t[E]){var n=i.split(/\\d/)[0];e&&!e(n)||Oe(t,n,null,null,i)}}var Ee={mouseenter:\"mouseover\",mouseleave:\"mouseout\",wheel:!(\"onwheel\"in window)&&\"mousewheel\"};function ke(e,t,i,n){var o,s,r=t+h(i)+(n?\"_\"+h(n):\"\");e[E]&&e[E][r]||(s=o=function(t){return i.call(n||e,t||window.event)},!b.touchNative&&b.pointer&&0===t.indexOf(\"touch\")?o=Jt(e,t,o):b.touch&&\"dblclick\"===t?o=ne(e,o):\"addEventListener\"in e?\"touchstart\"===t||\"touchmove\"===t||\"wheel\"===t||\"mousewheel\"===t?e.addEventListener(Ee[t]||t,o,!!b.passiveEvents&&{passive:!1}):\"mouseenter\"===t||\"mouseleave\"===t?e.addEventListener(Ee[t],o=function(t){t=t||window.event,We(e,t)&&s(t)},!1):e.addEventListener(t,s,!1):e.attachEvent(\"on\"+t,o),e[E]=e[E]||{},e[E][r]=o)}function Oe(t,e,i,n,o){o=o||e+h(i)+(n?\"_\"+h(n):\"\");var s,r,i=t[E]&&t[E][o];i&&(!b.touchNative&&b.pointer&&0===e.indexOf(\"touch\")?(n=t,r=i,Gt[s=e]?n.removeEventListener(Gt[s],r,!1):console.warn(\"wrong event specified:\",s)):b.touch&&\"dblclick\"===e?(n=i,(r=t).removeEventListener(\"dblclick\",n.dblclick),r.removeEventListener(\"click\",n.simDblclick)):\"removeEventListener\"in t?t.removeEventListener(Ee[e]||e,i,!1):t.detachEvent(\"on\"+e,i),t[E][o]=null)}function Ae(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Be(t){return ke(t,\"wheel\",Ae),this}function Ie(t){return S(t,\"mousedown touchstart dblclick contextmenu\",Ae),t._leaflet_disable_click=!0,this}function O(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Re(t){return O(t),Ae(t),this}function Ne(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function De(t,e){var i,n;return e?(n=(i=Ze(e)).boundingClientRect,new p((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)):new p(t.clientX,t.clientY)}var je=b.linux&&b.chrome?window.devicePixelRatio:b.mac?3*window.devicePixelRatio:0<window.devicePixelRatio?2*window.devicePixelRatio:1;function He(t){return b.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/je:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function We(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var mt={__proto__:null,on:S,off:k,stopPropagation:Ae,disableScrollPropagation:Be,disableClickPropagation:Ie,preventDefault:O,stop:Re,getPropagationPath:Ne,getMousePosition:De,getWheelDelta:He,isExternalTarget:We,addListener:S,removeListener:k},Fe=it.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Pe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire(\"start\"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=x(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){t=this._startPos.add(this._offset.multiplyBy(t));e&&t._round(),Z(this._el,t),this.fire(\"step\")},_complete:function(){r(this._animId),this._inProgress=!1,this.fire(\"end\")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),A=it.extend({options:{crs:lt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=c(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(w(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ce&&b.any3d&&!b.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),S(this._proxy,de,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if((e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(w(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i)&&(void 0!==i.animate&&(i.zoom=l({animate:i.animate},i.zoom),i.pan=l({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,e,i.pan&&i.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),t=(t instanceof p?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),n=this.containerPointToLatLng(o.add(t));return this.setView(n,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():g(t);var i=m(e.paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));return(o=\"number\"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0?{center:t.getCenter(),zoom:o}:(e=n.subtract(i).divideBy(2),n=this.project(t.getSouthWest(),o),i=this.project(t.getNorthEast(),o),{center:this.unproject(n.add(i).divideBy(2).add(e),o),zoom:o})},fitBounds:function(t,e){if((t=g(t)).isValid())return t=this._getBoundsCenterZoom(t,e),this.setView(t.center,t.zoom,e);throw new Error(\"Bounds are not valid.\")},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){var i;return e=e||{},(t=m(t).round()).x||t.y?(!0===e.animate||this.getSize().contains(t)?(this._panAnim||(this._panAnim=new Fe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire(\"movestart\"),!1!==e.animate?(M(this._mapPane,\"leaflet-pan-anim\"),i=this._getMapPanePos().subtract(t).round(),this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)):(this._rawPanBy(t),this.fire(\"move\").fire(\"moveend\"))):this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this):this.fire(\"moveend\")},flyTo:function(n,o,t){if(!1===(t=t||{}).animate||!b.any3d)return this.setView(n,o,t);this._stop();var s=this.project(this.getCenter()),r=this.project(n),e=this.getSize(),a=this._zoom,h=(n=w(n),o=void 0===o?a:o,Math.max(e.x,e.y)),i=h*this.getZoomScale(a,o),l=r.distanceTo(s)||1,u=1.42,c=u*u;function d(t){t=(i*i-h*h+(t?-1:1)*c*c*l*l)/(2*(t?i:h)*c*l),t=Math.sqrt(t*t+1)-t;return t<1e-9?-18:Math.log(t)}function _(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var m=d(0);function f(t){return h*(p(m)*(_(t=m+u*t)/p(t))-_(m))/c}var g=Date.now(),v=(d(1)-m)/u,y=t.duration?1e3*t.duration:1e3*v*.8;return this._moveStart(!0,t.noMoveStart),function t(){var e=(Date.now()-g)/y,i=(1-Math.pow(1-e,1.5))*v;e<=1?(this._flyToFrame=x(t,this),this._move(this.unproject(s.add(r.subtract(s).multiplyBy(f(i)/l)),a),this.getScaleZoom(h/(e=i,h*(p(m)/p(m+u*e))),a),{flyTo:!0})):this._move(n,o)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){t=this._getBoundsCenterZoom(t,e);return this.flyTo(t.center,t.zoom,e)},setMaxBounds:function(t){return t=g(t),this.listens(\"moveend\",this._panInsideMaxBounds)&&this.off(\"moveend\",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on(\"moveend\",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire(\"zoomlevelschange\"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire(\"zoomlevelschange\"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),t=this._limitCenter(i,this._zoom,g(t));return i.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=m((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),t=this.project(t),s=this.getPixelBounds(),i=_([s.min.add(i),s.max.subtract(n)]),s=i.getSize();return i.contains(t)||(this._enforcingBounds=!0,n=t.subtract(i.getCenter()),i=i.extend(t).getSize().subtract(s),o.x+=n.x<0?-i.x:i.x,o.y+=n.y<0?-i.y:i.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),n=e.divideBy(2).round(),o=i.divideBy(2).round(),n=n.subtract(o);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire(\"move\"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,\"moveend\"),200)):this.fire(\"moveend\")),this.fire(\"resize\",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire(\"viewreset\"),this._stop()},locate:function(t){var e,i;return t=this._locateOptions=l({timeout:1e4,watch:!1},t),\"geolocation\"in navigator?(e=a(this._handleGeolocationResponse,this),i=a(this._handleGeolocationError,this),t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t)):this._handleGeolocationError({code:0,message:\"Geolocation not supported.\"}),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?\"permission denied\":2===e?\"position unavailable\":\"timeout\"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire(\"locationerror\",{code:e,message:\"Geolocation error: \"+t+\".\"}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,i,n=new v(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(n,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:n,bounds:o,timestamp:t.timestamp});for(i in t.coords)\"number\"==typeof t.coords[i]&&(r[i]=t.coords[i]);this.fire(\"locationfound\",r)}},addHandler:function(t,e){return e&&(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable()),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off(\"moveend\",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error(\"Map container is being reused by another instance\");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),T(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(r(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire(\"unload\"),this._layers)this._layers[t].remove();for(t in this._panes)T(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){e=P(\"div\",\"leaflet-pane\"+(t?\" leaflet-\"+t.replace(\"Pane\",\"\")+\"-pane\":\"\"),e||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new s(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=g(t),i=m(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),t=t.getSouthEast(),i=this.getSize().subtract(i),t=_(this.project(t,n),this.project(r,n)).getSize(),r=b.any3d?this.options.zoomSnap:1,a=i.x/t.x,i=i.y/t.y,t=e?Math.max(a,i):Math.min(a,i),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=e?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new p(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){t=this._getTopLeftPoint(t,e);return new f(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return\"string\"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,t=(e=void 0===e?this._zoom:e,i.zoom(t*i.scale(e)));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(w(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(m(t),e)},layerPointToLatLng:function(t){t=m(t).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(t){return this.project(w(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(w(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(g(t))},distance:function(t,e){return this.options.crs.distance(w(t),w(e))},containerPointToLayerPoint:function(t){return m(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return m(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){t=this.containerPointToLayerPoint(m(t));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)))},mouseEventToContainerPoint:function(t){return De(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){t=this._container=_e(t);if(!t)throw new Error(\"Map container not found.\");if(t._leaflet_id)throw new Error(\"Map container is already initialized.\");S(t,\"scroll\",this._onScroll,this),this._containerId=h(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&b.any3d,M(t,\"leaflet-container\"+(b.touch?\" leaflet-touch\":\"\")+(b.retina?\" leaflet-retina\":\"\")+(b.ielt9?\" leaflet-oldie\":\"\")+(b.safari?\" leaflet-safari\":\"\")+(this._fadeAnimated?\" leaflet-fade-anim\":\"\")),pe(t,\"position\"));\"absolute\"!==e&&\"relative\"!==e&&\"fixed\"!==e&&\"sticky\"!==e&&(t.style.position=\"relative\"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane(\"mapPane\",this._container),Z(this._mapPane,new p(0,0)),this.createPane(\"tilePane\"),this.createPane(\"overlayPane\"),this.createPane(\"shadowPane\"),this.createPane(\"markerPane\"),this.createPane(\"tooltipPane\"),this.createPane(\"popupPane\"),this.options.markerZoomAnimation||(M(t.markerPane,\"leaflet-zoom-hide\"),M(t.shadowPane,\"leaflet-zoom-hide\"))},_resetView:function(t,e,i){Z(this._mapPane,new p(0,0));var n=!this._loaded,o=(this._loaded=!0,e=this._limitZoom(e),this.fire(\"viewprereset\"),this._zoom!==e);this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire(\"viewreset\"),n&&this.fire(\"load\")},_moveStart:function(t,e){return t&&this.fire(\"zoomstart\"),e||this.fire(\"movestart\"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire(\"zoom\",i):((o||i&&i.pinch)&&this.fire(\"zoom\",i),this.fire(\"move\",i)),this},_moveEnd:function(t){return t&&this.fire(\"zoomend\"),this.fire(\"moveend\")},_stop:function(){return r(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Z(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error(\"Set map center and zoom first.\")},_initEvents:function(t){this._targets={};var e=t?k:S;e((this._targets[h(this._container)]=this)._container,\"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup\",this._handleDOMEvent,this),this.options.trackResize&&e(window,\"resize\",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,\"moveend\",this._onMoveEnd)},_onResize:function(){r(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o=\"mouseout\"===e||\"mouseover\"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[h(s)])&&(\"click\"===e||\"preclick\"===e)&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!We(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n=n.length||r||o||!this.listens(e,!0)?n:[this]},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,i=t.target||t.srcElement;!this._loaded||i._leaflet_disable_events||\"click\"===t.type&&this._isClickDisabled(i)||(\"mousedown\"===(e=t.type)&&Me(i),this._fireDOMEvent(t,e))},_mouseEvents:[\"click\",\"dblclick\",\"mouseover\",\"mouseout\",\"contextmenu\"],_fireDOMEvent:function(t,e,i){\"click\"===t.type&&((a=l({},t)).type=\"preclick\",this._fireDOMEvent(a,a.type,i));var n=this._findEventTargets(t,e);if(i){for(var o=[],s=0;s<i.length;s++)i[s].listens(e,!0)&&o.push(i[s]);n=o.concat(n)}if(n.length){\"contextmenu\"===e&&O(t);var r,a=n[0],h={originalEvent:t};for(\"keypress\"!==t.type&&\"keydown\"!==t.type&&\"keyup\"!==t.type&&(r=a.getLatLng&&(!a._radius||a._radius<=10),h.containerPoint=r?this.latLngToContainerPoint(a.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=r?a.getLatLng():this.layerPointToLatLng(h.layerPoint)),s=0;s<n.length;s++)if(n[s].fire(e,h,!0),h.originalEvent._stopped||!1===n[s].options.bubblingMouseEvents&&-1!==G(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on(\"load\",t,e),this},_getMapPanePos:function(){return Pe(this._mapPane)||new p(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){i=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,i){i=this._getNewPixelOrigin(i,e);return _([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){var n,o;return!i||(n=this.project(t,e),o=this.getSize().divideBy(2),o=new f(n.subtract(o),n.add(o)),o=this._getBoundsOffset(o,i,e),Math.abs(o.x)<=1&&Math.abs(o.y)<=1)?t:this.unproject(n.add(o),e)},_limitOffset:function(t,e){var i;return e?(i=new f((i=this.getPixelBounds()).min.add(t),i.max.add(t)),t.add(this._getBoundsOffset(i,e))):t},_getBoundsOffset:function(t,e,i){e=_(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),i=e.min.subtract(t.min),e=e.max.subtract(t.max);return new p(this._rebound(i.x,-e.x),this._rebound(i.y,-e.y))},_rebound:function(t,e){return 0<t+e?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=b.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire(\"move\")},_onPanTransitionEnd:function(){z(this._mapPane,\"leaflet-pan-anim\"),this.fire(\"moveend\")},_tryAnimatedPan:function(t,e){t=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(t))&&(this.panBy(t,e),!0)},_createAnimProxy:function(){var t=this._proxy=P(\"div\",\"leaflet-proxy leaflet-zoom-animated\");this._panes.mapPane.appendChild(t),this.on(\"zoomanim\",function(t){var e=ue,i=this._proxy.style[e];be(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on(\"load moveend\",this._animMoveEnd,this),this._on(\"unload\",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){T(this._proxy),this.off(\"load moveend\",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();be(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf(\"transform\")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName(\"leaflet-zoom-animated\").length},_tryAnimatedZoom:function(t,e,i){if(!this._animatingZoom){if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/n);if(!0!==i.animate&&!this.getSize().contains(n))return!1;x(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this)}return!0},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,M(this._mapPane,\"leaflet-zoom-anim\")),this.fire(\"zoomanim\",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&z(this._mapPane,\"leaflet-zoom-anim\"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire(\"zoom\"),delete this._tempFireZoomEvent,this.fire(\"move\"),this._moveEnd(!0))}});function Ue(t){return new B(t)}var B=et.extend({options:{position:\"topright\"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),t=t._controlCorners[i];return M(e,\"leaflet-control\"),-1!==i.indexOf(\"bottom\")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on(\"unload\",this.remove,this),this},remove:function(){return this._map&&(T(this._container),this.onRemove&&this.onRemove(this._map),this._map.off(\"unload\",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}}),Ve=(A.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var i=this._controlCorners={},n=\"leaflet-\",o=this._controlContainer=P(\"div\",n+\"control-container\",this._container);function t(t,e){i[t+e]=P(\"div\",n+t+\" \"+n+e,o)}t(\"top\",\"left\"),t(\"top\",\"right\"),t(\"bottom\",\"left\"),t(\"bottom\",\"right\")},_clearControlPos:function(){for(var t in this._controlCorners)T(this._controlCorners[t]);T(this._controlContainer),delete this._controlCorners,delete this._controlContainer}}),B.extend({options:{collapsed:!0,position:\"topright\",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in c(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on(\"zoomend\",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on(\"add remove\",this._onLayerChange,this);return this._container},addTo:function(t){return B.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off(\"zoomend\",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off(\"add remove\",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off(\"add remove\",this._onLayerChange,this);t=this._getLayer(h(t));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){M(this._container,\"leaflet-control-layers-expanded\"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(M(this._section,\"leaflet-control-layers-scrollbar\"),this._section.style.height=t+\"px\"):z(this._section,\"leaflet-control-layers-scrollbar\"),this._checkDisabledLayers(),this},collapse:function(){return z(this._container,\"leaflet-control-layers-expanded\"),this},_initLayout:function(){var t=\"leaflet-control-layers\",e=this._container=P(\"div\",t),i=this.options.collapsed,n=(e.setAttribute(\"aria-haspopup\",!0),Ie(e),Be(e),this._section=P(\"section\",t+\"-list\")),o=(i&&(this._map.on(\"click\",this.collapse,this),S(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this)),this._layersLink=P(\"a\",t+\"-toggle\",e));o.href=\"#\",o.title=\"Layers\",o.setAttribute(\"role\",\"button\"),S(o,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){O(t),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=P(\"div\",t+\"-base\",n),this._separator=P(\"div\",t+\"-separator\",n),this._overlaysList=P(\"div\",t+\"-overlays\",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&h(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on(\"add remove\",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(a(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(this._container){me(this._baseLayersList),me(this._overlaysList),this._layerControlInputs=[];for(var t,e,i,n=0,o=0;o<this._layers.length;o++)i=this._layers[o],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,n+=i.overlay?0:1;this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&1<n)?\"\":\"none\"),this._separator.style.display=e&&t?\"\":\"none\"}return this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(h(t.target)),t=e.overlay?\"add\"===t.type?\"overlayadd\":\"overlayremove\":\"add\"===t.type?\"baselayerchange\":null;t&&this._map.fire(t,e)},_createRadioElement:function(t,e){t='<input type=\"radio\" class=\"leaflet-control-layers-selector\" name=\"'+t+'\"'+(e?' checked=\"checked\"':\"\")+\"/>\",e=document.createElement(\"div\");return e.innerHTML=t,e.firstChild},_addItem:function(t){var e,i=document.createElement(\"label\"),n=this._map.hasLayer(t.layer),n=(t.overlay?((e=document.createElement(\"input\")).type=\"checkbox\",e.className=\"leaflet-control-layers-selector\",e.defaultChecked=n):e=this._createRadioElement(\"leaflet-base-layers_\"+h(this),n),this._layerControlInputs.push(e),e.layerId=h(t.layer),S(e,\"click\",this._onInputClick,this),document.createElement(\"span\")),o=(n.innerHTML=\" \"+t.name,document.createElement(\"span\"));return i.appendChild(o),o.appendChild(e),o.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;0<=o;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section,e=(this._preventClick=!0,S(t,\"click\",O),this.expand(),this);setTimeout(function(){k(t,\"click\",O),e._preventClick=!1})}})),qe=B.extend({options:{position:\"topleft\",zoomInText:'<span aria-hidden=\"true\">+</span>',zoomInTitle:\"Zoom in\",zoomOutText:'<span aria-hidden=\"true\">&#x2212;</span>',zoomOutTitle:\"Zoom out\"},onAdd:function(t){var e=\"leaflet-control-zoom\",i=P(\"div\",e+\" leaflet-bar\"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+\"-in\",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+\"-out\",i,this._zoomOut),this._updateDisabled(),t.on(\"zoomend zoomlevelschange\",this._updateDisabled,this),i},onRemove:function(t){t.off(\"zoomend zoomlevelschange\",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){i=P(\"a\",i,n);return i.innerHTML=t,i.href=\"#\",i.title=e,i.setAttribute(\"role\",\"button\"),i.setAttribute(\"aria-label\",e),Ie(i),S(i,\"click\",Re),S(i,\"click\",o,this),S(i,\"click\",this._refocusOnMap,this),i},_updateDisabled:function(){var t=this._map,e=\"leaflet-disabled\";z(this._zoomInButton,e),z(this._zoomOutButton,e),this._zoomInButton.setAttribute(\"aria-disabled\",\"false\"),this._zoomOutButton.setAttribute(\"aria-disabled\",\"false\"),!this._disabled&&t._zoom!==t.getMinZoom()||(M(this._zoomOutButton,e),this._zoomOutButton.setAttribute(\"aria-disabled\",\"true\")),!this._disabled&&t._zoom!==t.getMaxZoom()||(M(this._zoomInButton,e),this._zoomInButton.setAttribute(\"aria-disabled\",\"true\"))}}),Ge=(A.mergeOptions({zoomControl:!0}),A.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))}),B.extend({options:{position:\"bottomleft\",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e=\"leaflet-control-scale\",i=P(\"div\",e),n=this.options;return this._addScales(n,e+\"-line\",i),t.on(n.updateWhenIdle?\"moveend\":\"move\",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?\"moveend\":\"move\",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=P(\"div\",e,i)),t.imperial&&(this._iScale=P(\"div\",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,t=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+\" m\":e/1e3+\" km\",e/t)},_updateImperial:function(t){var e,i,t=3.2808399*t;5280<t?(i=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,i+\" mi\",i/e)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+\" ft\",i/t))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+\"px\",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+\"\").length-1),t=t/e;return e*(t=10<=t?10:5<=t?5:3<=t?3:2<=t?2:1)}})),Ke=B.extend({options:{position:\"bottomright\",prefix:'<a href=\"https://leafletjs.com\" title=\"A JavaScript library for interactive maps\">'+(b.inlineSvg?'<svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" class=\"leaflet-attribution-flag\"><path fill=\"#4C7BE1\" d=\"M0 0h12v4H0z\"/><path fill=\"#FFD500\" d=\"M0 4h12v3H0z\"/><path fill=\"#E0BC00\" d=\"M0 7h12v1H0z\"/></svg> ':\"\")+\"Leaflet</a>\"},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=P(\"div\",\"leaflet-control-attribution\"),Ie(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on(\"layeradd\",this._addAttribution,this),this._container},onRemove:function(t){t.off(\"layeradd\",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once(\"remove\",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(\", \")),this._container.innerHTML=i.join(' <span aria-hidden=\"true\">|</span> ')}}}),n=(A.mergeOptions({attributionControl:!0}),A.addInitHook(function(){this.options.attributionControl&&(new Ke).addTo(this)}),B.Layers=Ve,B.Zoom=qe,B.Scale=Ge,B.Attribution=Ke,Ue.layers=function(t,e,i){return new Ve(t,e,i)},Ue.zoom=function(t){return new qe(t)},Ue.scale=function(t){return new Ge(t)},Ue.attribution=function(t){return new Ke(t)},et.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),ft=(n.addTo=function(t,e){return t.addHandler(e,this),this},{Events:e}),Ye=b.touch?\"touchstart mousedown\":\"mousedown\",Xe=it.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){c(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(S(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xe._dragging===this&&this.finishDrag(!0),k(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;this._enabled&&(this._moved=!1,ve(this._element,\"leaflet-zoom-anim\")||(t.touches&&1!==t.touches.length?Xe._dragging===this&&this.finishDrag():Xe._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Xe._dragging=this)._preventOutline&&Me(this._element),Le(),re(),this._moving||(this.fire(\"down\"),i=t.touches?t.touches[0]:t,e=Ce(this._element),this._startPoint=new p(i.clientX,i.clientY),this._startPos=Pe(this._element),this._parentScale=Ze(e),i=\"mousedown\"===t.type,S(document,i?\"mousemove\":\"touchmove\",this._onMove,this),S(document,i?\"mouseup\":\"touchend touchcancel\",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1<t.touches.length?this._moved=!0:!(e=new p((e=t.touches&&1===t.touches.length?t.touches[0]:t).clientX,e.clientY)._subtract(this._startPoint)).x&&!e.y||Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,O(t),this._moved||(this.fire(\"dragstart\"),this._moved=!0,M(document.body,\"leaflet-dragging\"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),M(this._lastTarget,\"leaflet-drag-target\")),this._newPos=this._startPos.add(e),this._moving=!0,this._lastEvent=t,this._updatePosition()))},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire(\"predrag\",t),Z(this._element,this._newPos),this.fire(\"drag\",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){z(document.body,\"leaflet-dragging\"),this._lastTarget&&(z(this._lastTarget,\"leaflet-drag-target\"),this._lastTarget=null),k(document,\"mousemove touchmove\",this._onMove,this),k(document,\"mouseup touchend touchcancel\",this._onUp,this),Te(),ae();var e=this._moved&&this._moving;this._moving=!1,Xe._dragging=!1,e&&this.fire(\"dragend\",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function Je(t,e,i){for(var n,o,s,r,a,h,l,u=[1,4,2,8],c=0,d=t.length;c<d;c++)t[c]._code=si(t[c],e);for(s=0;s<4;s++){for(h=u[s],n=[],c=0,o=(d=t.length)-1;c<d;o=c++)r=t[c],a=t[o],r._code&h?a._code&h||((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)):(a._code&h&&((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)),n.push(r));t=n}return t}function $e(t,e){var i,n,o,s,r,a,h;if(!t||0===t.length)throw new Error(\"latlngs not passed\");I(t)||(console.warn(\"latlngs are not flat! Only the first ring will be used\"),t=t[0]);for(var l=w([0,0]),u=g(t),c=(u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(l=Qe(t)),t.length),d=[],_=0;_<c;_++){var p=w(t[_]);d.push(e.project(w([p.lat-l.lat,p.lng-l.lng])))}for(_=r=a=h=0,i=c-1;_<c;i=_++)n=d[_],o=d[i],s=n.y*o.x-o.y*n.x,a+=(n.x+o.x)*s,h+=(n.y+o.y)*s,r+=3*s;u=0===r?d[0]:[a/r,h/r],u=e.unproject(m(u));return w([u.lat+l.lat,u.lng+l.lng])}function Qe(t){for(var e=0,i=0,n=0,o=0;o<t.length;o++){var s=w(t[o]);e+=s.lat,i+=s.lng,n++}return w([e/n,i/n])}var ti,gt={__proto__:null,clipPolygon:Je,polygonCenter:$e,centroid:Qe};function ei(t,e){if(e&&t.length){var i=t=function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)(function(t,e){var i=e.x-t.x,e=e.y-t.y;return i*i+e*e})(t[n],t[o])>e&&(i.push(t[n]),o=n);o<s-1&&i.push(t[s-1]);return i}(t,e=e*e),n=i.length,o=new(typeof Uint8Array!=void 0+\"\"?Uint8Array:Array)(n);o[0]=o[n-1]=1,function t(e,i,n,o,s){var r,a,h,l=0;for(a=o+1;a<=s-1;a++)h=ri(e[a],e[o],e[s],!0),l<h&&(r=a,l=h);n<l&&(i[r]=1,t(e,i,n,o,r),t(e,i,n,r,s))}(i,o,e,0,n-1);var s,r=[];for(s=0;s<n;s++)o[s]&&r.push(i[s]);return r}return t.slice()}function ii(t,e,i){return Math.sqrt(ri(t,e,i,!0))}function ni(t,e,i,n,o){var s,r,a,h=n?ti:si(t,i),l=si(e,i);for(ti=l;;){if(!(h|l))return[t,e];if(h&l)return!1;a=si(r=oi(t,e,s=h||l,i,o),i),s===h?(t=r,h=a):(e=r,l=a)}}function oi(t,e,i,n,o){var s,r,a=e.x-t.x,e=e.y-t.y,h=n.min,n=n.max;return 8&i?(s=t.x+a*(n.y-t.y)/e,r=n.y):4&i?(s=t.x+a*(h.y-t.y)/e,r=h.y):2&i?(s=n.x,r=t.y+e*(n.x-t.x)/a):1&i&&(s=h.x,r=t.y+e*(h.x-t.x)/a),new p(s,r,o)}function si(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function ri(t,e,i,n){var o=e.x,e=e.y,s=i.x-o,r=i.y-e,a=s*s+r*r;return 0<a&&(1<(a=((t.x-o)*s+(t.y-e)*r)/a)?(o=i.x,e=i.y):0<a&&(o+=s*a,e+=r*a)),s=t.x-o,r=t.y-e,n?s*s+r*r:new p(o,e)}function I(t){return!d(t[0])||\"object\"!=typeof t[0][0]&&void 0!==t[0][0]}function ai(t){return console.warn(\"Deprecated use of _flat, please use L.LineUtil.isFlat instead.\"),I(t)}function hi(t,e){var i,n,o,s,r,a;if(!t||0===t.length)throw new Error(\"latlngs not passed\");I(t)||(console.warn(\"latlngs are not flat! Only the first ring will be used\"),t=t[0]);for(var h=w([0,0]),l=g(t),u=(l.getNorthWest().distanceTo(l.getSouthWest())*l.getNorthEast().distanceTo(l.getNorthWest())<1700&&(h=Qe(t)),t.length),c=[],d=0;d<u;d++){var _=w(t[d]);c.push(e.project(w([_.lat-h.lat,_.lng-h.lng])))}for(i=d=0;d<u-1;d++)i+=c[d].distanceTo(c[d+1])/2;if(0===i)a=c[0];else for(n=d=0;d<u-1;d++)if(o=c[d],s=c[d+1],i<(n+=r=o.distanceTo(s))){a=[s.x-(r=(n-i)/r)*(s.x-o.x),s.y-r*(s.y-o.y)];break}l=e.unproject(m(a));return w([l.lat+h.lat,l.lng+h.lng])}var vt={__proto__:null,simplify:ei,pointToSegmentDistance:ii,closestPointOnSegment:function(t,e,i){return ri(t,e,i)},clipSegment:ni,_getEdgeIntersection:oi,_getBitCode:si,_sqClosestPointOnSegment:ri,isFlat:I,_flat:ai,polylineCenter:hi},yt={project:function(t){return new p(t.lng,t.lat)},unproject:function(t){return new v(t.y,t.x)},bounds:new f([-180,-90],[180,90])},xt={R:6378137,R_MINOR:6356752.314245179,bounds:new f([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,o=Math.sqrt(1-o*o),s=o*Math.sin(n),s=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),o/2),n=-i*Math.log(Math.max(s,1e-10));return new p(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&1e-7<Math.abs(l);h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new v(a*i,t.x*i/n)}},wt={__proto__:null,LonLat:yt,Mercator:xt,SphericalMercator:rt},Pt=l({},st,{code:\"EPSG:3395\",projection:xt,transformation:ht(bt=.5/(Math.PI*xt.R),.5,-bt,.5)}),li=l({},st,{code:\"EPSG:4326\",projection:yt,transformation:ht(1/180,1,-1/180,.5)}),Lt=l({},ot,{projection:yt,transformation:ht(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,e=e.lat-t.lat;return Math.sqrt(i*i+e*e)},infinite:!0}),o=(ot.Earth=st,ot.EPSG3395=Pt,ot.EPSG3857=lt,ot.EPSG900913=ut,ot.EPSG4326=li,ot.Simple=Lt,it.extend({options:{pane:\"overlayPane\",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[h(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[h(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e,i=t.target;i.hasLayer(this)&&(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents&&(e=this.getEvents(),i.on(e,this),this.once(\"remove\",function(){i.off(e,this)},this)),this.onAdd(i),this.fire(\"add\"),i.fire(\"layeradd\",{layer:this}))}})),ui=(A.include({addLayer:function(t){var e;if(t._layerAdd)return e=h(t),this._layers[e]||((this._layers[e]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this;throw new Error(\"The provided object is not a Layer.\")},removeLayer:function(t){var e=h(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire(\"layerremove\",{layer:t}),t.fire(\"remove\")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return h(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?d(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[h(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){t=h(t);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var t,e=1/0,i=-1/0,n=this._getZoomSpan();for(t in this._zoomBoundLayers)var o=this._zoomBoundLayers[t].options,e=void 0===o.minZoom?e:Math.min(e,o.minZoom),i=void 0===o.maxZoom?i:Math.max(i,o.maxZoom);this._layersMaxZoom=i===-1/0?void 0:i,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire(\"zoomlevelschange\"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}}),o.extend({initialize:function(t,e){var i,n;if(c(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){t=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(t){return(\"number\"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke(\"setZIndex\",t)},getLayerId:h})),ci=ui.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ui.prototype.addLayer.call(this,t),this.fire(\"layeradd\",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?((t=t in this._layers?this._layers[t]:t).removeEventParent(this),ui.prototype.removeLayer.call(this,t),this.fire(\"layerremove\",{layer:t})):this},setStyle:function(t){return this.invoke(\"setStyle\",t)},bringToFront:function(){return this.invoke(\"bringToFront\")},bringToBack:function(){return this.invoke(\"bringToBack\")},getBounds:function(){var t,e=new s;for(t in this._layers){var i=this._layers[t];e.extend(i.getBounds?i.getBounds():i.getLatLng())}return e}}),di=et.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){c(this,t)},createIcon:function(t){return this._createIcon(\"icon\",t)},createShadow:function(t){return this._createIcon(\"shadow\",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(i)return i=this._createImg(i,e&&\"IMG\"===e.tagName?e:null),this._setIconStyles(i,t),!this.options.crossOrigin&&\"\"!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?\"\":this.options.crossOrigin),i;if(\"icon\"===t)throw new Error(\"iconUrl not set in Icon options (see the docs).\");return null},_setIconStyles:function(t,e){var i=this.options,n=i[e+\"Size\"],n=m(n=\"number\"==typeof n?[n,n]:n),o=m(\"shadow\"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className=\"leaflet-marker-\"+e+\" \"+(i.className||\"\"),o&&(t.style.marginLeft=-o.x+\"px\",t.style.marginTop=-o.y+\"px\"),n&&(t.style.width=n.x+\"px\",t.style.height=n.y+\"px\")},_createImg:function(t,e){return(e=e||document.createElement(\"img\")).src=t,e},_getIconUrl:function(t){return b.retina&&this.options[t+\"RetinaUrl\"]||this.options[t+\"Url\"]}});var _i=di.extend({options:{iconUrl:\"marker-icon.png\",iconRetinaUrl:\"marker-icon-2x.png\",shadowUrl:\"marker-shadow.png\",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return\"string\"!=typeof _i.imagePath&&(_i.imagePath=this._detectIconPath()),(this.options.imagePath||_i.imagePath)+di.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){function e(t,e,i){return(e=e.exec(t))&&e[i]}return(t=e(t,/^url\\((['\"])?(.+)\\1\\)$/,2))&&e(t,/^(.*)marker-icon\\.png$/,1)},_detectIconPath:function(){var t=P(\"div\",\"leaflet-default-icon-path\",document.body),e=pe(t,\"background-image\")||pe(t,\"backgroundImage\");return document.body.removeChild(t),(e=this._stripUrl(e))?e:(t=document.querySelector('link[href$=\"leaflet.css\"]'))?t.href.substring(0,t.href.length-\"leaflet.css\".length-1):\"\"}}),pi=n.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Xe(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),M(t,\"leaflet-marker-draggable\")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&z(this._marker._icon,\"leaflet-marker-draggable\")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Pe(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),a=_(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));a.contains(s)||(o=m((Math.max(a.max.x,s.x)-a.max.x)/(r.max.x-a.max.x)-(Math.min(a.min.x,s.x)-a.min.x)/(r.min.x-a.min.x),(Math.max(a.max.y,s.y)-a.max.y)/(r.max.y-a.max.y)-(Math.min(a.min.y,s.y)-a.min.y)/(r.min.y-a.min.y)).multiplyBy(n),i.panBy(o,{animate:!1}),this._draggable._newPos._add(o),this._draggable._startPos._add(o),Z(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire(\"movestart\").fire(\"dragstart\")},_onPreDrag:function(t){this._marker.options.autoPan&&(r(this._panRequest),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Pe(e._icon),o=e._map.layerPointToLatLng(n);i&&Z(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire(\"move\",t).fire(\"drag\",t)},_onDragEnd:function(t){r(this._panRequest),delete this._oldLatLng,this._marker.fire(\"moveend\").fire(\"dragend\",t)}}),mi=o.extend({options:{icon:new _i,interactive:!0,keyboard:!0,title:\"\",alt:\"Marker\",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:\"markerPane\",shadowPane:\"shadowPane\",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){c(this,e),this._latlng=w(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on(\"zoomanim\",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off(\"zoomanim\",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.update(),this.fire(\"move\",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){var t;return this._icon&&this._map&&(t=this._map.latLngToLayerPoint(this._latlng).round(),this._setPos(t)),this},_initIcon:function(){var t=this.options,e=\"leaflet-zoom-\"+(this._zoomAnimated?\"animated\":\"hide\"),i=t.icon.createIcon(this._icon),n=!1,i=(i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),\"IMG\"===i.tagName&&(i.alt=t.alt||\"\")),M(i,e),t.keyboard&&(i.tabIndex=\"0\",i.setAttribute(\"role\",\"button\")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&S(i,\"focus\",this._panOnFocus,this),t.icon.createShadow(this._shadow)),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(M(i,e),i.alt=\"\"),this._shadow=i,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&k(this._icon,\"focus\",this._panOnFocus,this),T(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&T(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Z(this._icon,t),this._shadow&&Z(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(t)},_initInteraction:function(){var t;this.options.interactive&&(M(this._icon,\"leaflet-interactive\"),this.addInteractiveTarget(this._icon),pi&&(t=this.options.draggable,this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new pi(this),t&&this.dragging.enable()))},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&C(this._icon,t),this._shadow&&C(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t,e,i=this._map;i&&(t=(e=this.options.icon.options).iconSize?m(e.iconSize):m(0,0),e=e.iconAnchor?m(e.iconAnchor):m(0,0),i.panInside(this._latlng,{paddingTopLeft:e,paddingBottomRight:t.subtract(e)}))},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});var fi=o.extend({options:{stroke:!0,color:\"#3388ff\",weight:3,opacity:1,lineCap:\"round\",lineJoin:\"round\",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:\"evenodd\",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return c(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,\"weight\")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),gi=fi.extend({options:{fill:!0,radius:10},initialize:function(t,e){c(this,e),this._latlng=w(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.redraw(),this.fire(\"move\",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return fi.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),t=[t+i,e+i];this._pxBounds=new f(this._point.subtract(t),this._point.add(t))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});var vi=gi.extend({initialize:function(t,e,i){if(c(this,e=\"number\"==typeof e?l({},i,{radius:e}):e),this._latlng=w(t),isNaN(this.options.radius))throw new Error(\"Circle radius cannot be NaN\");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new s(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:fi.prototype.setStyle,_project:function(){var t,e,i,n,o,s=this._latlng.lng,r=this._latlng.lat,a=this._map,h=a.options.crs;h.distance===st.distance?(n=Math.PI/180,o=this._mRadius/st.R/n,t=a.project([r+o,s]),e=a.project([r-o,s]),e=t.add(e).divideBy(2),i=a.unproject(e).lat,n=Math.acos((Math.cos(o*n)-Math.sin(r*n)*Math.sin(i*n))/(Math.cos(r*n)*Math.cos(i*n)))/n,!isNaN(n)&&0!==n||(n=o/Math.cos(Math.PI/180*r)),this._point=e.subtract(a.getPixelOrigin()),this._radius=isNaN(n)?0:e.x-a.project([i,s-n]).x,this._radiusY=e.y-t.y):(o=h.unproject(h.project(this._latlng).subtract([this._mRadius,0])),this._point=a.latLngToLayerPoint(this._latlng),this._radius=this._point.x-a.latLngToLayerPoint(o).x),this._updateBounds()}});var yi=fi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){c(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,i=null,n=ri,o=0,s=this._parts.length;o<s;o++)for(var r=this._parts[o],a=1,h=r.length;a<h;a++){var l,u,c=n(t,l=r[a-1],u=r[a],!0);c<e&&(e=c,i=n(t,l,u))}return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){if(this._map)return hi(this._defaultShape(),this._map.options.crs);throw new Error(\"Must add layer to map before using getCenter()\")},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=w(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new s,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return I(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=I(t),n=0,o=t.length;n<o;n++)i?(e[n]=w(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new f;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),t=new p(t,t);this._rawPxBounds&&(this._pxBounds=new f([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof v,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var e,i,n,o,s=this._parts,r=0,a=0,h=this._rings.length;r<h;r++)for(e=0,i=(o=this._rings[r]).length;e<i-1;e++)(n=ni(o[e],o[e+1],t,e,!0))&&(s[a]=s[a]||[],s[a].push(n[0]),n[1]===o[e+1]&&e!==i-2||(s[a].push(n[1]),a++))},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=ei(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,h=this._clickTolerance();if(this._pxBounds&&this._pxBounds.contains(t))for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&ii(t,a[o],a[n])<=h)return!0;return!1}});yi._flat=ai;var xi=yi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(this._map)return $e(this._defaultShape(),this._map.options.crs);throw new Error(\"Must add layer to map before using getCenter()\")},_convertLatLngs:function(t){var t=yi.prototype._convertLatLngs.call(this,t),e=t.length;return 2<=e&&t[0]instanceof v&&t[0].equals(t[e-1])&&t.pop(),t},_setLatLngs:function(t){yi.prototype._setLatLngs.call(this,t),I(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return(I(this._latlngs[0])?this._latlngs:this._latlngs[0])[0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,e=new p(e,e),t=new f(t.min.subtract(e),t.max.add(e));if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,n=0,o=this._rings.length;n<o;n++)(i=Je(this._rings[n],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(h=(e=this._parts[o]).length)-1;s<h;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||yi.prototype._containsPoint.call(this,t,!0)}});var wi=ci.extend({initialize:function(t,e){c(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=d(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s,r=this.options;return(!r.filter||r.filter(t))&&(s=bi(t,r))?(s.feature=Zi(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=l({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(t,e){t.setStyle&&(\"function\"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function bi(t,e){var i,n,o,s,r=\"Feature\"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],l=e&&e.pointToLayer,u=e&&e.coordsToLatLng||Li;if(!a&&!r)return null;switch(r.type){case\"Point\":return Pi(l,t,i=u(a),e);case\"MultiPoint\":for(o=0,s=a.length;o<s;o++)i=u(a[o]),h.push(Pi(l,t,i,e));return new ci(h);case\"LineString\":case\"MultiLineString\":return n=Ti(a,\"LineString\"===r.type?0:1,u),new yi(n,e);case\"Polygon\":case\"MultiPolygon\":return n=Ti(a,\"Polygon\"===r.type?1:2,u),new xi(n,e);case\"GeometryCollection\":for(o=0,s=r.geometries.length;o<s;o++){var c=bi({geometry:r.geometries[o],type:\"Feature\",properties:t.properties},e);c&&h.push(c)}return new ci(h);case\"FeatureCollection\":for(o=0,s=r.features.length;o<s;o++){var d=bi(r.features[o],e);d&&h.push(d)}return new ci(h);default:throw new Error(\"Invalid GeoJSON object.\")}}function Pi(t,e,i,n){return t?t(e,i):new mi(i,n&&n.markersInheritOptions&&n)}function Li(t){return new v(t[1],t[0],t[2])}function Ti(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?Ti(t[s],e-1,i):(i||Li)(t[s]),o.push(n);return o}function Mi(t,e){return void 0!==(t=w(t)).alt?[i(t.lng,e),i(t.lat,e),i(t.alt,e)]:[i(t.lng,e),i(t.lat,e)]}function zi(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?zi(t[s],I(t[s])?0:e-1,i,n):Mi(t[s],n));return!e&&i&&0<o.length&&o.push(o[0].slice()),o}function Ci(t,e){return t.feature?l({},t.feature,{geometry:e}):Zi(e)}function Zi(t){return\"Feature\"===t.type||\"FeatureCollection\"===t.type?t:{type:\"Feature\",properties:{},geometry:t}}Tt={toGeoJSON:function(t){return Ci(this,{type:\"Point\",coordinates:Mi(this.getLatLng(),t)})}};function Si(t,e){return new wi(t,e)}mi.include(Tt),vi.include(Tt),gi.include(Tt),yi.include({toGeoJSON:function(t){var e=!I(this._latlngs);return Ci(this,{type:(e?\"Multi\":\"\")+\"LineString\",coordinates:zi(this._latlngs,e?1:0,!1,t)})}}),xi.include({toGeoJSON:function(t){var e=!I(this._latlngs),i=e&&!I(this._latlngs[0]),t=zi(this._latlngs,i?2:e?1:0,!0,t);return Ci(this,{type:(i?\"Multi\":\"\")+\"Polygon\",coordinates:t=e?t:[t]})}}),ui.include({toMultiPoint:function(e){var i=[];return this.eachLayer(function(t){i.push(t.toGeoJSON(e).geometry.coordinates)}),Ci(this,{type:\"MultiPoint\",coordinates:i})},toGeoJSON:function(e){var i,n,t=this.feature&&this.feature.geometry&&this.feature.geometry.type;return\"MultiPoint\"===t?this.toMultiPoint(e):(i=\"GeometryCollection\"===t,n=[],this.eachLayer(function(t){t.toGeoJSON&&(t=t.toGeoJSON(e),i?n.push(t.geometry):\"FeatureCollection\"===(t=Zi(t)).type?n.push.apply(n,t.features):n.push(t))}),i?Ci(this,{geometries:n,type:\"GeometryCollection\"}):{type:\"FeatureCollection\",features:n})}});var Mt=Si,Ei=o.extend({options:{opacity:1,alt:\"\",interactive:!1,crossOrigin:!1,errorOverlayUrl:\"\",zIndex:1,className:\"\"},initialize:function(t,e,i){this._url=t,this._bounds=g(e),c(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(M(this._image,\"leaflet-interactive\"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){T(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&fe(this._image),this},bringToBack:function(){return this._map&&ge(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=g(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=\"IMG\"===this._url.tagName,e=this._image=t?this._url:P(\"img\");M(e,\"leaflet-image-layer\"),this._zoomAnimated&&M(e,\"leaflet-zoom-animated\"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onload=a(this.fire,this,\"load\"),e.onerror=a(this._overlayOnError,this,\"error\"),!this.options.crossOrigin&&\"\"!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?\"\":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),t=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;be(this._image,t,e)},_reset:function(){var t=this._image,e=new f(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Z(t,e.min),t.style.width=i.x+\"px\",t.style.height=i.y+\"px\"},_updateOpacity:function(){C(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire(\"error\");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),ki=Ei.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=\"VIDEO\"===this._url.tagName,e=this._image=t?this._url:P(\"video\");if(M(e,\"leaflet-image-layer\"),this._zoomAnimated&&M(e,\"leaflet-zoom-animated\"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onloadeddata=a(this.fire,this,\"load\"),t){for(var i=e.getElementsByTagName(\"source\"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=0<i.length?n:[e.src]}else{d(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,\"objectFit\")&&(e.style.objectFit=\"fill\"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var r=P(\"source\");r.src=this._url[s],e.appendChild(r)}}}});var Oi=Ei.extend({_initImage:function(){var t=this._image=this._url;M(t,\"leaflet-image-layer\"),this._zoomAnimated&&M(t,\"leaflet-zoom-animated\"),this.options.className&&M(t,this.options.className),t.onselectstart=u,t.onmousemove=u}});var Ai=o.extend({options:{interactive:!1,offset:[0,0],className:\"\",pane:void 0,content:\"\"},initialize:function(t,e){t&&(t instanceof v||d(t))?(this._latlng=w(t),c(this,e)):(c(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&C(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&C(this._container,1),this.bringToFront(),this.options.interactive&&(M(this._container,\"leaflet-interactive\"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(C(this._container,0),this._removeTimeout=setTimeout(a(T,void 0,this._container),200)):T(this._container),this.options.interactive&&(z(this._container,\"leaflet-interactive\"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=w(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility=\"hidden\",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility=\"\",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&fe(this._container),this},bringToBack:function(){return this._map&&ge(this._container),this},_prepareOpen:function(t){if(!(i=this._source)._map)return!1;if(i instanceof ci){var e,i=null,n=this._source._layers;for(e in n)if(n[e]._map){i=n[e];break}if(!i)return!1;this._source=i}if(!t)if(i.getCenter)t=i.getCenter();else if(i.getLatLng)t=i.getLatLng();else{if(!i.getBounds)throw new Error(\"Unable to get source layer LatLng.\");t=i.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e=\"function\"==typeof this._content?this._content(this._source||this):this._content;if(\"string\"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire(\"contentupdate\")}},_updatePosition:function(){var t,e,i;this._map&&(e=this._map.latLngToLayerPoint(this._latlng),t=m(this.options.offset),i=this._getAnchor(),this._zoomAnimated?Z(this._container,e.add(i)):t=t.add(e).add(i),e=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x,this._container.style.bottom=e+\"px\",this._container.style.left=i+\"px\")},_getAnchor:function(){return[0,0]}}),Bi=(A.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),o.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(c(o,n),o._source=this):(o=e&&!n?e:new t(n,this)).setContent(i),o}}),Ai.extend({options:{pane:\"popupPane\",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:\"\"},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Ai.prototype.openOn.call(this,t)},onAdd:function(t){Ai.prototype.onAdd.call(this,t),t.fire(\"popupopen\",{popup:this}),this._source&&(this._source.fire(\"popupopen\",{popup:this},!0),this._source instanceof fi||this._source.on(\"preclick\",Ae))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire(\"popupclose\",{popup:this}),this._source&&(this._source.fire(\"popupclose\",{popup:this},!0),this._source instanceof fi||this._source.off(\"preclick\",Ae))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t=\"leaflet-popup\",e=this._container=P(\"div\",t+\" \"+(this.options.className||\"\")+\" leaflet-zoom-animated\"),i=this._wrapper=P(\"div\",t+\"-content-wrapper\",e);this._contentNode=P(\"div\",t+\"-content\",i),Ie(e),Be(this._contentNode),S(e,\"contextmenu\",Ae),this._tipContainer=P(\"div\",t+\"-tip-container\",e),this._tip=P(\"div\",t+\"-tip\",this._tipContainer),this.options.closeButton&&((i=this._closeButton=P(\"a\",t+\"-close-button\",e)).setAttribute(\"role\",\"button\"),i.setAttribute(\"aria-label\",\"Close popup\"),i.href=\"#close\",i.innerHTML='<span aria-hidden=\"true\">&#215;</span>',S(i,\"click\",function(t){O(t),this.close()},this))},_updateLayout:function(){var t=this._contentNode,e=t.style,i=(e.width=\"\",e.whiteSpace=\"nowrap\",t.offsetWidth),i=Math.min(i,this.options.maxWidth),i=(i=Math.max(i,this.options.minWidth),e.width=i+1+\"px\",e.whiteSpace=\"\",e.height=\"\",t.offsetHeight),n=this.options.maxHeight,o=\"leaflet-popup-scrolled\";(n&&n<i?(e.height=n+\"px\",M):z)(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();Z(this._container,t.add(e))},_adjustPan:function(){var t,e,i,n,o,s,r,a;this.options.autoPan&&(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning?this._autopanning=!1:(t=this._map,e=parseInt(pe(this._container,\"marginBottom\"),10)||0,e=this._container.offsetHeight+e,a=this._containerWidth,(i=new p(this._containerLeft,-e-this._containerBottom))._add(Pe(this._container)),i=t.layerPointToContainerPoint(i),o=m(this.options.autoPanPadding),n=m(this.options.autoPanPaddingTopLeft||o),o=m(this.options.autoPanPaddingBottomRight||o),s=t.getSize(),r=0,i.x+a+o.x>s.x&&(r=i.x+a-s.x+o.x),i.x-r-n.x<(a=0)&&(r=i.x-n.x),i.y+e+o.y>s.y&&(a=i.y+e-s.y+o.y),i.y-a-n.y<0&&(a=i.y-n.y),(r||a)&&(this.options.keepInView&&(this._autopanning=!0),t.fire(\"autopanstart\").panBy([r,a]))))},_getAnchor:function(){return m(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Ii=(A.mergeOptions({closePopupOnClick:!0}),A.include({openPopup:function(t,e,i){return this._initOverlay(Bi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),o.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Bi,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof ci||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Re(t),e=t.layer||t.target,this._popup._source!==e||e instanceof fi?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ai.extend({options:{pane:\"tooltipPane\",offset:[0,0],direction:\"auto\",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ai.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire(\"tooltipopen\",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire(\"tooltipopen\",{tooltip:this},!0))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire(\"tooltipclose\",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire(\"tooltipclose\",{tooltip:this},!0))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t=\"leaflet-tooltip \"+(this.options.className||\"\")+\" leaflet-zoom-\"+(this._zoomAnimated?\"animated\":\"hide\");this._contentNode=this._container=P(\"div\",t),this._container.setAttribute(\"role\",\"tooltip\"),this._container.setAttribute(\"id\",\"leaflet-tooltip-\"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,o=i.latLngToContainerPoint(i.getCenter()),i=i.layerPointToContainerPoint(t),s=this.options.direction,r=n.offsetWidth,a=n.offsetHeight,h=m(this.options.offset),l=this._getAnchor(),i=\"top\"===s?(e=r/2,a):\"bottom\"===s?(e=r/2,0):(e=\"center\"===s?r/2:\"right\"===s?0:\"left\"===s?r:i.x<o.x?(s=\"right\",0):(s=\"left\",r+2*(h.x+l.x)),a/2);t=t.subtract(m(e,i,!0)).add(h).add(l),z(n,\"leaflet-tooltip-right\"),z(n,\"leaflet-tooltip-left\"),z(n,\"leaflet-tooltip-top\"),z(n,\"leaflet-tooltip-bottom\"),M(n,\"leaflet-tooltip-\"+s),Z(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&C(this._container,t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(t)},_getAnchor:function(){return m(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}})),Ri=(A.include({openTooltip:function(t,e,i){return this._initOverlay(Ii,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),o.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ii,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){var e,i;!t&&this._tooltipHandlersAdded||(e=t?\"off\":\"on\",i={remove:this.closeTooltip,move:this._moveTooltip},this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t)},openTooltip:function(t){return this._tooltip&&(this instanceof ci||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e=\"function\"==typeof t.getElement&&t.getElement();e&&(S(e,\"focus\",function(){this._tooltip._source=t,this.openTooltip()},this),S(e,\"blur\",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){t=\"function\"==typeof t.getElement&&t.getElement();t&&t.setAttribute(\"aria-describedby\",this._tooltip._container.id)},_openTooltip:function(t){var e;this._tooltip&&this._map&&(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag?(this._openOnceFlag=!0,(e=this)._map.once(\"moveend\",function(){e._openOnceFlag=!1,e._openTooltip(t)})):(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)))},_moveTooltip:function(t){var e=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(t=this._map.mouseEventToContainerPoint(t.originalEvent),t=this._map.containerPointToLayerPoint(t),e=this._map.layerPointToLatLng(t)),this._tooltip.setLatLng(e)}}),di.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:\"leaflet-div-icon\"},createIcon:function(t){var t=t&&\"DIV\"===t.tagName?t:document.createElement(\"div\"),e=this.options;return e.html instanceof Element?(me(t),t.appendChild(e.html)):t.innerHTML=!1!==e.html?e.html:\"\",e.bgPos&&(e=m(e.bgPos),t.style.backgroundPosition=-e.x+\"px \"+-e.y+\"px\"),this._setIconStyles(t,\"icon\"),t},createShadow:function(){return null}}));di.Default=_i;var Ni=o.extend({options:{tileSize:256,opacity:1,updateWhenIdle:b.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:\"tilePane\",className:\"\",keepBuffer:2},initialize:function(t){c(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),T(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ge(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){var t;return this._map&&(this._removeAllTiles(),(t=this._clampZoom(this._map.getZoom()))!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=j(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement(\"div\")},getTileSize:function(){var t=this.options.tileSize;return t instanceof p?t:new p(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!b.ielt9){C(this._container,this.options.opacity);var t,e=+new Date,i=!1,n=!1;for(t in this._tiles){var o,s=this._tiles[t];s.current&&s.loaded&&(o=Math.min(1,(e-s.loaded)/200),C(s.el,o),o<1?i=!0:(s.active?n=!0:this._onOpaqueTile(s),s.active=!0))}n&&!this._noPrune&&this._pruneTiles(),i&&(r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=P(\"div\",\"leaflet-layer \"+(this.options.className||\"\")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(T(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=P(\"div\",\"leaflet-tile-container leaflet-zoom-animated\",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),u(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,e,i,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(e=i.coords,this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)T(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var t=Math.floor(t/2),e=Math.floor(e/2),i=i-1,o=new p(+t,+e),o=(o.z=i,this._tileCoordsToKey(o)),o=this._tiles[o];return o&&o.active?o.retain=!0:(o&&o.loaded&&(o.retain=!0),n<i&&this._retainParent(t,e,i,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new p(o,s),r=(r.z=i+1,this._tileCoordsToKey(r)),r=this._tiles[r];r&&r.active?r.retain=!0:(r&&r.loaded&&(r.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){t=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e),o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),e=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();b.any3d?be(t.el,e,n):Z(t.el,e)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(i,this._tileZoom),t=e.project(t,this._tileZoom).floor(),e=e.getSize().divideBy(2*i);return new f(t.subtract(e),t.add(e))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n,e=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(e),s=o.getCenter(),r=[],e=this.options.keepBuffer,a=new f(o.getBottomLeft().subtract([e,-e]),o.getTopRight().add([e,-e]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error(\"Attempted to load an infinite number of tiles\");for(n in this._tiles){var h=this._tiles[n].coords;h.z===this._tileZoom&&a.contains(new p(h.x,h.y))||(this._tiles[n].current=!1)}if(1<Math.abs(i-this._tileZoom))this._setView(t,i);else{for(var l=o.min.y;l<=o.max.y;l++)for(var u=o.min.x;u<=o.max.x;u++){var c,d=new p(u,l);d.z=this._tileZoom,this._isValidTile(d)&&((c=this._tiles[this._tileCoordsToKey(d)])?c.current=!0:r.push(d))}if(r.sort(function(t,e){return t.distanceTo(s)-e.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire(\"loading\"));for(var _=document.createDocumentFragment(),u=0;u<r.length;u++)this._addTile(r[u],_);this._level.el.appendChild(_)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),g(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),i=n.add(i);return[e.unproject(n,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){t=this._tileCoordsToNwSe(t),t=new s(t[0],t[1]);return t=this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+\":\"+t.y+\":\"+t.z},_keyToTileCoords:function(t){var t=t.split(\":\"),e=new p(+t[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(T(e.el),delete this._tiles[t],this.fire(\"tileunload\",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){M(t,\"leaflet-tile\");var e=this.getTileSize();t.style.width=e.x+\"px\",t.style.height=e.y+\"px\",t.onselectstart=u,t.onmousemove=u,b.ielt9&&this.options.opacity<1&&C(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(a(this._tileReady,this,t,null,o)),Z(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire(\"tileloadstart\",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire(\"tileerror\",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(C(i.el,0),r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(M(i.el,\"leaflet-tile-loaded\"),this.fire(\"tileload\",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire(\"load\"),b.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new p(this._wrapX?H(t.x,this._wrapX):t.x,this._wrapY?H(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new f(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var Di=Ni.extend({options:{minZoom:0,maxZoom:18,subdomains:\"abc\",errorTileUrl:\"\",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=c(this,e)).detectRetina&&b.retina&&0<e.maxZoom?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),\"string\"==typeof e.subdomains&&(e.subdomains=e.subdomains.split(\"\")),this.on(\"tileunload\",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement(\"img\");return S(i,\"load\",a(this._tileOnLoad,this,e,i)),S(i,\"error\",a(this._tileOnError,this,e,i)),!this.options.crossOrigin&&\"\"!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?\"\":this.options.crossOrigin),\"string\"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt=\"\",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:b.retina?\"@2x\":\"\",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};return this._map&&!this._map.options.crs.infinite&&(t=this._globalTileRange.max.y-t.y,this.options.tms&&(e.y=t),e[\"-y\"]=t),q(this._url,l(e,this.options))},_tileOnLoad:function(t,e){b.ielt9?setTimeout(a(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute(\"src\")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return(t=this.options.zoomReverse?e-t:t)+this.options.zoomOffset},_getSubdomain:function(t){t=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,e,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=u,i.onerror=u,i.complete||(i.src=K,e=this._tiles[t].coords,T(i),delete this._tiles[t],this.fire(\"tileabort\",{tile:i,coords:e})))},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute(\"src\",K),Ni.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute(\"src\")!==K))return Ni.prototype._tileReady.call(this,t,e,i)}});function ji(t,e){return new Di(t,e)}var Hi=Di.extend({defaultWmsParams:{service:\"WMS\",request:\"GetMap\",layers:\"\",styles:\"\",format:\"image/jpeg\",transparent:!1,version:\"1.1.1\"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i,n=l({},this.defaultWmsParams);for(i in e)i in this.options||(n[i]=e[i]);var t=(e=c(this,e)).detectRetina&&b.retina?2:1,o=this.getTileSize();n.width=o.x*t,n.height=o.y*t,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=1.3<=this._wmsVersion?\"crs\":\"srs\";this.wmsParams[e]=this._crs.code,Di.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,i=_(i.project(e[0]),i.project(e[1])),e=i.min,i=i.max,e=(1.3<=this._wmsVersion&&this._crs===li?[e.y,e.x,i.y,i.x]:[e.x,e.y,i.x,i.y]).join(\",\"),i=Di.prototype.getTileUrl.call(this,t);return i+U(this.wmsParams,i,this.options.uppercase)+(this.options.uppercase?\"&BBOX=\":\"&bbox=\")+e},setParams:function(t,e){return l(this.wmsParams,t),e||this.redraw(),this}});Di.WMS=Hi,ji.wms=function(t,e){return new Hi(t,e)};var Wi=o.extend({options:{padding:.1},initialize:function(t){c(this,t),h(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),M(this._container,\"leaflet-zoom-animated\")),this.getPane().appendChild(this._container),this._update(),this.on(\"update\",this._updatePaths,this)},onRemove:function(){this.off(\"update\",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),n=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));b.any3d?be(this._container,n,i):Z(this._container,n)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new f(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fi=Wi.extend({options:{tolerance:0},getEvents:function(){var t=Wi.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement(\"canvas\");S(t,\"mousemove\",this._onMouseMove,this),S(t,\"click dblclick mousedown mouseup contextmenu\",this._onClick,this),S(t,\"mouseout\",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext(\"2d\")},_destroyContainer:function(){r(this._redrawRequest),delete this._ctx,T(this._container),k(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){var t,e,i,n;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),t=this._bounds,e=this._container,i=t.getSize(),n=b.retina?2:1,Z(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+\"px\",e.style.height=i.y+\"px\",b.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire(\"update\"))},_reset:function(){Wi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);t=(this._layers[h(t)]=t)._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,e=e.prev;i?i.prev=e:this._drawLast=e,e?e.next=i:this._drawFirst=i,delete t._order,delete this._layers[h(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(\"string\"==typeof t.options.dashArray){for(var e,i=t.options.dashArray.split(/[, ]+/),n=[],o=0;o<i.length;o++){if(e=Number(i[o]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||x(this._redraw,this))},_extendRedrawBounds:function(t){var e;t._pxBounds&&(e=(t.options.weight||0)+1,this._redrawBounds=this._redrawBounds||new f,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e])))},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t,e=this._redrawBounds;e?(t=e.getSize(),this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)):(this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore())},_draw:function(){var t,e,i=this._redrawBounds;this._ctx.save(),i&&(e=i.getSize(),this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()),this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],h[n?\"lineTo\":\"moveTo\"](s.x,s.y);e&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){var e,i,n,o;this._drawing&&!t._empty()&&(e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),1!=(o=(Math.max(Math.round(t._radiusY),1)||n)/n)&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!=o&&i.restore(),this._fillStroke(i,t))},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||\"evenodd\")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&((\"click\"===t.type||\"preclick\"===t.type)&&this._map._draggableMoved(e)||(i=e));this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){var e;!this._map||this._map.dragging.moving()||this._map._animatingZoom||(e=this._map.mouseEventToLayerPoint(t),this._handleMouseHover(t,e))},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(z(this._container,\"leaflet-interactive\"),this._fireEvent([e],t,\"mouseout\"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(M(this._container,\"leaflet-interactive\"),this._fireEvent([n],t,\"mouseover\"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e,i,n=t._order;n&&(e=n.next,i=n.prev,e&&((e.prev=i)?i.next=e:e&&(this._drawFirst=e),n.prev=this._drawLast,(this._drawLast.next=n).next=null,this._drawLast=n,this._requestRedraw(t)))},_bringToBack:function(t){var e,i,n=t._order;n&&(e=n.next,(i=n.prev)&&((i.next=e)?e.prev=i:i&&(this._drawLast=i),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)))}});function Ui(t){return b.canvas?new Fi(t):null}var Vi=function(){try{return document.namespaces.add(\"lvml\",\"urn:schemas-microsoft-com:vml\"),function(t){return document.createElement(\"<lvml:\"+t+' class=\"lvml\">')}}catch(t){}return function(t){return document.createElement(\"<\"+t+' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"lvml\">')}}(),zt={_initContainer:function(){this._container=P(\"div\",\"leaflet-vml-container\")},_update:function(){this._map._animatingZoom||(Wi.prototype._update.call(this),this.fire(\"update\"))},_initPath:function(t){var e=t._container=Vi(\"shape\");M(e,\"leaflet-vml-shape \"+(this.options.className||\"\")),e.coordsize=\"1 1\",t._path=Vi(\"path\"),e.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;T(e),t.removeInteractiveTarget(e),delete this._layers[h(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e=e||(t._stroke=Vi(\"stroke\")),o.appendChild(e),e.weight=n.weight+\"px\",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=d(n.dashArray)?n.dashArray.join(\" \"):n.dashArray.replace(/( *, *)/g,\" \"):e.dashStyle=\"\",e.endcap=n.lineCap.replace(\"butt\",\"flat\"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=Vi(\"fill\")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?\"M0 0\":\"AL \"+e.x+\",\"+e.y+\" \"+i+\",\"+n+\" 0,23592600\")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){ge(t._container)}},qi=b.vml?Vi:ct,Gi=Wi.extend({_initContainer:function(){this._container=qi(\"svg\"),this._container.setAttribute(\"pointer-events\",\"none\"),this._rootGroup=qi(\"g\"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){T(this._container),k(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute(\"width\",e.x),i.setAttribute(\"height\",e.y)),Z(i,t.min),i.setAttribute(\"viewBox\",[t.min.x,t.min.y,e.x,e.y].join(\" \")),this.fire(\"update\"))},_initPath:function(t){var e=t._path=qi(\"path\");t.options.className&&M(e,t.options.className),t.options.interactive&&M(e,\"leaflet-interactive\"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){T(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,t=t.options;e&&(t.stroke?(e.setAttribute(\"stroke\",t.color),e.setAttribute(\"stroke-opacity\",t.opacity),e.setAttribute(\"stroke-width\",t.weight),e.setAttribute(\"stroke-linecap\",t.lineCap),e.setAttribute(\"stroke-linejoin\",t.lineJoin),t.dashArray?e.setAttribute(\"stroke-dasharray\",t.dashArray):e.removeAttribute(\"stroke-dasharray\"),t.dashOffset?e.setAttribute(\"stroke-dashoffset\",t.dashOffset):e.removeAttribute(\"stroke-dashoffset\")):e.setAttribute(\"stroke\",\"none\"),t.fill?(e.setAttribute(\"fill\",t.fillColor||t.color),e.setAttribute(\"fill-opacity\",t.fillOpacity),e.setAttribute(\"fill-rule\",t.fillRule||\"evenodd\")):e.setAttribute(\"fill\",\"none\"))},_updatePoly:function(t,e){this._setPath(t,dt(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=\"a\"+i+\",\"+(Math.max(Math.round(t._radiusY),1)||i)+\" 0 1,0 \",e=t._empty()?\"M0 0\":\"M\"+(e.x-i)+\",\"+e.y+n+2*i+\",0 \"+n+2*-i+\",0 \";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute(\"d\",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){ge(t._path)}});function Ki(t){return b.svg||b.vml?new Gi(t):null}b.vml&&Gi.include(zt),A.include({getRenderer:function(t){t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){var e;return\"overlayPane\"!==t&&void 0!==t&&(void 0===(e=this._paneRenderers[t])&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e)},_createRenderer:function(t){return this.options.preferCanvas&&Ui(t)||Ki(t)}});var Yi=xi.extend({initialize:function(t,e){xi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=g(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Gi.create=qi,Gi.pointsToPath=dt,wi.geometryToLayer=bi,wi.coordsToLatLng=Li,wi.coordsToLatLngs=Ti,wi.latLngToCoords=Mi,wi.latLngsToCoords=zi,wi.getFeature=Ci,wi.asFeature=Zi,A.mergeOptions({boxZoom:!0});var _t=n.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on(\"unload\",this._destroy,this)},addHooks:function(){S(this._container,\"mousedown\",this._onMouseDown,this)},removeHooks:function(){k(this._container,\"mousedown\",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){T(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),S(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=P(\"div\",\"leaflet-zoom-box\",this._container),M(this._container,\"leaflet-crosshair\"),this._map.fire(\"boxzoomstart\")),this._point=this._map.mouseEventToContainerPoint(t);var t=new f(this._point,this._startPoint),e=t.getSize();Z(this._box,t.min),this._box.style.width=e.x+\"px\",this._box.style.height=e.y+\"px\"},_finish:function(){this._moved&&(T(this._box),z(this._container,\"leaflet-crosshair\")),ae(),Te(),k(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0),t=new s(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire(\"boxzoomend\",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ct=(A.addInitHook(\"addHandler\",\"boxZoom\",_t),A.mergeOptions({doubleClickZoom:!0}),n.extend({addHooks:function(){this._map.on(\"dblclick\",this._onDoubleClick,this)},removeHooks:function(){this._map.off(\"dblclick\",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,i=t.originalEvent.shiftKey?i-n:i+n;\"center\"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}})),Zt=(A.addInitHook(\"addHandler\",\"doubleClickZoom\",Ct),A.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),n.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Xe(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on(\"predrag\",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on(\"predrag\",this._onPreDragWrap,this),t.on(\"zoomend\",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),M(this._map._container,\"leaflet-grab leaflet-touch-drag\"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){z(this._map._container,\"leaflet-grab\"),z(this._map._container,\"leaflet-touch-drag\"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=g(this._map.options.maxBounds),this._offsetLimit=_(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire(\"movestart\").fire(\"dragstart\"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire(\"move\",t).fire(\"drag\",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){var t,e;this._viscosity&&this._offsetLimit&&(t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit,t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,n=(n+e+i)%t-e-i,t=Math.abs(o+i)<Math.abs(n+i)?o:n;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=t},_onDragEnd:function(t){var e,i,n,o,s=this._map,r=s.options,a=!r.inertia||t.noInertia||this._times.length<2;s.fire(\"dragend\",t),!a&&(this._prunePositions(+new Date),t=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,e=r.easeLinearity,a=(t=t.multiplyBy(e/a)).distanceTo([0,0]),i=Math.min(r.inertiaMaxSpeed,a),t=t.multiplyBy(i/a),n=i/(r.inertiaDeceleration*e),(o=t.multiplyBy(-n/2).round()).x||o.y)?(o=s._limitOffset(o,s.options.maxBounds),x(function(){s.panBy(o,{duration:n,easeLinearity:e,noMoveStart:!0,animate:!0})})):s.fire(\"moveend\")}})),St=(A.addInitHook(\"addHandler\",\"dragging\",Zt),A.mergeOptions({keyboard:!0,keyboardPanDelta:80}),n.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex=\"0\"),S(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),k(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){var t,e,i;this._focused||(i=document.body,t=document.documentElement,e=i.scrollTop||t.scrollTop,i=i.scrollLeft||t.scrollLeft,this._map._container.focus(),window.scrollTo(i,e))},_onFocus:function(){this._focused=!0,this._map.fire(\"focus\")},_onBlur:function(){this._focused=!1,this._map.fire(\"blur\")},_setPanDelta:function(t){for(var e=this._panKeys={},i=this.keyCodes,n=0,o=i.left.length;n<o;n++)e[i.left[n]]=[-1*t,0];for(n=0,o=i.right.length;n<o;n++)e[i.right[n]]=[t,0];for(n=0,o=i.down.length;n<o;n++)e[i.down[n]]=[0,t];for(n=0,o=i.up.length;n<o;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){for(var e=this._zoomKeys={},i=this.keyCodes,n=0,o=i.zoomIn.length;n<o;n++)e[i.zoomIn[n]]=t;for(n=0,o=i.zoomOut.length;n<o;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){S(document,\"keydown\",this._onKeyDown,this)},_removeHooks:function(){k(document,\"keydown\",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i,n=t.keyCode,o=this._map;if(n in this._panKeys)o._panAnim&&o._panAnim._inProgress||(i=this._panKeys[n],t.shiftKey&&(i=m(i).multiplyBy(3)),o.options.maxBounds&&(i=o._limitOffset(m(i),o.options.maxBounds)),o.options.worldCopyJump?(e=o.wrapLatLng(o.unproject(o.project(o.getCenter()).add(i))),o.panTo(e)):o.panBy(i));else if(n in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}Re(t)}}})),Et=(A.addInitHook(\"addHandler\",\"keyboard\",St),A.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60}),n.extend({addHooks:function(){S(this._map._container,\"wheel\",this._onWheelScroll,this),this._delta=0},removeHooks:function(){k(this._map._container,\"wheel\",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=He(t),i=this._map.options.wheelDebounceTime,e=(this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date),Math.max(i-(+new Date-this._startTime),0));clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),e),Re(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0,n=(t._stop(),this._delta/(4*this._map.options.wheelPxPerZoomLevel)),n=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,i=i?Math.ceil(n/i)*i:n,n=t._limitZoom(e+(0<this._delta?i:-i))-e;this._delta=0,this._startTime=null,n&&(\"center\"===t.options.scrollWheelZoom?t.setZoom(e+n):t.setZoomAround(this._lastMousePos,e+n))}})),kt=(A.addInitHook(\"addHandler\",\"scrollWheelZoom\",Et),A.mergeOptions({tapHold:b.touchNative&&b.safari&&b.mobile,tapTolerance:15}),n.extend({addHooks:function(){S(this._map._container,\"touchstart\",this._onDown,this)},removeHooks:function(){k(this._map._container,\"touchstart\",this._onDown,this)},_onDown:function(t){var e;clearTimeout(this._holdTimeout),1===t.touches.length&&(e=t.touches[0],this._startPos=this._newPos=new p(e.clientX,e.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(S(document,\"touchend\",O),S(document,\"touchend touchcancel\",this._cancelClickPrevent),this._simulateEvent(\"contextmenu\",e))},this),600),S(document,\"touchend touchcancel contextmenu\",this._cancel,this),S(document,\"touchmove\",this._onMove,this))},_cancelClickPrevent:function t(){k(document,\"touchend\",O),k(document,\"touchend touchcancel\",t)},_cancel:function(){clearTimeout(this._holdTimeout),k(document,\"touchend touchcancel contextmenu\",this._cancel,this),k(document,\"touchmove\",this._onMove,this)},_onMove:function(t){t=t.touches[0];this._newPos=new p(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){t=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});t._simulated=!0,e.target.dispatchEvent(t)}})),Ot=(A.addInitHook(\"addHandler\",\"tapHold\",kt),A.mergeOptions({touchZoom:b.touch,bounceAtZoomLimits:!0}),n.extend({addHooks:function(){M(this._map._container,\"leaflet-touch-zoom\"),S(this._map._container,\"touchstart\",this._onTouchStart,this)},removeHooks:function(){z(this._map._container,\"leaflet-touch-zoom\"),k(this._map._container,\"touchstart\",this._onTouchStart,this)},_onTouchStart:function(t){var e,i,n=this._map;!t.touches||2!==t.touches.length||n._animatingZoom||this._zooming||(e=n.mouseEventToContainerPoint(t.touches[0]),i=n.mouseEventToContainerPoint(t.touches[1]),this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),\"center\"!==n.options.touchZoom&&(this._pinchStartLatLng=n.containerPointToLatLng(e.add(i)._divideBy(2))),this._startDist=e.distanceTo(i),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),S(document,\"touchmove\",this._onTouchMove,this),S(document,\"touchend touchcancel\",this._onTouchEnd,this),O(t))},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&1<o)&&(this._zoom=e._limitZoom(this._zoom)),\"center\"===e.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{i=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==o&&0===i.x&&0===i.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(i),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),r(this._animRequest);n=a(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=x(n,this,!0),O(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,r(this._animRequest),k(document,\"touchmove\",this._onTouchMove,this),k(document,\"touchend touchcancel\",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}})),Xi=(A.addInitHook(\"addHandler\",\"touchZoom\",Ot),A.BoxZoom=_t,A.DoubleClickZoom=Ct,A.Drag=Zt,A.Keyboard=St,A.ScrollWheelZoom=Et,A.TapHold=kt,A.TouchZoom=Ot,t.Bounds=f,t.Browser=b,t.CRS=ot,t.Canvas=Fi,t.Circle=vi,t.CircleMarker=gi,t.Class=et,t.Control=B,t.DivIcon=Ri,t.DivOverlay=Ai,t.DomEvent=mt,t.DomUtil=pt,t.Draggable=Xe,t.Evented=it,t.FeatureGroup=ci,t.GeoJSON=wi,t.GridLayer=Ni,t.Handler=n,t.Icon=di,t.ImageOverlay=Ei,t.LatLng=v,t.LatLngBounds=s,t.Layer=o,t.LayerGroup=ui,t.LineUtil=vt,t.Map=A,t.Marker=mi,t.Mixin=ft,t.Path=fi,t.Point=p,t.PolyUtil=gt,t.Polygon=xi,t.Polyline=yi,t.Popup=Bi,t.PosAnimation=Fe,t.Projection=wt,t.Rectangle=Yi,t.Renderer=Wi,t.SVG=Gi,t.SVGOverlay=Oi,t.TileLayer=Di,t.Tooltip=Ii,t.Transformation=at,t.Util=tt,t.VideoOverlay=ki,t.bind=a,t.bounds=_,t.canvas=Ui,t.circle=function(t,e,i){return new vi(t,e,i)},t.circleMarker=function(t,e){return new gi(t,e)},t.control=Ue,t.divIcon=function(t){return new Ri(t)},t.extend=l,t.featureGroup=function(t,e){return new ci(t,e)},t.geoJSON=Si,t.geoJson=Mt,t.gridLayer=function(t){return new Ni(t)},t.icon=function(t){return new di(t)},t.imageOverlay=function(t,e,i){return new Ei(t,e,i)},t.latLng=w,t.latLngBounds=g,t.layerGroup=function(t,e){return new ui(t,e)},t.map=function(t,e){return new A(t,e)},t.marker=function(t,e){return new mi(t,e)},t.point=m,t.polygon=function(t,e){return new xi(t,e)},t.polyline=function(t,e){return new yi(t,e)},t.popup=function(t,e){return new Bi(t,e)},t.rectangle=function(t,e){return new Yi(t,e)},t.setOptions=c,t.stamp=h,t.svg=Ki,t.svgOverlay=function(t,e,i){return new Oi(t,e,i)},t.tileLayer=ji,t.tooltip=function(t,e){return new Ii(t,e)},t.transformation=ht,t.version=\"1.9.4\",t.videoOverlay=function(t,e,i){return new ki(t,e,i)},window.L);t.noConflict=function(){return window.L=Xi,this},window.L=t});\n//# sourceMappingURL=leaflet.js.map"
  },
  {
    "path": "assets/js/sportspress.js",
    "content": "function sp_viewport() {\n\tvar e = window, a = 'inner';\n\tif ( ! ('innerWidth' in window )) {\n\t\ta = 'client';\n\t\te = document.documentElement || document.body;\n\t}\n\treturn { width : e[ a + 'Width' ] , height : e[ a + 'Height' ] };\n}\n\n(function($) {\n\n\t/* Header */\n\tif ( ! $( '.sp-header' ).length ) {\n\t\t$( 'body' ).prepend( '<div class=\"sp-header sp-header-loaded\"></div>' );\n\t}\n\n\t/* Countdown */\n\t$( \"[data-countdown]\" ).each(\n\t\tfunction() {\n\t\t\tvar $this = $( this );\n\t\t\t// Get countdown time\n\t\t\tvar countDownDate = new Date( $( this ).data( 'countdown' ) ).getTime();\n\t\t\t// Iterate every second\n\t\t\tvar x = setInterval(\n\t\t\t\tfunction() {\n\n\t\t\t\t\t// Get todays date and time\n\t\t\t\t\tvar now = new Date();\n\n\t\t\t\t\t// Convert curent date and time to UTC\n\t\t\t\t\tvar tzDifference = now.getTimezoneOffset();\n\t\t\t\t\tvar nowutc       = new Date( now.getTime() + tzDifference * 60 * 1000 );\n\n\t\t\t\t\t// Find the distance between now and the count down date\n\t\t\t\t\tvar distance = countDownDate - nowutc;\n\t\t\t\t\tif ( distance < 0 ) {\n\t\t\t\t\t\tdistance = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Time calculations for days, hours, minutes and seconds\n\t\t\t\t\tvar days    = Math.floor( distance / (1000 * 60 * 60 * 24) );\n\t\t\t\t\tvar hours   = Math.floor( (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) );\n\t\t\t\t\tvar minutes = Math.floor( (distance % (1000 * 60 * 60)) / (1000 * 60) );\n\t\t\t\t\tvar seconds = Math.floor( (distance % (1000 * 60)) / 1000 );\n\n\t\t\t\t\t// Output the result\n\t\t\t\t\t$this.html(\n\t\t\t\t\t\t\"<span>\" + (days < 10 ? '0' + days : days) + \" <small>\" + localized_strings.days + \"</small></span> \"\n\t\t\t\t\t\t+ \"<span>\" + ('0' + hours).slice( -2 ) + \" <small>\" + localized_strings.hrs + \"</small></span> \"\n\t\t\t\t\t\t+ \"<span>\" + ('0' + minutes).slice( -2 ) + \" <small>\" + localized_strings.mins + \"</small></span> \"\n\t\t\t\t\t\t+ \"<span>\" + ('0' + seconds).slice( -2 ) + \" <small>\" + localized_strings.secs + \"</small></span>\"\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t1000\n\t\t\t);\n\t\t}\n\t);\n\n\t/* Scrollable Tables */\n\t$( \".sp-scrollable-table\" ).wrap( \"<div class=\\\"sp-scrollable-table-wrapper\\\"></div>\" );\n\n\t/* Selector Redirect */\n\t$( \".sp-selector-redirect\" ).change(\n\t\tfunction() {\n\t\t\twindow.location = $( this ).val();\n\t\t}\n\t);\n\n\t/* Template Tabs */\n\t$( \".sp-tab-menu-item a\" ).click(\n\t\tfunction() {\n\t\t\t$template = $( this ).data( \"sp-tab\" );\n\t\t\t$( this ).closest( \".sp-tab-menu-item\" ).addClass( \"sp-tab-menu-item-active\" ).siblings( \".sp-tab-menu-item\" ).removeClass( \"sp-tab-menu-item-active\" );\n\t\t\t$( this ).closest( \".sp-tab-group\" ).find( \".sp-tab-content-\" + $template ).show().siblings( \".sp-tab-content\" ).hide();\n\t\t\treturn false;\n\t\t}\n\t);\n\n\t/* API method to get paging information */\n\t$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )\n\t{\n\t\treturn {\n\t\t\t\"iStart\":         oSettings._iDisplayStart,\n\t\t\t\"iEnd\":           oSettings.fnDisplayEnd(),\n\t\t\t\"iLength\":        oSettings._iDisplayLength,\n\t\t\t\"iTotal\":         oSettings.fnRecordsTotal(),\n\t\t\t\"iFilteredTotal\": oSettings.fnRecordsDisplay(),\n\t\t\t\"iPage\":          oSettings._iDisplayLength === -1 ?\n\t\t\t\t0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),\n\t\t\t\"iTotalPages\":    oSettings._iDisplayLength === -1 ?\n\t\t\t\t0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )\n\t\t};\n\t}\n\n\t/* Data Tables */\n\t$( \".sp-data-table\" ).each(\n\t\tfunction() {\n\t\t\tsortable       = $( this ).hasClass( \"sp-sortable-table\" );\n\t\t\tpaginated      = $( this ).hasClass( \"sp-paginated-table\" );\n\t\t\tdisplay_length = parseInt( $( this ).attr( \"data-sp-rows\" ) );\n\t\t\tif ( display_length == undefined || isNaN( display_length ) ) {\n\t\t\t\tdisplay_length = 10;\n\t\t\t}\n\t\t\tif ( $( this ).find( \"tbody tr\" ).length <= display_length ) {\n\t\t\t\tpaginated = false;\n\t\t\t}\n\t\t\tif ( sortable || paginated ) {\n\t\t\t\t$( this ).dataTable(\n\t\t\t\t\t{\n\t\t\t\t\t\t\"order\": [],\n\t\t\t\t\t\t\"autoWidth\": false,\n\t\t\t\t\t\t\"searching\": false,\n\t\t\t\t\t\t\"info\": false,\n\t\t\t\t\t\t\"paging\": paginated,\n\t\t\t\t\t\t\"lengthChange\": false,\n\t\t\t\t\t\t\"pagingType\": \"simple_numbers\",\n\t\t\t\t\t\t\"pageLength\": display_length,\n\t\t\t\t\t\t\"ordering\": sortable,\n\t\t\t\t\t\t\"language\": {\n\t\t\t\t\t\t\t\"aria\": {\n\t\t\t\t\t\t\t\t\"sortAscending\": \"\",\n\t\t\t\t\t\t\t\t\"sortDescending\": \"\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"paginate\": {\n\t\t\t\t\t\t\t\t\"previous\": localized_strings.previous,\n\t\t\t\t\t\t\t\t\"next\": localized_strings.next,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"columnDefs\": [\n\t\t\t\t\t\t{ \"type\": \"num-fmt\", \"targets\": [ \".data-number\", \".data-rank\" ] },\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t);\n\n})( jQuery );\n"
  },
  {
    "path": "changelog.txt",
    "content": "== SportsPress Changelog ==\n\n= 2.7.29 =\n* Fix - Error when extensions add null values.\n* Fix - Non-numeric metrics being converted to numeric values.\n\n= 2.7.27 =\n* Fix - Security issues.\n\n= 2.7.26 =\n* Tweak - Make SportsPress compatible with the Polylang plugin.\n* Fix - Non-numeric value error in player list.\n* Fix - Countdown widget null parameter deprecation.\n* Fix - Deprecated functiong get_page_by_title().\n* Fix - Output when image is used as a performance icon.\n\n= 2.7.24 =\n* Update - Leaflet version to 1.9.4.\n* Tweak - Refactor equation builder to support nested conditional equations.\n* Tweak - Add option to filter events by venue in admin.\n* Tweak - Include events with no status in countdown widget.\n* Fix - Errors related to PHP version 8.\n* Fix - Statistic format not saving.\n* Fix - Position stats in offense and defense not saving.\n* Fix - Google error: Date/time not in ISO 8601 format.\n* Fix - Minutes in league table.\n* Fix = Fatal error due to wrong type.\n\n= 2.7.23 =\n* Update - Version bump for SportsPress Pro.\n\n= 2.7.22 =\n* Fix - Security issues.\n\n= 2.7.21 =\n* Fix - Add nonce checks to hide notice links.\n\n= 2.7.20 =\n* Fix - Permalink access for non-admins.\n\n= 2.7.19 =\n* Fix - Games back showing as zero.\n\n= 2.7.18 =\n* Tweak - Only get staff template if enabled.\n* Tweak - Show visible option only when \"Auto\" mode is selected.\n* Fix - \"None\" option disappeared from dropdowns.\n* Fix - Minutes not shown when image used as icon.\n* Fix - Deprecated urlencode() notice.\n* Fix - Null parameter notice.\n* Fix - Undefined array key warnings.\n* Fix - Add user capability check and nonce check when updating permalinks.\n\n= 2.7.17 =\n* Fix - PHP 8.2.x deprecated code warnings.\n* Fix - Next team not working in shortcodes.\n* Fix - Links rendering in event specs.\n* Localization - Update translatable strings.\n\n= 2.7.16 =\n* Update - WP version tested up to 6.1.\n* Update - Leaflet version to 1.8.0.\n* Tweak - Datepicker support for event blocks, list, and calendar widgets.\n* Fix - Toggle between absolute and resltive dates in shortcodes.\n* Fix - Undefined variables showdob and showage.\n* Fix - Date range error in player lists.\n* Fix - Loss condition not applied on event results.\n* Fix - Can't set statistic variable for player positions.\n* Fix - API error when using _fields.\n* Fix - Event map and video not being displayed.\n* Fix - Escape functions in admin.\n\n= 2.7.15 =\n* Feature - Sports news widget in dashboard.\n* Fix - Fixture importer bug with extended characters in league and season name.\n* Fix - Player list not loading (too many resources).\n* Fix - Performance format not updating.\n* Fix - Trim whitespace on geo coordinates to avoid import error.\n\n= 2.7.14 =\n* Fix - Error when non-value added as adjustment.\n* Fix - Map links not escaped properly.\n* Fix - Event blocks missing attributes.\n* Fix - Player statistics meta escaping.\n\n= 2.7.13 =\n* Fix - Theme notice escaping.\n* Fix - Timezone dropdown selection now shown in general settings.\n* Fix - Double header when multiple player lists are displayed in team.\n* Fix - Dropdown options not saving in settings.\n* Fix - Setup page conflict with WooCommerce.\n\n= 2.7.12 =\n* Fix - OpenStreetMap not displaying map after update.\n\n= 2.7.11 =\n* Fix - Player status selector not reflecting changes in match edit screen.\n* Fix - Player dropdown template not displaying names.\n* Fix - Staff dropdown template not displaying names.\n\n= 2.7.10 =\n* Fix - Players not selectable in event edit page.\n* Fix - Videos embedded in post content not rendering.\n\n= 2.7.9 =\n* Tweak - Add support for event format in REST API.\n* Tweak - Add \"Order\" and \"Order by\" selection fields for countdown widget.\n* Tweak - Add option to display event status in countdown widget.\n* Tweak - Add ability to filter events by format in calendar template.\n* Tweak - Update TGM plugin activation library.\n* Fix - Remove plugin headers from modules for improved compatibility.\n* Fix - Reverse order not applying to teams in event lists.\n* Fix - Add validation to user inputs for improved security.\n* Fix - Sanitize all user inputs for improved security.\n* Fix - Escape all outputs in admin for improved security.\n* Fix - Filtering based on format for event blocks.\n* Fix - Last week and next week filter not applying to player lists.\n* Fix - Deselecting a selected team in settings.\n* Fix - PHP 8.0 deprecated warnings.\n* Localization - Add nationalities and flags for French Guiana, French Polynesia, Guadeloupe, Greenland, Martinique, Reunion, and Sint Maarten.\n\n= 2.7.8 =\n* Fix - Event results, box scores, and players stats not updating via REST API.\n\n= 2.7.7 =\n* Fix - Events not appearing due to filter malfunction.\n\n= 2.7.6 =\n* Feature - Add ability to bulk set events as on time.\n* Fix - Players in events not being filtered by team.\n\n= 2.7.5 =\n* Tweak - Add ability to filter events by team and match day in one query.\n* Tweak - Improve performance by updating leaflet script and only loading when required.\n* Tweak - Add overtime notation compatibility for minutes played.\n* Fix - Issue with event edit page where the scripts were not working.\n* Fix - No records when format is default in event list shortcode.\n\n= 2.7.4 =\n* Tweak - Add option to display birthday, age, or both in birthdays widget.\n* Fix - Player list data showing zeroes in some cases.\n\n= 2.7.3 =\n* Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary.\n* Tweak - Avoid showing minutes box for subs when not needed.\n* Tweak - Improve filtering speed for queries without leagues or seasons.\n* Tweak - Apply reverse order setting in event lists.\n* Tweak - Enable filtering a player's events played on a specific team.\n* Fix - Include future events in REST API for WordPress 5.5.\n* Fix - Enable updating player metrics using the REST API.\n* Fix - Deprecated code for PHP 7.4.\n* Fix - Elementor compatibility.\n* Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini.\n* Localization - Adjust RTL stylesheet for event performance icons.\n\n= 2.7.2 =\n* Tweak - Sanitize delimiter field in event settings.\n\n= 2.7.1 =\n* Feature - Enable player list filtering by nationality.\n* Feature - Add option to display date of birth in player lists.\n* Tweak - Exclude postponed and canceled events from countdowns.\n* Tweak - Apply reverse order option to event results.\n* Tweak - When a team has more than one home venue, separate with commas.\n* Fix - Venue address containing pluses in events.\n* Fix - Event blocks showing the wrong dates when embedded within other event pages.\n* Fix - Statistics not adding manual values when not based on equations.\n* Fix - Event lists ignoring the format parameter.\n* Fix - League table order when displaying multiple tables in team profiles.\n* Fix - Error when deleting configuration columns.\n* Fix - Player lists not including past players in some cases.\n* Fix - Prevent error when viewing event calendar in some cases.\n\n= 2.7 =\n* Feature - New bulk actions to postpone and cancel multiple events.\n* Feature - Add date of birth to player importer.\n* Feature - Automatically select the home team's venue as the default venue when importing fixtures.\n* Feature - Add ability to turn on comment for team profiles.\n* Feature - Filter league tables by event status.\n* Tweak - When an icon is used for player performance, display the icon in player lists and profiles.\n* Tweak - Add title attribute for player statistic icons.\n* Tweak - Default stylesheet sorting icon width.\n* Fix - Icon color picker rendering issue.\n* Fix - Image selector not working for player statistics.\n* Fix - Enqueue scripts and styles for OpenStreetMap when used in shortcodes.\n* Localization - Add translation options for countdown units.\n\n= 2.6.20 =\n* Tweak - Improve compatibility with volleyball for checkbox performance.\n* Preset - Update volleyball preset with additional options.\n\n= 2.6.19 =\n* Feature - Enable filtering calendars base on players.\n* Feature - Add checkbox type to event performance.\n* Fix - Javascript error when columns are hidden in event list.\n* Fix - Notice when displaying staff in event performance table.\n* Fix - Notice when event results are empty.\n* Fix - Uncaught error in player class.\n* Preset - Update volleyball preset using checkbox performance type.\n\n= 2.6.18 =\n* Fix - Prevent OpenStreetMap scripts from loading when Google Maps is active via SportsPress Pro.\n* Fix - Headers already sent error related to default nationality module.\n\n= 2.6.17 =\n* Tweak - Only show welcome screen on major version upgrade.\n* Tweak - Add filters to enable career totals calculation with extensions.\n* Fix - Countdowns not reflecting timezone setting.\n\n= 2.6.16 =\n* Tweak - Add support for updated baseball extension with partial innings.\n* Fix - Error displaying staff in events when offense and defense are separate tables.\n\n= 2.6.15 =\n* Important - Using Google Maps will require a SportsPress Pro license after August 31, 2019.\n* Refactor - Fallback to OpenStreetMap for venue maps without SportsPress Pro.\n* Feature - Option to display team logos instead of team names in player lists.\n* Feature - Option to display custom specs in event blocks and event lists.\n* Tweak - Improve page load speed when creating new league tables.\n* Tweak - Prevent displaying events other than published or scheduled.\n* Fix - Icons only appearing in the first table when player lists are grouped.\n* Fix - Character encoding and CRLF errors in calendar feeds.\n* Fix - Missing field location Schema error.\n* Fix - Dropdowns collapsing in admin when meta boxes are hidden.\n* Fix - Timezone handling in countdowns.\n* Fix - Error when using special characters in admin settings.\n\n= 2.6.14 =\n* Fix - API endpoints for secondary post types.\n\n= 2.6.13 =\n* Fix - Missing functionality with Gutenberg enabled.\n* Fix - Enable API endpoints with WordPress 5.0 and Gutenberg.\n\n= 2.6.12 =\n* Tweak - Match styling of date row in countdown.\n* Fix - Calculated totals in player performance array missing for custom templates.\n* Fix - Date field hidden from existing calendars.\n\n= 2.6.11 =\n* Tweak - Apply reverse teams setting to event blocks.\n* Tweak - Add zero before days in countdown when there are less than 10 days to go.\n* Fix - Venue address not setting correctly.\n* Fix - RTL language support for first column in tables.\n* Fix - PHP warnings for various static functions.\n* Fix - Custom post types displaying blank screen in admin when Gutenberg is active.\n\n= 2.6.10 =\n* Tweak - Apply reverse teams settings to logos.\n* Fix - Statistics doubling in player lists when player is assigned to a team.\n* Fix - Display blank placeholder in player lists when no team is assigned.\n* Preset - Update basketball efficiency rating equation.\n\n= 2.6.9 =\n* Feature - New event shortcodes: venue, officials, teams, and full event info.\n* Feature - Option to choose default nationality for faster data entry.\n* Feature - Date and time display options in countdown widgets.\n* Feature - Ability to filter player list shortcodes by league, season, and team.\n* Tweak - Improve page load for new player lists.\n* Tweak - Improve iCal feed by fixing wrapping issues.\n* Tweak - Use lighter placeholder color to differentiate from entered values.\n* Tweak - Preserve league, season, and position assignments when importing players.\n* Fix - PHP warnings when using version 7.2 or later.\n* Fix - Countdown timer format when event is 100 or more days away.\n* Fix - Player list displaying zero values when formatted using decimal places.\n* Fix - Start of the week filters for week-based calendars.\n* Fix - Location picker freezing issue.\n* Fix - Custom post types pages displaying blank page when Gutenberg is installed.\n\n= 2.6.8 =\n* Feature - Ability to add icons to player statistics.\n* Feature - Ability to display matchday in event blocks.\n* Feature - Add support for commenting on scheduled events.\n* Feature - Option to filter birthdays widget by week.\n* Feature - Option to filter events by competitive or friendly.\n* Tweak - Display pin in venue map and link map to web version.\n* Tweak - Add UK as alternate to GB in countries legacy list.\n* Tweak - Remove duplicate teams from players.\n* Tweak - Improve player assignment filtering for player lists.\n* Fix - Animated countdowns when visitor and site are in a different timezones.\n\n= 2.6.7 =\n* Fix - Update Google Maps API endpoints.\n\n= 2.6.6 =\n* Fix - Apply reverse teams to frontend templates only.\n\n= 2.6.5 =\n* Tweak - Increase coverage of reverse teams option.\n* Tweak - Improve sorting of leagues, positions, and seasons.\n* Localization - Additional legacy country code for Greece.\n* Fix - Broken post author select on certain pages.\n* Fix - Google Calendar link protocol.\n\n= 2.6.4 =\n* Fix - Undefined variable notice in player list.\n\n= 2.6.3 =\n* Fix - Assign past teams during player import.\n* Fix - Next team column displaying events furthest away.\n* Fix - Add fallback array_replace function for PHP versions earlier than 5.3.\n* Fix - Add fallback for web hosts that don't support multibyte PHP functions, causing blank player profiles.\n\n= 2.6.2 =\n* Fix - Newly added players from past and current team appearing in player lists.\n* Fix - Player lists appearing empty without league, season, and team selected.\n\n= 2.6.1 =\n* Fix - Player lists with a team selected showing players from other teams.\n* Fix - REST API endpoints not resolving for players.\n* Fix - Empty system status page.\n\n= 2.6 =\n* Feature - Add custom details to events using event specs.\n* Feature - Conditional equations for variables.\n* Feature - Display the next opponent in league tables.\n* Feature - Short name option added to teams.\n* Feature - Automatic event titles using short name when available.\n* Feature - Display featured image in countdown widget.\n* Tweak - Stronger connections between leagues, seasons, and teams for automatic player lists.\n* Tweak - Relative date option added to editor shortcodes.\n* Tweak - Display only current team in player list.\n* Tweak - Filter players dropdown by current team only.\n* Tweak - Allow 0 as a squad number when importing players.\n* Tweak - Prevent filtering through empty results.\n* Fix - Interpreting non-integer substitution times.\n* Fix - Warning when sorting terms without order.\n* Localization - Add WPML support to staff header.\n* Localization - Fix RTL not being applied in league tables.\n\n= 2.5.10 =\n* Fix - Date ranges not being applied to calendars.\n\n= 2.5.9 =\n* Fix - Unpublished posts being displayed in some themes.\n\n= 2.5.8 =\n* Fix - Display scheduled events using default permalinks via archives and third-party widgets.\n\n= 2.5.7 =\n* Fix - Blank general settings screen on WordPress versions prior to 4.9.\n* Fix - Revert responsive table behavior to prevent display issues on mobile.\n\n= 2.5.6 =\n* Tweak - Adjust player-related hooks.\n* Fix - Turn off responsive tables by default.\n\n= 2.5.5 =\n* Feature - Main league and current season settings.\n* Feature - New shortcode including full staff profile.\n* Feature - Add code highlighting to custom CSS field.\n* Feature - Add responsive layout option to tables.\n* Feature - Add filters to REST API players endpoint.\n* Feature - Option to merge duplicate teams, players, and staff.\n* Feature - Option to display specific event in event blocks.\n* Feature - Option to sort player checklist by name and squad number in events.\n* Feature - Option to filter player lists by team.\n* Feature - Option to link staff members.\n* Feature - Filter countdown by calendar.\n* Fix - Calculate column totals in box score.\n* Fix - Mismatched encoding of included library.\n* Localization - Fix translation function missing around string.\n\n= 2.5.4 =\n* Fix - Error when editing league table using older versions of WordPress.\n\n= 2.5.3 =\n* Fix - Calendar templates not loading when timezone setting is relative to UTC.\n\n= 2.5.2 =\n* Feature - Add match day to REST API.\n* Tweak - Add order to positions during preset installation.\n* Tweak - Display links to add new duties and officials if empty.\n* Tweak - Add linebreaks to substitute dropdowns.\n* Fix - Use default full time minutes in REST API.\n* Fix - Uploading custom images as performance icons.\n* Fix - Displaying timed performance with custom images.\n\n= 2.5.1 =\n* Feature - Officials importer.\n* Feature - Officials added to dashboard glance items.\n* Feature - Order setting added to staff jobs for custom sorting.\n* Tweak - Display only the highest order job in staff profiles.\n* Tweak - Require box score importer to be accessed from within an event.\n* Tweak - Add hook to declare importable post types.\n* Fix - Officials meta box in events when module is inactive.\n* Fix - Issues when timezone is not set.\n\n= 2.5 =\n* Feature - Player of the match and star numbers added to box scores.\n* Feature - Officials module for displaying referee appointments in matches.\n* Feature - New player performance icons to choose from.\n* Feature - Schema microdata added to event calendars, lists, and blocks.\n* Feature - Box score importer for updating existing events.\n* Feature - Order setting added to taxonomies for custom sorting.\n* Feature - New relative date range options in event calendars.\n* Feature - Date range options added to league tables and player lists.\n* Feature - Option to hide players with zero statistics in player list.\n* Tweak - Allow staff members to have multiple jobs.\n* Tweak - Indicator dots added to calendars with events in frontend stylesheet.\n* Tweak - Box score columns are now selected by default when adding new events.\n* Tweak - Events made sortable by match day in admin.\n* Tweak - Competitions renamed to leagues.\n* Fix - Quick edit teams not showing when filtering players by team.\n* Fix - Calendar feeds not updating without E-tag.\n* Fix - Admin table cells wrapping.\n* Fix - Timezone issues in calendars.\n\n= 2.4.3 =\n* Fix - Substitute Typo.\n* Fix - WordPay image trailing slash.\n\n= 2.4.2 =\n* Feature - Add visibility option to player metrics.\n* Fix - Remove protocol from default Gravatar images to prevent mix content warnings.\n\n= 2.4.1 =\n* Fix - Static function displaying notice in header.\n\n= 2.4 =\n* Feature - Integration with WordPay to allow paid team and player registrations.\n* Feature - New team gallery shortcode and widget for displaying a gallery of team logos.\n* Feature - Added support for player career totals based on calculated averages.\n* Tweak - Allow competitions to be selected for friendly matches.\n* Tweak - Added columns selector to gallery shortcodes.\n* Fix - Full time defaulting to 90 minutes.\n* Fix - Statistic format not reflected in meta box.\n* Fix - Shortcode button hook timing conflicts.\n* Preset - Swap par and score in golf preset.\n* Preset - Update all presets to reflect new career total type.\n\n= 2.3.2 =\n* Fix - Team in player statistics total row displaying as zero.\n* Fix - Notice when no sendoffs are available during minutes played calculation.\n\n= 2.3.1 =\n* Tweak - Update version numbers of recommended sport-specific extensions.\n* Fix - Manually entered statistics not reflected in player profile totals.\n* Fix - Template hooks not callable for third-party integration.\n* Fix - Error when editing league tables in PHP versions earlier than 5.5.\n\n= 2.3 =\n* Feature - New setup wizard for first-time installs.\n* Feature - Option to automatically create player profiles during user registration.\n* Feature - Choose team or individual mode for each event.\n* Feature - Send Off setting for player statistics to suspend minute count for that player.\n* Tweak - Remove horizontal scrolling in dashboard to fix hidden dropdowns.\n* Tweak - Revert text color overrides for dark color schemes in frontend styles.\n* Fix - Borrowed players not automatically loading on event edit.\n* Fix - Played minutes calculation and player profile statistics.\n\n= 2.2.11 =\n* Fix - Timeout issue when tiebreaker checks for head-to-head standings.\n* Fix - Check for REST API controllers to prevent errors when using Jetpack.\n\n= 2.2.10 =\n* Tweak - Update modules page.\n* Fix - League table discrepancy due to change in number of teams setting.\n* Fix - JavaScript error caused by box score displaying icons without players.\n\n= 2.2.9 =\n* Fix - Warning message above player list template.\n\n= 2.2.8 =\n* Fix - Hidden box score header in values mode.\n* Fix - Welcome page displaying after upgrade if preset was saved from settings.\n* Fix - Decimal places being dropped from player list statistics.\n\n= 2.2.7 =\n* Tweak - Adjust frontend styles to allow some overrides.\n* Tweak - Update modules page with new module options.\n* Fix - Javascript error in icon mode box scores.\n* Fix - Player list default sorting issue.\n* Fix - Empty team checkboxes in player quick edit.\n\n= 2.2.6 =\n* Tweak - Hide box score table header row in icon mode.\n* Tweak - Adjust frontend stylesheet.\n* Fix - Empty league tables when no columns are selected.\n* Fix - Empty player lists when no columns are selected.\n* Fix - Link events setting not applied to box score time.\n* Fix - Player list sorting error with non-numeric values.\n* Fix - Home and away records being combined when opponent not in league table.\n\n= 2.2.5 =\n* Feature - Enable positions to be displayed in icons mode box score.\n* Tweak - Reflect mixed column order in player list admin.\n* Tweak - Remove table row border in frontend stylesheet.\n* Tweak - Automatically apply table adjustments on admin page load.\n* Tweak - Simplify box score icon totals.\n* Fix - Adjustments not applying to player list values.\n* Fix - Minutes not displaying in box score.\n* Fix - Player positions displaying not displaying in box score.\n* Fix - Total time displaying as 0:00.\n\n= 2.2.4 =\n* Feature - Option to show or hide career totals in player profiles.\n* Tweak - Icons not rendering when frontend stylesheet is active.\n* Tweak - Remove underline from icon links in frontend stylesheet.\n* Tweak - Change competition and season placeholders in events to \"None\".\n* Tweak - Enable horizontal scrolling on large tables in admin.\n* Fix - Equations returning zero when no events played.\n* Fix - Player lists and player profiles showing different statistics when filtered by competition or season.\n* Fix - Substitution icon not rendering for starting lineup players.\n* Fix - Manual player performance errors in profile.\n* Fix - Error in event results if team was deleted.\n* Fix - Remove deprecated function in PHP 7.0.\n* Fix - Non-numeric errors in PHP 7.1.\n\n= 2.2.3 =\n* Fix - Placeholders for non-numeric values in player list displaying as zero.\n\n= 2.2.2 =\n* Tweak - Center align form events.\n* Fix - Reverse form array to display events in chronological order.\n* Fix - Error in player lists when querying legacy events.\n* Fix - Manual values in player lists when no events have been played.\n\n= 2.2.1 =\n* Fix - Empty timeline error when calculating substitution time.\n\n= 2.2 =\n* Feature - New frontend stylesheet for third-party themes.\n* Feature - New chronological streak format in league tables.\n* Feature - Head to head tiebreaker option in league tables.\n* Feature - Add option to select number of players in player lists.\n* Feature - Quick edit player's team and squad number.\n* Feature - Bulk edit players' past and current teams.\n* Feature - Taxonomies added to REST API.\n* Feature - Ability to display event history in player profiles.\n* Feature - Event list format option added to player and team events.\n* Feature - Option to record minutes for specific statistics.\n* Feature - Time format added for racing and timed sports.\n* Feature - Dedicated option to redirect team pages to site URL.\n* Feature - Bulk action to generate team calendars.\n* Feature - Automatically adjust played minutes based on substitution times.\n* Feature - Match day column option added to event lists.\n* Tweak - Remove event limit in calendars.\n* Tweak - Allow player squad number to be zero.\n* Tweak - Enable mixing performance and statistic column order.\n* Tweak - Filter player statistic equations by offense and defense.\n* Tweak - System status hidden unless in debug mode.\n* Tweak - Move event list column options to sidebar.\n* Tweak - Return zero instead of error if dividing by zero.\n* Tweak - Always display performance icons in admin.\n* Tweak - Add preview notation in event blocks by default.\n* Tweak - Single player performance name option added for hover text in icons mode.\n* Fix - Player list precision number format error.\n* Fix - Player list adjustments for existing values.\n* Fix - Hide empty positions in player lists and galleries.\n* Fix - Import button selectors disappeared in WordPress 4.7.\n* Fix - Substitution time missing parentheses.\n* Fix - Staff for home team not being displayed in events.\n* Fix - Enable output of time and results without team names in home/away mode.\n* Fix - Prevent totals override in box scores.\n* Localization - Add Gibraltar nationality option and flag.\n\n= 2.1.7 =\n* Fix - Activation error on older versions of PHP.\n\n= 2.1.6 =\n* Feature - Add equation format option to player performance.\n* Tweak - Add text options to change tab labels.\n* Fix - Activation errors using TGMPA.\n* Fix - Empty footer column in team staff table.\n* Preset - Update basketball preset.\n\n= 2.1.5 =\n* Feature - Add option to filter players by current or past team in player lists.\n* Fix - Scheduled events not queried in REST API.\n\n= 2.1.4 =\n* Feature - Player and staff dropdown templates added to layout designer.\n* Tweak - Default tab labels from layout designer.\n* Tweak - Add \"Home\" and \"Away\" to text options.\n* Tweak - Add horizontal padding to centered event list columns.\n* Fix - Disable numeric slug generation for events due to permalink issues in some cases.\n* Fix - Permalink issues caused by filter for scheduled events.\n* Fix - Scheduled events being ignored by REST API.\n* Fix - Inconsistent styling of player and staff dropdowns.\n* Fix - Only include current players in player lists.\n* Fix - Age calculation in BuddyPress context.\n\n= 2.1.3 =\n* Tweak - Add options to select number, team, and position columns to player list shortcode.\n* Fix - Totals row offset in player statistics admin.\n* Fix - Events not automatically ordered by date in some cases.\n* Fix - Google Maps error when address is empty.\n* Fix - Player lists for all teams not appearing in team edit screen.\n* Fix - Error in player list when team no longer exists.\n* Fix - Error in event logos when results are empty.\n* Fix - Issue with link to future event from daily archive when multiple events are scheduled for a single day.\n\n= 2.1.2 =\n* Feature - Add offense and defense statistics to REST API.\n* Tweak - Hide template tabs with no content.\n* Tweak - Allow selection of player lists without teams.\n* Tweak - Center-align time/results when between home and away teams in event list.\n* Tweak - Increase checklist panel height in admin.\n* Tweak - Update text options.\n* Fix - Hidden box score columns still displaying when in offense/defense mode.\n* Preset - Update cricket preset.\n\n= 2.1.1 =\n* Feature - Add substitution times in box score.\n* Feature - Add text options to change template tab names.\n* Tweak - Automatically align home and away columns in event lists.\n* Fix - Box score minutes display issue.\n\n= 2.1 =\n* Feature - New simplified fixtures importer compatible with [LeagueLobster](http://tboy.co/leaguelobster).\n* Feature - Add match day field to events.\n* Feature - Add box score minutes to events.\n* Feature - Add option to display full time in event details.\n* Feature - Add inline and block option to event logos.\n* Feature - Add squad number and name option to player details.\n* Feature - Add tab options to layout designer.\n* Feature - Add option to display player and staff dropdowns in profiles.\n* Feature - Add option to select TBA, postponed, and canceled event status.\n* Feature - Licenses tab for third-party extensions.\n* Tweak - Get player data only when needed.\n* Tweak - Add capabilities to taxonomies.\n* Tweak - Display tutorials in main menu if user role is not admin or league manager.\n* Tweak - Use contextual strings for featured images.\n* Tweak - Enable meta query vars in REST API.\n* Tweak - Adopt new tab class names in admin.\n* Tweak - Inherit text color for event logo team text.\n* Tweak - New developers section on modules page with link to join [Slack community](http://tboy.co/slack).\n* Fix - Taxonomy links appearing in admin for users that can't edit events.\n* Fix - Debug error on non-standard admin pages.\n* Fix - REST API notice in Jetpack.\n\n= 2.0.16 =\n* Tweak - Add shortcode parameter to override global date in event calendar.\n\n= 2.0.15 =\n* Fix - Subversion issues.\n\n= 2.0.14 =\n* Fix - Use search mode in maps to prevent invalid parameter error.\n\n= 2.0.13 =\n* Fix - Google Maps embed code to reflect selected map type.\n* Fix - Countdown error when teams are not selected.\n\n= 2.0.12 =\n* Tweak - Add API key to Google Maps in admin.\n\n= 2.0.11 =\n* Tweak - Embed code to reflect change in Google Maps API.\n\n= 2.0.10 =\n* Tweak - Enable sortable tables on all devices.\n\n= 2.0.9 =\n* Feature - Display admin notice when user is not allowed to edit an item.\n\n= 2.0.8 =\n* Feature - Add shortcode parameter to filter event calendars by player.\n* Feature - Add text options to change age and birthday labels.\n\n= 2.0.7 =\n* Feature - Add option to show or hide logos or photos in event blocks.\n* Tweak - Combine reverse teams option for results and box score.\n* Fix - Add filter to template output for extensions.\n\n= 2.0.6 =\n* Tweak - Display squad numbers in defense section.\n* Tweak - Display shared values in both offense and defense sections and sync when editing event.\n\n= 2.0.5 =\n* Fix - Hide team column in player statistics for player-vs-player sports.\n\n= 2.0.4 =\n* Fix - Title generator in event importer.\n\n= 2.0.3 =\n* Tweak - Restore career total tables in player profiles.\n* Fix - Display sport and timezone selector after first installation.\n\n= 2.0.2 =\n* Fix - New events not saving with automatic titles when title is empty.\n* Fix - Event importer not importing new events.\n\n= 2.0.1 =\n* Fix - Some player statistics calculating as zero.\n\n= 2.0 =\n* Feature - Integration with [WP REST API](https://wordpress.org/plugins/rest-api/) by adding endpoints for viewing, creating, editing, and deleting SportsPress data.\n* Feature - New drag-and-drop layout designer for customizing events, teams, players, and staff pages.\n* Feature - Allow player biography to float next to photo in profile.\n* Feature - Add option to display separate offensive and defensive statistics in player profiles.\n* Feature - Add option to display career totals as a footer row in player statistics tables.\n* Feature - Add option to display event calendar or fixtures & results on team pages.\n* Feature - Add option to display time in event logos section when results are not ready.\n* Feature - Add global visibility settings to player statistic columns.\n* Feature - Add team, competition, league, and venue filter to event calendar, event list, and event blocks shortcodes.\n* Feature - Automatically re-order competitions, seasons, venues, positions, and jobs by slug.\n* Feature - New welcome page outlining notable changes to major plugin version.\n* Refactor - Change parameter for sp_get_next_event function to allow custom templating.\n* Tweak - Reverse team order also applies to admin.\n* Tweak - Hide squad number from defense box score.\n* Tweak - Use more compact labeling in player columns admin meta box.\n* Tweak - Update modules page to reflect new premium scoreboard module.\n* Tweak - Remove hardcoded protocol for calls to Google Maps scripts.\n* Tweak - Limit venue archives to events.\n* Tweak - Float team profile next to logo on team pages.\n* Tweak - Display league table and player list option in teams only when modules are active.\n* Tweak - Load profile and description meta boxes as native editors instead of custom methods.\n* Tweak - Load team abbreviations independent of post title filter.\n* Tweak - Add z-index to make header float above other elements.\n* Fix - Error when league table column has no equation.\n* Fix - Error when displaying checkboxes for manual event statistics.\n* Fix - Venues linking automatically in countdown widgets.\n* Fix - Styling issue where countdown widgets were pushed off-screen in some themes.\n* Fix - Avoid loading countdown widget if no events are available.\n* Preset - Update baseball, cricket, floorball, handball, ice hockey, and softball presets.\n\n= 1.9.20 =\n* Tweak - Expand event title section for team logos in countdown widget.\n* Tweak - Center align team logo images in event.\n* Tweak - Add iCal feed venue name and description.\n* Fix - Escape address, summary, and description in iCal feed.\n* Preset - Add ties and defense/offense definition to baseball preset.\n* Localization - Add West Indies to nationality options.\n* Localization - Update strings.\n\n= 1.9.19 =\n* Feature - Add Birthdays module.\n* Feature - Add Lazy Loading module.\n* Feature - Add separate offense and defense categories to player performance and box score.\n* Feature - Add format setting to player performance with the options Number and Text.\n* Feature - Add option to show and hide date and time in events.\n* Tweak - Improve compatibility between custom color settings and theme options.\n* Tweak - Add light shade to substitute rows in box score.\n* Tweak - Prevent box score section from appearing when event is set in the future.\n* Fix - Display icon setting in editor.\n* Fix - Empty variable button appearing in equation builder when equation is empty.\n* Preset - Update cricket preset with batting and bowling categories.\n\n= 1.9.15 =\n* Tweak - Add medium crop image size to ensure gallery images are square.\n* Tweak - Add shortcut icon to admin bar.\n* Fix - Mobile admin table cell width.\n* Fix - Tutorial tab styling.\n* Localization - Update Norwegian Bokmål and Turkish translations.\n\n= 1.9.14 =\n* Fix - Error appearing on team page in some cases when there are no competitions or seasons.\n* Localization - Update source language file.\n\n= 1.9.13 =\n* Feature - Add option to display positions in player lists.\n* Feature - Add option to show or hide player squad number and rank column.\n* Feature - Add ability to display staff members in team page.\n* Feature - Unique widget option added to hide widget when same as content.\n* Tweak - Get auto and manual league tables in team page.\n* Tweak - Add row numbers to league table and event list.\n* Tweak - Allow searching from middle of sport preset names.\n* Tweak - Remove deprecated settings from admin.\n* Tweak - Prevent unnecessary scrollbar from appearing under scrollable tables.\n* Tweak - Add spaces between results in event blocks widget.\n* Tweak - Default template positions adjusted to render main content first.\n* Tweak - Adjust checkbox column padding in admin.\n* Tweak - Prevent positions and jobs from automatically linking to archives.\n* Tweak - Adjust capabilities to allow team managers to edit venues.\n* Fix - Player gallery thumbnail size too small in some cases.\n* Fix - Competitive event icon in edit screen.\n* Fix - SportsPress widget icons not appearing in 4.4 admin.\n* Localization - Add demoyer to translation team.\n* Localization - Update Dutch translations.\n\n= 1.9.12 =\n* Tweak - Display team names and score template without logos.\n* Tweak - Validate hex color input.\n* Tweak - Add sp prefix to TGMPA notice to avoid conflict with other plugins.\n* Fix - Empty seasons displaying in player profiles.\n* Fix - Error on pages with no screen objects.\n* Localization - Add Tandor, muhahmetkara, elarequi, diego.battistella, and tkausch to translation team.\n* Localization - Update Polish, Tamil, German, Turkish, Spanish, Dutch, and Portuguese translations.\n\n= 1.9.10 =\n* Fix - Automatic event results calculating without player performance.\n* Localization - Update Turkish translation.\n\n= 1.9.9 =\n* Feature - Enable presets to define result equations.\n* Tweak - Move event logo settings to new section in admin.\n* Tweak - Disable custom colors by default.\n* Tweak - Display league tables and player lists as auto when not manual.\n* Fix - Prevent teams containing quotes to duplicate during import.\n* Fix - Enable importing with special characters in team and player names.\n* Fix - Check for zero in equation denominator contained within parenthesis.\n* Fix - Placeholder in admin indicating automatic result.\n* Preset - Update cricket preset.\n* Localization - Update Tamil translation.\n\n= 1.9.8 =\n* Feature - Option to add custom table headings to calendars, league tables, and player lists.\n* Tweak - Revert automatically hiding featured images when viewing teams, players, and staff.\n* Fix - Team site URL escaping links in admin.\n\n= 1.9.7 =\n* Fix - Escape text inputs in admin.\n* Localization - Update German translation.\n\n= 1.9.6 =\n* Feature - Venue subset to reflect statistics from a team's home venue.\n* Tweak - Use team order instead of venue to get home and away subset.\n* Tweak - Allow special HTML characters in player list fields.\n* Tweak - Relabel box score to scorecard.\n* Fix - Player list sorting by ascending squad number.\n* Localization - Add Ales70, Elmister, and chinnz25 to translation team.\n* Localization - Add Tamil (India) translations.\n* Localization - Update Persian, Finnish, Italian, Czech, Greek, Slovenian, and Polish translations.\n\n= 1.9.5 =\n* Fix - Streaks calculation in league tables.\n\n= 1.9.4 =\n* Feature - Add Home and Away subset options to table column equation builder.\n* Tweak - Display player and team checklists in admin only when Manual mode is enabled to improve performance.\n* Localization - Add mahdi12 to translation team.\n* Localization - Update Persian and Polish translation.\n\n= 1.9.3 =\n* Fix - Event results skipping some players in player list.\n\n= 1.9.2 =\n* Fix - Dynamic stats not being reflected in player lists.\n\n= 1.9.1 =\n* Fix - Add up statistics from multiple competitions and seasons in player list.\n* Fix - Use player metrics as default in player list.\n* Localization - Update Spanish translation.\n\n= 1.9 =\n* Feature - New Icons module containing vector icon options for player performance.\n* Feature - Add event results to equation builder.\n* Feature - Allow different page templates to be selected for each post type.\n* Feature - Add equation builder to automate event results based on player performance.\n* Feature - Allow Event Managers to edit venues.\n* Feature - Display post excerpts in templates.\n* Feature - Hide featured image if photo or logo is displayed.\n* Feature - Add default outcome condition for events with more than 2 teams.\n* Feature - Add option to display competition and season in player details.\n* Feature - Add Google map zoom option.\n* Feature - Add national flag option to player list.\n* Feature - Add competition and season filter to manually inserted calendar shortcodes.\n* Refactor - Move cricket functionality to free extension.\n* Tweak - Improve individual mode admin screens and functionality.\n* Tweak - Add styling to default event teams template.\n* Tweak - Add cell padding to admin edit table.\n* Tweak - Display position column only if positions exist.\n* Tweak - Display Performance as Box Score in all occurrences.\n* Tweak - Simplify sample data team names.\n* Tweak - Move League Table module to Teams section.\n* Tweak - Display column labels for time and results in split team mode.\n* Tweak - Lock variable names once published to prevent equations from breaking.\n* Tweak - Rename featured image meta boxes to reflect image type.\n* Tweak - Improve readability of equations in admin.\n* Tweak - Trim delimiter example when limit is more than 3 teams.\n* Tweak - Allow a team limit of 0 for unlimited teams per event.\n* Fix - Sample data generator for individual mode.\n* Fix - Overview hierarchy in individual mode.\n* Fix - Event delimiter sample output.\n* Fix - Error in league table when stats are empty.\n* Fix - Check if teams exist in countdown.\n* Preset - Add golf preset.\n* Preset - Recommend sport-specific extensions for cricket, golf, and football (soccer).\n* Localization - Update Greek and French translations.\n\n= 1.8.9 =\n* Feature - Enable multiple nationalities for players and staff.\n* Feature - Enable multiple seasons and competitions for league tables.\n* Feature - Enable multiple seasons, competitions, and positions for player lists.\n* Feature - Add custom title field and widget alignment option to shortcodes.\n* Feature - Add option to always increment league table position.\n* Fix - Import button on admin pages.\n* Fix - Update jQuery DataTables to version 1.10.8 props devilsaces.\n* Localization - Group translation team by language and display stats.\n* Localization - Add albpower, elgolden, mobking, wah826, iojvan, eifelstudio, deckerweb, denkuhn, green_big_frog, Flubber89, sododesign, webby1973, Laislebai, slappfiskene.no, AugustoNeto, lfrodines, GonerSTUDIO, cofeman.sl, i1m3a7n92, opticadeharo, and ViktoriaRuzhylo to translation team.\n* Localization - Update Polish, Finnish, Armenian, German, Slovenian, Italian, Czech, Dutch, Spanish, Romanian, and French translations.\n\n= 1.8.8 =\n* Feature - Add option to hide player and staff details.\n* Tweak - Ability to display multiple current teams in staff profile.\n\n= 1.8.7 =\n* Feature - Add custom table heading option to widgets.\n* Feature - Add random sorting to player gallery.\n* Feature - Add option to hide player list and league table titles.\n* Feature - Add heading option to player positions.\n* Tweak - Display Soccer (Association Football) as Football.\n* Tweak - Flush permalinks automatically when saving modules.\n* Tweak - Separate scrollable and responsive table options.\n* Tweak - Display event performance icon tables in 2 columns.\n* Fix - Duplicate league table captions in team page.\n* Preset - Add softball preset.\n* Localization - Add FollowCandyPanda to translation team.\n* Localization - Update Polish, Spanish, German, Norwegian, Dutch, Finnish, Russian, Armenian, and Czech translations.\n\n= 1.8.6 =\n* Tweak - Update modules page to reflect a change in offered features.\n* Fix - Team dropdowns disappearing when none found in the competition and season assigned to an event.\n* Localization - Update Russian translations.\n\n= 1.8.5 =\n* Fix - Error merging option arrays.\n* Localization - Add m4rsal to translation team.\n* Localization - Update Polish, Spanish, German, Norwegian, Dutch, and Finnish translations.\n\n= 1.8.4 =\n* Fix - Installation screen notice related to default color scheme.\n* Localization - Add vetsmi, ceyhunulas, pgbenini, paulcoppen, fernandori, wolforg, and chr86 to translation team.\n* Localization - Update Dutch, Spanish, Portuguese (Brazil), French, and German translations.\n\n= 1.8.3 =\n* Tweak - Settings page styling updated.\n* Tweak - New modules category added for admin-related dashboard modules.\n* Fix - Widget floating issue in some themes.\n* Fix - Timezones added to calendar feeds using blog timezone setting.\n* Fix - Event filters generating redundant queries.\n* Localization - Update Finnish, Norwegian, Turkish, Polish, Portuguese (Brazil), and Portuguese (Portugal) translations.\n\n= 1.8.2 =\n* Tweak - Make scrollable tables fill content width.\n* Tweak - Improve widget alignment precision.\n* Tweak - Remove paginate link default color.\n* Fix - Future event post permalinks not found.\n\n= 1.8.1 =\n* Feature - Ability to display multiple widgets on one line by aligning left and right.\n* Tweak - Increase league table row height only when logos are displayed.\n* Fix - Taxonomy selection not displaying in admin after WordPress 4.2 update.\n* Localization - Add nagashitw, jikji96, and edesl to translation team.\n* Localization - Update Czech, German, Finnish, Portuguese, Korean, Italian, and Spanish translations.\n\n= 1.8 =\n* Feature - Games Behind calculation added to equation builder.\n* Feature - Home Record and Away Record calculation added to equation builder.\n* Feature - Add option to reverse team order in events.\n* Tweak - Allow inline results editing only if user has permissions.\n* Tweak - Allow underscore in equation variable names.\n* Tweak - Update welcome page with free Rookie theme link.\n* Tweak - Group sport presets into more descriptive categories.\n* Tweak - Display module descriptions in admin.\n* Tweak - Combine player and staff modules.\n* Tweak - Move mode setting to event page.\n* Tweak - Add option to show only top-level positions in events.\n* Tweak - Change Rounding to Decimal Places for clarity.\n* Tweak - Change Player Performance to Box Score.\n* Tweak - Add proper editing capabilities to Team Manager role.\n* Fix - Empty positions hidden in box score.\n* Preset - Update baseball preset.\n* Localization - Add Kosovo to countries list.\n* Localization - Use standard localization functions to improve translatability.\n* Localization - Update Spanish and Japanese translations.\n\n= 1.7.7 =\n* Tweak - Add option to filter teams in event by competition and season with no filter as default setting.\n\n= 1.7.6 =\n* Fix - Modules sidebar not displaying in admin.\n\n= 1.7.5 =\n* Fix - Calendars empty when no teams selected.\n\n= 1.7.4 =\n* Feature - Filter teams by competition and season on page load when editing event.\n* Feature - Enable multiple team selection in calendars.\n* Feature - Ability to install free starter theme from modules page.\n* Tweak - Use YouTube for tutorials instead of Vimeo.\n* Localization - Update Finnish, Dutch, Czech, Italian, and Polish translations.\n\n= 1.7.3 =\n* Tweak - Add option to hide/show player statistics.\n* Tweak - Always load overview, widgets, and importers.\n* Fix - Notice displaying in player statistics when no players available.\n* Localization - Update Greek, Polish, Finnish, Dutch, and Icelandic translations.\n\n= 1.7.2 =\n* Fix - Player positions disappearing in event page.\n* Fix - Individual mode automatically loading by default.\n* Localization - Update Polish translation.\n\n= 1.7.1 =\n* Fix - Activation error related to server limitations.\n* Localization - Update Greek translation.\n\n= 1.7 =\n* Feature - Enable multiple seasons and competitions to be selected for events, calendars, player lists, and league tables.\n* Feature - Enable primary performance selection.\n* Feature - Enable event result columns to be displayed automatically.\n* Feature - Enable switching overview, widgets, and importers on and off via modules.\n* Feature - New color scheme selector.\n* Feature - New video tutorials module.\n* Feature - Allow event performance tables to be split by team and by player position.\n* Feature - Allow extras row to be displayed in event performance.\n* Tweak - Display event venue address below map.\n* Tweak - Display plugin and theme recommendations only to network admins.\n* Tweak - Hide player details section if none available.\n* Tweak - Link module request to form instead of email.\n* Fix - Responsive table scrollbar causing horizontal page scrolling.\n* Fix - Misplaced config meta boxes.\n* Fix - Scrollbar appearing in countdown widget.\n* Fix - Event blocks template not honoring link events setting.\n* Fix - League table position calculations for tied teams.\n* Fix - Filter out empty results when viewing events in admin list view.\n* Fix - Invalid array issue when viewing league tables.\n* Preset - Enable sport presets to define plugin options.\n* Preset - Update cricket and ice hockey presets.\n* Localization - Number changed to Squad Number.\n* Localization - Update Polish, French, Czech, Dutch, Kannada, Finnish, Swedish, German, Russian, Greek, Portuguese, and Japanese translations.\n\n= 1.6.1 =\n* Feature - Countdown moved to module and now able to display team logos.\n* Feature - Add option to show or hide event list titles.\n* Tweak - Display latitude and longitude fields when adding venues.\n* Fix - Calculating equations with nested parentheses.\n* Fix - Minor meta box mislabeling.\n* Preset - Add Lacrosse preset.\n* Localization - Update Polish, French, Czech, Dutch, Kannada, Finnish, and Swedish translations.\n\n= 1.6 =\n* Feature - New modules page to quickly toggle additional features.\n* Feature - Option to automatically populate player list and league table based on criteria.\n* Feature - Display link to CSV importer at the top of admin list pages.\n* Feature - Update jQuery dataTables to version 1.10.4.\n* Feature - Wrap responsive tables via script.\n* Feature - New API functions for team abbreviations.\n* Feature - Enable searching team names in event edit screen.\n* Refactor - Enable global setting to use plugin as team-vs-team or player-vs-player (beta).\n* Refactor - Use 3-letter FIFA country codes with fallback for 2-letter codes.\n* Refactor - Merge scrollable and responsive settings.\n* Tweak - Make AJAX shortcodes hookable for extensions and modules.\n* Tweak - Mode maps setting to events tab.\n* Tweak - Highlight jobs link in admin menu when editing a job.\n* Tweak - Hide theme notice from welcome pages.\n* Tweak - Prepend prefix to frontend CSS selectors.\n* Tweak - Change Team Results to Event Results.\n* Tweak - Display result rows only for teams that have been selected.\n* Fix - League table displaying zeroes when competition is selected and season is set to all.\n* Fix - Notice when players don't exist in event.\n* Fix - Career totals not displaying in player profiles.\n* Fix - Player performance displaying rows when no team is selected.\n* Fix - Events linking in countdown widget and event list when option is turned off.\n* Fix - Option to hide event blocks title.\n* Fix - Event logos displaying different images when teams are not selected.\n* Preset - Add default labels for overtime in baseball and basketball presets.\n* Preset - Add Counter-Strike: Global Offensive preset.\n* Localization - Update list of countries for nationality selection.\n\n= 1.5 =\n* Feature - New inline quick result editing for events.\n* Feature - Automatically detect event outcome based on user-defined conditions.\n* Feature - Enable individual players to compete in events.\n* Feature - Add new API functions for theme developers.\n* Feature - Add event list time/results formatting options.\n* Feature - Add option to display player career totals.\n* Feature - Add option to display team logos in event lists.\n* Feature - Add option to display venue in event blocks.\n* Feature - Split iCal feed links for Apple Calendar, Google, and Outlook.\n* Refactor - Move Staff to dedicated menu link.\n* Refactor - Load sportspress.php template as a fallback only.\n* Tweak - Add caption header to event blocks.\n* Tweak - Add selector classes to event venue rows.\n* Tweak - Remove line breaks after template output.\n* Tweak - Disable responsive event performance when icons are shown.\n* Tweak - Update default color scheme.\n* Tweak - Update player gallery thumbnail markup.\n* Tweak - Sort Player positions dropdown by slug.\n* Tweak - Frontend styling to add margins and fix overflows.\n* Fix - Countdown datetime format.\n* Fix - Page slug conflict with SendPress.\n* Fix - Missing sample event video link.\n* Fix - iCal feed formatting when venue location is not set.\n* Preset - Update presets to include automatic outcome conditions.\n* Localization - Add Puerto Rico to countries list.\n* Localization - Update Polish, German, Spanish, Russian, Finnish, Italian, Armenian, Greek, Dutch, Turkish, French, and Bengali translations.\n\n= 1.4.7 =\n* Feature - New staff shortcode and widget to display staff photo and details.\n* Tweak - Display player photo in player details shortcode.\n* Tweak - Sample event csv to reflect soccer preset.\n* Fix - Saving a manual offset timezone.\n* Preset - Add player positions to volleyball preset.\n* Localization - Update Turkish, Italian, Polish, Finnish, and French translations.\n\n= 1.4.6 =\n* Tweak - Include all events that have results in league table calculations.\n* Fix - Duplicate Jobs selector in Edit Staff page.\n* Preset - Update basketball preset column priorities.\n* Localization - Update Finnish, Polish, Italian, Greek, Dutch, Turkish, and Russian translations.\n\n= 1.4.5 =\n* Fix - Away team players not being displayed without players in home team.\n* Fix - Primary team results always using default setting.\n* Localization - Update Finnish and Spanish translations.\n\n= 1.4.4 =\n* Feature - Automatically select event venue based on home team.\n* Fix - Featured images not displaying in some themes.\n* Preset - New Floorball preset.\n* Localization - Update Finnish and Armenian translations.\n\n= 1.4.3 =\n* Tweak - Update API functions for events and teams.\n* Tweak - Update sample video links.\n* Fix - Remove calendar link background color for more consistent styling.\n* Localization - Update Finnish, Italian, Russian, and Spanish translations.\n\n= 1.4.2 =\n* Tweak - Remove solid color from base stylesheet to improve integration.\n\n= 1.4.1 =\n* Fix - League table positions not sorting by sort order.\n\n= 1.4 =\n* Feature - New welcome page with intro video and separate tabs.\n* Feature - New iCal feeds for event calendars.\n* Feature - Add date range selector to event calendars.\n* Feature - Ability to insert sample data during installation.\n* Feature - Assign teams same position in league table when all values are tied.\n* Feature - Display time/results between home and away teams in event list.\n* Feature - Theme-specific stylesheets to apply when third-party theme is active.\n* Feature - Make event lists sortable.\n* Feature - Add team and event logo templates.\n* Feature - Add player and staff photo templates.\n* Feature - Option to hide Rank column in player lists.\n* Feature - Option to toggle frontend templates per post type.\n* Feature - Option to use abbreviated team names.\n* Feature - Option to enable comments in events articles.\n* Refactor - Change label for League to Competition.\n* Tweak - Bold and apply class to highlighted team name in league table.\n* Tweak - Remove team from venue hierarchy in overview.\n* Tweak - Admin editor styles to match WordPress 4.0 inline editor.\n* Tweak - Display performance icons in admin.\n* Tweak - Change default sport to Custom.\n* Tweak - Display none when no team available for player.\n* Tweak - Permanently delete config post types when sent to trash.\n* Tweak - Add hooks to widgets, shortcodes, and templates for integration.\n* Fix - Display team checkbox only once in player admin.\n* Fix - CSV team importer not saving all fields.\n* Preset - Adjust player positions in sport presets.\n* Preset - Add Bats / Throws metric to Baseball preset.\n* Preset - Add Bat brand metric to Cricket preset.\n* Localization - Make Video and Current Teams translatable.\n* Localization - Auto-load RTL stylesheet.\n* Localization - Include only compiled languages to reduce overall size.\n* Localization - Apply text options to translations.\n* Localization - Update Dutch, French, Armenian, Russian, Croatian, German, Greek, Thai, Japanese, Bosnian, Turkish, Spanish, Arabic, Italian, and Polish translations.\n\n= 1.3.2 =\n* Integration - WPML compatibility.\n* Feature - Option to set number of columns in player gallery.\n* Tweak - Remove line break after templates.\n* Tweak - Update plugin icon.\n* Tweak - Update welcome screen badge.\n* Tweak - Display admin menu label as Players & Staff.\n* Fix - Typo in sample CSV import file.\n* Fix - Apply default color scheme when left blank.\n* Fix - Notices where taxonomies or posts not found.\n* Localization - Update source strings.\n* Localization - Update French and Dutch translations.\n\n= 1.3.1 =\n* Fix - Player list shortcode meta displayed on league table edit page.\n* Localization - Update Dutch translation.\n\n= 1.3 =\n* Feature - New overview page with interactive sitemap.\n* Feature - New and improved CSV import tools for bulk adding.\n* Feature - New full time minutes setting in events for statistics calculation.\n* Feature - New roles taxonomy for staff.\n* Feature - Option to display home/away teams in event lists.\n* Feature - Option to display league and season in event blocks.\n* Feature - Option to choose all leagues and seasons in league table.\n* Feature - Option to choose all leagues and seasons in player list.\n* Feature - Choose between displaying values and icons in event player performance.\n* Feature - Option to display photos in player list.\n* Feature - Filter players by league and season in admin.\n* Feature - Select a team to highlight in league tables.\n* Feature - Display league tables in team pages.\n* Feature - Display total statistics per player.\n* Feature - Add team option to countdown widget.\n* Feature - Add scrollable tables option.\n* Feature - Ability to adjust overall table columns per team.\n* Refactor - Remove individual mode in favor of upcoming hybrid.\n* Refactor - Use global linking options per post type.\n* Refactor - Display player position in profile.\n* Tweak - Reorganize settings options.\n* Tweak - Update SportsPress icon.\n* Tweak - Rename widgets for better usability.\n* Tweak - Add div wrappers to templates for easier targeting.\n* Tweak - Show or hide admin checkboxes based on event format.\n* Tweak - Make event list and blocks pagination independent.\n* Tweak - Trim admin table padding.\n* Tweak - Display all event performance columns by default.\n* Fix - Event list results column not always displaying.\n* Preset - New Rugby Union preset.\n* Preset - New League of Legends preset.\n* Preset - New DotA 2 preset.\n* Preset - Group into traditional sports and esports.\n* Preset - Add missing primary results and column priorities.\n* Localization - Fix multilingual post linking.\n* Localization - Thai translation by Xyteton.\n* Localization - Add Xyteton, tyby94, & SilverXp to translation team.\n* Localization - Update translations from Transifex.\n\n= 1.2.8 =\n* Preset - Add water polo preset.\n* Localization - Add Macedonian translations.\n* Localization - Update Armenian, Bulgarian, Finnish, German, Greek, Japanese, & Norwegian translations.\n\n= 1.2.7 =\n* Fix - Responsive table columns hidden when script active.\n* Localization - Update Finnish & German translations.\n\n= 1.2.6 =\n* Fix - Number format rounding issue.\n\n= 1.2.5 =\n* Fix - Data calculations for values above 1000.\n* Localization - Update French, Finnish, Dutch, Greek, & Armenian translations.\n\n= 1.2.4 =\n* Fix - Team URL and abbreviation not saving when adding new team.\n* Localization - Update Armenian, Finnish, French, & German translations.\n\n= 1.2.3 =\n* Feature - Display event results in admin teams columns.\n* Tweak - Ensure teams are in order in event results.\n* Fix - Streaks calculator in league tables.\n* Fix - Streaks calculator in team columns.\n* Localization - Update German, Greek, & Norwegian translations.\n\n= 1.2.2 =\n* Tweak - Display link to docs instead of themes.\n* Fix - Enable hide theme support notice.\n* Fix - Typo in table caption classes.\n\n= 1.2.1 =\n* Feature - Enable option to display team's total player performance per event.\n* Tweak - Order player gallery positions by slug.\n* Tweak - Remove unused Played column setting from Player List widget.\n* Fix - League Table widget columns setting independent from post setting.\n* Fix - Event List widget columns setting not being applied.\n* Fix - Row limits in League Table, Player List, & Event List shortcodes.\n* Localization - Update Armenian, Finnish, & French translations.\n\n= 1.2 =\n* Feature - Shortcode dropdown menu added to page and post editor.\n* Feature - New shortcodes added to individual player profiles.\n* Tweak - Add timezone setting in place of base country.\n* Localization - Update translations.\n\n= 1.1.8 =\n* Tweak - Order player list positions by slug.\n* Tweak - Wrap templates with div for frontend styling.\n* Fix - Date format in sample events CSV.\n* Localization - Fix WPML duplicate posts.\n* Localization - Update Armenian, Finnish, French, German, Norwegian, & Spanish translations.\n\n= 1.1.7 =\n* Fix - Inconsistent country code for Wales.\n* Fix - Localize post date month names.\n* Fix - Warning message when changing mode on welcome page.\n* Localization - Update Armenian, French, Italian & Norwegian translations.\n\n= 1.1.6 =\n* Fix - Maps not loading in admin.\n\n= 1.1.5 =\n* Tweak - Wrap post content with div for easier templating.\n* Localization - Update French translation.\n* Localization - Update Spanish translation.\n\n= 1.1.4 =\n* Feature - Add home venue option in team admin.\n* Tweak - Move editor meta boxes to bottom of post edit page.\n* Tweak - Remove link to league and season archives.\n* Fix - Previous and next post function in some themes.\n* Fix - Duplicate team checkboxes in player.\n* Preset - Add table tennis preset.\n* Preset - Update ice hockey preset.\n\n= 1.1.3 =\n* Fix - Display all event result columns by default.\n\n= 1.1.2 =\n* Feature - Event outcome abbreviation for streak column.\n* Fix - League table calculations for constants with 2 or more digits.\n* Preset - Add ice hockey preset.\n* Preset - Add volleyball preset.\n* Localization - Update Armenian translation.\n* Localization - Update Finnish translation.\n* Localization - Update German translation.\n\n= 1.1.1 =\n* Tweak - Check if equation is attempting to divide by zero to prevent errors.\n* Fix - Player statistics meta box message.\n* Preset - Make baseball preset appear in dropdown.\n\n= 1.1 =\n* Feature - Enable individual sport mode.\n* Feature - Enable displaying player lists on team pages.\n* Feature - Enable player performance reordering in events.\n* Feature - Enable changing player numbers and positions per event.\n* Feature - Add date selector to display today's events and this week's events in calendar.\n* Feature - Option to redirect team permalinks to official team website instead of team page.\n* Feature - Display staff in event performance section.\n* Feature - Add column selector to player profiles and player lists.\n* Feature - Add option to show or hide player performance section in events.\n* Feature - Add global padding option to SportsPress settings.\n* Tweak - Force decimals to display when precision is set.\n* Tweak - Add SportsPress post types to At a Glance section in dashboard.\n* Tweak - Filter checklists by league and season.\n* Tweak - Display layout type in admin.\n* Tweak - Improve roles and permissions.\n* Fix - Some select all checkboxes defaulted to being checked.\n* Refactor - Use gettext filter to alter frontend text.\n* Preset - Add American Football preset.\n* Preset - Add Australian Rules Football preset.\n* Preset - Add baseball preset.\n* Preset - Add cricket preset.\n* Preset - Add darts preset.\n* Preset - Add handball preset.\n* Preset - Add netball preset.\n* Preset - Add Rugby League preset.\n* Preset - Add squash preset.\n* Preset - Add tennis preset.\n* Preset - Update soccer preset.\n* Localization - Armenian translation by ArtakEVN.\n* Localization - Update translations.\n\n= 1.0.4 =\n* Fix - Shorthand php notation removed for better compatibility.\n* Localization - Update Finnish translation.\n* Localization - Update Greek translation.\n\n= 1.0.3 =\n* Tweak - Hide theme integration notice.\n\n= 1.0.2 =\n* Fix - Initialize columns array in player list class.\n\n= 1.0.1 =\n* Fix - Conditional install error relating to post types function.\n\n= 1.0 =\n* Feature - New drag and drop equation builder.\n* Feature - Add team website link in admin.\n* Feature - Enable searching for post user when there are more than 10.\n* Feature - New event manager role that can publish and manage events only.\n* Tweak - Fix league table alignment and responsive height.\n* Tweak - Set maximum size of event blocks logos.\n* Tweak - Add option to link venues in event list.\n* Tweak - Remove margin between table and scrollbar.\n* Tweak - Display delimiter between team logos under event title.\n* Tweak - Hide media, comments, and tools from feature limited users.\n* Tweak - Hide previous and next post links for custom post types.\n* Tweak - Rounding explicitly displays all decimal places.\n* Refactor - Combine players and staff in admin menu.\n* Fix - Duplicate team logos in event blocks.\n* Fix - Query future events for next team event.\n* Fix - Live countdown in admin dashboard.\n* Fix - Display all current teams in player profile.\n* Localization - Norwegian Bokmål translation by sijo.\n* Localization - Update translations.\n\n= 0.9.4 =\n* Tweak - Force delete preset variables when switching sports in settings.\n* Fix - Apply player gallery limit.\n* Fix - Display localized team results string.\n* Refactor - Use more common thumbnail sizes.\n* Localization - Portuguese (Portugal) translation by Andrew_Melim.\n\n= 0.9.3 =\n* Fix - Player list columns not displaying.\n\n= 0.9.2 =\n* Fix - Duplicate editor fields in team edit screen.\n\n= 0.9.1 =\n* Tweak - Add text domain to configure descriptions.\n* Tweak - Change default country to US.\n* Fix - Event block results display for teams without logos.\n\n= 0.9 =\n* Feature - Import tool added for importing staff from CSV file.\n* Feature - Add checkboxes to select player statistics columns.\n* Feature - Add option to select Google Map type.\n* Feature - Add option to display team logos under event title.\n* Feature - Enable player metrics and statistics selection in player list widget.\n* Feature - Enable linking event blocks and event list to team pages.\n* Tweak - Move leagues and seasons to SportsPress submenu.\n* Tweak - Use singular post type slugs by default for consistency with WP core.\n* Tweak - Remove alternate color in favor of link color setting.\n* Tweak - Enable scrollable tables to prevent overflow.\n* Tweak - Add helper text to venue location picker.\n* Tweak - Adjust markup and remove link in league table caption.\n* Tweak - Insert group name anchors to player list.\n* Tweak - Display post type counts in system status.\n* Fix - Event list results calculation when team column unchecked.\n* Fix - Display player group names.\n* Preset - Add snooker preset.\n* Localization - Finnish translation by JuKi and hanro.\n* Localization - Chinese translation by dic_2008.\n* Localization - Dutch translation by valentijnreza.\n\n= 0.8.6 =\n* Fix - Issue adding teams to events.\n\n= 0.8.5 =\n* Fix - Issue saving new venues.\n\n= 0.8.4 =\n* Feature - Add option to limit number of teams per event.\n* Feature - Show venue option in Countdown widget.\n* Feature - Enable multiple current teams per player.\n* Feature - Format performance data for use in templates.\n* Feature - Add next event function to team for template.\n* Refactor - Adjust theme template loader for venues and seasons.\n* Tweak - Replace featured image text in admin.\n* Tweak - Use wider map zoom setting.\n* Tweak - Make SportsPress tables full width by default.\n* Fix - Team filter in admin.\n* Fix - Displaying 1 view as plural.\n\n= 0.8.3 =\n* Feature - Enable using events started and substituted in statistics equations.\n* Tweak - Remove deprecated MySQL version function from System Status page.\n* Fix - Adjust styling to display select boxes in admin.\n\n= 0.8.2 =\n* Fix - Add content in main loop only.\n\n= 0.8.1 =\n* Tweak - Output player statistics in system status.\n* Tweak - Prepend templates to content instead of outputting directly.\n* Fix - Enable metrics usage in individual player statistics.\n\n= 0.8 =\n* Feature - New shortcode event_results.\n* Feature - New shortcode event_details.\n* Feature - New shortcode event_performance.\n* Feature - New blocks layout to display calendars in fixtures/results style.\n* Feature - New player statistics calculate values using performance and metrics.\n* Feature - New staff profiles.\n* Feature - New System Status screen in admin.\n* Feature - Add status selector to calendars and event widgets.\n* Feature - Add ability to display statistics and metrics in player lists.\n* Feature - Add time/results column to event list.\n* Feature - Link WP user roles with players and staff.\n* Feature - Display player substitutions in event page.\n* Feature - Option to group player lists by position.\n* Feature - Option to display outcomes in event results.\n* Refactor - Player profiles now use statistics and performance.\n* Refactor - Split admin CSS files for better performance.\n* Tweak - Display player numbers in admin.\n* Tweak - Move SportsPress settings to top-level page.\n* Tweak - Link date to event page in event list.\n* Tweak - Load Google Maps script only when needed.\n* Tweak - Add descriptions to configure screen for clarity.\n* Tweak - Create dedicated settings tab for text settings.\n* Tweak - Remove redundant border from pagination table.\n* Tweak - Display players and teams as total count in admin.\n* Fix - Display player number when 0 or 00.\n* Fix - Enable changing variable name or key from quick edit.\n* Fix - Team data saving issue.\n* Fix - Display all future events in venue archive.\n* Fix - Display all metrics instead of filtering by position.\n* Localization - Croatian translation by i__k.\n* Localization - Greek translation by Spirossmil.\n* Localization - Portuguese (Brazil) translation by rochester.\n* Localization - Russian translation by Selskei.\n* Localization - Slovenian translation by BOCo.\n* Localization - Update translations.\n\n= 0.7.4 =\n* Feature - Shortcode added to display single event content.\n* Tweak - Display default shortcode format when editing a calendar or player list.\n* Tweak - Add backwards compatibility for shortcodes prior to version 0.7.\n* Fix - Template hook to change display strings in admin.\n\n= 0.7.3 =\n* Feature - Enable editing Key field in Metrics and Performance.\n* Tweak - Lighter default color scheme.\n\n= 0.7.2 =\n* Fix - Update missing assets.\n\n= 0.7.1 =\n* Fix - Activation error preventing new installation.\n\n= 0.7 =\n* Feature - Welcome page to display on activation.\n* Feature - Frontend color scheme selection.\n* Feature - Custom CSS option.\n* Feature - Add venue column to event list.\n* Feature - Manual point adjustments added to league tables.\n* Feature - Enable table pagination.\n* Feature - Enable live countdown setting.\n* Refactor - Only load required classes to improve performance.\n* Refactor - Change statistic to performance.\n* Refactor - Soft deprecate sportspress prefixed functions in favor of sp prefix.\n* Tweak - Filter players in events by current team.\n* Tweak - Separate admin styles to improve load times.\n* Tweak - Add margin above view all link in widgets.\n* Tweak - Group text options by context.\n* Tweak - Display event details in standard table markup for style consistency.\n* Tweak - Display venue as a table for style consistency.\n* Tweak - Hide individual player performance when players not selected.\n* Fix - Responsive league table glitch.\n* Fix - Warning messages when adding new team, player, or event.\n* Fix - Countdown widget when event is selected.\n* Fix - Multiple select box height glitch in some browsers fixed.\n* Localization - Arabic translation by Abdulelah.\n* Localization - German translation by Bhelpful2.\n* Localization - Update Swedish translation by JensZ.\n\n= 0.6.2 =\n* Feature - Add options to make tables responsive and sortable.\n* Feature - Use consistent shortcode naming with backwards compatibility.\n\n= 0.6.1 =\n* Feature - Display full event results on hover over main team result in admin.\n* Feature - Add option to choose delimiter to use between team names in event titles.\n* Tweak - Adjust text options to modify front-end only.\n* Fix - Responsive league table output and styling.\n\n= 0.6 =\n* Feature - New events shortcodes: countdown, events-calendar, and events-list.\n* Feature - New teams shortcode: league-table.\n* Feature - New players shortcodes: player-list and player-gallery.\n* Feature - Display available shortcodes in post edit screen.\n* Feature - Add new settings page to change default text output.\n* Feature - Add new section to permalinks settings to change post and term slugs.\n* Tweak - Display teams as link list in admin page for league table teams columns.\n* Tweak - Vertically align team logos in league table.\n* Fix - Check if player belongs to leagues to avoid warnings in player profile.\n* Fix - Total player statistics calculation in events.\n* Fix - Responsive tables in event details and outcomes.\n* Fix - Display players from all seasons or leagues when none have been created.\n\n= 0.5 =\n* Feature - Import tool added for importing events from CSV file.\n* Feature - New post type Calendar added.\n* Feature - League and Friendly format options added to events.\n* Feature - List and Gallery format options added to player lists.\n* Feature - Calendar and List format options added to calendars.\n* Feature - Options added to turn on and off player list columns.\n* Feature - Options added to player list widget to limit rows and display link to view all players.\n* Feature - Options added to calendar widget to filter events.\n* Feature - New widget Events List added.\n* Feature - New widget Player Gallery added.\n* Refactor - Use singular slugs for secondary post types.\n* Tweak - Add tooltips to icons in admin table headings.\n* Tweak - Style event results in admin events list. \n* Tweak - Separate event date and time in admin events list.\n* Fix - Enable custom post type sorting in admin.\n* Fix - Added check before displaying deleted posts in league tables and player lists.\n* Fix - Adjust Select All filter in player lists and league tables.\n\n= 0.4.3 =\n* Feature - Enable selecting multiple outcomes per team per event.\n* Tweak - Use icons in dashboard column labels for teams and roster.\n* Tweak - Mark current team with check icon in admin player table.\n* Fix - Check that selected columns are in array to avoid warning.\n* Localization - Add Czech translation.\n* Localization - Add Slovak translation.\n* Localization - Add Polish translation by karimjarro.\n\n= 0.4.2 =\n* Feature - Enable selecting columns to display in single league table.\n* Feature - Add options to limit rows, display logos, and display full table link.\n* Feature - Add option to display national flags in player profiles.\n* Refactor - Group Players and Staff under Roster menu group.\n* Tweak - Reorder default player profile content.\n* Tweak - Display player number before page title instead of metrics section.\n* Tweak - Display player metrics as definition list instead of table.\n* Fix - Check if static player list is array to avoid warning message.\n\n= 0.4.1 =\n* Tweak - Activate checkbox when all players are added to player list.\n* Fix - Function date_diff added for PHP < 5.3.\n* Localization - Swedish translation by JensZ.\n\n= 0.4 =\n* Feature - SportsPress Status dashboard widget added to display number of events and countdown in admin.\n* Feature - New dashboard menu icons.\n* Feature - More intuitive player edit screen.\n* Feature - Enable spreadsheet style keyboard navigation in admin data tables.\n* Feature - Add hover action on league table team names to edit display name.\n* Refactor - Remove min and max outcome options from column equation.\n* Refactor - Change Rounding precision to default to 0.\n* Tweak - Used jQuery Chosen for inputs where useful.\n* Tweak - Prepend plugin name to widget titles.\n* Tweak - Highlight settings in admin menu when adding new config post type.\n* Tweak - Display Events as Schedule in admin sidebar menu.\n* Tweak - Update widget descriptions.\n* Tweak - Remove unused external class eqGraph.\n* Tweak - Display sort order priority options for number of columns available.\n* Fix - Apply table column rounding when precision is set.\n* Fix - Display event results on events page when available.\n* Fix - Check that event results are available before displaying a warning under certain conditions.\n* Fix - Namespace eqEOS class to avoid conflict with other plugins.\n* Localization - Use specific strings instead of dynamic ones for more accurate translations.\n* Localization - Use generic strings where appropriate.\n* Localization - Update German translation.\n* Localization - Update Spanish translation.\n* Localization - Update French translation.\n* Localization - Update Italian translation.\n* Localization - Update Japanese translation.\n\n= 0.3.3 =\n* Feature - Add default sorting options per player list.\n* Feature - Add option to sort player list alphabetically by name or by default.\n\n= 0.3.2 =\n* Feature - Add England, Scotland, Northern Ireland, and Wales to countries selector.\n* Feature - Enable searching for countries in dropdown.\n\n= 0.3.1 =\n* Feature - Import tool added for importing teams from CSV file.\n* Tweak - Added option to select custom sport and enter sport name.\n* Tweak - Display player number under photo in admin screen.\n* Tweak - Positions, Leagues, and Seasons columns added to player import tool.\n* Tweak - Styled SportsPress setup notice.\n* Refactor - Sum changed to Total in player statistic calculation settings.\n\n= 0.3 =\n* Feature - Import tool added for importing players from CSV file.\n* Feature - Add ability to select \n* Tweak - Display current team indicator in players admin screen.\n\n= 0.2.10 =\n* Fix - Team filtering in events, tables, players, and lists.\n* Tweak - Display statistics for all league/season events played in player profiles and player lists.\n* Tweak - Count events as played when in starting lineup or made substitution.\n* Tweak - Display player metrics only when value is set.\n\n= 0.2.9 =\n* Feature - Ability to select players from all teams in player list.\n* Fix - Decimal sorting in league tables and player lists.\n\n= 0.2.8 =\n* Feature - Add player list widget.\n* Localization - Add German translations.\n* Localization - Add Spanish translations.\n* Localization - Add Italian translations.\n\n= 0.2.7 =\n* Feature - Select columns to display in league table widget.\n* Tweak - Start league table positions at 1 instead of 0.\n\n= 0.2.6 =\n* Localization - Add French translations.\n* Preset - Update soccer preset.\n\n= 0.2.5 =\n* Fix - Update deprecated function to prevent error in Player Lists.\n\n= 0.2.4 =\n* Feature - Display venue map on event page and venue archive.\n* Fix - Add checks to prevent league table dividing by zero when no events have been played.\n* Fix - Flush rewrite rules for taxonomies on activation.\n* Tweak - Sort sports presets alphabetically by localized name.\n\n= 0.2.3 =\n* Feature - Enable selecting main event result.\n* Feature - Add Last 5 counter to table columns.\n* Localization - Update Japanese translations.\n* Preset - Complete American Football preset.\n\n= 0.2.2 =\n* Feature - League Table widget added.\n* Feature - Recent Events widget added.\n* Feature - Future Events widget added.\n* Feature - Countdown widget added.\n* Fix - Syntax error fixed for PHP version 5.2 and below.\n* Tweak - Editor section added to League Tables and Player Lists.\n\n= 0.2.1 =\n* Feature - Events Calendar widget added.\n* Fix - Player settings table markup fixed.\n* Tweak - Refine custom post type capabilities for user roles.\n\n= 0.2 =\n* Feature - Add option to select whether statistics are calculated as a sum or average.\n* Feature - Enable pageview tracking for posts and custom post types.\n* Feature - Responsive datatables.\n* Fix - Add site admin capabilities for multisite.\n* Fix - Force numerical sorting of number column.\n* Tweak - Enable SportsPress content functions to be called without explicit ID.\n* Tweak - Remove redundant admin menu links via filter.\n\n= 0.1.7 =\n* Feature - Enable selecting venues to use uploaded images.\n\n= 0.1.6 =\n* Tweak - Activate per post type permissions.\n* Tweak - Give admin all permissions for custom posts.\n\n= 0.1.5 =\n* Tweak - Remove flag images to lighten download size.\n\n= 0.1.4 =\n* Fix - All Plugin-Check warnings.\n* Tweak - Split templates into files in subdirectory.\n* Tweak - Simplify gettext filters.\n\n= 0.1.3 =\n* Fix - Style conflict with Foundation framework in table columns.\n* Feature - HTML output added to custom post types with data table sorting.\n* Feature - Enable metrics and statistics per player position.\n* Feature - Save team played per season per league in player edit screen.\n* Feature - Give teams the option to show and hide past seasons.\n* Feature - Venues, Seasons, and Leagues added as taxonomies.\n* Feature - Add L10 counter to report last 10 outcomes.\n* Feature - Add STRK counter to report current outcome streak.\n* Localization - Add country names in Czech, German, Spanish, French, Italian, Japanese, Polish, Russian, and Slovak.\n\n= 0.1.2 =\n* Tweak - Use custom post types for metrics and statistics configuration.\n* Feature - Display HTML tables when viewing League Table and Player List post types.\n* Feature - Link player and team names to single post pages.\n* Feature - Register default configuration for soccer.\n* Feature - Sort league table and player list by priority.\n\n= 0.1.1 =\n* Tweak - Update description.\n\n= 0.1 =\n* Alpha release for first look and testing.\n"
  },
  {
    "path": "dummy-data/event-performance-sample.csv",
    "content": "Player,Goals,Assists,Yellow Cards,Red Cards\nDee Callery,0,1,0,0\nRomeo Melvin,2,0,1,0\nTy Carrell,0,2,0,0\nAlonzo Ohalloran,1,1,0,0\nNelson Giddings,1,0,0,1\nEllis Nicholls,0,1,0,0\nCorey Kirk,0,0,1,0\nSpencer Duncan,0,0,0,1\n"
  },
  {
    "path": "dummy-data/events-sample.csv",
    "content": "Date,Time,Venue,Teams,Results,Outcome,Players,Goals,Assists,Yellow Cards,Red Cards\r2015/01/20,14:15:00,Little Park,Eagles,1|3|4,Win,Joe Allen,0,1,0,0\r,,,,,,David Hardy,2,0,1,0\r,,,,,,Jude Murray,0,2,0,0\r,,,,,,Isaac Hall,1,1,0,0\r,,,,,,Nathan Knowles,1,0,0,1\r,,,Sharks,2|0|2,Loss,Daniel Sturridge,1,0,1,0\r,,,,,,Jake Price,0,0,1,1\r,,,,,,Owen Goodwin,1,2,0,0\r,,,,,,Dylan Gray,0,0,1,0\r,,,,,,Zachary Noble,0,0,2,0\r2015/01/24,16:00:00,Big Stadium,Kangaroos,1|1|2,Draw,Steven Gerrard,0,0,0,0\r,,,,,,Gabrielle Gonzalez,1,0,1,0\r,,,,,,Harrison Hancock,0,2,0,0\r,,,,,,Reece Reeves,1,0,0,0\r,,,,,,Edward Colier,0,0,0,1\r,,,Eagles,0|2|2,Draw,Joe Allen,1,0,3,0\r,,,,,,David Hardy,0,0,1,1\r,,,,,,Ellis Nicholls,0,1,0,0\r,,,,,,Corey Kirk,0,0,1,0\r,,,,,,Isaac Hall,1,1,2,0\r2015/03/14,16:00:00,Little Park,Sharks,2|0|2,Loss,Daniel Sturridge,1,0,1,0\r,,,,,,Jake Price,1,0,0,0\r,,,,,,Owen Goodwin,0,1,0,0\r,,,,,,Dylan Gray,0,1,1,0\r,,,,,,Henry Chadwick,0,0,0,1\r,,,Eagles,1|2|3,Win,Joe Allen,1,1,0,0\r,,,,,,David Hardy,0,0,1,0\r,,,,,,Jude Murray,1,0,1,0\r,,,,,,Corey Kirk,1,1,0,0\r,,,,,,Spencer Duncan,0,0,0,1\r2016/12/10,13:00:00,Little Park,Eagles,,,,,,,\r,,,Kangaroos,,,,,,,\r2017/05/05,12:00:00,Big Stadium,Sharks,,,,,,,\r,,,Kangaroos,,,,,,,"
  },
  {
    "path": "dummy-data/fixtures-sample.csv",
    "content": "Date,Time,Venue,Home,Away\r\n2017/01/20,14:30:00,Little Park,Eagles,Sharks\r\n2017/01/24,16:00:00,Big Stadium,Kangaroos,Eagles\r\n2017/02/14,16:15:00,Little Park,Sharks,Eagles\r\n2017/03/05,13:00:00,Little Park,Eagles,Kangaroos\r\n2017/04/27,12:45:00,Big Stadium,Sharks,Kangaroos"
  },
  {
    "path": "dummy-data/officials-sample.csv",
    "content": "Name\nMarco Andrews\nDaniel Jacobs\nErick Herbertson\nRupert Abraham"
  },
  {
    "path": "dummy-data/players-sample.csv",
    "content": "Number,Name,Positions,Teams,Leagues,Seasons,Nationality,DoB\n1,Joe Allen,Goalkeeper,Eagles,Primary League|Secondary League,2014,aus,1983/05/05\n3,Steven Gerrard,Defender,Kangaroos,Primary League,2014|2013,usa,1970/03/10\n5,Daniel Sturridge,Midfielder|Forward,Sharks,Primary League|Secondary League,2014|2013,eng,1990/02/15\n6,Gabrielle Gonzalez,Forward,Kangaroos|Sharks,Primary League,2014,esp,1987/01/20"
  },
  {
    "path": "dummy-data/staff-sample.csv",
    "content": "Name,Jobs,Teams,Leagues,Seasons,Nationality\nBobby Brown,Coach,Eagles,Primary League|Secondary League,2014,aus\nCharles Johnson,Assistant Coach,Kangaroos,Primary League,2014,eng\nMatt Smith,Waterboy,Sharks,Primary League|Secondary League,2013|2014,aus\nDerrick Dawson,Manager,Tigers,Primary League,2014,usa\nJohn Allen,Investor,Foxes,Primary League|Secondary League,2014,esp"
  },
  {
    "path": "dummy-data/teams-sample.csv",
    "content": "Name,Leagues,Seasons,Site URL,Abbreviation,Home\nEagles,Primary League|Secondary League,2014,http://tboy.co/eagles,EAGLES,Little Park\nSharks,Primary League|Secondary League,2014|2013,http://tboy.co/sharks,SHARKS\nKangaroos,Primary League,2014|2013,http://tboy.co/roos,ROOS,Big Stadium"
  },
  {
    "path": "feeds/ical.php",
    "content": "<?php\n/**\n * iCal Feed\n *\n * @author      ThemeBoy\n * @category    Feeds\n * @package     SportsPress/Feeds\n * @version     2.7.15\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( 'sp_calendar' !== get_post_type( $post ) ) {\n\twp_die( esc_html__( 'ERROR: This is not a valid feed template.', 'sportspress' ), '', array( 'response' => 404 ) );\n}\n\n// Get events in calendar\n$calendar = new SP_Calendar( $post );\n$events   = $calendar->data();\n\n// Get blog locale\n$locale = substr( get_locale(), 0, 2 );\n\n// Get main result setting\n$main_result = get_option( 'sportspress_primary_result', null );\n\n// Get the timezone setting\n$timezone = sanitize_option( 'timezone_string', get_option( 'timezone_string' ) );\n\n// Get the URL\n$url = add_query_arg( 'feed', 'sp-ical', get_post_permalink( $post ) );\n$url = wordwrap( $url, 60, \"\\r\\n\\t\", true );\n\n$output =\n\"BEGIN:VCALENDAR\\r\\n\" .\n\"VERSION:2.0\\r\\n\" .\n'PRODID:-//ThemeBoy//SportsPress//' . strtoupper( $locale ) . \"\\r\\n\" .\n\"CALSCALE:GREGORIAN\\r\\n\" .\n\"METHOD:PUBLISH\\r\\n\" .\n'URL:' . $url . \"\\r\\n\" .\n'X-FROM-URL:' . $url . \"\\r\\n\" .\n'NAME:' . $post->post_title . \"\\r\\n\" .\n'X-WR-CALNAME:' . $post->post_title . \"\\r\\n\" .\n'DESCRIPTION:' . $post->post_title . \"\\r\\n\" .\n'X-WR-CALDESC:' . $post->post_title . \"\\r\\n\" .\n\"REFRESH-INTERVAL;VALUE=DURATION:PT2M\\r\\n\" .\n\"X-PUBLISHED-TTL:PT2M\\r\\n\" .\n'TZID:' . $timezone . \"\\r\\n\" .\n'X-WR-TIMEZONE:' . $timezone . \"\\r\\n\";\n\n// Loop through each event\nforeach ( $events as $event ) :\n\n\t// Define date format\n\t$date_format = 'Ymd\\THis';\n\n\t// Get description\n\t$description = preg_replace( '/([\\,;])/', '\\\\\\$1', $event->post_content );\n\t$description = wordwrap( $description, 60, \"\\n\\t\" );\n\n\t// Initialize end time\n\t$end = new DateTime( $event->post_date );\n\n\t// Get full time minutes\n\t$minutes = get_post_meta( $event->ID, 'sp_minutes', true );\n\tif ( '' === $minutes ) {\n\t\t$minutes = get_option( 'sportspress_event_minutes', 90 );\n\t}\n\n\t// Add full time minutes to end time\n\t$end->add( new DateInterval( 'PT' . $minutes . 'M' ) );\n\n\t// Initialize location\n\t$location = '';\n\n\t// Get venue information\n\t$venues = get_the_terms( $event->ID, 'sp_venue' );\n\tif ( $venues ) {\n\t\t$venue     = reset( $venues );\n\t\t$location .= $venue->name;\n\n\t\t// Get venue term meta\n\t\t$t_id = $venue->term_id;\n\t\t$meta = get_option( \"taxonomy_$t_id\" );\n\n\t\t// Add details to location\n\t\t$address = sp_array_value( $meta, 'sp_address', false );\n\t\tif ( false !== $address ) {\n\t\t\t$location = $venue->name . '\\, ' . preg_replace( '/([\\,;])/', '\\\\\\$1', $address );\n\t\t}\n\n\t\t// Generate geo tag\n\t\t$latitude  = sp_array_value( $meta, 'sp_latitude', false );\n\t\t$longitude = sp_array_value( $meta, 'sp_longitude', false );\n\t\tif ( false !== $latitude && false !== $longitude ) {\n\t\t\t$geo = $latitude . ';' . $longitude;\n\t\t} else {\n\t\t\t$geo = false;\n\t\t}\n\t}\n\t$location = wordwrap( $location, 60, \"\\r\\n\\t\" );\n\n\t// Get title or write summary based on scores\n\t$results = array();\n\t$teams   = (array) get_post_meta( $event->ID, 'sp_team', false );\n\t$teams   = array_filter( $teams );\n\t$teams   = array_unique( $teams );\n\tif ( ! empty( $teams ) ) {\n\t\t$event_results = get_post_meta( $event->ID, 'sp_results', true );\n\t\tforeach ( $teams as $team_id ) {\n\t\t\tif ( ! $team_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$team = get_post( $team_id );\n\n\t\t\tif ( $team ) {\n\t\t\t\t$team_results = sportspress_array_value( $event_results, $team_id, null );\n\n\t\t\t\tif ( $main_result ) {\n\t\t\t\t\t$team_result = sportspress_array_value( $team_results, $main_result, null );\n\t\t\t\t} else {\n\t\t\t\t\tif ( is_array( $team_results ) ) {\n\t\t\t\t\t\tend( $team_results );\n\t\t\t\t\t\t$team_result = prev( $team_results );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$team_result = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( $team_result != null ) {\n\t\t\t\t\t$results[] = get_the_title( $team_id ) . ' ' . $team_result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif ( sizeof( $results ) ) {\n\t\t$summary = implode( ' ', $results );\n\t} else {\n\t\t$summary = $event->post_title;\n\t}\n\n\t// Convert &#[0-9]+ entities to UTF-8\n\t$summary = preg_replace_callback(\n\t\t'/(&#[0-9]+;)/',\n\t\tfunction( $m ) {\n\t\t\treturn mb_convert_encoding( $m[1], 'UTF-8', 'HTML-ENTITIES' );\n\t\t},\n\t\t$summary\n\t);\n\n\t$summary = apply_filters( 'sportspress_ical_feed_summary', $summary, $event );\n\n\t// Append to output string\n\t$output .=\n\t\"BEGIN:VEVENT\\r\\n\" .\n\t'SUMMARY:' . preg_replace( '/([\\,;])/', '\\\\\\$1', $summary ) . \"\\r\\n\" .\n\t\"UID:$event->ID\\r\\n\" .\n\t\"STATUS:CONFIRMED\\r\\n\" .\n\t\"DTSTAMP:19700101T000000\\r\\n\" .\n\t'DTSTART:' . mysql2date( $date_format, $event->post_date ) . \"\\r\\n\" .\n\t'DTEND:' . $end->format( $date_format ) . \"\\r\\n\" .\n\t'LAST-MODIFIED:' . mysql2date( $date_format, $event->post_modified_gmt ) . \"\\r\\n\";\n\n\tif ( $description ) {\n\t\t$output .= 'DESCRIPTION:' . $description . \"\\r\\n\";\n\t}\n\n\tif ( $location ) {\n\t\t$output .= 'LOCATION:' . $location . \"\\r\\n\";\n\t}\n\n\tif ( $geo ) {\n\t\t$output .= 'GEO:' . $geo . \"\\r\\n\";\n\t}\n\n\t$output .= \"END:VEVENT\\r\\n\";\nendforeach;\n\n// End output\n$output .= 'END:VCALENDAR';\n\n// Print headers\nheader( 'Content-type: text/calendar; charset=utf-8' );\n\n// The E-Tag is not being changed when the output file is generated – Some Webdav clients do not like this and\n// do not then 'see' that the file has changed – updates to the calendars are then not displayed to the user.\n// Props @garygomm https://wordpress.org/support/topic/calendar-feed-issue-not-updating-after-change/\n$etag = md5( $output );\nheader( 'Etag:' . '\"' . $etag . '\"' );\n\nheader( 'Content-Disposition: inline; filename=' . $post->post_name . '.ics' );\n\n// Print content\necho wp_kses_post( $output );\n"
  },
  {
    "path": "includes/abstracts/abstract-sp-custom-post.php",
    "content": "<?php\n/**\n * Abstract Custom Post Class\n *\n * The SportsPress custom post class handles individual post data.\n *\n * @class       SP_Custom_Post\n * @version     2.6.5\n * @package     SportsPress/Abstracts\n * @category    Abstract Class\n * @author      ThemeBoy\n */\nabstract class SP_Custom_Post {\n\n\t/** @var int The post ID. */\n\tpublic $ID;\n\n\t/** @var object The actual post object. */\n\tpublic $post;\n\n\t/**\n\t * __construct function.\n\t *\n\t * @access public\n\t * @param mixed $post\n\t */\n\tpublic function __construct( $post ) {\n\t\tif ( $post instanceof WP_Post || $post instanceof SP_Custom_Post ) :\n\t\t\t$this->ID   = absint( $post->ID );\n\t\t\t$this->post = $post;\n\t\telse :\n\t\t\t$this->ID   = absint( $post );\n\t\t\t$this->post = get_post( $this->ID );\n\t\tendif;\n\t}\n\n\t/**\n\t * __isset function.\n\t *\n\t * @access public\n\t * @param mixed $key\n\t * @return bool\n\t */\n\tpublic function __isset( $key ) {\n\t\treturn metadata_exists( 'post', $this->ID, 'sp_' . $key );\n\t}\n\n\t/**\n\t * __get function.\n\t *\n\t * @access public\n\t * @param mixed $key\n\t * @return bool\n\t */\n\tpublic function __get( $key ) {\n\t\tif ( ! isset( $key ) ) :\n\t\t\treturn $this->post;\n\t\telse :\n\t\t\t$value = get_post_meta( $this->ID, 'sp_' . $key, true );\n\t\tendif;\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Get the post data.\n\t *\n\t * @access public\n\t * @return object\n\t */\n\tpublic function get_post_data() {\n\t\treturn $this->post;\n\t}\n\n\t/**\n\t * Get terms sorted by order.\n\t *\n\t * @access public\n\t * @param  string $taxonomy     The taxonomy.\n\t * @return array|false|WP_Error See `get_the_terms()`\n\t */\n\tpublic function get_terms_sorted_by_sp_order( $taxonomy ) {\n\t\t$terms = get_the_terms( $this->ID, $taxonomy );\n\t\tif ( $terms ) {\n\t\t\tusort( $terms, 'sp_sort_terms' );\n\t\t}\n\t\treturn $terms;\n\t}\n}\n"
  },
  {
    "path": "includes/abstracts/abstract-sp-secondary-post.php",
    "content": "<?php\n/**\n * Abstract Secondary Post Class\n *\n * The SportsPress secondary post class extends custom posts with handling of secondary post types.\n *\n * @class       SP_Secondary_Post\n * @version   2.5.3\n * @package     SportsPress/Abstracts\n * @category    Abstract Class\n * @author      ThemeBoy\n */\nabstract class SP_Secondary_Post extends SP_Custom_Post {\n\n\t/** @var string The date filter for events. */\n\tpublic $date = 0;\n\n\t/** @var string The date to range from. */\n\tpublic $from = 'now';\n\n\t/** @var string The date to range to. */\n\tpublic $to = 'now';\n\n\t/** @var string The number of days to query in the past. */\n\tpublic $past = 0;\n\n\t/** @var string The number of days to query in the future. */\n\tpublic $future = 0;\n\n\t/** @var boolean Determines whether the date range is relative. */\n\tpublic $relative = false;\n\n\t/**\n\t * __construct function.\n\t *\n\t * @access public\n\t * @param mixed $post\n\t */\n\tpublic function __construct( $post ) {\n\t\tif ( $post instanceof WP_Post || $post instanceof SP_Secondary_Post ) :\n\t\t\t$this->ID   = absint( $post->ID );\n\t\t\t$this->post = $post;\n\t  else :\n\t\t  $this->ID   = absint( $post );\n\t\t  $this->post = get_post( $this->ID );\n\t  endif;\n\t}\n\n\tpublic function range( $where = '', $format = 'Y-m-d' ) {\n\t\t$from = new DateTime( $this->from );\n\t\t$to   = new DateTime( $this->to );\n\n\t\t$to->modify( '+1 day' );\n\n\t\t$where .= \" AND post_date BETWEEN '\" . $from->format( $format ) . \"' AND '\" . $to->format( $format ) . \"'\";\n\n\t\treturn $where;\n\t}\n\n\tpublic function relative( $where = '', $format = 'Y-m-d' ) {\n\t\t$from = new DateTime( 'now' );\n\t\t$to   = new DateTime( 'now' );\n\n\t\t$from->modify( '-' . abs( (int) $this->past ) . ' day' );\n\t\t$to->modify( '+' . abs( (int) $this->future ) . ' day' );\n\n\t\t$to->modify( '+1 day' );\n\n\t\t$where .= \" AND post_date BETWEEN '\" . $from->format( $format ) . \"' AND '\" . $to->format( $format ) . \"'\";\n\n\t\treturn $where;\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-sp-admin-ajax.php",
    "content": "<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SportsPress Admin.\n *\n * @class       SP_Admin_AJAX\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     1.7\n */\nclass SP_Admin_AJAX {\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'wp_ajax_sp-save-primary-result', array( $this, 'save_primary_result' ), 1 );\n\t\tadd_action( 'wp_ajax_sp-save-primary-performance', array( $this, 'save_primary_performance' ), 1 );\n\t\tadd_action( 'wp_ajax_sp-save-inline-results', array( $this, 'save_inline_results' ) );\n\t}\n\n\t/**\n\t * Auto-save the selected primary result.\n\t *\n\t * @since  1.3\n\t */\n\tfunction save_primary_result() {\n\t\tcheck_ajax_referer( 'sp-save-primary-result', 'nonce' );\n\n\t\t$primary_result = sanitize_key( $_POST['primary_result'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\n\t\tupdate_option( 'sportspress_primary_result', $primary_result );\n\t\twp_send_json_success();\n\t}\n\n\t/**\n\t * Auto-save the selected primary performance.\n\t *\n\t * @since  1.7\n\t */\n\tfunction save_primary_performance() {\n\t\tcheck_ajax_referer( 'sp-save-primary-performance', 'nonce' );\n\n\t\t$primary_performance = sanitize_key( $_POST['primary_performance'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\n\t\tupdate_option( 'sportspress_primary_performance', $primary_performance );\n\t\twp_send_json_success();\n\t}\n\n\t/**\n\t * Save event results inline.\n\t *\n\t * @since  1.5\n\t */\n\tfunction save_inline_results() {\n\t\tcheck_ajax_referer( 'sp-save-inline-results', 'nonce' );\n\n\t\t$id      = sp_array_value( $_POST, 'post_id' );\n\t\t$results = sp_array_value( $_POST, 'results' );\n\n\t\tif ( sp_update_main_results( $id, $results ) ) {\n\t\t\twp_send_json_success();\n\t\t} else {\n\t\t\twp_send_json_error();\n\t\t}\n\t}\n}\n\nreturn new SP_Admin_AJAX();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-assets.php",
    "content": "<?php\n/**\n * Load assets.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version   2.6.15\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Assets' ) ) :\n\n\t/**\n\t * SP_Admin_Assets Class\n\t */\n\tclass SP_Admin_Assets {\n\n\t\t/**\n\t\t * Hook in tabs.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'admin_styles' ) );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );\n\t\t}\n\n\t\t/**\n\t\t * Enqueue styles\n\t\t */\n\t\tpublic function admin_styles( $hook ) {\n\t\t\t// Sitewide menu CSS\n\t\t\twp_enqueue_style( 'sportspress-admin-menu-styles', SP()->plugin_url() . '/assets/css/menu.css', array(), SP_VERSION );\n\n\t\t\t$screen = get_current_screen();\n\n\t\t\tif ( in_array( $screen->id, sp_get_screen_ids() ) ) {\n\t\t\t\t// Admin styles for SP pages only\n\t\t\t\twp_enqueue_style( 'jquery-chosen', SP()->plugin_url() . '/assets/css/chosen.css', array(), '1.1.0' );\n\t\t\t\twp_enqueue_style( 'wp-color-picker' );\n\t\t\t\twp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION );\n\t\t\t} elseif ( strpos( $screen->id, 'sportspress-config' ) !== false ) {\n\t\t\t\twp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION );\n\t\t\t}\n\n\t\t\tif ( strpos( $screen->id, 'sportspress-overview' ) !== false ) {\n\t\t\t\twp_enqueue_style( 'sportspress-admin-slickmap', SP()->plugin_url() . '/assets/css/slickmap.css', array(), '1.1.0' );\n\t\t\t}\n\n\t\t\tif ( in_array( $screen->id, array( 'dashboard' ) ) ) {\n\t\t\t\twp_enqueue_style( 'sportspress-admin-dashboard-styles', SP()->plugin_url() . '/assets/css/dashboard.css', array(), SP_VERSION );\n\t\t\t}\n\n\t\t\tif ( in_array( $screen->id, array( 'customize' ) ) ) {\n\t\t\t\twp_enqueue_style( 'sportspress-admin-customize-styles', SP()->plugin_url() . '/assets/css/customize.css', array(), SP_VERSION );\n\t\t\t}\n\n\t\t\tif ( in_array( $screen->id, array( 'sp_result', 'sp_performance', 'sp_column', 'sp_statistic' ) ) ) {\n\t\t\t\twp_enqueue_style( 'sportspress-admin-equation-styles', SP()->plugin_url() . '/assets/css/equation.css', array(), SP_VERSION );\n\t\t\t}\n\n\t\t\tif ( in_array( $screen->id, apply_filters( 'sportspress_admin_datepicker_screen_ids', array( 'sp_calendar', 'sp_table', 'sp_list', 'widgets' ) ) ) || in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) {\n\t\t\t\twp_enqueue_style( 'jquery-ui-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css' );\n\t\t\t\twp_enqueue_style( 'sportspress-admin-datepicker-styles', SP()->plugin_url() . '/assets/css/datepicker.css', array( 'jquery-ui-style' ), SP_VERSION );\n\t\t\t}\n\n\t\t\tdo_action( 'sportspress_admin_css', $screen );\n\t\t}\n\n\t\t/**\n\t\t * Enqueue scripts\n\t\t */\n\t\tpublic function admin_scripts( $hook ) {\n\t\t\tglobal $wp_query, $post;\n\n\t\t\t$screen = get_current_screen();\n\n\t\t\t// Register scripts\n\t\t\twp_register_script( 'chosen', SP()->plugin_url() . '/assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );\n\n\t\t\twp_register_script( 'jquery-tiptip', SP()->plugin_url() . '/assets/js/jquery.tipTip.min.js', array( 'jquery' ), '1.3', true );\n\n\t\t\twp_register_script( 'jquery-caret', SP()->plugin_url() . '/assets/js/jquery.caret.min.js', array( 'jquery' ), '1.02', true );\n\n\t\t\twp_register_script( 'jquery-fitvids', SP()->plugin_url() . '/assets/js/jquery.fitvids.js', array( 'jquery' ), '1.1', true );\n\n\t\t\twp_register_script( 'sportspress-admin-equationbuilder', SP()->plugin_url() . '/assets/js/admin/equationbuilder.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable' ), SP_VERSION, true );\n\n\t\t\twp_register_script( 'sportspress-admin-colorpicker', SP()->plugin_url() . '/assets/js/admin/colorpicker.js', array( 'jquery', 'wp-color-picker', 'iris' ), SP_VERSION, true );\n\n\t\t\twp_register_script( 'sportspress-admin-widgets', SP()->plugin_url() . '/assets/js/admin/widgets.js', array( 'jquery' ), SP_VERSION, true );\n\n\t\t\twp_register_script( 'sportspress-admin-quickeditor', SP()->plugin_url() . '/assets/js/admin/quickeditor.js', array( 'jquery' ), SP_VERSION, true );\n\n\t\t\t// SportsPress admin pages\n\t\t\tif ( in_array( $screen->id, sp_get_screen_ids() ) || strpos( $screen->id, 'sportspress-config' ) || in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) {\n\n\t\t\t\twp_enqueue_script( 'jquery' );\n\t\t\t\twp_enqueue_script( 'chosen' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-core' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-draggable' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-droppable' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-sortable' );\n\t\t\t\twp_enqueue_script( 'jquery-tiptip' );\n\t\t\t\twp_enqueue_script( 'jquery-caret' );\n\t\t\t\twp_enqueue_script( 'jquery-fitvids' );\n\t\t\t\twp_enqueue_script( 'sportspress-admin', SP()->plugin_url() . '/assets/js/admin/sportspress-admin.js', array( 'jquery', 'chosen', 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-tiptip', 'jquery-caret', 'jquery-fitvids' ), SP_VERSION, true );\n\n\t\t\t\t$strings = apply_filters(\n\t\t\t\t\t'sportspress_localized_strings',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'none'             => esc_attr__( 'None', 'sportspress' ),\n\t\t\t\t\t\t'remove_text'      => esc_attr__( '&mdash; Remove &mdash;', 'sportspress' ),\n\t\t\t\t\t\t'days'             => esc_attr__( 'days', 'sportspress' ),\n\t\t\t\t\t\t'hrs'              => esc_attr__( 'hrs', 'sportspress' ),\n\t\t\t\t\t\t'mins'             => esc_attr__( 'mins', 'sportspress' ),\n\t\t\t\t\t\t'secs'             => esc_attr__( 'secs', 'sportspress' ),\n\t\t\t\t\t\t'displaying_posts' => html_entity_decode( esc_attr__( 'Displaying %1$s&#8211;%2$s of %3$s', 'sportspress' ) ),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// Localize scripts\n\t\t\t\twp_localize_script( 'sportspress-admin', 'localized_strings', $strings );\n\t\t\t}\n\n\t\t\tif ( in_array( $screen->id, array( 'widgets' ) ) ) {\n\t\t\t\twp_enqueue_script( 'sportspress-admin-widgets' );\n\t\t\t}\n\n\t\t\t// Edit color\n\t\t\tif ( in_array( $screen->id, array( 'sp_outcome' ) ) ) {\n\t\t\t\twp_enqueue_script( 'sportspress-admin-colorpicker' );\n\t\t\t}\n\n\t\t\t// Edit equation\n\t\t\tif ( in_array( $screen->id, array( 'sp_result', 'sp_performance', 'sp_column', 'sp_statistic' ) ) ) {\n\t\t\t\twp_enqueue_script( 'sportspress-admin-equationbuilder' );\n\t\t\t}\n\n\t\t\t// Quick edit\n\t\t\tif ( in_array( $screen->id, array( 'edit-sp_player' ) ) ) {\n\t\t\t\twp_enqueue_script( 'sportspress-admin-quickeditor' );\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_Assets();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-dashboard.php",
    "content": "<?php\n/**\n * Admin Dashboard\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.15\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Dashboard' ) ) :\n\n\t/**\n\t * SP_Admin_Dashboard Class\n\t */\n\tclass SP_Admin_Dashboard {\n\n\t\t/**\n\t\t * Hook in tabs.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Only hook in admin parts if the user has admin access\n\t\t\tif ( current_user_can( 'view_sportspress_reports' ) || current_user_can( 'manage_sportspress' ) || current_user_can( 'publish_sp_events' ) ) {\n\t\t\t\tadd_action( 'wp_dashboard_setup', array( $this, 'init' ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Init dashboard widgets\n\t\t */\n\t\tpublic function init() {\n\t\t\twp_add_dashboard_widget( 'sportspress_dashboard_status', esc_attr__( 'SportsPress', 'sportspress' ), array( $this, 'status_widget' ) );\n\t\t\tadd_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );\n\t\t}\n\n\t\t/**\n\t\t * Add links to At a Glance\n\t\t */\n\t\tfunction glance_items( $items = array() ) {\n\t\t\t$post_types = apply_filters( 'sportspress_glance_items', array( 'sp_event', 'sp_team', 'sp_player', 'sp_staff' ) );\n\t\t\tforeach ( $post_types as $type ) :\n\t\t\t\tif ( ! post_type_exists( $type ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$num_posts = wp_count_posts( $type );\n\t\t\t\tif ( $num_posts ) :\n\t\t\t\t\t$published = intval( $num_posts->publish );\n\t\t\t\t\t$post_type = get_post_type_object( $type );\n\t\t\t\t\t$text      = _n( '%s ' . $post_type->labels->singular_name, '%s ' . $post_type->labels->name, $published, 'sportspress' );\n\t\t\t\t\t$text      = sprintf( $text, number_format_i18n( $published ) );\n\t\t\t\t\tif ( current_user_can( $post_type->cap->edit_posts ) ) :\n\t\t\t\t\t\t$output = '<a href=\"edit.php?post_type=' . $post_type->name . '\">' . $text . '</a>';\n\t\t\t\t\telse :\n\t\t\t\t\t\t$output = '<span>' . $text . '</span>';\n\t\t\t\t\tendif;\n\t\t\t\t\techo '<li class=\"post-count ' . esc_attr( $post_type->name ) . '-count\">' . wp_kses_post( $output ) . '</li>';\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn $items;\n\t\t}\n\n\t\t/**\n\t\t * Show status widget\n\t\t */\n\t\tpublic function status_widget() {\n\t\t\t?>\n\t  <ul class=\"sp_status_list\">\n\t\t\t<?php\n\t\t\t  $count           = wp_count_posts( 'sp_event' );\n\t\t\t  $scheduled_count = isset( $count->future ) ? $count->future : 0;\n\t\t\t  $published_count = isset( $count->publish ) ? $count->publish : 0;\n\t\t\t  $next_event      = sp_get_next_event();\n\t\t\tif ( $next_event ) :\n\t\t\t\t$now      = new DateTime( current_time( 'mysql', 0 ) );\n\t\t\t\t$date     = new DateTime( $next_event->post_date );\n\t\t\t\t$interval = date_diff( $now, $date );\n\t\t\t\t?>\n\t\t\t  <li class=\"countdown\" data-countdown=\"<?php echo esc_attr( str_replace( '-', '/', get_gmt_from_date( $next_event->post_date ) ) ); ?>\">\n\t\t\t\t  <a href=\"<?php echo esc_url( get_edit_post_link( $next_event->ID ) ); ?>\">\n\t\t\t\t  <?php printf( wp_kses_post( __( '<strong>%s</strong> until next event', 'sportspress' ) ), esc_html( $interval->days ) . ' ' . esc_html__( 'days', 'sportspress' ) . ' ' . sprintf( '%02s:%02s:%02s', esc_html( $interval->h ), esc_html( $interval->i ), esc_html( $interval->s ) ) ); ?>\n\t\t\t\t\t  (<?php echo esc_html( $next_event->post_title ); ?>)\n\t\t\t\t  </a>\n\t\t\t  </li>\n\t\t  <?php endif; ?>\n\t\t  <li class=\"events-scheduled\">\n\t\t\t  <a href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_event&post_status=future' ).'savvas' ); ?>\">\n\t\t\t\t  <?php printf( wp_kses_post( _n( '<strong>%s event</strong> scheduled', '<strong>%s events</strong> scheduled', $scheduled_count, 'sportspress' ) ), esc_attr( $scheduled_count ) ); ?>\n\t\t\t  </a>\n\t\t  </li>\n\t\t  <li class=\"events-published\">\n\t\t\t  <a href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_event&post_status=publish' ) ); ?>\">\n\t\t\t\t  <?php printf( wp_kses_post( _n( '<strong>%s event</strong> published', '<strong>%s events</strong> published', $published_count, 'sportspress' ) ), esc_attr( $published_count ) ); ?>\n\t\t\t  </a>\n\t\t  </li>\n\t  </ul>\n\t\t\t<?php\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_Dashboard();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-editor.php",
    "content": "<?php\n/**\n * Admin Editor\n *\n * Methods which tweak the WP Editor.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version   2.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Admin_Editor class.\n *\n * @since 1.2\n */\nclass SP_Admin_Editor {\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'admin_init', array( $this, 'add_shortcode_button' ) );\n\t\tadd_filter( 'tiny_mce_version', array( $this, 'refresh_mce' ) );\n\t\tadd_filter( 'mce_external_languages', array( $this, 'add_tinymce_lang' ), 10, 1 );\n\t}\n\n\t/**\n\t * Add a button for shortcodes to the WP editor.\n\t */\n\tpublic function add_shortcode_button() {\n\t\tif ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'true' == get_user_option( 'rich_editing' ) ) {\n\t\t\tadd_filter( 'mce_external_plugins', array( $this, 'add_shortcode_tinymce_plugin' ) );\n\t\t\tadd_filter( 'mce_buttons', array( $this, 'register_shortcode_button' ) );\n\t\t}\n\t}\n\n\t/**\n\t * add_tinymce_lang function.\n\t *\n\t * @param array $arr\n\t * @return array\n\t */\n\tpublic function add_tinymce_lang( $arr ) {\n\t\t$arr['sp_shortcodes_button'] = SP()->plugin_path() . '/assets/js/admin/editor-lang.php';\n\t\treturn $arr;\n\t}\n\n\t/**\n\t * Register the shortcode button.\n\t *\n\t * @param array $buttons\n\t * @return array\n\t */\n\tpublic function register_shortcode_button( $buttons ) {\n\t\tarray_push( $buttons, 'sp_shortcodes_button' );\n\t\treturn $buttons;\n\t}\n\n\t/**\n\t * Add the shortcode button to TinyMCE\n\t *\n\t * @param array $plugin_array\n\t * @return array\n\t */\n\tpublic function add_shortcode_tinymce_plugin( $plugin_array ) {\n\t\t$plugin_array['sp_shortcodes_button'] = SP()->plugin_url() . '/assets/js/admin/editor.js';\n\t\treturn $plugin_array;\n\t}\n\n\t/**\n\t * Force TinyMCE to refresh.\n\t *\n\t * @param int $ver\n\t * @return int\n\t */\n\tpublic function refresh_mce( $ver ) {\n\t\t$ver += 3;\n\t\treturn $ver;\n\t}\n\n}\n\nnew SP_Admin_Editor();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-importers.php",
    "content": "<?php\n/**\n * Setup importers for SP data.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.13\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Importers' ) ) :\n\n\t/**\n\t * SP_Admin_Importers Class\n\t */\n\tclass SP_Admin_Importers {\n\n\t\t/**\n\t\t * Hook in tabs.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\tadd_action( 'admin_init', array( $this, 'register_importers' ) );\n\t\t}\n\n\t\t/**\n\t\t * Add menu items\n\t\t */\n\t\tpublic function register_importers() {\n\t\t\tglobal $pagenow;\n\t\t\t$importers = apply_filters(\n\t\t\t\t'sportspress_importers',\n\t\t\t\tarray(\n\t\t\t\t\t'sp_event_csv'   => array(\n\t\t\t\t\t\t'name'        => esc_attr__( 'SportsPress Events (CSV)', 'sportspress' ),\n\t\t\t\t\t\t'description' => wp_kses_post( __( 'Import <strong>events</strong> from a csv file.', 'sportspress' ) ),\n\t\t\t\t\t\t'callback'    => array( $this, 'events_importer' ),\n\t\t\t\t\t),\n\t\t\t\t\t'sp_fixture_csv' => array(\n\t\t\t\t\t\t'name'        => esc_attr__( 'SportsPress Fixtures (CSV)', 'sportspress' ),\n\t\t\t\t\t\t'description' => wp_kses_post( __( 'Import <strong>upcoming events</strong> from a csv file.', 'sportspress' ) ),\n\t\t\t\t\t\t'callback'    => array( $this, 'fixtures_importer' ),\n\t\t\t\t\t),\n\t\t\t\t\t'sp_team_csv'    => array(\n\t\t\t\t\t\t'name'        => esc_attr__( 'SportsPress Teams (CSV)', 'sportspress' ),\n\t\t\t\t\t\t'description' => wp_kses_post( __( 'Import <strong>teams</strong> from a csv file.', 'sportspress' ) ),\n\t\t\t\t\t\t'callback'    => array( $this, 'teams_importer' ),\n\t\t\t\t\t),\n\t\t\t\t\t'sp_player_csv'  => array(\n\t\t\t\t\t\t'name'        => esc_attr__( 'SportsPress Players (CSV)', 'sportspress' ),\n\t\t\t\t\t\t'description' => wp_kses_post( __( 'Import <strong>players</strong> from a csv file.', 'sportspress' ) ),\n\t\t\t\t\t\t'callback'    => array( $this, 'players_importer' ),\n\t\t\t\t\t),\n\t\t\t\t\t'sp_staff_csv'   => array(\n\t\t\t\t\t\t'name'        => esc_attr__( 'SportsPress Staff (CSV)', 'sportspress' ),\n\t\t\t\t\t\t'description' => wp_kses_post( __( 'Import <strong>staff</strong> from a csv file.', 'sportspress' ) ),\n\t\t\t\t\t\t'callback'    => array( $this, 'staff_importer' ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( 'import.php' !== $pagenow ) {\n\t\t\t\t$importers['sp_event_performance_csv'] = array(\n\t\t\t\t\t'name'        => esc_attr__( 'SportsPress Box Score (CSV)', 'sportspress' ),\n\t\t\t\t\t'description' => '<a href=\"' . admin_url( add_query_arg( array( 'post_type' => 'sp_event' ), 'edit.php' ) ) . '\">' . sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Event', 'sportspress' ) ) . '</a>',\n\t\t\t\t\t'callback'    => array( $this, 'event_performance_importer' ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tforeach ( $importers as $id => $importer ) {\n\t\t\t\tregister_importer( $id, $importer['name'], $importer['description'], $importer['callback'] );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function events_importer() {\n\t\t\t$this->includes();\n\n\t\t\trequire 'importers/class-sp-event-importer.php';\n\n\t\t\t// Dispatch\n\t\t\t$importer = new SP_Event_Importer();\n\t\t\t$importer->dispatch();\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function event_performance_importer() {\n\t\t\t$this->includes();\n\n\t\t\trequire 'importers/class-sp-event-performance-importer.php';\n\n\t\t\t// Dispatch\n\t\t\t$importer = new SP_Event_Performance_Importer();\n\t\t\t$importer->dispatch();\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function fixtures_importer() {\n\t\t\t$this->includes();\n\n\t\t\trequire 'importers/class-sp-fixture-importer.php';\n\n\t\t\t// Dispatch\n\t\t\t$importer = new SP_Fixture_Importer();\n\t\t\t$importer->dispatch();\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function teams_importer() {\n\t\t\t$this->includes();\n\n\t\t\trequire 'importers/class-sp-team-importer.php';\n\n\t\t\t// Dispatch\n\t\t\t$importer = new SP_Team_Importer();\n\t\t\t$importer->dispatch();\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function players_importer() {\n\t\t\t$this->includes();\n\n\t\t\trequire 'importers/class-sp-player-importer.php';\n\n\t\t\t// Dispatch\n\t\t\t$importer = new SP_Player_Importer();\n\t\t\t$importer->dispatch();\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function staff_importer() {\n\t\t\t$this->includes();\n\n\t\t\trequire 'importers/class-sp-staff-importer.php';\n\n\t\t\t// Dispatch\n\t\t\t$importer = new SP_Staff_Importer();\n\t\t\t$importer->dispatch();\n\t\t}\n\n\t\tpublic static function includes() {\n\t\t\t// Load Importer API\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/import.php';\n\n\t\t\tif ( ! class_exists( 'WP_Importer' ) ) {\n\t\t\t\t$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';\n\t\t\t\tif ( file_exists( $class_wp_importer ) ) {\n\t\t\t\t\trequire $class_wp_importer;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trequire 'importers/class-sp-importer.php';\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_Importers();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-menus.php",
    "content": "<?php\n/**\n * Setup menus in WP admin.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Menus' ) ) :\n\n\t/**\n\t * SP_Admin_Menus Class\n\t */\n\tclass SP_Admin_Menus {\n\n\t\t/**\n\t\t * Hook in tabs.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\tadd_filter( 'admin_menu', array( $this, 'menu_clean' ), 5 );\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ), 6 );\n\t\t\tadd_action( 'admin_menu', array( $this, 'config_menu' ), 7 );\n\t\t\tadd_action( 'admin_menu', array( $this, 'leagues_menu' ), 20 );\n\t\t\tadd_action( 'admin_menu', array( $this, 'seasons_menu' ), 21 );\n\n\t\t\tadd_action( 'admin_head', array( $this, 'menu_highlight' ) );\n\t\t\tadd_action( 'admin_head', array( $this, 'menu_rename' ) );\n\t\t\tadd_action( 'parent_file', array( $this, 'parent_file' ) );\n\t\t\tadd_filter( 'menu_order', array( $this, 'menu_order' ) );\n\t\t\tadd_filter( 'custom_menu_order', array( $this, 'custom_menu_order' ) );\n\t\t\tadd_filter( 'sportspress_sitemap_taxonomy_post_types', array( $this, 'sitemap_taxonomy_post_types' ), 10, 2 );\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function admin_menu() {\n\t\t\tglobal $menu;\n\n\t\t\tif ( current_user_can( 'manage_sportspress' ) ) {\n\t\t\t\t$menu[] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );\n\t\t\t}\n\n\t\t\t$main_page = add_menu_page( esc_attr__( 'SportsPress', 'sportspress' ), esc_attr__( 'SportsPress', 'sportspress' ), 'manage_sportspress', 'sportspress', array( $this, 'settings_page' ), apply_filters( 'sportspress_menu_icon', null ), '51.5' );\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function config_menu() {\n\t\t\tadd_submenu_page( 'sportspress', esc_attr__( 'Configure', 'sportspress' ), esc_attr__( 'Configure', 'sportspress' ), 'manage_sportspress', 'sportspress-config', array( $this, 'config_page' ) );\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function leagues_menu() {\n\t\t\tadd_submenu_page( 'sportspress', esc_attr__( 'Leagues', 'sportspress' ), esc_attr__( 'Leagues', 'sportspress' ), 'manage_sportspress', 'edit-tags.php?taxonomy=sp_league' );\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function seasons_menu() {\n\t\t\tadd_submenu_page( 'sportspress', esc_attr__( 'Seasons', 'sportspress' ), esc_attr__( 'Seasons', 'sportspress' ), 'manage_sportspress', 'edit-tags.php?taxonomy=sp_season' );\n\t\t}\n\n\t\t/**\n\t\t * Highlights the correct top level admin menu item for post type add screens.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function menu_highlight() {\n\t\t\tglobal $typenow;\n\t\t\t$screen = get_current_screen();\n\t\t\tif ( ! is_object( $screen ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( $screen->id == 'sp_role' ) {\n\t\t\t\t$this->highlight_admin_menu( 'edit.php?post_type=sp_staff', 'edit-tags.php?taxonomy=sp_role&post_type=sp_staff' );\n\t\t\t} elseif ( is_sp_config_type( $typenow ) ) {\n\t\t\t\t$this->highlight_admin_menu( 'sportspress', 'sportspress-config' );\n\t\t\t} elseif ( $typenow == 'sp_calendar' ) {\n\t\t\t\t$this->highlight_admin_menu( 'edit.php?post_type=sp_event', 'edit.php?post_type=sp_calendar' );\n\t\t\t} elseif ( $typenow == 'sp_table' ) {\n\t\t\t\t$this->highlight_admin_menu( 'edit.php?post_type=sp_team', 'edit.php?post_type=sp_table' );\n\t\t\t} elseif ( $typenow == 'sp_list' ) {\n\t\t\t\t$this->highlight_admin_menu( 'edit.php?post_type=sp_player', 'edit.php?post_type=sp_list' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Renames admin menu items.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function menu_rename() {\n\t\t\tglobal $menu, $submenu;\n\n\t\t\tif ( isset( $submenu['sportspress'] ) && isset( $submenu['sportspress'][0] ) && isset( $submenu['sportspress'][0][0] ) ) {\n\t\t\t\t$submenu['sportspress'][0][0] = esc_attr__( 'Settings', 'sportspress' );\n\t\t\t}\n\t\t}\n\n\t\tpublic function parent_file( $parent_file ) {\n\t\t\tglobal $current_screen;\n\t\t\t$taxonomy = $current_screen->taxonomy;\n\t\t\tif ( in_array( $taxonomy, array( 'sp_league', 'sp_season' ) ) ) {\n\t\t\t\t$parent_file = 'sportspress';\n\t\t\t}\n\t\t\treturn $parent_file;\n\t\t}\n\n\t\t/**\n\t\t * Reorder the SP menu items in admin.\n\t\t *\n\t\t * @param mixed $menu_order\n\t\t * @return array\n\t\t */\n\t\tpublic function menu_order( $menu_order ) {\n\t\t\t// Initialize our custom order array\n\t\t\t$sportspress_menu_order = array();\n\n\t\t\t// Get the index of our custom separator\n\t\t\t$sportspress_separator = array_search( 'separator-sportspress', $menu_order );\n\n\t\t\t// Get index of menu items\n\t\t\t$sportspress_event  = array_search( 'edit.php?post_type=sp_event', $menu_order );\n\t\t\t$sportspress_team   = array_search( 'edit.php?post_type=sp_team', $menu_order );\n\t\t\t$sportspress_player = array_search( 'edit.php?post_type=sp_player', $menu_order );\n\t\t\t$sportspress_staff  = array_search( 'edit.php?post_type=sp_staff', $menu_order );\n\n\t\t\t// Loop through menu order and do some rearranging\n\t\t\tforeach ( $menu_order as $index => $item ) :\n\n\t\t\t\tif ( ( ( 'sportspress' ) == $item ) ) :\n\t\t\t\t\t$sportspress_menu_order[] = 'separator-sportspress';\n\t\t\t\t\t$sportspress_menu_order[] = $item;\n\t\t\t\t\t$sportspress_menu_order[] = 'edit.php?post_type=sp_event';\n\t\t\t\t\t$sportspress_menu_order[] = 'edit.php?post_type=sp_team';\n\t\t\t\t\t$sportspress_menu_order[] = 'edit.php?post_type=sp_player';\n\t\t\t\t\t$sportspress_menu_order[] = 'edit.php?post_type=sp_staff';\n\t\t\t\t\tunset( $menu_order[ $sportspress_separator ] );\n\t\t\t\t\tunset( $menu_order[ $sportspress_event ] );\n\t\t\t\t\tunset( $menu_order[ $sportspress_team ] );\n\t\t\t\t\tunset( $menu_order[ $sportspress_player ] );\n\t\t\t\t\tunset( $menu_order[ $sportspress_staff ] );\n\n\t\t\t\t\t// Apply to added menu items\n\t\t\t\t\t$menu_items = apply_filters( 'sportspress_menu_items', array() );\n\t\t\t\t\tforeach ( $menu_items as $menu_item ) :\n\t\t\t\t\t\t$sportspress_menu_order[] = $menu_item;\n\t\t\t\t\t\t$index                    = array_search( $menu_item, $menu_order );\n\t\t\t\t\t\tunset( $menu_order[ $index ] );\n\t\t\t\t\tendforeach;\n\n\t\t\t\telseif ( ! in_array( $item, array( 'separator-sportspress' ) ) ) :\n\t\t\t\t\t$sportspress_menu_order[] = $item;\n\t\t\t\tendif;\n\n\t\t\tendforeach;\n\n\t\t\t// Return order\n\t\t\treturn $sportspress_menu_order;\n\t\t}\n\n\t\t/**\n\t\t * custom_menu_order\n\t\t *\n\t\t * @return bool\n\t\t */\n\t\tpublic function custom_menu_order() {\n\t\t\tif ( ! current_user_can( 'manage_sportspress' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Clean the SP menu items in admin.\n\t\t */\n\t\tpublic function menu_clean() {\n\t\t\tglobal $menu, $submenu, $current_user;\n\n\t\t\t// Find where our separator is in the menu\n\t\t\tforeach ( $menu as $key => $data ) :\n\t\t\t\tif ( is_array( $data ) && array_key_exists( 2, $data ) && $data[2] == 'edit.php?post_type=sp_separator' ) {\n\t\t\t\t\t$separator_position = $key;\n\t\t\t\t}\n\t\t\tendforeach;\n\n\t\t\t// Swap our separator post type with a menu separator\n\t\t\tif ( isset( $separator_position ) ) :\n\t\t\t\t$menu[ $separator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );\n\t\t\tendif;\n\n\t\t\t// Remove \"Leagues\" and \"Seasons\" links from Events submenu\n\t\t\tif ( isset( $submenu['edit.php?post_type=sp_event'] ) ) :\n\t\t\t\t$submenu['edit.php?post_type=sp_event'] = array_filter( $submenu['edit.php?post_type=sp_event'], array( $this, 'remove_leagues' ) );\n\t\t\t\t$submenu['edit.php?post_type=sp_event'] = array_filter( $submenu['edit.php?post_type=sp_event'], array( $this, 'remove_seasons' ) );\n\t\t\tendif;\n\n\t\t\t// Remove \"Venues\", \"Leagues\" and \"Seasons\" links from Teams submenu\n\t\t\tif ( isset( $submenu['edit.php?post_type=sp_team'] ) ) :\n\t\t\t\t$submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_venues' ) );\n\t\t\t\t$submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_leagues' ) );\n\t\t\t\t$submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_seasons' ) );\n\t\t\tendif;\n\n\t\t\t// Remove \"Leagues\" and \"Seasons\" links from Players submenu\n\t\t\tif ( isset( $submenu['edit.php?post_type=sp_player'] ) ) :\n\t\t\t\t$submenu['edit.php?post_type=sp_player'] = array_filter( $submenu['edit.php?post_type=sp_player'], array( $this, 'remove_leagues' ) );\n\t\t\t\t$submenu['edit.php?post_type=sp_player'] = array_filter( $submenu['edit.php?post_type=sp_player'], array( $this, 'remove_seasons' ) );\n\t\t\tendif;\n\n\t\t\t// Remove \"Leagues\" and \"Seasons\" links from Staff submenu\n\t\t\tif ( isset( $submenu['edit.php?post_type=sp_staff'] ) ) :\n\t\t\t\t$submenu['edit.php?post_type=sp_staff'] = array_filter( $submenu['edit.php?post_type=sp_staff'], array( $this, 'remove_leagues' ) );\n\t\t\t\t$submenu['edit.php?post_type=sp_staff'] = array_filter( $submenu['edit.php?post_type=sp_staff'], array( $this, 'remove_seasons' ) );\n\t\t\tendif;\n\n\t\t\t$user_roles = $current_user->roles;\n\t\t\t$user_role  = array_shift( $user_roles );\n\n\t\t\tif ( in_array( $user_role, array( 'sp_player', 'sp_staff', 'sp_event_manager', 'sp_team_manager' ) ) ) :\n\t\t\t\tremove_menu_page( 'upload.php' );\n\t\t\t\tremove_menu_page( 'edit-comments.php' );\n\t\t\t\tremove_menu_page( 'tools.php' );\n\t\t\tendif;\n\t\t}\n\n\t\t/**\n\t\t * Init the config page\n\t\t */\n\t\tpublic function config_page() {\n\t\t\tinclude 'views/html-admin-config.php';\n\t\t}\n\n\t\t/**\n\t\t * Init the settings page\n\t\t */\n\t\tpublic function settings_page() {\n\t\t\tinclude_once 'class-sp-admin-settings.php';\n\t\t\tSP_Admin_Settings::output();\n\t\t}\n\n\t\tpublic function remove_add_new( $arr = array() ) {\n\t\t\treturn $arr[0] != esc_attr__( 'Add New', 'sportspress' );\n\t\t}\n\n\t\tpublic function remove_leagues( $arr = array() ) {\n\t\t\treturn $arr[0] != esc_attr__( 'Leagues', 'sportspress' );\n\t\t}\n\n\t\tpublic function remove_positions( $arr = array() ) {\n\t\t\treturn $arr[0] != esc_attr__( 'Positions', 'sportspress' );\n\t\t}\n\n\t\tpublic function remove_seasons( $arr = array() ) {\n\t\t\treturn $arr[0] != esc_attr__( 'Seasons', 'sportspress' );\n\t\t}\n\n\t\tpublic function remove_venues( $arr = array() ) {\n\t\t\treturn $arr[0] != esc_attr__( 'Venues', 'sportspress' );\n\t\t}\n\n\t\tpublic static function highlight_admin_menu( $p = 'sportspress', $s = 'sportspress' ) {\n\t\t\tglobal $parent_file, $submenu_file;\n\t\t\t$parent_file  = $p;\n\t\t\t$submenu_file = $s;\n\t\t}\n\n\t\tpublic static function sitemap_taxonomy_post_types( $post_types = array(), $taxonomy = 'sp_venue' ) {\n\t\t\t$post_types = array_intersect( $post_types, sp_primary_post_types() );\n\t\t\t// Remove teams from venues taxonomy post type array\n\t\t\tif ( $taxonomy === 'sp_venue' && ( $key = array_search( 'sp_team', $post_types ) ) !== false ) :\n\t\t\t\tunset( $post_types[ $key ] );\n\t\t\tendif;\n\n\t\t\treturn $post_types;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_Menus();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-notices.php",
    "content": "<?php\n/**\n * Display notices in admin.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.21\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Notices' ) ) :\n\n\t/**\n\t * SP_Admin_Notices Class\n\t */\n\tclass SP_Admin_Notices {\n\n\t\t/**\n\t\t * Hook in tabs.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\tadd_action( 'switch_theme', array( $this, 'reset_admin_notices' ) );\n\t\t\tadd_action( 'sportspress_updated', array( $this, 'reset_admin_notices' ) );\n\t\t\tadd_action( 'admin_print_styles', array( $this, 'add_notices' ) );\n\t\t}\n\n\t\t/**\n\t\t * Reset notices for themes when switched or a new version of SP is installed\n\t\t */\n\t\tpublic function reset_admin_notices() {\n\t\t\tupdate_option( 'sportspress_admin_notices', array( 'template_files', 'theme_support' ) );\n\t\t}\n\n\t\t/**\n\t\t * Add notices + styles if needed.\n\t\t */\n\t\tpublic function add_notices() {\n\t\t\t$screen  = get_current_screen();\n\t\t\t$notices = get_option( 'sportspress_admin_notices', array() );\n\n\t\t\tif ( ! is_object( $screen ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! get_option( 'sportspress_completed_setup' ) && ! in_array( $screen->id, array( 'dashboard_page_sp-about', 'dashboard_page_sp-credits', 'dashboard_page_sp-translators' ) ) ) {\n\t\t\t\twp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ) );\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'setup_notice' ) );\n\t\t\t}\n\n\t\t\tif ( 'post' == $screen->base ) {\n\t\t\t\t$post_id = get_the_ID();\n\t\t\t\tif ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) {\n\t\t\t\t\tadd_action( 'admin_notices', array( $this, 'no_access_notice' ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $_GET['hide_theme_support_notice'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ) ) ) {\n\t\t\t\t$notices = array_diff( $notices, array( 'theme_support' ) );\n\t\t\t\tupdate_option( 'sportspress_admin_notices', $notices );\n\t\t\t}\n\n\t\t\tif ( ! empty( $_GET['hide_template_files_notice'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ) ) ) {\n\t\t\t\t$notices = array_diff( $notices, array( 'template_files' ) );\n\t\t\t\tupdate_option( 'sportspress_admin_notices', $notices );\n\t\t\t}\n\n\t\t\tif ( in_array( 'theme_support', $notices ) && ! current_theme_supports( 'sportspress' ) && ! in_array( $screen->id, array( 'toplevel_page_sportspress', 'dashboard_page_sp-about', 'dashboard_page_sp-credits', 'dashboard_page_sp-translators' ) ) ) {\n\t\t\t\t$template = get_option( 'template' );\n\n\t\t\t\tif ( ! in_array( $template, array( 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ) {\n\t\t\t\t\twp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ) );\n\t\t\t\t\tadd_action( 'admin_notices', array( $this, 'theme_check_notice' ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( in_array( 'template_files', $notices ) ) {\n\t\t\t\twp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ) );\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'template_file_check_notice' ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Show the setup notices\n\t\t */\n\t\tpublic function setup_notice() {\n\t\t\tinclude 'views/html-notice-install.php';\n\t\t}\n\n\t\t/**\n\t\t * Displays a notice when the user doesn't have access to edit a post type\n\t\t */\n\t\tpublic function no_access_notice() {\n\t\t\tinclude 'views/html-notice-no-access.php';\n\t\t}\n\n\t\t/**\n\t\t * Show the Theme Check notice\n\t\t */\n\t\tpublic function theme_check_notice() {\n\t\t\tinclude 'views/html-notice-theme-support.php';\n\t\t}\n\n\t\t/**\n\t\t * Show a notice highlighting bad template files\n\t\t */\n\t\tpublic function template_file_check_notice() {\n\t\t\tif ( isset( $_GET['page'] ) && 'sportspress' == $_GET['page'] && isset( $_GET['tab'] ) && 'status' == $_GET['tab'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$status         = include 'class-sp-admin-status.php';\n\t\t\t$core_templates = $status->scan_template_files( SP()->plugin_path() . '/templates' );\n\t\t\t$outdated       = false;\n\n\t\t\tforeach ( $core_templates as $file ) {\n\t\t\t\t$theme_file = false;\n\t\t\t\tif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {\n\t\t\t\t\t$theme_file = get_stylesheet_directory() . '/' . $file;\n\t\t\t\t} elseif ( file_exists( get_stylesheet_directory() . '/sportspress/' . $file ) ) {\n\t\t\t\t\t$theme_file = get_stylesheet_directory() . '/sportspress/' . $file;\n\t\t\t\t} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {\n\t\t\t\t\t$theme_file = get_template_directory() . '/' . $file;\n\t\t\t\t} elseif ( file_exists( get_template_directory() . '/sportspress/' . $file ) ) {\n\t\t\t\t\t$theme_file = get_template_directory() . '/sportspress/' . $file;\n\t\t\t\t}\n\n\t\t\t\tif ( $theme_file ) {\n\t\t\t\t\t$core_version  = $status->get_file_version( SP()->plugin_path() . '/templates/' . $file );\n\t\t\t\t\t$theme_version = $status->get_file_version( $theme_file );\n\n\t\t\t\t\tif ( $core_version && $theme_version && version_compare( $theme_version, $core_version, '<' ) ) {\n\t\t\t\t\t\t$outdated = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $outdated ) {\n\t\t\t\tinclude 'views/html-notice-template-check.php';\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_Notices();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-permalink-settings.php",
    "content": "<?php\n/**\n * Adds settings to the permalinks admin settings page.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.20\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Permalink_Settings' ) ) :\n\n\t/**\n\t * SP_Admin_Permalink_Settings Class\n\t */\n\tclass SP_Admin_Permalink_Settings {\n\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\tpublic $slugs = array();\n\t\t\n\t\t/**\n\t\t * Hook in tabs.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->slugs = apply_filters(\n\t\t\t\t'sportspress_permalink_slugs',\n\t\t\t\tarray(\n\t\t\t\t\tarray( 'event', esc_attr__( 'Events', 'sportspress' ) ),\n\t\t\t\t\tarray( 'venue', esc_attr__( 'Venues', 'sportspress' ) ),\n\t\t\t\t\tarray( 'calendar', esc_attr__( 'Calendars', 'sportspress' ) ),\n\t\t\t\t\tarray( 'team', esc_attr__( 'Teams', 'sportspress' ) ),\n\t\t\t\t\tarray( 'league', esc_attr__( 'Leagues', 'sportspress' ) ),\n\t\t\t\t\tarray( 'season', esc_attr__( 'Seasons', 'sportspress' ) ),\n\t\t\t\t\tarray( 'table', esc_attr__( 'League Tables', 'sportspress' ) ),\n\t\t\t\t\tarray( 'player', esc_attr__( 'Players', 'sportspress' ) ),\n\t\t\t\t\tarray( 'position', esc_attr__( 'Positions', 'sportspress' ) ),\n\t\t\t\t\tarray( 'list', esc_attr__( 'Player Lists', 'sportspress' ) ),\n\t\t\t\t\tarray( 'staff', esc_attr__( 'Staff', 'sportspress' ) ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tadd_action( 'admin_init', array( $this, 'settings_init' ) );\n\t\t\tadd_action( 'admin_init', array( $this, 'settings_save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Init our settings\n\t\t */\n\t\tpublic function settings_init() {\n\t\t\t// Add a section to the permalinks page\n\t\t\tadd_settings_section( 'sportspress-permalink', esc_attr__( 'SportsPress', 'sportspress' ), array( $this, 'settings' ), 'permalink' );\n\n\t\t\t// Add our settings\n\t\t\tforeach ( $this->slugs as $slug ) :\n\t\t\t\tadd_settings_field(\n\t\t\t\t\t$slug[0],                           // id\n\t\t\t\t\t$slug[1],                           // setting title\n\t\t\t\t\tarray( $this, 'slug_input' ),       // display callback\n\t\t\t\t\t'permalink',                        // settings page\n\t\t\t\t\t'sportspress-permalink'             // settings section\n\t\t\t\t);\n\t\t\tendforeach;\n\t\t}\n\n\t\t/**\n\t\t * Show a slug input box.\n\t\t */\n\t\tpublic function slug_input() {\n\t\t\t$slug = array_shift( $this->slugs );\n\t\t\t$key  = $slug[0];\n\t\t\t$text = get_option( 'sportspress_' . $key . '_slug', null );\n\t\t\t?><fieldset><input id=\"sportspress_<?php echo esc_attr( $key ); ?>_slug\" name=\"sportspress_<?php echo esc_attr( $key ); ?>_slug\" type=\"text\" class=\"regular-text code\" value=\"<?php echo esc_attr( $text ); ?>\" placeholder=\"<?php echo esc_attr( $key ); ?>\"></fieldset>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Show the settings\n\t\t */\n\t\tpublic function settings() {\n\t\t\techo wp_kses_post( wpautop( __( 'These settings control the permalinks used for SportsPress. These settings only apply when <strong>not using \"default\" permalinks above</strong>.', 'sportspress' ) ) );\n        wp_nonce_field( plugin_basename( __FILE__ ), 'sp_permalink_nonce' );\n\t\t}\n\n\t\t/**\n\t\t * Save the settings\n\t\t */\n\t\tpublic function settings_save() {\n\t\t\tif ( ! is_admin() ) :\n\t\t\t\treturn;\n\t\t\tendif;\n\n\t\t\tif ( ! is_user_logged_in() ) :\n\t\t\t\treturn;\n\t\t\tendif;\n\n\t\t\tif ( ! current_user_can( 'manage_sportspress' ) ) :\n\t\t\t\treturn;\n\t\t\tendif;\n\n\t\t\tif ( isset( $_POST['permalink_structure'] ) || isset( $_POST['sportspress_event_slug'] ) ) :\n        if ( ! isset( $_POST['sp_permalink_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['sp_permalink_nonce'] ), plugin_basename( __FILE__ ) ) ) :\n          return;\n        endif;\n\n\t\t\t\tforeach ( $this->slugs as $slug ) :\n\t\t\t\t\t$key   = 'sportspress_' . $slug[0] . '_slug';\n\t\t\t\t\t$value = null;\n\t\t\t\t\tif ( isset( $_POST[ $key ] ) ) {\n\t\t\t\t\t\t$value = sanitize_text_field( wp_unslash( $_POST[ $key ] ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( empty( $value ) ) {\n\t\t\t\t\t\tdelete_option( $key );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tupdate_option( $key, $value );\n\t\t\t\t\t}\n\t\t\t\tendforeach;\n\t\t\t\tsp_flush_rewrite_rules();\n\t\t\tendif;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_Permalink_Settings();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-post-types.php",
    "content": "<?php\n/**\n * Post Types Admin\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.0\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Post_Types' ) ) :\n\n\t/**\n\t * SP_Admin_Post_Types Class\n\t */\n\tclass SP_Admin_Post_Types {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\tadd_action( 'admin_init', array( $this, 'include_post_type_handlers' ) );\n\t\t\tadd_action( 'save_post', array( $this, 'unflag_post' ) );\n\t\t\tadd_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );\n\t\t\tadd_filter( 'sportspress_meta_boxes', array( $this, 'meta_boxes' ) );\n\t\t}\n\n\t\t/**\n\t\t * Conditonally load classes and functions only needed when viewing a post type.\n\t\t */\n\t\tpublic function include_post_type_handlers() {\n\t\t\tinclude_once 'post-types/class-sp-admin-meta-boxes.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-result.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-outcome.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-performance.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-column.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-metric.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-statistic.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-event.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-team.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-player.php';\n\t\t\tinclude_once 'post-types/class-sp-admin-cpt-staff.php';\n\t\t\tdo_action( 'sportspress_include_post_type_handlers' );\n\t\t}\n\n\t\t/**\n\t\t * Unflag preset and sample posts.\n\t\t */\n\t\tpublic function unflag_post( $post_id ) {\n\t\t\t$post_types   = sp_post_types();\n\t\t\t$config_types = sp_config_types();\n\t\t\t$post_type    = get_post_type( $post_id );\n\t\t\tif ( in_array( $post_type, $post_types ) ) :\n\t\t\t\tdelete_post_meta( $post_id, '_sp_sample' );\n\t\t\telseif ( in_array( $post_type, $config_types ) ) :\n\t\t\t\tdelete_post_meta( $post_id, '_sp_preset' );\n\t\t\tendif;\n\t\t}\n\n\t\t/**\n\t\t * Change messages when a post type is updated.\n\t\t *\n\t\t * @param  array $messages\n\t\t * @return array\n\t\t */\n\t\tpublic function post_updated_messages( $messages ) {\n\t\t\tglobal $typenow, $post;\n\n\t\t\tif ( is_sp_config_type( $typenow ) ) :\n\t\t\t\t$obj = get_post_type_object( $typenow );\n\n\t\t\t\tfor ( $i = 0; $i <= 10; $i++ ) :\n\t\t\t\t\t$messages['post'][ $i ] = esc_attr__( 'Settings saved.', 'sportspress' ) .\n\t\t\t\t\t' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=' . $typenow ) ) . '\">' .\n\t\t\t\t\t__( 'View All', 'sportspress' ) . '</a>';\n\t\t\t\tendfor;\n\t\t\telseif ( is_sp_post_type( $typenow ) ) :\n\t\t\t\t$obj = get_post_type_object( $typenow );\n\n\t\t\t\t$messages['post'][1] = esc_attr__( 'Changes saved.', 'sportspress' ) .\n\t\t\t\t' <a href=\"' . esc_url( get_permalink( $post->ID ) ) . '\">' . $obj->labels->view_item . '</a>';\n\n\t\t\t\t$messages['post'][4] = esc_attr__( 'Changes saved.', 'sportspress' );\n\n\t\t\t\t$messages['post'][6] = esc_attr__( 'Success!', 'sportspress' ) .\n\t\t\t\t' <a href=\"' . esc_url( get_permalink( $post->ID ) ) . '\">' . $obj->labels->view_item . '</a>';\n\n\t\t\t\t$messages['post'][7] = esc_attr__( 'Changes saved.', 'sportspress' );\n\n\t\t\t\t$messages['post'][8] = esc_attr__( 'Success!', 'sportspress' ) .\n\t\t\t\t' <a target=\"_blank\" href=\"' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '\">' .\n\t\t\t\tsprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';\n\n\t\t\t\t$messages['post'][9] = sprintf(\n\t\t\t\t\t__( 'Scheduled for: <b>%1$s</b>.', 'sportspress' ),\n\t\t\t\t\tdate_i18n( esc_attr__( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) ),\n\t\t\t\t\tesc_url( get_permalink( $post->ID ) )\n\t\t\t\t) .\n\t\t\t\t\t' <a target=\"_blank\" href=\"' . esc_url( get_permalink( $post->ID ) ) . '\">' .\n\t\t\t\t\tsprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';\n\n\t\t\t\t$messages['post'][10] = esc_attr__( 'Success!', 'sportspress' ) .\n\t\t\t\t\t' <a target=\"_blank\" href=\"' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '\">' .\n\t\t\t\t\tsprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';\n\t\t\tendif;\n\n\t\t\treturn $messages;\n\t\t}\n\n\t\t/**\n\t\t * Remove meta boxes as needed\n\t\t */\n\t\tpublic static function meta_boxes( $meta_boxes ) {\n\t\t\tif ( 'manual' != get_option( 'sportspress_player_columns', 'auto' ) ) {\n\t\t\t\tunset( $meta_boxes['sp_player']['columns'] );\n\t\t\t}\n\t\t\treturn $meta_boxes;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_Post_Types();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-sample-data.php",
    "content": "<?php\n/**\n * SportsPress Admin Sample Data Class.\n *\n * The SportsPress admin sample data class stores demo content.\n *\n * @class       SP_Admin_Sample_Data\n * @version     2.5\n * @package     SportsPress/Admin\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Admin_Sample_Data {\n\n\t/**\n\t * Sample data\n\t *\n\t * Adds sample SportsPress data\n\t *\n\t * @access public\n\t */\n\tpublic static function insert_posts() {\n\n\t\t// Initialize inserted ids array\n\t\t$inserted_ids = array(\n\t\t\t'sp_league'   => array(),\n\t\t\t'sp_season'   => array(),\n\t\t\t'sp_venue'    => array(),\n\t\t\t'sp_position' => array(),\n\t\t\t'sp_role'     => array(),\n\t\t\t'sp_event'    => array(),\n\t\t\t'sp_calendar' => array(),\n\t\t\t'sp_team'     => array(),\n\t\t\t'sp_table'    => array(),\n\t\t\t'sp_player'   => array(),\n\t\t\t'sp_list'     => array(),\n\t\t\t'sp_staff'    => array(),\n\t\t);\n\n\t\t// Terms to insert\n\t\t$taxonomies = array();\n\n\t\t// Leagues\n\t\t$taxonomies['sp_league'] = array( _x( 'Primary League', 'example', 'sportspress' ), _x( 'Secondary League', 'example', 'sportspress' ) );\n\n\t\t// Seasons\n\t\t$current_year            = date( 'Y' );\n\t\t$current_year            = intval( $current_year );\n\t\t$taxonomies['sp_season'] = array( $current_year - 1, $current_year, $current_year + 1 );\n\n\t\t// Venues\n\t\t$taxonomies['sp_venue'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'Bentleigh',\n\t\t\t\t'meta' => array(\n\t\t\t\t\t'sp_address'   => '12A Bolinda Street, Bentleigh VIC 3204, Australia',\n\t\t\t\t\t'sp_latitude'  => -37.920537,\n\t\t\t\t\t'sp_longitude' => 145.043199,\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'Essendon',\n\t\t\t\t'meta' => array(\n\t\t\t\t\t'sp_address'   => '74 Napier Street, Essendon VIC 3040, Australia',\n\t\t\t\t\t'sp_latitude'  => -37.751940,\n\t\t\t\t\t'sp_longitude' => 144.919549,\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'Kensington',\n\t\t\t\t'meta' => array(\n\t\t\t\t\t'sp_address'   => '50 Altona Street, Kensington, Victoria, Australia',\n\t\t\t\t\t'sp_latitude'  => -37.797789,\n\t\t\t\t\t'sp_longitude' => 144.924709,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Jobs\n\t\t$taxonomies['sp_role'] = array( 'Coach' );\n\n\t\t/*\n\t\t * Insert terms\n\t\t */\n\t\tforeach ( $taxonomies as $taxonomy => $terms ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t// Determine if term is array or name string\n\t\t\t\tif ( is_array( $term ) ) {\n\t\t\t\t\t$name = $term['name'];\n\t\t\t\t} else {\n\t\t\t\t\t$name = $term;\n\t\t\t\t}\n\n\t\t\t\t// Insert term\n\t\t\t\t$inserted = wp_insert_term(\n\t\t\t\t\t$name,\n\t\t\t\t\t$taxonomy,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'description' => $name,\n\t\t\t\t\t\t'slug'        => sanitize_title( $name ),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// Add meta to term if is array\n\t\t\t\tif ( ! is_wp_error( $inserted ) && is_array( $term ) && array_key_exists( 'meta', $term ) ) {\n\t\t\t\t\t$t_id = sp_array_value( $inserted, 'term_id', 1 );\n\t\t\t\t\t$meta = sp_array_value( $term, 'meta' );\n\t\t\t\t\tupdate_option( \"taxonomy_$t_id\", $meta );\n\n\t\t\t\t\t// Add to inserted ids array\n\t\t\t\t\t$inserted_ids[ $taxonomy ][] = $t_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Create sample content\n\t\t$sample_content = _x( 'This is an example %1$s. As a new SportsPress user, you should go to <a href=\\\"%3$s\\\">your dashboard</a> to delete this %1$s and create new %2$s for your content. Have fun!', 'example', 'sportspress' );\n\n\t\t// Define teams\n\t\t$teams = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'Bluebirds',\n\t\t\t\t'url'  => 'http://tboy.co/bluebirds',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'Eagles',\n\t\t\t\t'url'  => 'http://tboy.co/eagles',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'Kangaroos',\n\t\t\t\t'url'  => 'http://tboy.co/kangaroos',\n\t\t\t),\n\t\t);\n\n\t\t// Define players\n\t\t$players = array(\n\t\t\t'Mario Bellucci',\n\t\t\t'Aiden Leggatt',\n\t\t\t'Seth Clemens',\n\t\t\t'Mitchell Childe',\n\t\t\t'Daniel Benn',\n\t\t\t'Archie Stead',\n\t\t\t'Finn Rosetta',\n\t\t\t'Koby Brough',\n\t\t\t'Blake Bannan',\n\t\t\t'Hugo Stones',\n\t\t\t'Tristian Holme',\n\t\t\t'Mason Ewing',\n\t\t);\n\n\t\t// Define staff\n\t\t$staff = array(\n\t\t\t'Bobby Brown',\n\t\t);\n\n\t\t// Define event videos\n\t\t$event_videos = array(\n\t\t\t'https://www.youtube.com/watch?v=xNkf2LYckI0',\n\t\t\t'https://www.youtube.com/watch?v=sIrjQyuwteM',\n\t\t\t'https://www.youtube.com/watch?v=xSGxuTGVQYE',\n\t\t);\n\n\t\t// Get countries\n\t\t$countries = new SP_Countries();\n\n\t\t/*\n\t\t * Insert teams\n\t\t */\n\t\tforeach ( $teams as $index => $team ) {\n\t\t\t$post['post_title']   = $team['name'];\n\t\t\t$post['post_type']    = 'sp_team';\n\t\t\t$post['post_status']  = 'publish';\n\t\t\t$post['post_content'] = sprintf( $sample_content, esc_attr__( 'Team', 'sportspress' ), esc_attr__( 'Teams', 'sportspress' ), add_query_arg( 'post_type', 'sp_team', admin_url( 'edit.php' ) ) );\n\n\t\t\t// Terms\n\t\t\t$post['tax_input'] = array();\n\t\t\t$taxonomies        = array( 'sp_league', 'sp_season' );\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\t$post['tax_input'][ $taxonomy ] = get_terms(\n\t\t\t\t\t$taxonomy,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$post['tax_input']['sp_venue'] = get_terms(\n\t\t\t\t'sp_venue',\n\t\t\t\tarray(\n\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t'orderby'    => 'id',\n\t\t\t\t\t'order'      => 'ASC',\n\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t'offset'     => $index,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Insert post\n\t\t\t$id = wp_insert_post( $post );\n\n\t\t\t// Add to inserted ids array\n\t\t\t$inserted_ids['sp_team'][] = $id;\n\n\t\t\t// Flag as sample\n\t\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\n\t\t\t// Update meta\n\t\t\tupdate_post_meta( $id, 'sp_url', $team['url'] );\n\t\t}\n\n\t\t// Get columns\n\t\t$columns = array( 'team' );\n\t\t$args    = array(\n\t\t\t'post_type'      => array( 'sp_performance', 'sp_statistic' ),\n\t\t\t'posts_per_page' => 2,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\t\t$vars    = get_posts( $args );\n\t\tforeach ( $vars as $var ) {\n\t\t\t$columns[] = $var->post_name;\n\t\t}\n\n\t\t/*\n\t\t * Insert players\n\t\t */\n\t\tforeach ( $players as $index => $name ) {\n\t\t\t$post['post_title']   = $name;\n\t\t\t$post['post_type']    = 'sp_player';\n\t\t\t$post['post_status']  = 'publish';\n\t\t\t$post['post_content'] = sprintf( $sample_content, esc_attr__( 'Player', 'sportspress' ), esc_attr__( 'Players', 'sportspress' ), add_query_arg( 'post_type', 'sp_player', admin_url( 'edit.php' ) ) );\n\n\t\t\t// Terms\n\t\t\t$post['tax_input'] = array();\n\t\t\t$taxonomies        = array( 'sp_league', 'sp_season' );\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\t$post['tax_input'][ $taxonomy ] = get_terms(\n\t\t\t\t\t$taxonomy,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$taxonomies = array( 'sp_position' );\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\t$terms = get_terms(\n\t\t\t\t\t$taxonomy,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t\t'offset'     => $index % 4,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif ( $terms && ! is_wp_error( $terms ) ) {\n\t\t\t\t\t$post['tax_input'][ $taxonomy ] = $terms;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Insert post\n\t\t\t$id = wp_insert_post( $post );\n\n\t\t\t// Add to inserted ids array\n\t\t\t$inserted_ids['sp_player'][] = $id;\n\n\t\t\t// Flag as sample\n\t\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\n\t\t\t// Calculate meta\n\t\t\t$nationality     = array_rand( $countries->countries );\n\t\t\t$team_index      = floor( $index / 4 );\n\t\t\t$past_team_index = ( $team_index + 1 ) % 3;\n\t\t\t$current_team    = sp_array_value( $inserted_ids['sp_team'], $team_index, 0 );\n\t\t\t$past_team       = sp_array_value( $inserted_ids['sp_team'], $past_team_index, 0 );\n\t\t\t$primary_league  = reset( $post['tax_input']['sp_league'] );\n\t\t\t$season_teams    = $season_stats = array();\n\t\t\tforeach ( $post['tax_input']['sp_season'] as $season_index => $season_id ) {\n\t\t\t\t$season_stats[ $season_id ] = array();\n\t\t\t\tif ( $season_index == 0 ) {\n\t\t\t\t\t$season_teams[ $season_id ] = $past_team;\n\t\t\t\t} else {\n\t\t\t\t\t$season_teams[ $season_id ] = $current_team;\n\t\t\t\t\tif ( $season_index == 1 ) {\n\t\t\t\t\t\tforeach ( $vars as $var ) {\n\t\t\t\t\t\t\t$season_stats[ $season_id ][ $var->post_name ] = rand( 1, 10 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$player_stats   = array( $primary_league => $season_stats );\n\t\t\t$player_leagues = array( $primary_league => $season_teams );\n\n\t\t\t// Update meta\n\t\t\tupdate_post_meta( $id, 'sp_columns', $columns );\n\t\t\tupdate_post_meta( $id, 'sp_number', $index + 1 );\n\t\t\tupdate_post_meta( $id, 'sp_nationality', $nationality );\n\t\t\tupdate_post_meta( $id, 'sp_current_team', $current_team );\n\t\t\tupdate_post_meta( $id, 'sp_past_team', $past_team );\n\t\t\tupdate_post_meta( $id, 'sp_leagues', $player_leagues );\n\t\t\tupdate_post_meta( $id, 'sp_statistics', $player_stats );\n\t\t\tsp_update_post_meta_recursive( $id, 'sp_team', array( $current_team, $past_team ) );\n\t\t}\n\n\t\t// Get columns\n\t\t$columns           = array();\n\t\t$args              = array(\n\t\t\t'post_type'      => 'sp_performance',\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\t\t$performance_posts = get_posts( $args );\n\t\tforeach ( $performance_posts as $performance_post ) {\n\t\t\tif ( sizeof( $columns ) >= 5 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$columns[] = $performance_post->post_name;\n\t\t}\n\t\t$args          = array(\n\t\t\t'post_type'      => 'sp_result',\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\t\t$result_posts  = get_posts( $args );\n\t\t$args          = array(\n\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\t\t$outcome_posts = get_posts( $args );\n\n\t\t/*\n\t\t * Insert staff\n\t\t */\n\t\tforeach ( $staff as $index => $name ) {\n\t\t\t$post['post_title']   = $name;\n\t\t\t$post['post_type']    = 'sp_staff';\n\t\t\t$post['post_status']  = 'publish';\n\t\t\t$post['post_content'] = sprintf( $sample_content, esc_attr__( 'Staff', 'sportspress' ), esc_attr__( 'Staff', 'sportspress' ), add_query_arg( 'post_type', 'sp_staff', admin_url( 'edit.php' ) ) );\n\n\t\t\t// Terms\n\t\t\t$post['tax_input'] = array();\n\t\t\t$taxonomies        = array( 'sp_league', 'sp_season' );\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\t$post['tax_input'][ $taxonomy ] = get_terms(\n\t\t\t\t\t$taxonomy,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$taxonomies = array( 'sp_role' );\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\t$terms                          = get_terms(\n\t\t\t\t\t$taxonomy,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t\t'offset'     => $index % 4,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$post['tax_input'][ $taxonomy ] = $terms;\n\t\t\t}\n\n\t\t\t// Insert post\n\t\t\t$id = wp_insert_post( $post );\n\n\t\t\t// Add to inserted ids array\n\t\t\t$inserted_ids['sp_staff'][] = $id;\n\n\t\t\t// Flag as sample\n\t\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\n\t\t\t// Calculate meta\n\t\t\t$team_index   = floor( $index / 4 );\n\t\t\t$past_teams   = $inserted_ids['sp_team'];\n\t\t\t$current_team = sp_array_value( $past_teams, $team_index, 0 );\n\t\t\tunset( $past_teams[ $team_index ] );\n\n\t\t\t// Update meta\n\t\t\tupdate_post_meta( $id, 'sp_columns', $columns );\n\t\t\tupdate_post_meta( $id, 'sp_number', $index + 1 );\n\t\t\tupdate_post_meta( $id, 'sp_nationality', 'aus' );\n\t\t\tupdate_post_meta( $id, 'sp_current_team', $current_team );\n\t\t\tsp_update_post_meta_recursive( $id, 'sp_past_team', $past_teams );\n\t\t\tsp_update_post_meta_recursive( $id, 'sp_team', $inserted_ids['sp_team'] );\n\t\t}\n\n\t\t/*\n\t\t * Insert events\n\t\t */\n\t\tfor ( $index = 0; $index < 6; $index ++ ) {\n\t\t\t// Determine team index and post status\n\t\t\t$i = $index % 3;\n\t\t\tif ( $index < 3 ) {\n\t\t\t\t$post_status  = 'publish';\n\t\t\t\t$post_year    = $current_year - 1;\n\t\t\t\t$event_season = get_terms(\n\t\t\t\t\t'sp_season',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t\t'orderby'    => 'id',\n\t\t\t\t\t\t'order'      => 'ASC',\n\t\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$post_status  = 'future';\n\t\t\t\t$post_year    = $current_year + 1;\n\t\t\t\t$event_season = get_terms(\n\t\t\t\t\t'sp_season',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t\t'orderby'    => 'id',\n\t\t\t\t\t\t'order'      => 'DESC',\n\t\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t// The away team should be the next inserted team, or the first if this is the last event\n\t\t\tif ( $i == 2 ) {\n\t\t\t\t$away_index = 0;\n\t\t\t} else {\n\t\t\t\t$away_index = $i + 1;\n\t\t\t}\n\t\t\t$post = array(\n\t\t\t\t'post_title'   => $teams[ $i ]['name'] . ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ' . $teams[ $away_index ]['name'],\n\t\t\t\t'post_type'    => 'sp_event',\n\t\t\t\t'post_status'  => $post_status,\n\t\t\t\t'post_content' => sprintf( $sample_content, esc_attr__( 'Event', 'sportspress' ), esc_attr__( 'Events', 'sportspress' ), add_query_arg( 'post_type', 'sp_event', admin_url( 'edit.php' ) ) ),\n\t\t\t\t'post_date'    => $post_year . '-' . sprintf( '%02d', 3 + $i * 3 ) . '-' . sprintf( '%02d', 5 + $i * 10 ) . ' ' . ( 18 + $i ) . ':00:00',\n\t\t\t\t'tax_input'    => array(\n\t\t\t\t\t'sp_league' => get_terms(\n\t\t\t\t\t\t'sp_league',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t\t\t'orderby'    => 'id',\n\t\t\t\t\t\t\t'order'      => 'ASC',\n\t\t\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'sp_season' => $event_season,\n\t\t\t\t\t'sp_venue'  => get_terms(\n\t\t\t\t\t\t'sp_venue',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t\t\t'orderby'    => 'id',\n\t\t\t\t\t\t\t'order'      => 'ASC',\n\t\t\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t\t\t'offset'     => $i,\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t// Insert post\n\t\t\t$id = wp_insert_post( $post );\n\n\t\t\t// Add to inserted ids array\n\t\t\t$inserted_ids['sp_event'][] = $id;\n\n\t\t\t// Flag as sample\n\t\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\n\t\t\t// Calculate home and away team ids\n\t\t\t$home_team_index = ( $i ) % 3;\n\t\t\t$away_team_index = ( $i + 1 ) % 3;\n\t\t\t$home_team_id    = sp_array_value( $inserted_ids['sp_team'], $home_team_index, 0 );\n\t\t\t$away_team_id    = sp_array_value( $inserted_ids['sp_team'], $away_team_index, 0 );\n\t\t\t$event_teams     = array(\n\t\t\t\t$home_team_id,\n\t\t\t\t$away_team_id,\n\t\t\t);\n\n\t\t\t// Initialize meta\n\t\t\t$event_players = array( 0 );\n\t\t\t$performance   = $results = array();\n\n\t\t\tif ( $home_team_id ) {\n\t\t\t\t// Add home team player performance\n\t\t\t\t$performance[ $home_team_id ] = array();\n\t\t\t\tfor ( $j = 0; $j < 4; $j ++ ) {\n\t\t\t\t\t$player_id          = sp_array_value( $inserted_ids['sp_player'], $home_team_index * 4 + $j );\n\t\t\t\t\t$event_players[]    = $player_id;\n\t\t\t\t\t$player_performance = array();\n\t\t\t\t\tforeach ( $performance_posts as $performance_post ) {\n\t\t\t\t\t\t$player_performance[ $performance_post->post_name ] = rand( 0, 1 );\n\t\t\t\t\t}\n\t\t\t\t\t$performance[ $home_team_id ][ $player_id ] = $player_performance;\n\t\t\t\t}\n\n\t\t\t\t// Add home team results\n\t\t\t\t$results[ $home_team_id ] = array();\n\t\t\t\tforeach ( $result_posts as $result_post_index => $result_post ) {\n\t\t\t\t\t$results[ $home_team_id ][ $result_post->post_name ] = 1 + $result_post_index;\n\t\t\t\t}\n\t\t\t\t$outcome = reset( $outcome_posts );\n\t\t\t\tif ( is_object( $outcome ) ) {\n\t\t\t\t\t$results[ $home_team_id ]['outcome'] = array( $outcome->post_name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Separate teams with zero\n\t\t\t$event_players[] = 0;\n\n\t\t\tif ( $away_team_id ) {\n\t\t\t\t$performance[ $away_team_id ] = array();\n\t\t\t\tfor ( $j = 0; $j < 4; $j ++ ) {\n\t\t\t\t\t$player_id          = sp_array_value( $inserted_ids['sp_player'], $away_team_index * 4 + $j );\n\t\t\t\t\t$event_players[]    = $player_id;\n\t\t\t\t\t$player_performance = array();\n\t\t\t\t\tforeach ( $performance_posts as $performance_post ) {\n\t\t\t\t\t\t$player_performance[ $performance_post->post_name ] = rand( 0, 1 );\n\t\t\t\t\t}\n\t\t\t\t\t$performance[ $away_team_id ][ $player_id ] = $player_performance;\n\t\t\t\t}\n\n\t\t\t\t// Add away team results\n\t\t\t\t$results[ $away_team_id ] = array();\n\t\t\t\tforeach ( $result_posts as $result_post ) {\n\t\t\t\t\t$results[ $away_team_id ][ $result_post->post_name ] = '0';\n\t\t\t\t}\n\t\t\t\t$outcome = next( $outcome_posts );\n\t\t\t\tif ( is_object( $outcome ) ) {\n\t\t\t\t\t$results[ $away_team_id ]['outcome'] = array( $outcome->post_name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( 'publish' === $post_status ) {\n\t\t\t\t// Swap results for last event only\n\t\t\t\tif ( $i == 2 ) {\n\t\t\t\t\t$k       = array_keys( $results );\n\t\t\t\t\t$v       = array_values( $results );\n\t\t\t\t\t$rv      = array_reverse( $v );\n\t\t\t\t\t$results = array_combine( $k, $rv );\n\t\t\t\t}\n\n\t\t\t\t// Update future post meta\n\t\t\t\tupdate_post_meta( $id, 'sp_players', $performance );\n\t\t\t\tupdate_post_meta( $id, 'sp_results', $results );\n\t\t\t}\n\n\t\t\t// Update general meta\n\t\t\tsp_update_post_meta_recursive( $id, 'sp_team', $event_teams );\n\t\t\tsp_update_post_meta_recursive( $id, 'sp_player', $event_players );\n\t\t\tupdate_post_meta( $id, 'sp_columns', $columns );\n\t\t\tupdate_post_meta( $id, 'sp_format', 'league' );\n\t\t\tupdate_post_meta( $id, 'sp_video', $event_videos[ $i ] );\n\t\t}\n\n\t\t/*\n\t\t * Insert calendar\n\t\t */\n\t\t$post = array(\n\t\t\t'post_title'   => _x( 'Fixtures & Results', 'example', 'sportspress' ),\n\t\t\t'post_type'    => 'sp_calendar',\n\t\t\t'post_status'  => 'publish',\n\t\t\t'post_content' => sprintf( $sample_content, esc_attr__( 'Calendar', 'sportspress' ), esc_attr__( 'Calendars', 'sportspress' ), add_query_arg( 'post_type', 'sp_calendar', admin_url( 'edit.php' ) ) ),\n\t\t);\n\n\t\t// Insert post\n\t\t$id = wp_insert_post( $post );\n\n\t\t// Add to inserted ids array\n\t\t$inserted_ids['sp_calendar'][] = $id;\n\n\t\t// Flag as sample\n\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\n\t\t// Define columns\n\t\t$columns = array( 'event', 'time', 'article' );\n\n\t\t// Update meta\n\t\tupdate_post_meta( $id, 'sp_format', 'list' );\n\t\tupdate_post_meta( $id, 'sp_status', 'any' );\n\t\tupdate_post_meta( $id, 'sp_date', 0 );\n\t\tupdate_post_meta( $id, 'sp_team', 0 );\n\t\tupdate_post_meta( $id, 'sp_order', 'ASC' );\n\t\tupdate_post_meta( $id, 'sp_columns', $columns );\n\n\t\t/*\n\t\t * Insert league table\n\t\t */\n\t\t$leagues = get_terms(\n\t\t\t'sp_league',\n\t\t\tarray(\n\t\t\t\t'hide_empty' => 0,\n\t\t\t\t'orderby'    => 'id',\n\t\t\t\t'order'      => 'ASC',\n\t\t\t\t'number'     => 1,\n\t\t\t)\n\t\t);\n\t\t$league  = reset( $leagues );\n\t\t$seasons = get_terms(\n\t\t\t'sp_season',\n\t\t\tarray(\n\t\t\t\t'hide_empty' => 0,\n\t\t\t\t'orderby'    => 'id',\n\t\t\t\t'order'      => 'ASC',\n\t\t\t\t'number'     => 1,\n\t\t\t)\n\t\t);\n\t\t$season  = reset( $seasons );\n\t\t$post    = array(\n\t\t\t'post_title'   => $league->name . ' ' . $season->name,\n\t\t\t'post_type'    => 'sp_table',\n\t\t\t'post_status'  => 'publish',\n\t\t\t'post_content' => sprintf( $sample_content, esc_attr__( 'League Table', 'sportspress' ), esc_attr__( 'League Tables', 'sportspress' ), add_query_arg( 'post_type', 'sp_table', admin_url( 'edit.php' ) ) ),\n\t\t\t'tax_input'    => array(\n\t\t\t\t'sp_league' => $league->term_id,\n\t\t\t\t'sp_season' => $season->term_id,\n\t\t\t),\n\t\t);\n\n\t\t// Insert post\n\t\t$id = wp_insert_post( $post );\n\n\t\t// Add to inserted ids array\n\t\t$inserted_ids['sp_table'][] = $id;\n\n\t\t// Flag as sample\n\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\n\t\t// Get columns\n\t\t$columns      = array();\n\t\t$args         = array(\n\t\t\t'post_type'      => 'sp_column',\n\t\t\t'posts_per_page' => 8,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\t\t$column_posts = get_posts( $args );\n\t\tforeach ( $column_posts as $column_post ) {\n\t\t\t$columns[] = $column_post->post_name;\n\t\t}\n\n\t\t// Update meta\n\t\tsp_update_post_meta_recursive( $id, 'sp_team', $inserted_ids['sp_team'] );\n\t\tupdate_post_meta( $id, 'sp_columns', $columns );\n\t\tupdate_post_meta( $id, 'sp_highlight', reset( $inserted_ids['sp_team'] ) );\n\n\t\t/*\n\t\t * Insert player list for each team\n\t\t */\n\t\tforeach ( $inserted_ids['sp_team'] as $index => $team_id ) {\n\t\t\t$post = array(\n\t\t\t\t'post_title'   => get_the_title( $team_id ) . ' ' . _x( 'Roster', 'example', 'sportspress' ),\n\t\t\t\t'post_type'    => 'sp_list',\n\t\t\t\t'post_status'  => 'publish',\n\t\t\t\t'post_content' => sprintf( $sample_content, esc_attr__( 'Player List', 'sportspress' ), esc_attr__( 'Player Lists', 'sportspress' ), add_query_arg( 'post_type', 'sp_list', admin_url( 'edit.php' ) ) ),\n\t\t\t);\n\n\t\t\t// Insert post\n\t\t\t$id = wp_insert_post( $post );\n\n\t\t\t// Add to inserted ids array\n\t\t\t$inserted_ids['sp_list'][] = $id;\n\n\t\t\t// Flag as sample\n\t\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\n\t\t\t// Get players from team\n\t\t\t$list_players = array_slice( $inserted_ids['sp_player'], $index * 4, 4 );\n\n\t\t\t// Get columns\n\t\t\t$columns      = array();\n\t\t\t$args         = array(\n\t\t\t\t'post_type'      => array( 'sp_metric' ),\n\t\t\t\t'posts_per_page' => 2,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$column_posts = get_posts( $args );\n\t\t\tforeach ( $column_posts as $column_post ) {\n\t\t\t\t$columns[] = $column_post->post_name;\n\t\t\t}\n\n\t\t\t// Update meta\n\t\t\tupdate_post_meta( $id, 'sp_format', 'list' );\n\t\t\tsp_update_post_meta_recursive( $id, 'sp_player', $list_players );\n\t\t\tupdate_post_meta( $id, 'sp_columns', $columns );\n\t\t\tupdate_post_meta( $id, 'sp_grouping', 'position' );\n\t\t\tupdate_post_meta( $id, 'sp_orderby', 'name' );\n\t\t\tupdate_post_meta( $id, 'sp_order', 'ASC' );\n\t\t\tupdate_post_meta( $id, 'sp_team', $team_id );\n\t\t}\n\n\t\t/*\n\t\t * Insert player list for player ranking\n\t\t */\n\t\t$post = array(\n\t\t\t'post_title'   => _x( 'Player Ranking', 'example', 'sportspress' ),\n\t\t\t'post_type'    => 'sp_list',\n\t\t\t'post_status'  => 'publish',\n\t\t\t'post_content' => sprintf( $sample_content, esc_attr__( 'Player List', 'sportspress' ), esc_attr__( 'Player Lists', 'sportspress' ), add_query_arg( 'post_type', 'sp_list', admin_url( 'edit.php' ) ) ),\n\t\t);\n\n\t\t// Insert post\n\t\t$id = wp_insert_post( $post );\n\n\t\t// Add to inserted ids array\n\t\t$inserted_ids['sp_list'][] = $id;\n\n\t\t// Flag as sample\n\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\n\t\t// Get columns\n\t\t$columns          = array( 'team' );\n\t\t$performance_post = reset( $performance_posts );\n\t\tif ( is_object( $performance_post ) ) {\n\t\t\t$columns[] = $performance_post->post_name;\n\t\t}\n\n\t\t// Update meta\n\t\tupdate_post_meta( $id, 'sp_format', 'list' );\n\t\tsp_update_post_meta_recursive( $id, 'sp_player', $inserted_ids['sp_player'] );\n\t\tupdate_post_meta( $id, 'sp_columns', $columns );\n\t\tupdate_post_meta( $id, 'sp_grouping', '0' );\n\t\tupdate_post_meta( $id, 'sp_order', 'DESC' );\n\t\tif ( is_object( $performance_post ) ) {\n\t\t\tupdate_post_meta( $id, 'sp_orderby', $performance_post->post_name );\n\t\t}\n\n\t\t/*\n\t\t * Update player list and league table per team\n\t\t */\n\t\tforeach ( $inserted_ids['sp_team'] as $index => $team_id ) {\n\t\t\tupdate_post_meta( $team_id, 'sp_list', sp_array_value( $inserted_ids['sp_list'], $index, 0 ) );\n\t\t\tupdate_post_meta( $team_id, 'sp_table', sp_array_value( $inserted_ids['sp_table'], 0 ) );\n\t\t}\n\t}\n\n\t/**\n\t * Deletes sample SportsPress data\n\t *\n\t * @access public\n\t */\n\tpublic static function delete_posts() {\n\t\t$post_types = sp_post_types();\n\t\t$args       = array(\n\t\t\t'post_type'      => $post_types,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'post_status'    => array( 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash' ),\n\t\t\t'meta_query'     => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => '_sp_sample',\n\t\t\t\t\t'value' => 1,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Delete posts\n\t\t$old_posts = get_posts( $args );\n\t\tforeach ( $old_posts as $post ) :\n\t\t\twp_delete_post( $post->ID, true );\n\t\tendforeach;\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-sp-admin-settings.php",
    "content": "<?php\n/**\n * SportsPress Admin Settings Class.\n *\n * @author    ThemeBoy\n * @category  Admin\n * @package   SportsPress/Admin\n * @version   2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Settings' ) ) :\n\n\t/**\n\t * SP_Admin_Settings\n\t */\n\tclass SP_Admin_Settings {\n\n\t\tprivate static $settings  = array();\n\t\tprivate static $errors    = array();\n\t\tprivate static $messages  = array();\n\t\tprivate static $overrides = array();\n\n\t\t/**\n\t\t * Include the settings page classes\n\t\t */\n\t\tpublic static function get_settings_pages() {\n\t\t\tif ( empty( self::$settings ) ) {\n\t\t\t\t$settings = array();\n\n\t\t\t\tinclude_once 'class-sp-admin-sports.php';\n\t\t\t\tinclude_once 'settings/class-sp-settings-page.php';\n\n\t\t\t\t$settings[] = include 'settings/class-sp-settings-modules.php';\n\t\t\t\t$settings[] = include 'settings/class-sp-settings-general.php';\n\t\t\t\t$settings[] = include 'settings/class-sp-settings-events.php';\n\t\t\t\t$settings[] = include 'settings/class-sp-settings-teams.php';\n\t\t\t\t$settings[] = include 'settings/class-sp-settings-players.php';\n\t\t\t\t$settings[] = include 'settings/class-sp-settings-staff.php';\n\n\t\t\t\t$settings = apply_filters( 'sportspress_get_settings_pages', $settings );\n\n\t\t\t\t$settings[] = include 'settings/class-sp-settings-text.php';\n\n\t\t\t\tif (\n\t\t\t\t( ! is_multisite() && current_user_can( 'manage_options' ) ) ||\n\t\t\t\t( is_multisite() && current_user_can( 'manage_network_options' ) )\n\t\t\t\t) {\n\t\t\t\t\t$settings[] = include 'settings/class-sp-settings-licenses.php';\n\t\t\t\t}\n\n\t\t\t\t$settings[] = include 'settings/class-sp-settings-status.php';\n\n\t\t\t\tself::$settings = apply_filters( 'sportspress_get_settings_config_pages', $settings );\n\t\t\t}\n\t\t\treturn self::$settings;\n\t\t}\n\n\t\t/**\n\t\t * Save the settings\n\t\t */\n\t\tpublic static function save() {\n\t\t\tglobal $current_section, $current_tab;\n\n\t\t\tif ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'sportspress-settings' ) ) {\n\t\t\t\tdie( esc_html__( 'Action failed. Please refresh the page and retry.', 'sportspress' ) );\n\t\t\t}\n\n\t\t\t// Trigger actions\n\t\t\tdo_action( 'sportspress_settings_save_' . $current_tab );\n\t\t\tdo_action( 'sportspress_update_options_' . $current_tab );\n\t\t\tdo_action( 'sportspress_update_options' );\n\n\t\t\tself::add_message( esc_attr__( 'Your settings have been saved.', 'sportspress' ) );\n\n\t\t\tdo_action( 'sportspress_settings_saved' );\n\t\t}\n\n\t\t/**\n\t\t * Add a message\n\t\t *\n\t\t * @param string $text\n\t\t */\n\t\tpublic static function add_message( $text ) {\n\t\t\tself::$messages[] = $text;\n\t\t}\n\n\t\t/**\n\t\t * Add an override\n\t\t *\n\t\t * @param string $text\n\t\t */\n\t\tpublic static function add_override( $text ) {\n\t\t\tself::$overrides[] = $text;\n\t\t}\n\n\t\t/**\n\t\t * Add an error\n\t\t *\n\t\t * @param string $text\n\t\t */\n\t\tpublic static function add_error( $text ) {\n\t\t\tself::$errors[] = $text;\n\t\t}\n\n\t\t/**\n\t\t * Output messages + overrides + errors\n\t\t */\n\t\tpublic static function show_messages() {\n\t\t\tif ( sizeof( self::$errors ) > 0 ) {\n\t\t\t\tforeach ( self::$errors as $error ) {\n\t\t\t\t\techo '<div id=\"message\" class=\"error fade\"><p><strong>' . esc_html( $error ) . '</strong></p></div>';\n\t\t\t\t}\n\t\t\t} elseif ( sizeof( self::$overrides ) > 0 ) {\n\t\t\t\tforeach ( self::$overrides as $override ) {\n\t\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p><strong>' . esc_html( $override ) . '</strong></p></div>';\n\t\t\t\t}\n\t\t\t} elseif ( sizeof( self::$messages ) > 0 ) {\n\t\t\t\tforeach ( self::$messages as $message ) {\n\t\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p><strong>' . esc_html( $message ) . '</strong></p></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Settings page.\n\t\t *\n\t\t * Handles the display of the main sportspress settings page in admin.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic static function output() {\n\t\t\tglobal $current_section, $current_tab;\n\n\t\t\tdo_action( 'sportspress_settings_start' );\n\n\t\t\twp_enqueue_script( 'sportspress_settings', SP()->plugin_url() . '/assets/js/admin/settings.js', array( 'jquery', 'wp-color-picker', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'chosen' ), SP()->version, true );\n\n\t\t\twp_localize_script(\n\t\t\t\t'sportspress_settings',\n\t\t\t\t'localized_strings',\n\t\t\t\tarray(\n\t\t\t\t\t'none' => esc_attr__( 'None', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Include settings pages\n\t\t\tself::get_settings_pages();\n\n\t\t\t// Get current tab/section\n\t\t\t$current_tab     = empty( $_GET['tab'] ) ? 'modules' : sanitize_title( wp_unslash( $_GET['tab'] ) );\n\t\t\t$current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( wp_unslash( $_REQUEST['section'] ) );\n\n\t\t\t// Save settings if data has been posted\n\t\t\tif ( ! empty( $_POST ) ) {\n\t\t\t\tself::save();\n\t\t\t}\n\n\t\t\t// Add any posted messages\n\t\t\tif ( ! empty( $_GET['sp_error'] ) ) {\n\t\t\t\tself::add_error( stripslashes( sanitize_text_field( wp_unslash( $_GET['sp_error'] ) ) ) );\n\t\t\t}\n\n\t\t\tif ( ! empty( $_GET['sp_message'] ) ) {\n\t\t\t\tself::add_message( stripslashes( sanitize_text_field( wp_unslash( $_GET['sp_message'] ) ) ) );\n\t\t\t}\n\n\t\t\tself::show_messages();\n\n\t\t\t// Get tabs for the settings page\n\t\t\t$tabs = apply_filters( 'sportspress_settings_tabs_array', array() );\n\n\t\t\tinclude 'views/html-admin-settings.php';\n\t\t}\n\n\t\t/**\n\t\t * Get a setting from the settings API.\n\t\t *\n\t\t * @param mixed $option\n\t\t * @return string\n\t\t */\n\t\tpublic static function get_option( $option_name, $default = '' ) {\n\t\t\t// Array value\n\t\t\tif ( strstr( $option_name, '[' ) ) {\n\n\t\t\t\tparse_str( html_entity_decode( $option_name ), $option_array );\n\n\t\t\t\t// Option name is first key\n\t\t\t\t$option_name = current( array_keys( $option_array ) );\n\n\t\t\t\t// Get value\n\t\t\t\t$option_values = get_option( $option_name, '' );\n\n\t\t\t\t$key = key( $option_array[ $option_name ] );\n\n\t\t\t\tif ( isset( $option_values[ $key ] ) ) {\n\t\t\t\t\t$option_value = $option_values[ $key ];\n\t\t\t\t} else {\n\t\t\t\t\t$option_value = null;\n\t\t\t\t}\n\n\t\t\t\t// Single value\n\t\t\t} else {\n\t\t\t\t$option_value = get_option( $option_name, null );\n\t\t\t}\n\n\t\t\tif ( is_array( $option_value ) ) {\n\t\t\t\t$option_value = array_map( 'stripslashes', $option_value );\n\t\t\t} elseif ( ! is_null( $option_value ) ) {\n\t\t\t\t$option_value = stripslashes( $option_value );\n\t\t\t}\n\n\t\t\treturn $option_value === null ? $default : $option_value;\n\t\t}\n\n\t\t/**\n\t\t * Output admin fields.\n\t\t *\n\t\t * Loops though the sportspress options array and outputs each field.\n\t\t *\n\t\t * @access public\n\t\t * @param array $options Opens array to output\n\t\t */\n\t\tpublic static function output_fields( $options ) {\n\t\t\tforeach ( $options as $value ) {\n\t\t\t\tif ( ! isset( $value['type'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $value['id'] ) ) {\n\t\t\t\t\t$value['id'] = '';\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $value['title'] ) ) {\n\t\t\t\t\t$value['title'] = isset( $value['name'] ) ? $value['name'] : '';\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $value['class'] ) ) {\n\t\t\t\t\t$value['class'] = '';\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $value['css'] ) ) {\n\t\t\t\t\t$value['css'] = '';\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $value['default'] ) ) {\n\t\t\t\t\t$value['default'] = '';\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $value['desc'] ) ) {\n\t\t\t\t\t$value['desc'] = '';\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $value['desc_tip'] ) ) {\n\t\t\t\t\t$value['desc_tip'] = false;\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $value['placeholder'] ) ) {\n\t\t\t\t\t$value['placeholder'] = '';\n\t\t\t\t}\n\n\t\t\t\t// Custom attribute handling\n\t\t\t\t$custom_attributes = array();\n\n\t\t\t\tif ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) {\n\t\t\t\t\tforeach ( $value['custom_attributes'] as $attribute => $attribute_value ) {\n\t\t\t\t\t\t$custom_attributes[] = esc_attr( $attribute ) . '=\"' . esc_attr( $attribute_value ) . '\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Description handling\n\t\t\t\tif ( $value['desc_tip'] === true ) {\n\t\t\t\t\t$description = '';\n\t\t\t\t\t$tip         = $value['desc'];\n\t\t\t\t} elseif ( ! empty( $value['desc_tip'] ) ) {\n\t\t\t\t\t$description = $value['desc'];\n\t\t\t\t\t$tip         = $value['desc_tip'];\n\t\t\t\t} elseif ( ! empty( $value['desc'] ) ) {\n\t\t\t\t\t$description = $value['desc'];\n\t\t\t\t\t$tip         = '';\n\t\t\t\t} else {\n\t\t\t\t\t$description = $tip = '';\n\t\t\t\t}\n\n\t\t\t\tif ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) {\n\t\t\t\t\t$description = '<p style=\"margin-top:0\">' . wp_kses_post( $description ) . '</p>';\n\t\t\t\t} elseif ( $description && in_array( $value['type'], array( 'checkbox' ) ) ) {\n\t\t\t\t\t$description = wp_kses_post( $description );\n\t\t\t\t} elseif ( $description && in_array( $value['type'], array( 'select' ) ) ) {\n\t\t\t\t\t$description = '<p class=\"description\">' . wp_kses_post( $description ) . '</p>';\n\t\t\t\t} elseif ( $description ) {\n\t\t\t\t\t$description = '<span class=\"description\">' . wp_kses_post( $description ) . '</span>';\n\t\t\t\t}\n\n\t\t\t\tif ( $tip && in_array( $value['type'], array( 'checkbox' ) ) ) {\n\n\t\t\t\t\t$tip = '<p class=\"description\">' . $tip . '</p>';\n\n\t\t\t\t} elseif ( $tip ) {\n\n\t\t\t\t\t$tip = '<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"' . $tip . '\" />';\n\n\t\t\t\t}\n\n\t\t\t\t// Switch based on type\n\t\t\t\tswitch ( $value['type'] ) {\n\n\t\t\t\t\t// Section Titles\n\t\t\t\t\tcase 'title':\n\t\t\t\t\t\techo '<div class=\"sp-settings-section sp-settings-section-' . esc_attr( sp_array_value( $value, 'id' ) ) . '\">';\n\t\t\t\t\t\techo '<a name=\"sp-settings-section-' . esc_attr( sp_array_value( $value, 'id' ) ) . '\"></a>';\n\t\t\t\t\t\tif ( ! empty( $value['title'] ) ) {\n\t\t\t\t\t\t\techo '<h3>' . esc_html( $value['title'] ) . '</h3>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! empty( $value['desc'] ) ) {\n\t\t\t\t\t\t\techo wp_kses_post( wpautop( wptexturize( $value['desc'] ) ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '<table class=\"form-table\">' . \"\\n\\n\";\n\t\t\t\t\t\tif ( ! empty( $value['id'] ) ) {\n\t\t\t\t\t\t\tdo_action( 'sportspress_settings_' . sanitize_title( $value['id'] ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Section Ends\n\t\t\t\t\tcase 'sectionend':\n\t\t\t\t\t\tif ( ! empty( $value['id'] ) ) {\n\t\t\t\t\t\t\tdo_action( 'sportspress_settings_' . sanitize_title( $value['id'] ) . '_end' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</table>';\n\t\t\t\t\t\tif ( ! empty( $value['id'] ) ) {\n\t\t\t\t\t\t\tdo_action( 'sportspress_settings_' . sanitize_title( $value['id'] ) . '_after' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Standard text inputs and subtypes like 'number'\n\t\t\t\t\tcase 'text':\n\t\t\t\t\tcase 'email':\n\t\t\t\t\tcase 'number':\n\t\t\t\t\tcase 'color':\n\t\t\t\t\tcase 'password':\n\t\t\t\t\t\t$type         = $value['type'];\n\t\t\t\t\t\t$class        = '';\n\t\t\t\t\t\t$option_value = self::get_option( $value['id'], $value['default'] );\n\n\t\t\t\t\t\tif ( $value['type'] == 'color' ) {\n\t\t\t\t\t\t\t$type            = 'text';\n\t\t\t\t\t\t\t$value['class'] .= 'colorpick';\n\t\t\t\t\t\t\t$description    .= '<div id=\"colorPickerDiv_' . esc_attr( $value['id'] ) . '\" class=\"colorpickdiv\" style=\"z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;\"></div>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t?><tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $value['id'] ); ?>\"><?php echo esc_html( $value['title'] ); ?></label>\n\t\t\t\t\t\t\t<?php echo esc_html( $tip ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-<?php echo esc_attr( $value['type'] ); ?>\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tname=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\tid=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\ttype=\"<?php echo esc_attr( $type ); ?>\"\n\t\t\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $value['css'] ); ?>\"\n\t\t\t\t\t\t\t\tvalue=\"<?php echo esc_attr( $option_value ); ?>\"\n\t\t\t\t\t\t\t\tplaceholder=\"<?php echo esc_attr( $value['placeholder'] ); ?>\"\n\t\t\t\t\t\t\t\tclass=\"<?php echo esc_attr( $value['class'] ); ?>\"\n\t\t\t\t\t\t\t\t<?php echo wp_kses_data( implode( ' ', $custom_attributes ) ); ?>\n\t\t\t\t\t\t\t\t/> <?php echo wp_kses_post( $description ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Textarea\n\t\t\t\t\tcase 'textarea':\n\t\t\t\t\t\t$option_value = self::get_option( $value['id'], $value['default'] );\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $value['id'] ); ?>\"><?php echo esc_html( $value['title'] ); ?></label>\n\t\t\t\t\t\t\t<?php echo esc_html( $tip ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-<?php echo esc_attr( $value['type'] ); ?>\">\n\t\t\t\t\t\t\t<?php echo wp_kses_post( $description ); ?>\n\n\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\tname=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\tid=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $value['css'] ); ?>\"\n\t\t\t\t\t\t\t\tclass=\"<?php echo esc_attr( $value['class'] ); ?>\"\n\t\t\t\t\t\t\t\t<?php echo esc_html( implode( ' ', $custom_attributes ) ); ?>\n\t\t\t\t\t\t\t\t><?php echo esc_textarea( $option_value ); ?></textarea>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Select boxes\n\t\t\t\t\tcase 'select':\n\t\t\t\t\tcase 'multiselect':\n\t\t\t\t\t\t$option_value = self::get_option( $value['id'], $value['default'] );\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $value['id'] ); ?>\"><?php echo esc_html( $value['title'] ); ?></label>\n\t\t\t\t\t\t\t<?php echo esc_html( $tip ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-<?php echo esc_attr( $value['type'] ); ?>\">\n\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\tname=\"<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) { echo '[]';} ?>\"\n\t\t\t\t\t\t\t\tid=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $value['css'] ); ?>\"\n\t\t\t\t\t\t\t\tclass=\"chosen-select\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( is_rtl() ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t chosen-rtl<?php endif; ?> <?php echo esc_attr( $value['class'] ); ?>\"\n\t\t\t\t\t\t\t\t<?php echo esc_html( implode( ' ', $custom_attributes ) ); ?>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $value['type'] == 'multiselect' ) {\n\t\t\t\t\t\t\t\t\techo 'multiple=\"multiple\"';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $value['options'] as $key => $val ) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  <?php\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( is_array( $option_value ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected( in_array( $key, $option_value ), true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected( $option_value, $key );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t><?php echo esc_attr( $val ); ?></option>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t   </select> <?php echo wp_kses_post( $description ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Select boxes with optgroup\n\t\t\t\t\tcase 'groupselect':\n\t\t\t\t\t\t$option_value = self::get_option( $value['id'], $value['default'] );\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $value['id'] ); ?>\"><?php echo esc_html( $value['title'] ); ?></label>\n\t\t\t\t\t\t\t<?php echo esc_html( $tip ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-<?php echo esc_attr( $value['type'] ); ?>\">\n\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\tname=\"<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) { echo '[]';} ?>\"\n\t\t\t\t\t\t\t\tid=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $value['css'] ); ?>\"\n\t\t\t\t\t\t\t\tclass=\"chosen-select\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( is_rtl() ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t chosen-rtl<?php endif; ?> <?php echo esc_attr( $value['class'] ); ?>\"\n\t\t\t\t\t\t\t\t<?php echo esc_html( implode( ' ', $custom_attributes ) ); ?>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $value['type'] == 'multiselect' ) {\n\t\t\t\t\t\t\t\t\techo 'multiple=\"multiple\"';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $value['options'] as $group => $options ) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<optgroup label=\"<?php esc_attr_e( $group, 'sportspress' ); ?>\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tforeach ( $options as $key => $val ) {\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  <?php\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( is_array( $option_value ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected( in_array( $key, $option_value ), true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected( $option_value, $key );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t><?php echo esc_attr( $val ); ?></option>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</optgroup>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t   </select> <?php echo wp_kses_post( $description ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Select sport\n\t\t\t\t\tcase 'sport':\n\t\t\t\t\t\t$default      = apply_filters( 'sportspress_default_sport', 'soccer' );\n\t\t\t\t\t\t$option_value = self::get_option( $value['id'], $value['default'] );\n\t\t\t\t\t\tif ( 'none' === $option_value ) {\n\t\t\t\t\t\t\t$option_value = $default;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$categories = SP_Admin_Sports::sport_category_names();\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $value['id'] ); ?>\"><?php echo esc_html( $value['title'] ); ?></label>\n\t\t\t\t\t\t\t<?php echo esc_html( $tip ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-<?php echo esc_attr( $value['type'] ); ?>\">\n\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\tname=\"<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) { echo '[]';} ?>\"\n\t\t\t\t\t\t\t\tid=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $value['css'] ); ?>\"\n\t\t\t\t\t\t\t\tclass=\"sp-select-sport chosen-select\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( is_rtl() ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t chosen-rtl<?php endif; ?> <?php echo esc_attr( $value['class'] ); ?>\"\n\t\t\t\t\t\t\t\t<?php echo esc_html( implode( ' ', $custom_attributes ) ); ?>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $value['type'] == 'multiselect' ) {\n\t\t\t\t\t\t\t\t\techo 'multiple=\"multiple\"';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $value['options'] as $group => $options ) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<optgroup label=\"<?php echo esc_attr( sp_array_value( $categories, $group, $group ) ); ?>\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tforeach ( $options as $key => $val ) {\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  <?php\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( is_array( $option_value ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected( in_array( $key, $option_value ), true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected( $option_value, $key );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t><?php echo esc_attr( $val ); ?></option>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</optgroup>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</select> <?php echo wp_kses_post( $description ); ?> <a class=\"button button-small sp-configure-sport\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress-config' ), 'admin.php' ) ) ); ?>\"><?php esc_html_e( 'Configure', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"add_sample_data\" id=\"add_sample_data\" <?php checked( sp_array_value( $value, 'welcome' ) ); ?>>\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Install demo content', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Radio inputs\n\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t$option_value = self::get_option( $value['id'], $value['default'] );\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $value['id'] ); ?>\"><?php echo esc_html( $value['title'] ); ?></label>\n\t\t\t\t\t\t\t<?php echo wp_kses_post( $tip ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-<?php echo esc_attr( $value['type'] ); ?>\">\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<?php echo wp_kses_post( $description ); ?>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $value['options'] as $key => $val ) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t<label><input\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\tvalue=\"<?php echo esc_attr( $key ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $value['css'] ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"<?php echo esc_attr( $value['class'] ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( implode( ' ', $custom_attributes ) ); ?>\n\t\t\t\t\t\t\t\t\t\t\t<?php checked( $key, $option_value ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t/> <?php echo esc_attr( $val ); ?></label>\n\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Checkbox input\n\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t$option_value    = self::get_option( $value['id'], $value['default'] );\n\t\t\t\t\t\t$visbility_class = array();\n\n\t\t\t\t\t\tif ( ! isset( $value['hide_if_checked'] ) ) {\n\t\t\t\t\t\t\t$value['hide_if_checked'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! isset( $value['show_if_checked'] ) ) {\n\t\t\t\t\t\t\t$value['show_if_checked'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $value['hide_if_checked'] == 'yes' || $value['show_if_checked'] == 'yes' ) {\n\t\t\t\t\t\t\t$visbility_class[] = 'hidden_option';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $value['hide_if_checked'] == 'option' ) {\n\t\t\t\t\t\t\t$visbility_class[] = 'hide_options_if_checked';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $value['show_if_checked'] == 'option' ) {\n\t\t\t\t\t\t\t$visbility_class[] = 'show_options_if_checked';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! isset( $value['checkboxgroup'] ) || 'start' == $value['checkboxgroup'] ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr valign=\"top\" class=\"<?php echo esc_attr( implode( ' ', $visbility_class ) ); ?>\">\n\t\t\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\"><?php echo esc_html( $value['title'] ); ?></th>\n\t\t\t\t\t\t\t\t<td class=\"forminp forminp-checkbox\">\n\t\t\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<fieldset class=\"<?php echo esc_attr( implode( ' ', $visbility_class ) ); ?>\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $value['title'] ) ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<legend class=\"screen-reader-text\"><span><?php echo esc_html( $value['title'] ); ?></span></legend>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $value['id'] ); ?>\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tname=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\tid=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\t\t\t\t<?php checked( $option_value, 'yes' ); ?>\n\t\t\t\t\t\t\t\t<?php echo esc_html( implode( ' ', $custom_attributes ) ); ?>\n\t\t\t\t\t\t\t/> <?php echo wp_kses_post( $description ); ?>\n\t\t\t\t\t\t</label> <?php echo wp_kses_post( $tip ); ?>\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\tif ( ! isset( $value['checkboxgroup'] ) || 'end' == $value['checkboxgroup'] ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Default: run an action\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdo_action( 'sportspress_admin_field_' . $value['type'], $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Save admin fields.\n\t\t *\n\t\t * Loops though the sportspress options array and outputs each field.\n\t\t *\n\t\t * @access public\n\t\t * @param array $options Opens array to output\n\t\t * @return bool\n\t\t */\n\t\tpublic static function save_fields( $options ) {\n\t\t\tif ( empty( $_POST ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Options to update will be stored here\n\t\t\t$update_options = array();\n\n\t\t\t// Loop options and get values to save\n\t\t\tforeach ( $options as $value ) {\n\n\t\t\t\tif ( ! isset( $value['id'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$type = isset( $value['type'] ) ? sanitize_key( $value['type'] ) : '';\n\n\t\t\t\t// Get the option name\n\t\t\t\t$option_value = null;\n\n\t\t\t\tswitch ( $type ) {\n\n\t\t\t\t\t// Standard types\n\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\tif ( isset( $_POST[ $value['id'] ] ) ) {\n\t\t\t\t\t\t\t$option_value = 'yes';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$option_value = 'no';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'textarea':\n\t\t\t\t\t\tif ( isset( $_POST[ $value['id'] ] ) ) {\n\t\t\t\t\t\t\t$option_value = wp_kses_post( trim( stripslashes( sanitize_textarea_field( wp_unslash( $_POST[ $value['id'] ] ) ) ) ) );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$option_value = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'text':\n\t\t\t\t\tcase 'email':\n\t\t\t\t\tcase 'number':\n\t\t\t\t\tcase 'select':\n\t\t\t\t\tcase 'groupselect':\n\t\t\t\t\tcase 'sport':\n\t\t\t\t\tcase 'color':\n\t\t\t\t\tcase 'password':\n\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\tif ( isset( $_POST[ $value['id'] ] ) ) {\n\t\t\t\t\t\t\t$option_value = sanitize_text_field( wp_unslash( $_POST[ $value['id'] ] ) );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$option_value = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Special types\n\t\t\t\t\tcase 'multiselect':\n\t\t\t\t\tcase 'multi_select_countries':\n\t\t\t\t\t\t// Get countries array\n\t\t\t\t\t\tif ( isset( $_POST[ $value['id'] ] ) ) {\n\t\t\t\t\t\t\t$selected_countries = array_map( 'sanitize_text_field', array_map( 'wp_unslash', (array) $_POST[ $value['id'] ] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$selected_countries = array();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$option_value = $selected_countries;\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Custom handling\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdo_action( 'sportspress_update_option_' . $type, $value );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! is_null( $option_value ) ) {\n\t\t\t\t\t// Check if option is an array\n\t\t\t\t\tif ( strstr( $value['id'], '[' ) ) {\n\n\t\t\t\t\t\tparse_str( $value['id'], $option_array );\n\n\t\t\t\t\t\t// Option name is first key\n\t\t\t\t\t\t$option_name = current( array_keys( $option_array ) );\n\n\t\t\t\t\t\t// Get old option value\n\t\t\t\t\t\tif ( ! isset( $update_options[ $option_name ] ) ) {\n\t\t\t\t\t\t\t$update_options[ $option_name ] = get_option( $option_name, array() );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! is_array( $update_options[ $option_name ] ) ) {\n\t\t\t\t\t\t\t$update_options[ $option_name ] = array();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set keys and value\n\t\t\t\t\t\t$key = key( $option_array[ $option_name ] );\n\n\t\t\t\t\t\t$update_options[ $option_name ][ $key ] = $option_value;\n\n\t\t\t\t\t\t// Single value\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$update_options[ $value['id'] ] = $option_value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Custom handling\n\t\t\t\tdo_action( 'sportspress_update_option', $value );\n\t\t\t}\n\n\t\t\t// Now save the options\n\t\t\tforeach ( $update_options as $name => $value ) {\n\t\t\t\tupdate_option( $name, $value );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\nendif;\n"
  },
  {
    "path": "includes/admin/class-sp-admin-setup-wizard.php",
    "content": "<?php\n/**\n * Setup Wizard Class\n *\n * Takes new users through some basic steps to setup their club website.\n *\n * Adapted from code in WooCommerce (Copyright (c) 2017, Automattic).\n *\n * @author      WooThemes\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.13\n */\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\n/**\n * SP_Admin_Setup_Wizard class.\n */\nclass SP_Admin_Setup_Wizard {\n\n\t/** @var string Current Step */\n\tprivate $step = '';\n\n\t/** @var array Steps for the setup wizard */\n\tprivate $steps = array();\n\n\t/** @var array Tweets user can optionally send after install */\n\tprivate $tweets = array(\n\t\t'Someone give me a high five, I just set up a new sports data website with #SportsPress and #WordPress!',\n\t);\n\n\t/**\n\t * Hook in tabs.\n\t */\n\tpublic function __construct() {\n\t\tif ( apply_filters( 'sportspress_enable_setup_wizard', true ) && current_user_can( 'manage_sportspress' ) ) {\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menus' ) );\n\t\t\tadd_action( 'admin_init', array( $this, 'setup_wizard' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Add admin menus/screens.\n\t */\n\tpublic function admin_menus() {\n\t\tadd_dashboard_page( '', '', 'manage_options', 'sp-setup', '' );\n\t}\n\n\t/**\n\t * Show the setup wizard.\n\t */\n\tpublic function setup_wizard() {\n\t\tif ( empty( $_GET['page'] ) || 'sp-setup' !== $_GET['page'] ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->steps = array(\n\t\t\t'introduction'  => array(\n\t\t\t\t'name'    => esc_attr__( 'Introduction', 'sportspress' ),\n\t\t\t\t'view'    => array( $this, 'sp_setup_introduction' ),\n\t\t\t\t'handler' => '',\n\t\t\t),\n\t\t\t'basics'        => array(\n\t\t\t\t'name'    => esc_attr__( 'Basic Setup', 'sportspress' ),\n\t\t\t\t'view'    => array( $this, 'sp_setup_basics' ),\n\t\t\t\t'handler' => array( $this, 'sp_setup_basics_save' ),\n\t\t\t),\n\t\t\t'teams'         => array(\n\t\t\t\t'name'    => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t'view'    => array( $this, 'sp_setup_teams' ),\n\t\t\t\t'handler' => array( $this, 'sp_setup_teams_save' ),\n\t\t\t),\n\t\t\t'players_staff' => array(\n\t\t\t\t'name'    => esc_attr__( 'Players', 'sportspress' ) . ' &amp; ' . esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t'view'    => array( $this, 'sp_setup_players_staff' ),\n\t\t\t\t'handler' => array( $this, 'sp_setup_players_staff_save' ),\n\t\t\t),\n\t\t\t'venue'         => array(\n\t\t\t\t'name'    => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t'view'    => array( $this, 'sp_setup_venue' ),\n\t\t\t\t'handler' => array( $this, 'sp_setup_venue_save' ),\n\t\t\t),\n\t\t\t'pages'         => array(\n\t\t\t\t'name'    => esc_attr__( 'Pages', 'sportspress' ),\n\t\t\t\t'view'    => array( $this, 'sp_setup_pages' ),\n\t\t\t\t'handler' => array( $this, 'sp_setup_pages_save' ),\n\t\t\t),\n\t\t\t'next_steps'    => array(\n\t\t\t\t'name'    => esc_attr__( 'Ready!', 'sportspress' ),\n\t\t\t\t'view'    => array( $this, 'sp_setup_ready' ),\n\t\t\t\t'handler' => '',\n\t\t\t),\n\t\t);\n\t\t$this->step  = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) );\n\t\t$suffix      = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\n\t\twp_enqueue_style( 'jquery-chosen', SP()->plugin_url() . '/assets/css/chosen.css', array(), '1.1.0' );\n\t\twp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION );\n\t\twp_enqueue_style( 'sportspress-setup', SP()->plugin_url() . '/assets/css/setup.css', array( 'dashicons', 'install' ), SP_VERSION );\n\n\t\twp_register_script( 'chosen', SP()->plugin_url() . '/assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );\n\t\twp_register_script( 'jquery-tiptip', SP()->plugin_url() . '/assets/js/jquery.tipTip.min.js', array( 'jquery' ), '1.3', true );\n\t\twp_register_script( 'sportspress-setup', SP()->plugin_url() . '/assets/js/admin/sportspress-setup.js', array( 'jquery', 'chosen', 'jquery-tiptip' ), SP_VERSION, true );\n\n\t\tdo_action( 'sp_setup_geocoder_scripts' );\n\n\t\t$strings = apply_filters(\n\t\t\t'sportspress_localized_strings',\n\t\t\tarray(\n\t\t\t\t'none'        => esc_attr__( 'None', 'sportspress' ),\n\t\t\t\t'remove_text' => esc_attr__( '&mdash; Remove &mdash;', 'sportspress' ),\n\t\t\t)\n\t\t);\n\n\t\t// Localize scripts\n\t\twp_localize_script( 'sportspress-setup', 'localized_strings', $strings );\n\n\t\tif ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) {\n\t\t\tcall_user_func( $this->steps[ $this->step ]['handler'] );\n\t\t}\n\n\t\tob_start();\n\t\t$this->setup_wizard_header();\n\t\t$this->setup_wizard_steps();\n\t\t$this->setup_wizard_content();\n\t\t$this->setup_wizard_footer();\n\t\texit;\n\t}\n\n\tpublic function get_next_step_link() {\n\t\t$keys = array_keys( $this->steps );\n\t\treturn add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ) ) + 1 ] );\n\t}\n\n\t/**\n\t * Setup Wizard Header.\n\t */\n\tpublic function setup_wizard_header() {\n\t\t?>\n\t<!DOCTYPE html>\n\t<html <?php language_attributes(); ?>>\n\t<head>\n\t  <meta name=\"viewport\" content=\"width=device-width\" />\n\t  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t  <title><?php esc_html_e( 'SportsPress', 'sportspress' ); ?> &rsaquo; <?php echo esc_html( $this->steps[ $this->step ]['name'] ); ?></title>\n\t\t<?php do_action( 'admin_print_styles' ); ?>\n\t</head>\n\t<body class=\"sp-setup wp-core-ui\">\n\t  <h1 id=\"sp-logo\"><?php echo wp_kses_post( apply_filters( 'sportspress_logo', '<img src=\"' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/modules/sportspress' . ( class_exists( 'SportsPress_Pro' ) ? '-pro' : '' ) . '.png\" alt=\"' . esc_attr__( 'SportsPress', 'sportspress' ) . '\">' ) ); ?></h1>\n\t\t<?php\n\t}\n\n\t/**\n\t * Setup Wizard Footer.\n\t */\n\tpublic function setup_wizard_footer() {\n\t\t?>\n\t\t<?php if ( 'next_steps' === $this->step ) : ?>\n\t\t<p class=\"sp-return-to-dashboard\"><a href=\"<?php echo esc_url( admin_url( 'index.php?page=sp-about' ) ); ?>\"><?php esc_html_e( 'Return to the WordPress Dashboard', 'sportspress' ); ?></a></p>\n\t  <?php endif; ?>\n\t\t<?php wp_print_scripts( 'sportspress-setup' ); ?>\n\t  </body>\n\t</html>\n\t\t<?php\n\t}\n\n\t/**\n\t * Output the steps.\n\t */\n\tpublic function setup_wizard_steps() {\n\t\t$ouput_steps = $this->steps;\n\t\tarray_shift( $ouput_steps );\n\t\t?>\n\t<ol class=\"sp-setup-steps\">\n\t\t<?php foreach ( $ouput_steps as $step_key => $step ) : ?>\n\t\t<li class=\"\n\t\t\t<?php\n\t\t\tif ( $step_key === $this->step ) {\n\t\t\t\techo 'active';\n\t\t\t} elseif ( array_search( $this->step, array_keys( $this->steps ) ) > array_search( $step_key, array_keys( $this->steps ) ) ) {\n\t\t\t\techo 'done';\n\t\t\t}\n\t\t\t?>\n\t\t\"><?php echo esc_html( $step['name'] ); ?></li>\n\t  <?php endforeach; ?>\n\t</ol>\n\t\t<?php\n\t}\n\n\t/**\n\t * Output the content for the current step.\n\t */\n\tpublic function setup_wizard_content() {\n\t\techo '<div class=\"sp-setup-content\">';\n\t\tcall_user_func( $this->steps[ $this->step ]['view'] );\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * Introduction Step.\n\t */\n\tpublic function sp_setup_introduction() {\n\t\t?>\n\t<h1><?php esc_html_e( 'Welcome to SportsPress', 'sportspress' ); ?></h1>\n\t<p><?php echo wp_kses_post( __( 'Thank you for choosing SportsPress to power your sports website! This quick setup wizard will help you configure the basic settings. <strong>It’s completely optional and shouldn’t take longer than five minutes.</strong>', 'sportspress' ) ); ?></p>\n\t<p><?php esc_html_e( 'No time right now? If you don’t want to go through the wizard, you can skip and return to the WordPress dashboard. Come back anytime if you change your mind!', 'sportspress' ); ?></p>\n\t<p class=\"sp-setup-actions step\">\n\t  <a href=\"<?php echo esc_url( $this->get_next_step_link() ); ?>\" class=\"button-primary button button-large button-next\"><?php esc_html_e( 'Let\\'s Go!', 'sportspress' ); ?></a>\n\t  <a href=\"<?php echo esc_url( admin_url( 'index.php?page=sp-about' ) ); ?>\" class=\"button button-large button-muted\"><?php esc_html_e( 'Not right now', 'sportspress' ); ?></a>\n\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Basic Setup.\n\t */\n\tpublic function sp_setup_basics() {\n\t\t$class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' );\n\t\t?>\n\t<h1><?php esc_html_e( 'Basic Setup', 'sportspress' ); ?></h1>\n\t<form method=\"post\">\n\t  <p><?php esc_html_e( 'Select your timezone and sport to get started.', 'sportspress' ); ?></p>\n\t  <table class=\"form-table\" cellspacing=\"0\">\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Timezone', 'sportspress' ); ?> <i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Choose a city in the same timezone as you.', 'sportspress' ); ?>\"></i></th>\n\t\t  <td>\n\t\t\t<select id=\"timezone_string\" name=\"timezone_string\" class=\"<?php echo esc_attr( $class ); ?>\">\n\t\t\t  <?php\n\t\t\t\t$current_offset = get_option( 'gmt_offset' );\n\t\t\t\t$tzstring       = get_option( 'timezone_string' );\n\n\t\t\t\t$check_zone_info = true;\n\n\t\t\t\t// Remove old Etc mappings. Fallback to gmt_offset.\n\t\t\t\tif ( false !== strpos( $tzstring, 'Etc/GMT' ) ) {\n\t\t\t\t\t$tzstring = '';\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists\n\t\t\t\t\t$check_zone_info = false;\n\t\t\t\t\tif ( 0 == $current_offset ) {\n\t\t\t\t\t\t$tzstring = 'UTC+0';\n\t\t\t\t\t} elseif ( $current_offset < 0 ) {\n\t\t\t\t\t\t$tzstring = 'UTC' . $current_offset;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tzstring = 'UTC+' . $current_offset;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo wp_kses( wp_timezone_choice( $tzstring ), array( 'option' => array( 'value' => array(), 'selected' => array() ) ) );\n\t\t\t\t?>\n\t\t\t</select>\n\t\t  </td>\n\t\t</tr>\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php echo esc_html_x( 'Sport', 'Page title', 'sportspress' ); ?></th>\n\t\t  <td>\n\t\t\t  <?php\n\t\t\t\t$options = SP_Admin_Sports::get_preset_options();\n\t\t\t\t$default = apply_filters( 'sportspress_default_sport', 'soccer' );\n\t\t\t\t$sport   = get_option( 'sportspress_sport', $default );\n\t\t\t\tif ( 'none' === $sport ) {\n\t\t\t\t\t$sport = $default;\n\t\t\t\t}\n\t\t\t\t$categories = SP_Admin_Sports::sport_category_names();\n\t\t\t\t?>\n\t\t\t<select name=\"sport\" id=\"sport\" class=\"sp-select-sport <?php echo esc_attr( $class ); ?>\">\n\t\t\t  <?php\n\t\t\t\tforeach ( $options as $group => $options ) {\n\t\t\t\t\t?>\n\t\t\t\t<optgroup label=\"<?php echo esc_attr( sp_array_value( $categories, $group, $group ) ); ?>\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $options as $key => $val ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\" <?php selected( $sport, $key ); ?>><?php echo esc_html( $val ); ?></option>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</optgroup>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t  </td>\n\t\t</tr>\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Main League', 'sportspress' ); ?> <i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'The name of a league or division.', 'sportspress' ); ?>\"></i></th>\n\t\t  <td>\n\t\t\t<input name=\"league\" type=\"text\" class=\"widefat\" value=\"<?php echo esc_attr_x( 'Primary League', 'example', 'sportspress' ); ?>\">\n\t\t  </td>\n\t\t</tr>\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Current Season', 'sportspress' ); ?></th>\n\t\t  <td>\n\t\t\t<input name=\"season\" type=\"text\" class=\"widefat\" value=\"<?php echo esc_attr( date( 'Y' ) ); ?>\">\n\t\t  </td>\n\t\t</tr>\n\t  </table>\n\n\t  <p class=\"sp-setup-actions step\">\n\t\t<input type=\"submit\" class=\"button-primary button button-large button-next\" value=\"<?php esc_attr_e( 'Continue', 'sportspress' ); ?>\" name=\"save_step\" />\n\t\t<a href=\"<?php echo esc_url( $this->get_next_step_link() ); ?>\" class=\"button button-large button-next button-muted\"><?php esc_html_e( 'Skip this step', 'sportspress' ); ?></a>\n\t\t  <?php wp_nonce_field( 'sp-setup' ); ?>\n\t  </p>\n\t</form>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save Basic Settings.\n\t */\n\tpublic function sp_setup_basics_save() {\n\t\tcheck_admin_referer( 'sp-setup' );\n\n\t\t// Update timezone\n\t\t$timezone_string = sanitize_text_field( wp_unslash( $_POST['timezone_string'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\tif ( ! empty( $timezone_string ) && preg_match( '/^UTC[+-]/', $timezone_string ) ) {\n\t\t\t$gmt_offset      = $timezone_string;\n\t\t\t$gmt_offset      = preg_replace( '/UTC\\+?/', '', $gmt_offset );\n\t\t\t$timezone_string = '';\n\t\t}\n\n\t\tif ( isset( $timezone_string ) ) {\n\t\t\tupdate_option( 'timezone_string', $timezone_string );\n\t\t}\n\n\t\tif ( isset( $gmt_offset ) ) {\n\t\t\tupdate_option( 'gmt_offset', $gmt_offset );\n\t\t}\n\n\t\t// Update sport\n\t\t$sport = sanitize_text_field( wp_unslash( $_POST['sport'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\tif ( ! empty( $sport ) && get_option( 'sportspress_sport', null ) !== $sport ) {\n\t\t\tSP_Admin_Sports::apply_preset( $sport );\n\t\t}\n\t\tupdate_option( 'sportspress_sport', $sport );\n\n\t\t// Insert league\n\t\t$league = sanitize_text_field( wp_unslash( $_POST['league'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\tif ( ! is_string( $league ) || empty( $league ) ) {\n\t\t\t$league = _x( 'Primary League', 'example', 'sportspress' );\n\t\t}\n\t\t$inserted = wp_insert_term( $league, 'sp_league' );\n\t\tif ( ! is_wp_error( $inserted ) ) {\n\t\t\tupdate_option( 'sportspress_league', sp_array_value( $inserted, 'term_id', null ) );\n\t\t}\n\n\t\t// Insert season\n\t\t$season = sanitize_text_field( wp_unslash( $_POST['season'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\tif ( ! is_string( $season ) || empty( $season ) ) {\n\t\t\t$season = date( 'Y' );\n\t\t}\n\t\t$inserted = wp_insert_term( $season, 'sp_season' );\n\t\tif ( ! is_wp_error( $inserted ) ) {\n\t\t\tupdate_option( 'sportspress_season', sp_array_value( $inserted, 'term_id', null ) );\n\t\t}\n\n\t\twp_redirect( esc_url_raw( $this->get_next_step_link() ) );\n\t\texit;\n\t}\n\n\t/**\n\t * Team Setup.\n\t */\n\tpublic function sp_setup_teams() {\n\t\t$class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' );\n\t\t?>\n\t<h1><?php esc_html_e( 'Team Setup', 'sportspress' ); ?></h1>\n\t<form method=\"post\">\n\t  <p><?php esc_html_e( \"Great! Now let's add some teams.\", 'sportspress' ); ?></p>\n\t  <table class=\"form-table\" cellspacing=\"0\">\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Home Team', 'sportspress' ); ?></th>\n\t\t  <td>\n\t\t\t<input name=\"home_team\" type=\"text\" class=\"widefat\" placeholder=\"<?php esc_html_e( 'What is your team called?', 'sportspress' ); ?>\">\n\t\t  </td>\n\t\t</tr>\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Rival Team', 'sportspress' ); ?></th>\n\t\t  <td>\n\t\t\t<input name=\"away_team\" type=\"text\" class=\"widefat\" placeholder=\"<?php esc_html_e( 'Who are you playing against next?', 'sportspress' ); ?>\">\n\t\t\t<p class=\"description\"><?php esc_html_e( 'You can add more teams later.', 'sportspress' ); ?></p>\n\t\t  </td>\n\t\t</tr>\n\t  </table>\n\n\t  <p class=\"sp-setup-actions step\">\n\t\t<input type=\"submit\" class=\"button-primary button button-large button-next\" value=\"<?php esc_attr_e( 'Continue', 'sportspress' ); ?>\" name=\"save_step\" />\n\t\t<a href=\"<?php echo esc_url( $this->get_next_step_link() ); ?>\" class=\"button button-large button-next button-muted\"><?php esc_html_e( 'Skip this step', 'sportspress' ); ?></a>\n\t\t<?php wp_nonce_field( 'sp-setup' ); ?>\n\t  </p>\n\t</form>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save Team Settings.\n\t */\n\tpublic function sp_setup_teams_save() {\n\t\tcheck_admin_referer( 'sp-setup' );\n\n\t\t// Add away team\n\t\t$post['post_title']  = sanitize_text_field( wp_unslash( $_POST['away_team'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t$post['post_type']   = 'sp_team';\n\t\t$post['post_status'] = 'publish';\n\t\t$post['tax_input']   = array();\n\t\t$taxonomies          = array( 'sp_league', 'sp_season' );\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$post['tax_input'][ $taxonomy ] = get_terms(\n\t\t\t\t$taxonomy,\n\t\t\t\tarray(\n\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\twp_insert_post( $post );\n\n\t\t// Add home team\n\t\t$post['post_title'] = sanitize_text_field( wp_unslash( $_POST['home_team'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\twp_insert_post( $post );\n\n\t\twp_redirect( esc_url_raw( $this->get_next_step_link() ) );\n\t\texit;\n\t}\n\n\t/**\n\t * Players & Staff Setup.\n\t */\n\tpublic function sp_setup_players_staff() {\n\t\t$positions = (array) get_terms(\n\t\t\t'sp_position',\n\t\t\tarray(\n\t\t\t\t'hide_empty' => 0,\n\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t'fields'     => 'names',\n\t\t\t)\n\t\t)\n\t\t?>\n\t<h1><?php esc_html_e( 'Player & Staff Setup', 'sportspress' ); ?></h1>\n\t<form method=\"post\">\n\t  <p><?php esc_html_e( \"Let's add players and a staff member.\", 'sportspress' ); ?></p>\n\t  <table class=\"form-table\" cellspacing=\"0\">\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Players', 'sportspress' ); ?> <i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Enter a squad number, name, and position for each player.', 'sportspress' ); ?>\"></i></th>\n\t\t  <td>\n\t\t\t<ul>\n\t\t\t  <?php for ( $i = 0; $i < 3; $i++ ) { ?>\n\t\t\t\t<li class=\"player\"><input name=\"players[<?php echo esc_attr( $i ); ?>][number]\" type=\"text\" class=\"player-number\" placeholder=\"#\" value=\"<?php echo esc_attr( $i + 1 ); ?>\"> <input name=\"players[<?php echo esc_attr( $i ); ?>][name]\" type=\"text\" placeholder=\"<?php esc_attr_e( 'Name', 'sportspress' ); ?>\"> <input name=\"players[<?php echo esc_attr( $i ); ?>][position]\" type=\"text\" placeholder=\"<?php esc_attr_e( 'Position', 'sportspress' ); ?>\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( sizeof( $positions ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t value=\"<?php echo esc_attr( $positions[ $i % sizeof( $positions ) ] ); ?>\"<?php } ?>></li>\n\t\t\t  <?php } ?>\n\t\t\t</ul>\n\t\t\t<p class=\"description\"><?php esc_html_e( 'You can add more players later.', 'sportspress' ); ?></p>\n\t\t  </td>\n\t\t</tr>\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Staff', 'sportspress' ); ?></th>\n\t\t  <td>\n\t\t\t<ul>\n\t\t\t  <li class=\"staff\"><input name=\"staff\" type=\"text\" class=\"staff-name\" placeholder=\"<?php esc_attr_e( 'Name', 'sportspress' ); ?>\"> <input name=\"role\" type=\"text\" placeholder=\"<?php esc_attr_e( 'Job', 'sportspress' ); ?>\" value=\"Coach\"></li>\n\t\t\t</ul>\n\t\t  </td>\n\t\t</tr>\n\t  </table>\n\n\t  <p class=\"sp-setup-actions step\">\n\t\t<input type=\"submit\" class=\"button-primary button button-large button-next\" value=\"<?php esc_attr_e( 'Continue', 'sportspress' ); ?>\" name=\"save_step\" />\n\t\t<a href=\"<?php echo esc_url( $this->get_next_step_link() ); ?>\" class=\"button button-large button-next button-muted\"><?php esc_html_e( 'Skip this step', 'sportspress' ); ?></a>\n\t\t<?php wp_nonce_field( 'sp-setup' ); ?>\n\t  </p>\n\t</form>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save Player & Staff Settings.\n\t */\n\tpublic function sp_setup_players_staff_save() {\n\t\tcheck_admin_referer( 'sp-setup' );\n\n\t\t// Get home team\n\t\t$teams = (array) get_posts(\n\t\t\tarray(\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'post_type'      => 'sp_team',\n\t\t\t\t'fields'         => 'ids',\n\t\t\t)\n\t\t);\n\t\t$team  = reset( $teams );\n\n\t\t// Add players\n\t\t$post['post_type']   = 'sp_player';\n\t\t$post['post_status'] = 'publish';\n\t\t$post['tax_input']   = array();\n\t\t$taxonomies          = array( 'sp_league', 'sp_season' );\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$post['tax_input'][ $taxonomy ] = get_terms(\n\t\t\t\t$taxonomy,\n\t\t\t\tarray(\n\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif ( is_array( $_POST['players'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\tforeach ( $_POST['players'] as $i => $player ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t\tif ( empty( $player['name'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$post['post_title'] = $player['name'];\n\t\t\t\t$id                 = wp_insert_post( $post );\n\n\t\t\t\t// Add squad number\n\t\t\t\t$number = sanitize_text_field( sp_array_value( $player, 'number' ) );\n\t\t\t\tupdate_post_meta( $id, 'sp_number', $number );\n\n\t\t\t\t// Add position\n\t\t\t\twp_set_object_terms( $id, sp_array_value( $player, 'position', esc_attr__( 'Position', 'sportspress' ) ), 'sp_position', false );\n\n\t\t\t\t// Add team\n\t\t\t\tif ( $team ) {\n\t\t\t\t\tupdate_post_meta( $id, 'sp_team', $team );\n\t\t\t\t\tupdate_post_meta( $id, 'sp_current_team', $team );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add staff\n\t\tif ( ! empty( $_POST['staff'] ) ) {\n\n\t\t\t$post['post_type']  = 'sp_staff';\n\t\t\t$post['post_title'] = sanitize_text_field( wp_unslash( $_POST['staff'] ) );\n\t\t\t$id                 = wp_insert_post( $post );\n\n\t\t\t// Add role\n\t\t\twp_set_object_terms( $id, sp_array_value( $_POST, 'role', 'Coach' ), 'sp_role', false );\n\n\t\t\t// Add team\n\t\t\tif ( $team ) {\n\t\t\t\tupdate_post_meta( $id, 'sp_team', $team );\n\t\t\t\tupdate_post_meta( $id, 'sp_current_team', $team );\n\t\t\t}\n\t\t}\n\n\t\twp_redirect( esc_url_raw( $this->get_next_step_link() ) );\n\t\texit;\n\t}\n\n\t/**\n\t * Venue Step.\n\t */\n\tpublic function sp_setup_venue() {\n\t\tdo_action( 'sp_setup_venue_geocoder_scripts' );\n\t\t?>\n\t<h1><?php esc_html_e( 'Venue Setup', 'sportspress' ); ?></h1>\n\t<form method=\"post\">\n\t  <p><?php esc_html_e( 'Enter the details of your home venue.', 'sportspress' ); ?></p>\n\t  <table class=\"form-table\" cellspacing=\"0\">\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Name', 'sportspress' ); ?></th>\n\t\t  <td>\n\t\t\t<input name=\"venue\" type=\"text\" placeholder=\"<?php esc_attr_e( 'Venue', 'sportspress' ); ?>\">\n\t\t  </td>\n\t\t</tr>\n\t\t<tr>\n\t\t  <th scope=\"row\"><?php esc_html_e( 'Address', 'sportspress' ); ?></th>\n\t\t  <td>\n\t\t\t<input name=\"address\" id=\"sp_address\" class=\"sp-address\" type=\"text\" value=\"Marvel Stadium, Melbourne\">\n\t\t\t<div id=\"sp-location-picker\" class=\"sp-location-picker\" style=\"width: 95%; height: 320px\"></div>\n\t\t\t<p class=\"description\"><?php esc_html_e( \"Drag the marker to the venue's location.\", 'sportspress' ); ?></p>\n\t\t\t<input name=\"latitude\" id=\"sp_latitude\" class=\"sp-latitude\" type=\"hidden\" value=\"-37.8165647\">\n\t\t\t<input name=\"longitude\" id=\"sp_longitude\" class=\"sp-longitude\" type=\"hidden\" value=\"144.9475055\">\n\t\t  </td>\n\t\t</tr>\n\t  </table>\n\n\t  <p class=\"sp-setup-actions step\">\n\t\t<input type=\"submit\" class=\"button-primary button button-large button-next\" value=\"<?php esc_attr_e( 'Continue', 'sportspress' ); ?>\" name=\"save_step\" />\n\t\t<a href=\"<?php echo esc_url( $this->get_next_step_link() ); ?>\" class=\"button button-large button-next button-muted\"><?php esc_html_e( 'Skip this step', 'sportspress' ); ?></a>\n\t\t<?php wp_nonce_field( 'sp-setup' ); ?>\n\t  </p>\n\t</form>\n\t\t<?php\n\t\tdo_action( 'sp_admin_geocoder_scripts' );\n\t}\n\n\t/**\n\t * Venue Settings.\n\t */\n\tpublic function sp_setup_venue_save() {\n\t\tcheck_admin_referer( 'sp-setup' );\n\n\t\t// Get home team\n\t\t$teams = (array) get_posts(\n\t\t\tarray(\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'post_type'      => 'sp_team',\n\t\t\t\t'fields'         => 'ids',\n\t\t\t)\n\t\t);\n\t\t$team  = reset( $teams );\n\n\t\t// Insert venue\n\t\t$venue = sanitize_text_field( wp_unslash( $_POST['venue'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\tif ( ! is_string( $venue ) || empty( $venue ) ) {\n\t\t\t$venue = sp_array_value( $_POST, 'address', esc_attr__( 'Venue', 'sportspress' ) );\n\t\t}\n\t\t$inserted = wp_insert_term( $venue, 'sp_venue' );\n\n\t\t// Add address and coordinates to venue\n\t\tif ( ! is_wp_error( $inserted ) ) {\n\t\t\t$t_id = sp_array_value( $inserted, 'term_id', 1 );\n\n\t\t\tif ( $team ) {\n\t\t\t\twp_set_object_terms( $team, $t_id, 'sp_venue', true );\n\t\t\t}\n\n\t\t\t$meta = array(\n\t\t\t\t'sp_address'   => sanitize_text_field( sp_array_value( $_POST, 'address' ) ),\n\t\t\t\t'sp_latitude'  => sanitize_text_field( sp_array_value( $_POST, 'latitude' ) ),\n\t\t\t\t'sp_longitude' => sanitize_text_field( sp_array_value( $_POST, 'longitude' ) ),\n\t\t\t);\n\t\t\tupdate_option( \"taxonomy_$t_id\", $meta );\n\t\t}\n\n\t\twp_redirect( esc_url_raw( $this->get_next_step_link() ) );\n\t\texit;\n\t}\n\n\t/**\n\t * Pages Step.\n\t */\n\tpublic function sp_setup_pages() {\n\t\t$pages = apply_filters(\n\t\t\t'sportspress_setup_pages',\n\t\t\tarray(\n\t\t\t\t'sp_calendar' => esc_attr__( 'Organize and publish calendars using different layouts.', 'sportspress' ),\n\t\t\t\t'sp_table'    => esc_attr__( 'Create automated league tables to keep track of team standings.', 'sportspress' ),\n\t\t\t\t'sp_list'     => esc_attr__( 'Create team rosters, player galleries, and ranking charts.', 'sportspress' ),\n\t\t\t)\n\t\t);\n\t\t?>\n\t<h1><?php esc_html_e( 'Pages', 'sportspress' ); ?></h1>\n\t<form method=\"post\">\n\t  <p><?php printf( esc_html__( 'The following will be created automatically (if they do not already exist):', 'sportspress' ), '<a href=\"' . esc_url( admin_url( 'edit.php?post_type=page' ) ) . '\" target=\"_blank\">', '</a>' ); ?></p>\n\t  <table class=\"form-table\" cellspacing=\"0\">\n\t\t<?php foreach ( $pages as $post_type => $description ) { ?>\n\t\t\t<?php\n\t\t\t$obj = get_post_type_object( $post_type );\n\t\t\tif ( ! is_object( $obj ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t?>\n\t\t  <tr>\n\t\t\t<th scope=\"row\"><?php echo esc_html( $obj->labels->singular_name ); ?></th>\n\t\t\t<td><?php echo wp_kses_post( $description ); ?></td>\n\t\t  </tr>\n\t\t<?php } ?>\n\t  </table>\n\n\t  <p><?php printf( esc_html__( 'Once created, these pages can be managed from your admin dashboard.', 'sportspress' ), '<a href=\"' . esc_url( admin_url( 'edit.php?post_type=page' ) ) . '\" target=\"_blank\">', '</a>', '<a href=\"' . esc_url( admin_url( 'nav-menus.php' ) ) . '\" target=\"_blank\">', '</a>' ); ?></p>\n\n\t  <p class=\"sp-setup-actions step\">\n\t\t<input type=\"submit\" class=\"button-primary button button-large button-next\" value=\"<?php esc_attr_e( 'Continue', 'sportspress' ); ?>\" name=\"save_step\" />\n\t\t<a href=\"<?php echo esc_url( $this->get_next_step_link() ); ?>\" class=\"button button-large button-next button-muted\"><?php esc_html_e( 'Skip this step', 'sportspress' ); ?></a>\n\t\t  <?php wp_nonce_field( 'sp-setup' ); ?>\n\t  </p>\n\t</form>\n\t\t<?php\n\t}\n\n\t/**\n\t * Pages Settings.\n\t */\n\tpublic function sp_setup_pages_save() {\n\t\tcheck_admin_referer( 'sp-setup' );\n\n\t\t$pages = apply_filters(\n\t\t\t'sportspress_setup_pages',\n\t\t\tarray(\n\t\t\t\t'sp_calendar' => esc_attr__( 'Organize and publish calendars using different layouts.', 'sportspress' ),\n\t\t\t\t'sp_table'    => esc_attr__( 'Create automated league tables to keep track of team standings.', 'sportspress' ),\n\t\t\t\t'sp_list'     => esc_attr__( 'Create team rosters, player galleries, and ranking charts.', 'sportspress' ),\n\t\t\t)\n\t\t);\n\n\t\t// Initialize post\n\t\t$post           = array( 'post_status' => 'publish' );\n\t\t$sample_content = _x( 'This is an example %1$s. As a new SportsPress user, you should go to <a href=\\\"%3$s\\\">your dashboard</a> to delete this %1$s and create new %2$s for your content. Have fun!', 'example', 'sportspress' );\n\n\t\t// Insert posts\n\t\tforeach ( $pages as $post_type => $description ) {\n\t\t\t$obj = get_post_type_object( $post_type );\n\t\t\tif ( ! is_object( $obj ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip if post exists\n\t\t\t$posts = get_posts(\n\t\t\t\tarray(\n\t\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t\t'post_type'      => $post_type,\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( $posts ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Add post args\n\t\t\t$post['post_title']   = $obj->labels->singular_name;\n\t\t\t$post['post_type']    = $post_type;\n\t\t\t$post['post_content'] = sprintf( $sample_content, $obj->labels->singular_name, $obj->labels->name, add_query_arg( 'post_type', $post_type, admin_url( 'edit.php' ) ) );\n\n\t\t\t// Insert post\n\t\t\t$id = wp_insert_post( $post );\n\n\t\t\t// Flag as sample\n\t\t\tupdate_post_meta( $id, '_sp_sample', 1 );\n\t\t}\n\n\t\twp_redirect( esc_url_raw( $this->get_next_step_link() ) );\n\t\texit;\n\t}\n\n\t/**\n\t * Actions on the final step.\n\t */\n\tprivate function sp_setup_ready_actions() {\n\t\tdelete_option( '_sp_needs_welcome' );\n\t\tupdate_option( 'sportspress_installed', 1 );\n\t\tupdate_option( 'sportspress_completed_setup', 1 );\n\t\tdelete_transient( '_sp_activation_redirect' );\n\n\t\t// Check if first event already exists\n\t\t$events = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type'      => 'sp_event',\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'post_status'    => 'draft',\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => '_sp_first',\n\t\t\t\t\t\t'value' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( $events ) {\n\t\t\t$event = reset( $events );\n\t\t\treturn $event->ID;\n\t\t}\n\n\t\t// Get teams\n\t\t$team_post_type = 'sp_team';\n\t\tif ( 'player' === get_option( 'sportspress_mode', 'team' ) ) {\n\t\t\t$team_post_type = 'sp_player';\n\t\t}\n\t\t$teams = get_posts(\n\t\t\tarray(\n\t\t\t\t'posts_per_page' => 2,\n\t\t\t\t'post_type'      => $team_post_type,\n\t\t\t)\n\t\t);\n\n\t\t// Get players\n\t\t$players = (array) get_posts(\n\t\t\tarray(\n\t\t\t\t'posts_per_page' => 3,\n\t\t\t\t'post_type'      => 'sp_player',\n\t\t\t\t'fields'         => 'ids',\n\t\t\t)\n\t\t);\n\n\t\t// Get staff\n\t\t$staff = (array) get_posts(\n\t\t\tarray(\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'post_type'      => 'sp_staff',\n\t\t\t\t'fields'         => 'ids',\n\t\t\t)\n\t\t);\n\n\t\t// Initialize post\n\t\t$post['post_type']   = 'sp_event';\n\t\t$post['post_status'] = 'draft';\n\t\t$post['tax_input']   = array();\n\n\t\t// Add taxonomies\n\t\t$taxonomies = array( 'sp_league', 'sp_season', 'sp_venue' );\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$post['tax_input'][ $taxonomy ] = get_terms(\n\t\t\t\t$taxonomy,\n\t\t\t\tarray(\n\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t'number'     => 1,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// Add post title\n\t\tif ( is_array( $teams ) && sizeof( $teams ) ) {\n\t\t\t$team_names = array();\n\t\t\tforeach ( $teams as $team ) {\n\t\t\t\tif ( ! $team ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$team_names[] = $team->post_title;\n\t\t\t}\n\t\t\t$post['post_title'] = implode( ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ', $team_names );\n\t\t} else {\n\t\t\t$post['post_title'] = esc_attr__( 'Event', 'sportspress' );\n\t\t}\n\n\t\t// Insert event\n\t\t$id = wp_insert_post( $post );\n\n\t\t// Add teams\n\t\tif ( is_array( $teams ) && sizeof( $teams ) ) {\n\t\t\tforeach ( $teams as $team ) {\n\t\t\t\tif ( ! $team ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tadd_post_meta( $id, 'sp_team', $team->ID );\n\t\t\t}\n\t\t}\n\n\t\t// Add players\n\t\tadd_post_meta( $id, 'sp_player', 0 );\n\t\tforeach ( $players as $player ) {\n\t\t\tif ( ! $player ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tadd_post_meta( $id, 'sp_player', $player );\n\t\t}\n\t\tadd_post_meta( $id, 'sp_player', 0 );\n\n\t\tupdate_post_meta( $id, '_sp_first', 1 );\n\n\t\treturn $id;\n\t}\n\n\t/**\n\t * Final step.\n\t */\n\tpublic function sp_setup_ready() {\n\t\t$id = $this->sp_setup_ready_actions();\n\t\tshuffle( $this->tweets );\n\n\t\t$steps = apply_filters(\n\t\t\t'sportspress_setup_wizard_next_steps',\n\t\t\tarray(\n\t\t\t\t'first' => array(\n\t\t\t\t\t'label'   => esc_attr__( 'Next Steps', 'sportspress' ),\n\t\t\t\t\t'content' => '<a class=\"button button-primary button-large button-first-event\" href=\"' . esc_url( admin_url( 'post.php?post=' . $id . '&action=edit' ) ) . '\">' . esc_attr__( 'Schedule your first event!', 'sportspress' ) . '</a>',\n\t\t\t\t),\n\t\t\t\t'last'  => array(\n\t\t\t\t\t'label'   => esc_attr__( 'Upgrade to Pro', 'sportspress' ),\n\t\t\t\t\t'content' => esc_attr__( 'Get SportsPress Pro to get access to all modules. You can upgrade any time without losing any of your data.', 'sportspress' ) . ' <a href=\"' . apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) . '\" target=\"_blank\">' . esc_attr__( 'Learn more', 'sportspress' ) . '</a>',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t\t?>\n\t<a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://tboy.co/sp\" data-text=\"<?php echo esc_attr( $this->tweets[0] ); ?>\" data-via=\"ThemeBoy\" data-size=\"large\">Tweet</a>\n\t<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n\n\t<h1><?php esc_html_e( 'Thanks for installing!', 'sportspress' ); ?></h1>\n\n\t<div class=\"sp-banner\"><img src=\"//ps.w.org/sportspress/assets/banner-772x250.png\"></div>\n\n\t<div class=\"sp-setup-next-steps\">\n\t\t<?php foreach ( $steps as $class => $step ) { ?>\n\t\t<div class=\"sp-setup-next-steps-<?php echo esc_attr( $class ); ?>\">\n\t\t  <h2><?php echo esc_html( $step['label'] ); ?></h2>\n\t\t  <ul>\n\t\t\t<li><?php echo wp_kses_post( $step['content'] ); ?></li>\n\t\t  </ul>\n\t\t</div>\n\t  <?php } ?>\n\t</div>\n\t\t<?php\n\t}\n}\n\nnew SP_Admin_Setup_Wizard();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-sports.php",
    "content": "<?php\n/**\n * SportsPress Admin Sports Class.\n *\n * The SportsPress admin sports class stores preset sport data.\n *\n * @class       SP_Admin_Sports\n * @version     2.7.23\n * @package     SportsPress/Admin\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Admin_Sports {\n\n\tpublic static $presets = array();\n\tpublic static $options = array();\n\n\t/**\n\t * Include the preset classes\n\t */\n\tpublic static function get_presets() {\n\t\tif ( empty( self::$presets ) ) {\n\t\t\t$presets       = array();\n\t\t\tself::$options = array(\n\t\t\t\t'team-sports'   => array(),\n\t\t\t\t'racket-sports' => array(),\n\t\t\t\t'water-sports'  => array(),\n\t\t\t\t'target-sports' => array(),\n\t\t\t\t'esports'       => array(),\n\t\t\t\t'other'         => array(),\n\t\t\t);\n\n\t\t\tforeach ( self::$options as $slug => $options ) {\n\t\t\t\t$dir   = scandir( SP()->plugin_path() . '/presets/' . $slug );\n\t\t\t\t$files = array();\n\t\t\t\tif ( $dir ) {\n\t\t\t\t\tforeach ( $dir as $key => $value ) {\n\t\t\t\t\t\tif ( substr( $value, 0, 1 ) !== '.' && strpos( $value, '.' ) !== false ) {\n\t\t\t\t\t\t\t$files[] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach ( $files as $file ) {\n\t\t\t\t\t$json_data = file_get_contents( SP()->plugin_path() . '/presets/' . $slug . '/' . $file );\n\t\t\t\t\t$data      = json_decode( $json_data, true );\n\t\t\t\t\tif ( ! is_array( $data ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$id             = preg_replace( '/\\\\.[^.\\\\s]{3,4}$/', '', $file );\n\t\t\t\t\t$presets[ $id ] = $data;\n\t\t\t\t\t$name           = array_key_exists( 'name', $data ) ? esc_attr__( $data['name'], 'sportspress' ) : $id;\n\n\t\t\t\t\t// Conditionally append filename in parentheses for clarity\n\t\t\t\t\tif ( false === strpos( str_replace( ' ', '', strtolower( $data['name'] ) ), str_replace( '-', '', $id ) ) ) {\n\t\t\t\t\t\tif ( 4 < strlen( $id ) ) {\n\t\t\t\t\t\t\t$name .= ' (' . ucfirst( $id ) . ')';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$name .= ' (' . strtoupper( $id ) . ')';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$options[ $slug ][ $id ] = $name;\n\t\t\t\t}\n\t\t\t\tasort( self::$options[ $slug ] );\n\t\t\t}\n\n\t\t\tself::$presets = apply_filters( 'sportspress_get_presets', $presets );\n\t\t}\n\t\treturn self::$presets;\n\t}\n\n\tpublic static function get_preset( $id ) {\n\t\t$json_data = @file_get_contents( SP()->plugin_path() . '/presets/' . $id . '.json', true );\n\n\t\tif ( $json_data ) {\n\t\t\treturn json_decode( $json_data, true );\n\t\t}\n\n\t\t$dir = scandir( SP()->plugin_path() . '/presets' );\n\t\tif ( $dir ) {\n\t\t\tforeach ( $dir as $key => $value ) {\n\t\t\t\tif ( substr( $value, 0, 1 ) !== '.' && strpos( $value, '.' ) === false ) {\n\t\t\t\t\t$json_data = @file_get_contents( SP()->plugin_path() . '/presets/' . $value . '/' . $id . '.json', true );\n\t\t\t\t\tif ( $json_data ) {\n\t\t\t\t\t\treturn json_decode( $json_data, true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static function get_preset_options() {\n\t\t$presets = self::get_presets();\n\t\treturn self::$options;\n\t}\n\n\t/**\n\t * Apply preset\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic static function apply_preset( $id ) {\n\t\t$preset = self::get_preset( $id );\n\n\t\t// Positions\n\t\t$positions = sp_array_value( $preset, 'positions', array() );\n\t\t$i         = 0;\n\t\tforeach ( $positions as $position ) {\n\t\t\tif ( is_string( $position ) ) {\n\t\t\t\t$name     = $position;\n\t\t\t\t$sections = array( 0, 1 );\n\t\t\t} else {\n\t\t\t\t$name     = sp_array_value( $position, 'name', esc_attr__( 'Position', 'sportspress' ) );\n\t\t\t\t$sections = sp_array_value( $position, 'sections', array( 0, 1 ) );\n\t\t\t}\n\t\t\t$term = wp_insert_term( $name, 'sp_position' );\n\t\t\tif ( is_wp_error( $term ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$t_id                     = $term['term_id'];\n\t\t\t$term_meta                = (array) get_option( \"taxonomy_$t_id\" );\n\t\t\t$term_meta['sp_sections'] = $sections;\n\t\t\tupdate_option( \"taxonomy_$t_id\", $term_meta );\n\t\t\tupdate_term_meta( $t_id, 'sp_order', $i + 1 );\n\t\t\t$i++;\n\t\t}\n\n\t\t// Outcomes\n\t\t$post_type = 'sp_outcome';\n\t\t$outcomes  = sp_array_value( $preset, 'outcomes', array() );\n\t\tself::delete_preset_posts( $post_type );\n\t\tforeach ( $outcomes as $index => $outcome ) {\n\t\t\t$post = self::get_post_array( $outcome, $post_type );\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$id = self::insert_preset_post( $post, $index );\n\t\t\tupdate_post_meta( $id, 'sp_abbreviation', sp_array_value( $outcome, 'abbreviation', null ) );\n\t\t\tupdate_post_meta( $id, 'sp_condition', sp_array_value( $outcome, 'condition', null ) );\n\t\t}\n\n\t\t// Results\n\t\t$post_type = 'sp_result';\n\t\t$results   = sp_array_value( $preset, 'results', array() );\n\t\tself::delete_preset_posts( $post_type );\n\t\t$primary_result = 0;\n\t\tforeach ( $results as $index => $result ) {\n\t\t\t$post = self::get_post_array( $result, $post_type );\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$id = self::insert_preset_post( $post, $index );\n\t\t\tif ( is_array( $result ) && array_key_exists( 'primary', $result ) ) {\n\t\t\t\t$primary_result = $post['post_name'];\n\t\t\t}\n\t\t\tupdate_post_meta( $id, 'sp_equation', sp_array_value( $result, 'equation', null ) );\n\t\t}\n\n\t\t// Make sure statistics, metrics and specs have greater menu order than performance\n\t\t$i = 0;\n\n\t\t// Performance\n\t\t$post_type    = 'sp_performance';\n\t\t$performances = sp_array_value( $preset, 'performance', array() );\n\t\tself::delete_preset_posts( $post_type );\n\t\tforeach ( $performances as $index => $performance ) {\n\t\t\t$post = self::get_post_array( $performance, $post_type );\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$id = self::insert_preset_post( $post, $index );\n\t\t\tif ( isset( $performance['position'] ) ) {\n\t\t\t\twp_set_object_terms( $id, $performance['position'], 'sp_position', false );\n\t\t\t}\n\t\t\tupdate_post_meta( $id, 'sp_singular', sp_array_value( $performance, 'singular', null ) );\n\t\t\tupdate_post_meta( $id, 'sp_icon', sp_array_value( $performance, 'icon', null ) );\n\t\t\tupdate_post_meta( $id, 'sp_color', sp_array_value( $performance, 'color', null ) );\n\t\t\tupdate_post_meta( $id, 'sp_section', sp_array_value( $performance, 'section', -1 ) );\n\t\t\tupdate_post_meta( $id, 'sp_format', sp_array_value( $performance, 'format', 'number' ) );\n\t\t\tupdate_post_meta( $id, 'sp_equation', sp_array_value( $performance, 'equation', null ) );\n\t\t\tupdate_post_meta( $id, 'sp_precision', sp_array_value( $performance, 'precision', 0 ) );\n\t\t\tupdate_post_meta( $id, 'sp_timed', sp_array_value( $performance, 'timed', null ) );\n\t\t\t$i ++;\n\t\t}\n\n\t\t// Columns\n\t\t$post_type = 'sp_column';\n\t\t$columns   = sp_array_value( $preset, 'columns', array() );\n\t\tself::delete_preset_posts( $post_type );\n\t\tforeach ( $columns as $index => $column ) {\n\t\t\t$post = self::get_post_array( $column, $post_type );\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$id = self::insert_preset_post( $post, $index );\n\t\t\tupdate_post_meta( $id, 'sp_equation', sp_array_value( $column, 'equation', null ) );\n\t\t\tupdate_post_meta( $id, 'sp_precision', sp_array_value( $column, 'precision', 0 ) );\n\t\t\tupdate_post_meta( $id, 'sp_priority', sp_array_value( $column, 'priority', null ) );\n\t\t\tupdate_post_meta( $id, 'sp_order', sp_array_value( $column, 'order', 'DESC' ) );\n\t\t}\n\n\t\t// Metrics\n\t\t$post_type = 'sp_metric';\n\t\t$metrics   = sp_array_value( $preset, 'metrics', array() );\n\t\tself::delete_preset_posts( $post_type );\n\t\tforeach ( $metrics as $index => $metric ) {\n\t\t\t$post = self::get_post_array( $metric, $post_type );\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$id = self::insert_preset_post( $post, $i + $index );\n\t\t\t$i ++;\n\t\t}\n\n\t\t// Event Specs\n\t\t$post_type = 'sp_spec';\n\t\t$specs     = sp_array_value( $preset, 'specs', array() );\n\t\tself::delete_preset_posts( $post_type );\n\t\tforeach ( $specs as $index => $spec ) {\n\t\t\t$post = self::get_post_array( $spec, $post_type );\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$id = self::insert_preset_post( $post, $i + $index );\n\t\t\t$i ++;\n\t\t}\n\n\t\t// Statistics\n\t\t$post_type  = 'sp_statistic';\n\t\t$statistics = sp_array_value( $preset, 'statistics', array() );\n\t\tself::delete_preset_posts( $post_type );\n\t\tforeach ( $statistics as $index => $statistic ) {\n\t\t\t$post = self::get_post_array( $statistic, $post_type );\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$id = self::insert_preset_post( $post, $i + $index );\n\t\t\tupdate_post_meta( $id, 'sp_equation', sp_array_value( $statistic, 'equation', null ) );\n\t\t\tupdate_post_meta( $id, 'sp_precision', sp_array_value( $statistic, 'precision', 0 ) );\n\t\t\tupdate_post_meta( $id, 'sp_type', sp_array_value( $statistic, 'type', 'total' ) );\n\t\t}\n\n\t\t// Options\n\t\t$options = sp_array_value( $preset, 'options', array() );\n\t\tforeach ( $options as $option => $value ) {\n\t\t\tupdate_option( 'sportspress_' . $option, $value );\n\t\t}\n\n\t\t// Primary Result\n\t\tupdate_option( 'sportspress_primary_result', $primary_result );\n\t}\n\n\tpublic static function delete_preset_posts( $post_type = null ) {\n\t\t$args = array(\n\t\t\t'post_type'      => $post_type,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'post_status'    => array( 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash' ),\n\t\t\t'meta_query'     => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => '_sp_preset',\n\t\t\t\t\t'value' => 1,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Delete posts\n\t\t$old_posts = get_posts( $args );\n\t\tforeach ( $old_posts as $post ) :\n\t\t\twp_delete_post( $post->ID, true );\n\t\tendforeach;\n\t}\n\n\tpublic static function get_post_array( $post = array(), $post_type = null ) {\n\t\t$post_array = array();\n\t\tif ( is_string( $post ) ) {\n\t\t\t$post_array['post_title'] = $post;\n\t\t\t$post_array['post_name']  = sp_get_eos_safe_slug( $post_array['post_title'] );\n\t\t} elseif ( is_array( $post ) ) {\n\t\t\tif ( ! array_key_exists( 'name', $post ) ) {\n\t\t\t\t$post_array = array();\n\t\t\t}\n\t\t\t$post_array['post_title'] = $post['name'];\n\t\t\t$post_array['post_name']  = sp_array_value( $post, 'id', sp_get_eos_safe_slug( $post_array['post_title'] ) );\n\t\t}\n\n\t\t// Return empty array if post with same slug already exists\n\t\tif ( get_page_by_path( $post_array['post_name'], OBJECT, $post_type ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// Set post type\n\t\t$post_array['post_type'] = $post_type;\n\n\t\t// Add post excerpt\n\t\tif ( is_array( $post ) && array_key_exists( 'description', $post ) ) {\n\t\t\t$post_array['post_excerpt'] = $post['description'];\n\t\t}\n\n\t\treturn $post_array;\n\t}\n\n\tpublic static function insert_preset_post( $post, $index = 0 ) {\n\t\t// Increment menu order by 10 and publish post\n\t\t$post['menu_order']  = $index * 10 + 10;\n\t\t$post['post_status'] = 'publish';\n\t\t$id                  = wp_insert_post( $post );\n\n\t\t// Flag as preset\n\t\tupdate_post_meta( $id, '_sp_preset', 1 );\n\n\t\treturn $id;\n\t}\n\n\t/**\n\t * Sport category names\n\t *\n\t * @return null\n\t */\n\tpublic static function sport_category_names() {\n\t\treturn apply_filters(\n\t\t\t'sportspress_sport_categories',\n\t\t\tarray(\n\t\t\t\t'team-sports'   => esc_attr__( 'Team Sports', 'sportspress' ),\n\t\t\t\t'racket-sports' => esc_attr__( 'Racket Sports', 'sportspress' ),\n\t\t\t\t'water-sports'  => esc_attr__( 'Water Sports', 'sportspress' ),\n\t\t\t\t'target-sports' => esc_attr__( 'Target Sports', 'sportspress' ),\n\t\t\t\t'esports'       => esc_attr__( 'Esports', 'sportspress' ),\n\t\t\t\t'other'         => esc_attr__( 'Other', 'sportspress' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Sport preset names for localization\n\t *\n\t * @return null\n\t */\n\tpublic static function sport_preset_names() {\n\t\t__( 'Baseball', 'sportspress' );\n\t\t__( 'Basketball', 'sportspress' );\n\t\t__( 'Cricket', 'sportspress' );\n\t\t__( 'Darts', 'sportspress' );\n\t\t__( 'Floorball', 'sportspress' );\n\t\t__( 'Association Football', 'sportspress' );\n\t\t__( 'American Football', 'sportspress' );\n\t\t__( 'Australian Rules Football', 'sportspress' );\n\t\t__( 'Handball', 'sportspress' );\n\t\t__( 'Ice Hockey', 'sportspress' );\n\t\t__( 'Lacrosse', 'sportspress' );\n\t\t__( 'Netball', 'sportspress' );\n\t\t__( 'Rugby League', 'sportspress' );\n\t\t__( 'Rugby Union', 'sportspress' );\n\t\t__( 'Snooker', 'sportspress' );\n\t\t__( 'Softball', 'sportspress' );\n\t\t__( 'Squash', 'sportspress' );\n\t\t__( 'Table Tennis', 'sportspress' );\n\t\t__( 'Tennis', 'sportspress' );\n\t\t__( 'Volleyball', 'sportspress' );\n\t\t__( 'Water Polo', 'sportspress' );\n\t\t__( 'Dota 2', 'sportspress' );\n\t\t__( 'League of Legends', 'sportspress' );\n\t\t__( 'Counter-Strike: Global Offensive', 'sportspress' );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/class-sp-admin-status.php",
    "content": "<?php\n/**\n * Debug/Status page\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     1.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_Status' ) ) :\n\n\t/**\n\t * SP_Admin_Status Class\n\t */\n\tclass SP_Admin_Status {\n\n\t\t/**\n\t\t * Retrieve metadata from a file. Based on WP Core's get_file_data function\n\t\t *\n\t\t * @since 0.8\n\t\t * @param string $file Path to the file\n\t\t * @param array  $all_headers List of headers, in the format array('HeaderKey' => 'Header Name')\n\t\t */\n\t\tpublic function get_file_version( $file ) {\n\t\t\t// We don't need to write to the file, so just open for reading.\n\t\t\t$fp = fopen( $file, 'r' );\n\n\t\t\t// Pull only the first 8kiB of the file in.\n\t\t\t$file_data = fread( $fp, 8192 );\n\n\t\t\t// PHP will close file handle, but we are good citizens.\n\t\t\tfclose( $fp );\n\n\t\t\t// Make sure we catch CR-only line endings.\n\t\t\t$file_data = str_replace( \"\\r\", \"\\n\", $file_data );\n\t\t\t$version   = '';\n\n\t\t\tif ( preg_match( '/^[ \\t\\/*#@]*' . preg_quote( '@version', '/' ) . '(.*)$/mi', $file_data, $match ) && $match[1] ) {\n\t\t\t\t$version = _cleanup_header_comment( $match[1] );\n\t\t\t}\n\n\t\t\treturn $version;\n\t\t}\n\n\t\t/**\n\t\t * Scan the template files\n\t\t *\n\t\t * @access public\n\t\t * @param string $template_path\n\t\t * @return array\n\t\t */\n\t\tpublic function scan_template_files( $template_path ) {\n\t\t\t$files  = scandir( $template_path );\n\t\t\t$result = array();\n\t\t\tif ( $files ) {\n\t\t\t\tforeach ( $files as $key => $value ) {\n\t\t\t\t\tif ( ! in_array( $value, array( '.', '..' ) ) ) {\n\t\t\t\t\t\tif ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) {\n\t\t\t\t\t\t\t$sub_files = $this->scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value );\n\t\t\t\t\t\t\tforeach ( $sub_files as $sub_file ) {\n\t\t\t\t\t\t\t\t$result[] = $value . DIRECTORY_SEPARATOR . $sub_file;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$result[] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_Status();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-taxonomies.php",
    "content": "<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * Handles taxonomies in admin\n *\n * @class       SP_Admin_Taxonomies\n * @version     2.7.23\n * @package     SportsPress/Admin\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Admin_Taxonomies {\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\n\t\t// Add league field\n\t\tadd_action( 'sp_league_edit_form_fields', array( $this, 'edit_taxonomy_fields' ), 10, 1 );\n\t\tadd_action( 'edited_sp_league', array( $this, 'save_fields' ), 10, 1 );\n\n\t\t// Add season field\n\t\tadd_action( 'sp_season_edit_form_fields', array( $this, 'edit_taxonomy_fields' ), 10, 1 );\n\t\tadd_action( 'edited_sp_season', array( $this, 'save_fields' ), 10, 1 );\n\n\t\t// Add venue field\n\t\tadd_action( 'sp_venue_add_form_fields', array( $this, 'add_venue_fields' ) );\n\t\tadd_action( 'sp_venue_edit_form_fields', array( $this, 'edit_venue_fields' ), 10, 1 );\n\t\tadd_action( 'edited_sp_venue', array( $this, 'save_fields' ), 10, 1 );\n\t\tadd_action( 'create_sp_venue', array( $this, 'save_fields' ), 10, 1 );\n\n\t\t// Add position field\n\t\tadd_action( 'sp_position_add_form_fields', array( $this, 'add_position_fields' ) );\n\t\tadd_action( 'sp_position_edit_form_fields', array( $this, 'edit_position_fields' ), 10, 1 );\n\t\tadd_action( 'edited_sp_position', array( $this, 'save_fields' ), 10, 1 );\n\t\tadd_action( 'create_sp_position', array( $this, 'save_fields' ), 10, 1 );\n\n\t\t// Add job field\n\t\tadd_action( 'sp_role_edit_form_fields', array( $this, 'edit_taxonomy_fields' ), 10, 1 );\n\t\tadd_action( 'edited_sp_role', array( $this, 'save_fields' ), 10, 1 );\n\n\t\t// Change league columns\n\t\tadd_filter( 'manage_edit-sp_league_columns', array( $this, 'taxonomy_columns' ) );\n\t\tadd_filter( 'manage_sp_league_custom_column', array( $this, 'column_value' ), 10, 3 );\n\n\t\t// Change season columns\n\t\tadd_filter( 'manage_edit-sp_season_columns', array( $this, 'taxonomy_columns' ) );\n\t\tadd_filter( 'manage_sp_season_custom_column', array( $this, 'column_value' ), 10, 3 );\n\n\t\t// Change venue columns\n\t\tadd_filter( 'manage_edit-sp_venue_columns', array( $this, 'venue_columns' ) );\n\t\tadd_filter( 'manage_sp_venue_custom_column', array( $this, 'column_value' ), 10, 3 );\n\n\t\t// Change position columns\n\t\tadd_filter( 'manage_edit-sp_position_columns', array( $this, 'position_columns' ) );\n\t\tadd_filter( 'manage_sp_position_custom_column', array( $this, 'column_value' ), 10, 3 );\n\n\t\t// Change job columns\n\t\tadd_filter( 'manage_edit-sp_role_columns', array( $this, 'taxonomy_columns' ) );\n\t\tadd_filter( 'manage_sp_role_custom_column', array( $this, 'column_value' ), 10, 3 );\n\t}\n\n\t/**\n\t * Edit league/season fields.\n\t *\n\t * @access public\n\t * @param mixed $term Term (category) being edited\n\t */\n\tpublic function edit_taxonomy_fields( $term ) {\n\t\t$t_id = $term->term_id;\n\t\t?>\n\t\t<?php if ( function_exists( 'get_term_meta' ) ) { ?>\n\t\t\t<?php $order = get_term_meta( $t_id, 'sp_order', true ); ?>\n\t\t\t<tr class=\"form-field\">\n\t\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"sp_order\"><?php esc_html_e( 'Order', 'sportspress' ); ?></label></th>\n\t\t\t\t<td><input name=\"sp_order\" class=\"sp-number-input\" type=\"text\" step=\"1\" size=\"4\" id=\"sp_order\" value=\"<?php echo (int) $order; ?>\"></td>\n\t\t\t</tr>\n\t\t<?php } ?>\n\t\t<?php\n\t}\n\n\t/**\n\t * Add venue fields.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function add_venue_fields() {\n\t\t$args = array(\n\t\t\t'orderby'    => 'id',\n\t\t\t'order'      => 'DESC',\n\t\t\t'hide_empty' => false,\n\t\t\t'number'     => 1,\n\t\t);\n\t\t\n\t\t// Get latitude and longitude from the last added venue\n\t\t$terms = get_terms( 'sp_venue', $args );\n\t\tif ( $terms && array_key_exists( 0, $terms ) && is_object( reset( $terms ) ) ) {\n\t\t\t$term      = reset( $terms );\n\t\t\t$t_id      = $term->term_id;\n\t\t\t$term_meta = get_option( \"taxonomy_$t_id\" );\n\t\t\t$latitude  = sp_array_value( $term_meta, 'sp_latitude', '-37.8165647' );\n\t\t\t$longitude = sp_array_value( $term_meta, 'sp_longitude', '144.9475055' );\n\t\t\t$address   = sp_array_value( $term_meta, 'sp_address', '' );\n\t\t}else{\n\t\t\t// Sanitize latitude and longitude, fallback to default.\n\t\t\t$latitude  = '-37.8165647';\n\t\t\t$longitude = '144.9475055';\n\t\t\t$address   = '';\n\t\t}\n\t\t?>\n\t\t<div class=\"form-field\">\n\t\t\t<div id=\"sp-location-picker\" class=\"sp-location-picker\" style=\"width: 95%; height: 320px\"></div>\n\t\t\t<p><?php esc_html_e( \"Drag the marker to the venue's location.\", 'sportspress' ); ?></p>\n\t\t</div>\n\t\t<div class=\"form-field\">\n\t\t\t<label for=\"term_meta[sp_address]\"><?php esc_html_e( 'Address', 'sportspress' ); ?></label>\n\t\t\t<input type=\"text\" class=\"sp-address\" name=\"term_meta[sp_address]\" id=\"term_meta[sp_address]\" value=\"<?php echo esc_attr( $address ); ?>\">\n\t\t</div>\n\t\t<div class=\"form-field\">\n\t\t\t<label for=\"term_meta[sp_latitude]\"><?php esc_html_e( 'Latitude', 'sportspress' ); ?></label>\n\t\t\t<input type=\"text\" class=\"sp-latitude\" name=\"term_meta[sp_latitude]\" id=\"term_meta[sp_latitude]\" value=\"<?php echo esc_attr( $latitude ); ?>\">\n\t\t</div>\n\t\t<div class=\"form-field\">\n\t\t\t<label for=\"term_meta[sp_longitude]\"><?php esc_html_e( 'Longitude', 'sportspress' ); ?></label>\n\t\t\t<input type=\"text\" class=\"sp-longitude\" name=\"term_meta[sp_longitude]\" id=\"term_meta[sp_longitude]\" value=\"<?php echo esc_attr( $longitude ); ?>\">\n\t\t</div>\n\t\t<?php\n\t\tdo_action( 'sp_admin_geocoder_scripts' );\n\t}\n\n\t/**\n\t * Edit venue fields.\n\t *\n\t * @access public\n\t * @param mixed $term Term (category) being edited\n\t */\n\tpublic function edit_venue_fields( $term ) {\n\t\t$t_id      = $term->term_id;\n\t\t$term_meta = get_option( \"taxonomy_$t_id\" );\n\t\t$latitude  = is_numeric( $term_meta['sp_latitude'] ) ? $term_meta['sp_latitude'] : '';\n\t\t$longitude = is_numeric( $term_meta['sp_longitude'] ) ? $term_meta['sp_longitude'] : '';\n\t\t$address   = $term_meta['sp_address'] ? $term_meta['sp_address'] : '';\n\t\t?>\n\t\t<tr class=\"form-field\">\n\t\t\t<td colspan=\"2\">\n\t\t\t\t<p><div id=\"sp-location-picker\" class=\"sp-location-picker\" style=\"width: 95%; height: 320px\"></div></p>\n\t\t\t\t<p class=\"description\"><?php esc_html_e( \"Drag the marker to the venue's location.\", 'sportspress' ); ?></p>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"term_meta[sp_address]\"><?php esc_html_e( 'Address', 'sportspress' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" class=\"sp-address\" name=\"term_meta[sp_address]\" id=\"term_meta[sp_address]\" value=\"<?php echo esc_attr( $address ); ?>\">\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"term_meta[sp_latitude]\"><?php esc_html_e( 'Latitude', 'sportspress' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" class=\"sp-latitude\" name=\"term_meta[sp_latitude]\" id=\"term_meta[sp_latitude]\" value=\"<?php echo esc_attr( $latitude ); ?>\">\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"term_meta[sp_longitude]\"><?php esc_html_e( 'Longitude', 'sportspress' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" class=\"sp-longitude\" name=\"term_meta[sp_longitude]\" id=\"term_meta[sp_longitude]\" value=\"<?php echo esc_attr( $longitude ); ?>\">\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php\n\t\tdo_action( 'sp_admin_geocoder_scripts' );\n\t}\n\n\t/**\n\t * Add position fields.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function add_position_fields() {\n\t\t?>\n\t\t<div class=\"form-field\">\n\t\t\t<label><?php esc_html_e( 'Statistics', 'sportspress' ); ?></label>\n\t\t\t<select name=\"term_meta[sp_sections][]\" id=\"term_meta[sp_sections][]\" class=\"widefat chosen-select\n\t\t\t<?php\n\t\t\tif ( is_rtl() ) :\n\t\t\t\t?>\n\t\t\t\t chosen-rtl<?php endif; ?>\" multiple=\"multiple\">\n\t\t\t\t<?php\n\t\t\t\t$options = apply_filters(\n\t\t\t\t\t'sportspress_performance_sections',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t1 => esc_attr__(\n\t\t\t\t\t\t\t'Defense',\n\t\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( true ), esc_html( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Edit position fields.\n\t *\n\t * @access public\n\t * @param mixed $term Term (category) being edited\n\t */\n\tpublic function edit_position_fields( $term ) {\n\t\t$t_id     = $term->term_id;\n\t\t$sections = sp_get_term_sections( $t_id );\n\t\t?>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"term_meta[sp_sections]\"><?php esc_html_e( 'Statistics', 'sportspress' ); ?></label></th>\n\t\t\t<input type=\"hidden\" name=\"term_meta[sp_sections]\" value=\"\">\n\t\t\t<td>\n\t\t\t\t<select name=\"term_meta[sp_sections][]\" id=\"term_meta[sp_sections][]\" class=\"widefat chosen-select\n\t\t\t\t<?php\n\t\t\t\tif ( is_rtl() ) :\n\t\t\t\t\t?>\n\t\t\t\t\t chosen-rtl<?php endif; ?>\" multiple=\"multiple\">\n\t\t\t\t\t<?php\n\t\t\t\t\t$options = apply_filters(\n\t\t\t\t\t\t'sportspress_performance_sections',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t\t1 => esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( in_array( $key, $sections ), true, false ), esc_html( $value ) );\n\t\t\t\t\tendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php if ( function_exists( 'get_term_meta' ) ) { ?>\n\t\t\t<?php $order = get_term_meta( $t_id, 'sp_order', true ); ?>\n\t\t\t<tr class=\"form-field\">\n\t\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"sp_order\"><?php esc_html_e( 'Order', 'sportspress' ); ?></label></th>\n\t\t\t\t<td><input name=\"sp_order\" class=\"sp-number-input\" type=\"text\" step=\"1\" size=\"4\" id=\"sp_order\" value=\"<?php echo (int) $order; ?>\"></td>\n\t\t\t</tr>\n\t\t<?php } ?>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save fields.\n\t *\n\t * @access public\n\t * @param mixed $term_id Term ID being saved\n\t * @return void\n\t */\n\tpublic function save_fields( $term_id ) {\n\t\tif ( isset( $_POST['term_meta'] ) ) {\n\t\t\t$t_id      = $term_id;\n\t\t\t$term_meta = get_option( \"taxonomy_$t_id\" );\n\t\t\t$cat_keys  = array_keys( wp_unslash( $_POST['term_meta'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\tforeach ( $cat_keys as $key ) {\n\t\t\t\tif ( isset( $_POST['term_meta'][ $key ] ) ) {\n\t\t\t\t\tif ( is_array( $_POST['term_meta'][ $key ] ) ) {\n\t\t\t\t\t\t// If it's an array, loop through each element and sanitize\n\t\t\t\t\t\t$term_meta[ $key ] = array_map( 'sanitize_text_field', wp_unslash( $_POST['term_meta'][ $key ] ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it's not an array, just sanitize the single value\n\t\t\t\t\t\t$term_meta[ $key ] = sanitize_text_field( wp_unslash( $_POST['term_meta'][ $key ] ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdate_option( \"taxonomy_$t_id\", $term_meta );\n\t\t}\n\t\tif ( function_exists( 'add_term_meta' ) ) {\n\t\t\tupdate_term_meta( $term_id, 'sp_order', (int) sp_array_value( $_POST, 'sp_order', 0, 'int' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Posts column changed to Events in admin.\n\t *\n\t * @access public\n\t * @param mixed $columns\n\t * @return array\n\t */\n\tpublic function taxonomy_columns( $columns ) {\n\t\t$new_columns = array();\n\n\t\tif ( function_exists( 'get_term_meta' ) ) {\n\t\t\t$new_columns['sp_order'] = esc_attr__( 'Order', 'sportspress' );\n\t\t}\n\n\t\tif ( array_key_exists( 'posts', $columns ) ) {\n\t\t\t$new_columns['posts'] = $columns['posts'];\n\n\t\t\tunset( $columns['posts'] );\n\t\t}\n\n\t\treturn array_merge( $columns, $new_columns );\n\t}\n\n\t/**\n\t * Change venue columns in admin.\n\t *\n\t * @access public\n\t * @param mixed $columns\n\t * @return array\n\t */\n\tpublic function venue_columns( $columns ) {\n\t\t$new_columns               = array();\n\t\t$new_columns['sp_address'] = esc_attr__( 'Address', 'sportspress' );\n\n\t\tif ( array_key_exists( 'posts', $columns ) ) {\n\t\t\t$new_columns['posts'] = $columns['posts'];\n\t\t\tunset( $columns['posts'] );\n\t\t}\n\n\t\tunset( $columns['description'] );\n\t\tunset( $columns['slug'] );\n\n\t\treturn array_merge( $columns, $new_columns );\n\t}\n\n\t/**\n\t * Posts column changed to Players in admin.\n\t *\n\t * @access public\n\t * @param mixed $columns\n\t * @return array\n\t */\n\tpublic function position_columns( $columns ) {\n\t\t$new_columns                = array();\n\t\t$new_columns['sp_sections'] = esc_attr__( 'Statistics', 'sportspress' );\n\n\t\tif ( function_exists( 'get_term_meta' ) ) {\n\t\t\t$new_columns['sp_order'] = esc_attr__( 'Order', 'sportspress' );\n\t\t}\n\n\t\tif ( array_key_exists( 'posts', $columns ) ) {\n\t\t\t$new_columns['posts'] = $columns['posts'];\n\t\t\tunset( $columns['posts'] );\n\t\t}\n\n\t\tunset( $columns['description'] );\n\t\tunset( $columns['slug'] );\n\n\t\treturn array_merge( $columns, $new_columns );\n\t}\n\n\t/**\n\t * Column value added to category admin.\n\t *\n\t * @access public\n\t * @param mixed $columns\n\t * @param mixed $column\n\t * @param mixed $id\n\t * @return array\n\t */\n\tpublic function column_value( $columns, $column, $id ) {\n\n\t\tif ( $column == 'sp_address' ) {\n\n\t\t\t$term_meta = get_option( \"taxonomy_$id\" );\n\n\t\t\t$address = ( isset( $term_meta['sp_address'] ) ? esc_attr($term_meta['sp_address']) : '&mdash;' );\n\n\t\t\t$columns .= $address;\n\n\t\t} elseif ( $column == 'sp_sections' ) {\n\n\t\t\t$options = apply_filters(\n\t\t\t\t'sportspress_performance_sections',\n\t\t\t\tarray(\n\t\t\t\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t1 => esc_attr__(\n\t\t\t\t\t\t'Defense',\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$sections = sp_get_term_sections( $id );\n\n\t\t\t$section_names = array();\n\n\t\t\tif ( is_array( $sections ) ) {\n\t\t\t\tforeach ( $sections as $section ) {\n\t\t\t\t\tif ( array_key_exists( $section, $options ) ) {\n\t\t\t\t\t\t$section_names[] = $options[ $section ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$columns .= implode( ', ', $section_names );\n\n\t\t} elseif ( $column == 'sp_order' ) {\n\n\t\t\t$columns = (int) get_term_meta( $id, 'sp_order', true );\n\n\t\t}\n\n\t\treturn $columns;\n\t}\n}\n\nnew SP_Admin_Taxonomies();\n"
  },
  {
    "path": "includes/admin/class-sp-admin-welcome.php",
    "content": "<?php\n/**\n * Welcome Page Class\n *\n * Shows a feature overview for the new version (major) and credits.\n *\n * Adapted from code in EDD (Copyright (c) 2012, Pippin Williamson) and WP.\n *\n * @author    ThemeBoy\n * @category  Admin\n * @package   SportsPress/Admin\n * @version   2.7.13\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Admin_Welcome class.\n */\nclass SP_Admin_Welcome {\n\n\tprivate $plugin;\n\n\t/**\n\t * __construct function.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function __construct() {\n\t\t$this->plugin = 'sportspress/sportspress.php';\n\n\t\tadd_action( 'admin_menu', array( $this, 'admin_menus' ) );\n\t\tadd_action( 'admin_head', array( $this, 'admin_head' ) );\n\t\tadd_action( 'admin_init', array( $this, 'welcome' ) );\n\t}\n\n\t/**\n\t * Add admin menus/screens\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function admin_menus() {\n\t\tif ( empty( $_GET['page'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$welcome_page_name  = esc_attr__( 'About SportsPress', 'sportspress' );\n\t\t$welcome_page_title = esc_attr__( 'Welcome to SportsPress', 'sportspress' );\n\n\t\tswitch ( $_GET['page'] ) {\n\t\t\tcase 'sp-about':\n\t\t\t\t$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-about', array( $this, 'about_screen' ) );\n\t\t\t\tadd_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) );\n\t\t\t\tbreak;\n\t\t\tcase 'sp-credits':\n\t\t\t\t$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-credits', array( $this, 'credits_screen' ) );\n\t\t\t\tadd_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) );\n\t\t\t\tbreak;\n\t\t\tcase 'sp-translators':\n\t\t\t\t$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-translators', array( $this, 'translators_screen' ) );\n\t\t\t\tadd_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * admin_css function.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function admin_css() {\n\t\twp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ), array(), SP_VERSION );\n\t}\n\n\t/**\n\t * Add styles just for this page, and remove dashboard page links.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function admin_head() {\n\t\tremove_submenu_page( 'index.php', 'sp-about' );\n\t\tremove_submenu_page( 'index.php', 'sp-credits' );\n\t\tremove_submenu_page( 'index.php', 'sp-translators' );\n\t}\n\n\t/**\n\t * Into text/links shown on all about pages.\n\t *\n\t * @access private\n\t * @return void\n\t */\n\tprivate function intro() {\n\n\t\t// Flush after upgrades\n\t\tif ( ! empty( $_GET['sp-updated'] ) || ! empty( $_GET['sp-installed'] ) ) {\n\t\t\tflush_rewrite_rules();\n\t\t}\n\n\t\t// Get major version number\n\t\t$version = explode( '.', SP()->version, 3 );\n\t\tunset( $version[2] );\n\t\t$display_version = implode( '.', $version );\n\t\t?>\n\t<h1 class=\"sp-welcome-logo\"><?php echo wp_kses_post( apply_filters( 'sportspress_logo', '<img src=\"' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/welcome/sportspress' . ( class_exists( 'SportsPress_Pro' ) ? '-pro' : '' ) . '.png\" alt=\"' . esc_attr__( 'SportsPress', 'sportspress' ) . '\">' ) ); ?></h1>\n\n\t<div class=\"sp-badge\"><?php printf( esc_html__( 'Version %s', 'sportspress' ), esc_html( SP()->version ) ); ?></div>\n\n\t<div class=\"about-text sp-about-text\">\n\t\t<?php\n\t\tif ( ! empty( $_GET['sp-installed'] ) ) {\n\t\t\t$message = esc_attr__( 'Thanks, all done!', 'sportspress' );\n\t\t} elseif ( ! empty( $_GET['sp-updated'] ) ) {\n\t\t\t$message = esc_attr__( 'Thank you for updating to the latest version!', 'sportspress' );\n\t\t} else {\n\t\t\t$message = esc_attr__( 'Thanks for installing!', 'sportspress' );\n\t\t}\n\n\t\tprintf( esc_html__( '%1$s SportsPress %2$s has lots of refinements we think you&#8217;ll love.', 'sportspress' ), esc_html( $message ), esc_html( $display_version ) );\n\t\t?>\n\t</div>\n\n\t\t  <a href=\"\n\t\t  <?php\n\t\t\techo esc_url( admin_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'page' => 'sportspress',\n\t\t\t\t\t\t'tab'  => 'general',\n\t\t\t\t\t),\n\t\t\t\t\t'admin.php'\n\t\t\t\t)\n\t\t\t) );\n\t\t\t?>\n\t\t\t\t\t\" class=\"button button-primary\"><?php esc_html_e( 'Settings', 'sportspress' ); ?></a>\n\t  <a href=\"<?php echo esc_url( apply_filters( 'sportspress_docs_url', 'http://tboy.co/docs', 'sportspress' ) ); ?>\" class=\"docs button button-primary\"><?php esc_html_e( 'Docs', 'sportspress' ); ?></a>\n\t  <a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://wordpress.org/plugins/sportspress\" data-text=\"An open-source (free) #WordPress plugin that helps you build professional league websites\" data-via=\"ThemeBoy\" data-size=\"large\" data-hashtags=\"SportsPress\">Tweet</a>\n\t  <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n\t</p>\n\n\t<h2 class=\"nav-tab-wrapper\">\n\t  <a class=\"nav-tab \n\t\t<?php\n\t\tif ( sanitize_key( $_GET['page'] ) == 'sp-about' ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\techo 'nav-tab-active';}\n\t\t?>\n\t\t\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sp-about' ), 'index.php' ) ) ); ?>\">\n\t\t<?php esc_html_e( 'Welcome', 'sportspress' ); ?>\n\t  </a><a class=\"nav-tab \n\t\t<?php\n\t\tif ( sanitize_key( $_GET['page'] ) == 'sp-credits' ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\techo 'nav-tab-active';}\n\t\t?>\n\t\t\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sp-credits' ), 'index.php' ) ) ); ?>\">\n\t\t<?php esc_html_e( 'Credits', 'sportspress' ); ?>\n\t  </a>\n\t</h2>\n\t\t<?php\n\t}\n\n\t/**\n\t * Output the about screen.\n\t */\n\tpublic function about_screen() {\n\t\tinclude_once 'class-sp-admin-settings.php';\n\t\t$class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' );\n\t\t?>\n\t<div class=\"wrap about-wrap about-sportspress-wrap\">\n\n\t\t<?php $this->intro(); ?>\n\n\t\t<?php\n\t\t// Save settings\n\t\tif ( isset( $_POST['timezone_string'] ) ) :\n\t\t\tupdate_option( 'timezone_string', sanitize_text_field( wp_unslash( $_POST['timezone_string'] ) ) );\n\t\t\tupdate_option( 'sportspress_basic_setup', 1 );\n\t\t  endif;\n\t\tif ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) ) :\n\t\t\t$sport = sanitize_text_field( wp_unslash( $_POST['sportspress_sport'] ) );\n\t\t\tSP_Admin_Sports::apply_preset( $sport );\n\t\t\tupdate_option( 'sportspress_sport', $sport );\n\t\t\tdelete_option( '_sp_needs_welcome' );\n\t\t\tupdate_option( 'sportspress_installed', 1 );\n\t\t\t?>\n\t\t<div id=\"message\" class=\"updated sportspress-message\">\n\t\t  <p><strong><?php esc_html_e( 'Your settings have been saved.', 'sportspress' ); ?></strong></p>\n\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t\tif ( isset( $_POST['add_sample_data'] ) ) :\n\t\t\tSP_Admin_Sample_Data::delete_posts();\n\t\t\tSP_Admin_Sample_Data::insert_posts();\n\t\tendif;\n\n\t\tdo_action( 'sportspress_before_welcome_features' );\n\t\t?>\n\t  <div class=\"feature-section one-col\">\n\t\t<div class=\"col\">\n\t\t  <h2>New Features 🌟</h2>\n\t\t</div>\n\t  </div>\n\n\t  <div class=\"feature-section three-col\">\n\t\t<div class=\"col\">\n\t\t  <img src=\"<?php echo esc_url( plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/welcome/screenshot-conditional-equations.png' );?>\" alt=\"Screenshot\">\n\t\t  <h3>Conditional Equations</h3>\n\t\t  <p>Use the newly introduced conditional operators <strong>&gt;</strong>, <strong>&lt;</strong>, <strong>&equiv;</strong>, <strong>&ne;</strong>, <strong>&ge;</strong>, and <strong>&le;</strong> to calculate the relationship between variables, then insert that calculation into more complex equations. Visit the <a href=\"<?php echo esc_url( add_query_arg( array( 'page' => 'sportspress-config' ), admin_url( 'admin.php' ) ) ); ?>\">Configure</a> page to edit variables and equations.</p>\n\t\t</div>\n\t\t<div class=\"col\">\n\t\t  <img src=\"<?php echo esc_url( plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/welcome/screenshot-event-specs.png' );?>\" alt=\"Screenshot\">\n\t\t  <h3>Event Specs</h3>\n\t\t  <p>Measure and display additional details per event using the new <strong>Event Specs</strong> variables. They are customizable and can be useful for keeping track of information like player of the match, attendance, and venue weather.\n\t\t</div>\n\t\t<div class=\"col\">\n\t\t  <img src=\"<?php echo esc_url( plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/welcome/screenshot-next-team.png' );?>\" alt=\"Screenshot\">\n\t\t  <h3>Next Team Column</h3>\n\t\t  <p>Provide a quick overview of who each team is playing next using the new <strong>Next Team</strong> preset for <a href=\"<?php echo esc_url( add_query_arg( array( 'post_type' => 'sp_column' ), admin_url( 'edit.php' ) ) ); ?>\">league table columns</a>. This will automatically display the next team's name or logo that links to the next match for each team in the table.<p>\n\t\t</div>\n\t  </div>\n\n\t\t<?php if ( ! class_exists( 'SportsPress_Pro' ) ) { ?>\n\t  <hr>\n\n\t  <div class=\"feature-section one-col\">\n\t\t<div class=\"col\">\n\t\t  <h2>SportsPress Pro Updates 🏆</h2>\n\t\t</div>\n\t  </div>\n\n\t  <div class=\"feature-section three-col\">\n\t\t<div class=\"col\">\n\t\t  <img src=\"<?php echo esc_url( plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/welcome/screenshot-results-matrix.png' );?>\" alt=\"Results Matrix\">\n\t\t  <h3>Results Matrix</h3>\n\t\t  <p>Display matches between home and away team in a grid. Create or select an existing calendar and select the <strong>Matrix</strong> layout to convert the calendar to an interactive results matrix!</p>\n\t\t</div>\n\t\t<div class=\"col\">\n\t\t  <img src=\"<?php echo esc_url( plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/welcome/screenshot-midseason-transfers.png' );?>\" alt=\"Midseason Transfers\">\n\t\t  <h3>Midseason Transfers</h3>\n\t\t  <p>Keep track of players that switched teams during a season by adding one or more extra rows to their statistics table. Display the team and partial statistics before and after the transfer.<p>\n\t\t</div>\n\t\t<div class=\"col\">\n\t\t  <img src=\"<?php echo esc_url( plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/welcome/screenshot-vertical-timelines.png' );?>\" alt=\"Vertical Timelines\">\n\t\t  <h3>Vertical Timelines</h3>\n\t\t  <p>Display a match commentary style play-by-play timeline within events. <a href=\"<?php echo esc_url( apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) ); ?>\">Upgrade to SportsPress Pro</a> to get access to <strong>Timelines</strong> and other pro features.<p>\n\t\t</div>\n\t  </div>\n\n\t  <a class=\"button button-primary button-hero\" href=\"<?php echo esc_url( apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) ); ?>\"><?php esc_html_e( 'Upgrade to Pro', 'sportspress' ); ?></a>\n\n\t  <p><?php esc_html_e( 'Get SportsPress Pro to get access to all modules. You can upgrade any time without losing any of your data.', 'sportspress' ); ?></p>\n\t  <?php } ?>\n\n\t  <hr>\n\n\t  <div class=\"feature-section one-col\">\n\t\t<div class=\"col\">\n\t\t  <h2>Player Data Improvements</h2>\n\t\t</div>\n\t  </div>\n\n\t  <div class=\"feature-section three-col\">\n\t\t<div class=\"col\">\n\t\t  <h3>Player Assignments</h3>\n\t\t  <p>Players will now be saved using a new data format that allows them to belong to multiple leagues, seasons, and teams and be accurately selected in <a href=\"<?php echo esc_url( add_query_arg( array( 'post_type' => 'sp_list' ), admin_url( 'edit.php' ) ) ); ?>\">player lists</a>.</p>\n\t\t</div>\n\t\t<div class=\"col\">\n\t\t  <h3>Current Team Column</h3>\n\t\t  <p>The <strong>Team</strong> column in player lists will now display only the current team that player belongs to, determined by the <strong>Current Team</strong> setting of each player.</p>\n\t\t</div>\n\t\t<div class=\"col\">\n\t\t  <h3>Squad Number Zero</h3>\n\t\t  <p>It's now possible to import players with the squad number <strong>0 (zero)</strong> or any other value that would previously be interpreted as empty.</p>\n\t\t</div>\n\t  </div>\n\n\t  <hr>\n\n\t  <div class=\"feature-section one-col\">\n\t\t<div class=\"col\">\n\t\t  <h2>Other Notes</h2>\n\t\t</div>\n\t  </div>\n\n\t  <div class=\"feature-section three-col\">\n\t\t<div class=\"col\">\n\t\t  <h3>Countdown Images</h3>\n\t\t  <p>A new option has been added to the <strong>Countdown</strong> widget, allowing you to display a featured image from the next event.</p>\n\t\t</div>\n\t\t<div class=\"col\">\n\t\t  <h3>Relative Date in Shortcodes</h3>\n\t\t  <p>You'll now be able to select a relative date range when inserting calendar-related shortcodes from the visual editor.</p>\n\t\t</div>\n\t\t<div class=\"col\">\n\t\t  <h3>Short Names</h3>\n\t\t  <p>Teams have been given a <strong>Short Name</strong> setting in addition to the existing <strong>Abbreviation</strong> for added customizability.</p>\n\t\t</div>\n\t  </div>\n\n\t\t<?php do_action( 'sportspress_after_welcome_features' ); ?>\n\t\t  <a href=\"\n\t\t  <?php\n\t\t\techo esc_url(\n\t\t\t\tadmin_url(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'page' => 'sportspress',\n\t\t\t\t\t\t\t'tab'  => 'general',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t\t\t\t\"><?php esc_html_e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>\n\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Output the credits.\n\t */\n\tpublic function credits_screen() {\n\t\t?>\n\t<div class=\"wrap about-wrap about-sportspress-wrap\">\n\t\t<?php $this->intro(); ?>\n\t  \n\t  <p class=\"about-description\"><?php printf( wp_kses_post( __( 'SportsPress is developed and maintained by a worldwide team of passionate individuals and backed by an awesome developer community. Want to see your name? <a href=\"%s\">Contribute to SportsPress</a>.', 'sportspress' ) ), 'https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md' ); ?></p>\n\n\t  <div class=\"sp-feature feature-section col one-col\">\n\t\t<?php echo wp_kses_post( $this->contributors() ); ?>\n\t  </div>\n\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Output the translators screen\n\t */\n\tpublic function translators_screen() {\n\t\t?>\n\t<div class=\"wrap about-wrap about-sportspress-wrap\">\n\n\t\t<?php $this->intro(); ?>\n\n\t  <p class=\"about-description\"><?php printf( wp_kses_post( __( 'SportsPress has been kindly translated into several other languages thanks to our translation team. Want to see your name? <a href=\"%s\">Translate SportsPress</a>.', 'sportspress' ) ), 'https://translate.wordpress.org/projects/wp-plugins/sportspress' ); ?></p>\n\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render Contributors List\n\t *\n\t * @access public\n\t * @return string $contributor_list HTML formatted list of contributors.\n\t */\n\tpublic function contributors() {\n\t\t$contributors = $this->get_contributors();\n\n\t\tif ( empty( $contributors ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$contributor_list = '<ul class=\"wp-people-group\">';\n\n\t\tforeach ( $contributors as $contributor ) {\n\t\t\t$contributor_list .= '<li class=\"wp-person\">';\n\t\t\t$contributor_list .= sprintf(\n\t\t\t\t'<a href=\"%s\" title=\"%s\">',\n\t\t\t\tesc_url( 'https://github.com/' . $contributor->login ),\n\t\t\t\tesc_html( sprintf( esc_attr__( 'View %s', 'sportspress' ), $contributor->login ) )\n\t\t\t);\n\t\t\t$contributor_list .= sprintf( '<img src=\"%s\" width=\"64\" height=\"64\" class=\"gravatar\" alt=\"%s\" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );\n\t\t\t$contributor_list .= '</a>';\n\t\t\t$contributor_list .= sprintf( '<a class=\"web\" href=\"%s\">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );\n\t\t\t$contributor_list .= '</a>';\n\t\t\t$contributor_list .= '</li>';\n\t\t}\n\n\t\t$contributor_list .= '</ul>';\n\n\t\treturn $contributor_list;\n\t}\n\n\t/**\n\t * Retrieve list of contributors from GitHub.\n\t *\n\t * @access public\n\t * @return mixed\n\t */\n\tpublic function get_contributors() {\n\t\t$contributors = get_transient( 'sportspress_contributors' );\n\n\t\tif ( false !== $contributors ) {\n\t\t\treturn $contributors;\n\t\t}\n\n\t\t$response = wp_remote_get( 'https://api.github.com/repos/ThemeBoy/SportsPress/contributors', array( 'sslverify' => false ) );\n\n\t\tif ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$contributors = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\tif ( ! is_array( $contributors ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\tset_transient( 'sportspress_contributors', $contributors, HOUR_IN_SECONDS );\n\n\t\treturn $contributors;\n\t}\n\n\t/**\n\t * Sends user to the welcome page on first activation\n\t */\n\tpublic function welcome() {\n\n\t\t// Bail if no activation redirect transient is set\n\t\tif ( ! get_transient( '_sp_activation_redirect' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Delete the redirect transient\n\t\tdelete_transient( '_sp_activation_redirect' );\n\n\t\t// Bail if we are waiting to install or update via the interface update/install links\n\t\tif ( get_option( '_sp_needs_update' ) == 1 || get_option( '_sp_needs_pages' ) == 1 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if activating from network, or bulk, or within an iFrame\n\t\tif ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == sanitize_key( $_GET['action'] ) ) && ( isset( $_GET['plugin'] ) && strstr( $_GET['plugin'], 'sportspress.php' ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! get_option( 'sportspress_completed_setup' ) ) {\n\t\t\twp_redirect( admin_url( 'admin.php?page=sp-setup' ) );\n\t\t\texit;\n\t\t}\n\n\t\twp_redirect( admin_url( 'index.php?page=sp-about' ) );\n\t\texit;\n\t}\n}\n\nnew SP_Admin_Welcome();\n"
  },
  {
    "path": "includes/admin/class-sp-admin.php",
    "content": "<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SportsPress Admin.\n *\n * @class       SP_Admin\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.5.1\n */\nclass SP_Admin {\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'init', array( $this, 'includes' ) );\n\t\tadd_action( 'current_screen', array( $this, 'conditonal_includes' ) );\n\t\tadd_action( 'admin_init', array( $this, 'prevent_admin_access' ) );\n\n\t\t// Action buttons\n\t\tadd_action( 'admin_print_footer_scripts', array( $this, 'action_links' ) );\n\n\t\t// Review link\n\t\tadd_action( 'sportspress_settings_page', 'sp_review_link' );\n\t\tadd_action( 'sportspress_config_page', 'sp_review_link' );\n\t\tadd_action( 'sportspress_overview_page', 'sp_review_link' );\n\t}\n\n\t/**\n\t * Include any classes we need within admin.\n\t */\n\tpublic function includes() {\n\t\t// Functions\n\t\tinclude_once 'sp-admin-functions.php';\n\n\t\t// Classes\n\t\tinclude_once 'class-sp-admin-post-types.php';\n\t\tinclude_once 'class-sp-admin-taxonomies.php';\n\t\tinclude_once 'class-sp-admin-ajax.php';\n\n\t\t// Classes we only need if the ajax is not-ajax\n\t\tif ( ! is_ajax() ) {\n\t\t\tinclude 'class-sp-admin-menus.php';\n\t\t\tinclude 'class-sp-admin-welcome.php';\n\t\t\tinclude 'class-sp-admin-notices.php';\n\t\t\tinclude 'class-sp-admin-assets.php';\n\t\t\tinclude 'class-sp-admin-permalink-settings.php';\n\n\t\t\tif ( 'yes' == get_option( 'sportspress_rich_editing', 'yes' ) ) :\n\t\t\t\tinclude 'class-sp-admin-editor.php';\n\t\t\tendif;\n\t\t}\n\n\t\t// Setup/welcome\n\t\tif ( ! empty( $_GET['page'] ) ) {\n\t\t\tswitch ( $_GET['page'] ) {\n\t\t\t\tcase 'sp-setup':\n\t\t\t\t\tinclude_once 'class-sp-admin-setup-wizard.php';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Include admin files conditionally\n\t */\n\tpublic function conditonal_includes() {\n\t\t$screen = get_current_screen();\n\n\t\tswitch ( $screen->id ) {\n\t\t\tcase 'dashboard':\n\t\t\t\tinclude 'class-sp-admin-dashboard.php';\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Prevent any user who cannot 'edit_posts' (subscribers, fans etc) from accessing admin\n\t */\n\tpublic function prevent_admin_access() {\n\t\t$prevent_access = false;\n\n\t\tif ( 'yes' == get_option( 'sportspress_lock_down_admin' ) && ! is_ajax() && ! ( current_user_can( 'edit_posts' ) || current_user_can( 'manage_sportspress' ) ) && basename( $_SERVER['SCRIPT_FILENAME'] ) !== 'admin-post.php' ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t$prevent_access = true;\n\t\t}\n\n\t\t$prevent_access = apply_filters( 'sportspress_prevent_admin_access', $prevent_access );\n\n\t\tif ( $prevent_access ) {\n\t\t\twp_safe_redirect( get_permalink( sp_get_page_id( 'myaccount' ) ) );\n\t\t\texit;\n\t\t}\n\t}\n\n\t/**\n\t * Add action link after post list title\n\t */\n\tpublic function action_links() {\n\t\tglobal $pagenow, $typenow;\n\t\tif ( in_array( $typenow, sp_importable_post_types() ) ) {\n\t\t\tif ( 'sp_event' === $typenow ) {\n\t\t\t\tif ( 'edit.php' === $pagenow ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t(function($) {\n\t\t\t\t\t\t$(\".wrap .page-title-action\").first().after(\n\t\t\t\t\t\t\t$(\"<a class=\\\"add-new-h2\\\" href=\\\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => 'sp_fixture_csv' ), 'admin.php' ) ) ); ?>\\\"><?php esc_html_e( 'Import Fixtures', 'sportspress' ); ?></a>\")\n\t\t\t\t\t\t).after(\n\t\t\t\t\t\t\t$(\"<a class=\\\"add-new-h2\\\" href=\\\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => 'sp_event_csv' ), 'admin.php' ) ) ); ?>\\\"><?php esc_html_e( 'Import Events', 'sportspress' ); ?></a>\")\n\t\t\t\t\t\t);\n\t\t\t\t\t})(jQuery);\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( 'edit.php' === $pagenow ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t(function($) {\n\t\t\t\t\t\t$(\".wrap .page-title-action\").first().after(\n\t\t\t\t\t\t\t$(\"<a class=\\\"add-new-h2\\\" href=\\\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => $typenow . '_csv' ), 'admin.php' ) ) ); ?>\\\"><?php esc_html_e( 'Import', 'sportspress' ); ?></a>\")\n\t\t\t\t\t\t);\n\t\t\t\t\t})(jQuery);\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nreturn new SP_Admin();\n"
  },
  {
    "path": "includes/admin/importers/class-sp-event-importer.php",
    "content": "<?php\n/**\n * Event importer - import events into SportsPress.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Importers\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( class_exists( 'WP_Importer' ) ) {\n\tclass SP_Event_Importer extends SP_Importer {\n\n\t\t/**\n\t\t * __construct function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->import_page  = 'sp_event_csv';\n\t\t\t$this->import_label = esc_attr__( 'Import Events', 'sportspress' );\n\t\t\t$this->columns      = array(\n\t\t\t\t'post_date'  => esc_attr__( 'Date', 'sportspress' ),\n\t\t\t\t'post_time'  => esc_attr__( 'Time', 'sportspress' ),\n\t\t\t\t'sp_venue'   => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t'sp_team'    => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t'sp_results' => esc_attr__( 'Results', 'sportspress' ),\n\t\t\t\t'sp_outcome' => esc_attr__( 'Outcome', 'sportspress' ),\n\t\t\t\t'sp_player'  => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t);\n\t\t\t$performance_labels = sp_get_var_labels( 'sp_performance' );\n\t\t\tif ( $performance_labels && is_array( $performance_labels ) && sizeof( $performance_labels ) ) {\n\t\t\t\t$this->columns = array_merge( $this->columns, $performance_labels );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * import function.\n\t\t *\n\t\t * @access public\n\t\t * @param array $array\n\t\t * @param array $columns\n\t\t * @return void\n\t\t */\n\t\tfunction import( $array = array(), $columns = array( 'post_title' ) ) {\n\t\t\t$this->imported = $this->skipped = 0;\n\n\t\t\tif ( ! is_array( $array ) || ! sizeof( $array ) ) :\n\t\t\t\t$this->footer();\n\t\t\t\tdie();\n\t\t\tendif;\n\n\t\t\t$rows = array_chunk( $array, sizeof( $columns ) );\n\n\t\t\t// Get event format, league, and season from post vars\n\t\t\t$event_format = ( empty( $_POST['sp_format'] ) ? false : sanitize_key( $_POST['sp_format'] ) );\n\t\t\t$league       = ( sp_array_value( $_POST, 'sp_league', '-1' ) == '-1' ? false : sanitize_key( $_POST['sp_league'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t$season       = ( sp_array_value( $_POST, 'sp_season', '-1' ) == '-1' ? false : sanitize_key( $_POST['sp_season'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t$date_format  = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : sanitize_text_field( wp_unslash( $_POST['sp_date_format'] ) ) );\n\n\t\t\t// Get labels from result and performance post types\n\t\t\t$result_labels      = sp_get_var_labels( 'sp_result' );\n\t\t\t$performance_labels = sp_get_var_labels( 'sp_performance' );\n\n\t\t\tforeach ( $rows as $row ) :\n\n\t\t\t\t$row = array_filter( $row );\n\n\t\t\t\tif ( empty( $row ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$meta = array();\n\n\t\t\t\tforeach ( $columns as $index => $key ) :\n\t\t\t\t\t$meta[ $key ] = sp_array_value( $row, $index );\n\t\t\t\tendforeach;\n\n\t\t\t\t// Slice array into event, team, and player\n\t\t\t\t$event  = array_slice( $row, 0, 3 );\n\t\t\t\t$team   = array_slice( $row, 3, 3 );\n\t\t\t\t$player = array_slice( $row, 6 );\n\n\t\t\t\t// Get event details\n\t\t\t\t$event = array(\n\t\t\t\t\tsp_array_value( $meta, 'post_date' ),\n\t\t\t\t\tsp_array_value( $meta, 'post_time' ),\n\t\t\t\t\tsp_array_value( $meta, 'sp_venue' ),\n\t\t\t\t);\n\t\t\t\tunset( $meta['post_date'] );\n\t\t\t\tunset( $meta['post_time'] );\n\t\t\t\tunset( $meta['sp_venue'] );\n\n\t\t\t\t// Get team results\n\t\t\t\t$team = array(\n\t\t\t\t\tsp_array_value( $meta, 'sp_team' ),\n\t\t\t\t\tsp_array_value( $meta, 'sp_results' ),\n\t\t\t\t\tsp_array_value( $meta, 'sp_outcome' ),\n\t\t\t\t);\n\t\t\t\tunset( $meta['sp_team'] );\n\t\t\t\tunset( $meta['sp_results'] );\n\t\t\t\tunset( $meta['sp_outcome'] );\n\n\t\t\t\t// Get player performance\n\t\t\t\t$player = array(\n\t\t\t\t\tsp_array_value( $meta, 'sp_player' ),\n\t\t\t\t);\n\t\t\t\tunset( $meta['sp_player'] );\n\t\t\t\tforeach ( $performance_labels as $key => $label ) :\n\t\t\t\t\t// Get performance object.\n\t\t\t\t\t$perf_column = get_page_by_path( $key, OBJECT, 'sp_performance' );\n\t\t\t\t\t// Check if it has time format and convert it to seconds.\n\t\t\t\t\tif ( is_object( $perf_column ) && 'time' == get_post_meta( $perf_column->ID, 'sp_format', true ) ) {\n\t\t\t\t\t\t$player[] = sp_value_time( sp_array_value( $meta, $key, '0' ) );\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$player[] = sp_array_value( $meta, $key, '' );\n\t\t\t\t\t}\n\t\t\t\tendforeach;\n\n\t\t\t\t// Add new event if date is given\n\t\t\t\tif ( sizeof( $event ) > 0 && ! empty( $event[0] ) ) :\n\n\t\t\t\t\t// Add player performance to last event if available\n\t\t\t\t\tif ( isset( $id ) && isset( $players ) && sizeof( $players ) > 0 ) :\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_players', $players );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// List event columns\n\t\t\t\t\tlist( $date, $time, $venue ) = $event;\n\n\t\t\t\t\t// Format date\n\t\t\t\t\t$date       = str_replace( '/', '-', trim( $date ) );\n\t\t\t\t\t$date_array = explode( '-', $date );\n\t\t\t\t\tswitch ( $date_format ) :\n\t\t\t\t\t\tcase 'dd/mm/yyyy':\n\t\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mm/dd/yyyy':\n\t\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 0, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 2, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\t\tendswitch;\n\n\t\t\t\t\t// Add time to date if given\n\t\t\t\t\tif ( ! empty( $time ) ) :\n\t\t\t\t\t\t$date .= ' ' . trim( $time );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Define post type args\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'   => 'sp_event',\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_date'   => $date,\n\t\t\t\t\t\t'post_title'  => esc_attr__( 'Event', 'sportspress' ),\n\t\t\t\t\t);\n\n\t\t\t\t\t// Insert event\n\t\t\t\t\t$id = wp_insert_post( $args );\n\n\t\t\t\t\t// Initialize performance array\n\t\t\t\t\t$players = array();\n\n\t\t\t\t\t// Flag as import\n\t\t\t\t\tupdate_post_meta( $id, '_sp_import', 1 );\n\n\t\t\t\t\t// Update event format\n\t\t\t\t\tif ( $event_format ) :\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_format', $event_format );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update league\n\t\t\t\t\tif ( $league ) :\n\t\t\t\t\t\twp_set_object_terms( $id, $league, 'sp_league', false );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update season\n\t\t\t\t\tif ( $season ) :\n\t\t\t\t\t\twp_set_object_terms( $id, $season, 'sp_season', false );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update venue\n\t\t\t\t\twp_set_object_terms( $id, $venue, 'sp_venue', false );\n\n\t\t\t\t\t// Increment\n\t\t\t\t\t$this->imported ++;\n\n\t\t\t\tendif;\n\n\t\t\t\t// Add new team if team name is given\n\t\t\t\tif ( sizeof( $team ) > 0 && ! empty( $team[0] ) ) :\n\n\t\t\t\t\t// List team columns\n\t\t\t\t\tlist( $team_name, $result, $outcome ) = $team;\n\n\t\t\t\t\t// Find out if team exists\n\t\t\t\t\t$team_object = sp_get_post_by_title( stripslashes( $team_name ), 'sp_team' );\n\n\t\t\t\t\t// Get or insert team\n\t\t\t\t\tif ( $team_object ) :\n\n\t\t\t\t\t\t// Make sure team is published\n\t\t\t\t\t\tif ( $team_object->post_status != 'publish' ) :\n\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'ID'          => $team_object->ID,\n\t\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t// Get team ID\n\t\t\t\t\t\t$team_id = $team_object->ID;\n\n\t\t\t\t\telse :\n\n\t\t\t\t\t\t// Insert team\n\t\t\t\t\t\t$team_id = wp_insert_post(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $team_name ),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Flag as import\n\t\t\t\t\t\tupdate_post_meta( $team_id, '_sp_import', 1 );\n\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update league\n\t\t\t\t\tif ( $league ) :\n\t\t\t\t\t\twp_set_object_terms( $team_id, $league, 'sp_league', true );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update season\n\t\t\t\t\tif ( $season ) :\n\t\t\t\t\t\twp_set_object_terms( $team_id, $season, 'sp_season', true );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Add to event if exists\n\t\t\t\t\tif ( isset( $id ) ) :\n\n\t\t\t\t\t\t// Add team to event\n\t\t\t\t\t\tadd_post_meta( $id, 'sp_team', $team_id );\n\n\t\t\t\t\t\t// Add empty player to event\n\t\t\t\t\t\tadd_post_meta( $id, 'sp_player', 0 );\n\n\t\t\t\t\t\t// Explode results into array\n\t\t\t\t\t\t$results = explode( '|', $result );\n\n\t\t\t\t\t\t// Create team results array from result keys\n\t\t\t\t\t\t$team_results = array();\n\t\t\t\t\t\tif ( sizeof( $result_labels ) > 0 ) :\n\t\t\t\t\t\t\tforeach ( $result_labels as $key => $label ) :\n\t\t\t\t\t\t\t\t$team_results[ $key ] = trim( array_shift( $results ) );\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t$team_results['outcome'] = array();\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t// Explode outcomes into array\n\t\t\t\t\t\t$outcomes = explode( '|', $outcome );\n\n\t\t\t\t\t\t// Add outcome slugs to team outcomes array\n\t\t\t\t\t\tforeach ( $outcomes as $outcome ) :\n\n\t\t\t\t\t\t\t// Continue if outcome doesn't exist\n\t\t\t\t\t\t\tif ( $outcome == null ) :\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t// Remove whitespace\n\t\t\t\t\t\t\t$outcome = trim( $outcome );\n\n\t\t\t\t\t\t\t// Get or insert outcome\n\t\t\t\t\t\t\t$outcome_object = sp_get_post_by_title( stripslashes( $outcome ), 'sp_outcome' );\n\n\t\t\t\t\t\t\tif ( $outcome_object ) :\n\n\t\t\t\t\t\t\t\t// Make sure outcome is published\n\t\t\t\t\t\t\t\tif ( $outcome_object->post_status != 'publish' ) :\n\t\t\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'ID'          => $outcome_object->ID,\n\t\t\t\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t// Get outcome slug\n\t\t\t\t\t\t\t\t$outcome_slug = $outcome_object->post_name;\n\n\t\t\t\t\t\t\telse :\n\n\t\t\t\t\t\t\t\t// Insert outcome\n\t\t\t\t\t\t\t\t$outcome_id = wp_insert_post(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'post_type'   => 'sp_outcome',\n\t\t\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $outcome ),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t// Get outcome slug\n\t\t\t\t\t\t\t\t$post_data    = get_post( $outcome_id, ARRAY_A );\n\t\t\t\t\t\t\t\t$outcome_slug = $post_data['post_name'];\n\n\t\t\t\t\t\t\t\t// Flag as import\n\t\t\t\t\t\t\t\tupdate_post_meta( $outcome_id, '_sp_import', 1 );\n\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t// Add to team results array\n\t\t\t\t\t\t\t$team_results['outcome'][] = $outcome_slug;\n\n\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t// Get existing results\n\t\t\t\t\t\t$event_results = get_post_meta( $id, 'sp_results', true );\n\n\t\t\t\t\t\t// Create new array if results not exists\n\t\t\t\t\t\tif ( ! $event_results ) :\n\t\t\t\t\t\t\t$event_results = array();\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t// Add team results to existing results\n\t\t\t\t\t\t$event_results[ $team_id ] = $team_results;\n\n\t\t\t\t\t\t// Update event results\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_results', $event_results );\n\n\t\t\t\t\t\t// Get event name\n\t\t\t\t\t\t$title = get_the_title( $id );\n\n\t\t\t\t\t\t// Initialize event name\n\t\t\t\t\t\tif ( esc_attr__( 'Event', 'sportspress' ) === $title ) {\n\t\t\t\t\t\t\t$title = '';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$title .= ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Append team name to event name\n\t\t\t\t\t\t$title .= $team_name;\n\n\t\t\t\t\t\t// Update event with new name\n\t\t\t\t\t\t$post = array(\n\t\t\t\t\t\t\t'ID'         => $id,\n\t\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t\t'post_name'  => $id,\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_post( $post );\n\n\t\t\t\t\tendif;\n\n\t\t\t\tendif;\n\n\t\t\t\t// Add new player if player name is given\n\t\t\t\tif ( sizeof( $player ) > 0 && ! empty( $player[0] ) ) :\n\n\t\t\t\t\t// Get and unset player name leaving us with the performance\n\t\t\t\t\t$player_name = $player[0];\n\t\t\t\t\tunset( $player[0] );\n\n\t\t\t\t\t// Find out if player exists\n\t\t\t\t\t$player_object = sp_get_post_by_title( stripslashes( $player_name ), 'sp_player' );\n\n\t\t\t\t\t// Get or insert player\n\t\t\t\t\tif ( $player_object ) :\n\n\t\t\t\t\t\t// Make sure player is published\n\t\t\t\t\t\tif ( $player_object->post_status != 'publish' ) :\n\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'ID'          => $player_object->ID,\n\t\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t// Get player ID\n\t\t\t\t\t\t$player_id = $player_object->ID;\n\n\t\t\t\t\t\t// Get player number\n\t\t\t\t\t\t$player_number = get_post_meta( $player_id, 'sp_number', true );\n\n\t\t\t\t\telse :\n\n\t\t\t\t\t\t// Insert player\n\t\t\t\t\t\t$player_id = wp_insert_post(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'   => 'sp_player',\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $player_name ),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Flag as import\n\t\t\t\t\t\tupdate_post_meta( $player_id, '_sp_import', 1 );\n\n\t\t\t\t\t\t// Update number\n\t\t\t\t\t\tupdate_post_meta( $player_id, 'sp_number', null );\n\n\t\t\t\t\t\t// Get player number\n\t\t\t\t\t\t$player_number = null;\n\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update league\n\t\t\t\t\tif ( $league ) :\n\t\t\t\t\t\twp_set_object_terms( $player_id, $league, 'sp_league', true );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update season\n\t\t\t\t\tif ( $season ) :\n\t\t\t\t\t\twp_set_object_terms( $player_id, $season, 'sp_season', true );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Add to event if exists\n\t\t\t\t\tif ( isset( $id ) ) :\n\n\t\t\t\t\t\t// Add player to event\n\t\t\t\t\t\tadd_post_meta( $id, 'sp_player', $player_id );\n\n\t\t\t\t\t\t// Add player performance to array if team is available\n\t\t\t\t\t\tif ( isset( $team_id ) ) :\n\n\t\t\t\t\t\t\t// Initialize performance array\n\t\t\t\t\t\t\t$performance = array( 'number' => $player_number );\n\n\t\t\t\t\t\t\t// Map keys to player performance\n\t\t\t\t\t\t\tforeach ( $performance_labels as $key => $label ) :\n\t\t\t\t\t\t\t\t$performance[ $key ] = array_shift( $player );\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t$players[ $team_id ][ $player_id ] = $performance;\n\n\t\t\t\t\t\t\t// Get player teams\n\t\t\t\t\t\t\t$player_teams = get_post_meta( $player_id, 'sp_team', false );\n\t\t\t\t\t\t\t$current_team = get_post_meta( $player_id, 'sp_current_team', true );\n\t\t\t\t\t\t\t$past_teams   = get_post_meta( $player_id, 'sp_past_team', false );\n\n\t\t\t\t\t\t\t// Add team if not exists in player\n\t\t\t\t\t\t\tif ( ! in_array( $team_id, $player_teams ) ) :\n\t\t\t\t\t\t\t\tadd_post_meta( $player_id, 'sp_team', $team_id );\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t// Add as past team or set current team if not set\n\t\t\t\t\t\t\tif ( ! $current_team ) :\n\t\t\t\t\t\t\t\tupdate_post_meta( $player_id, 'sp_current_team', $team_id );\n\t\t\t\t\t\t\telseif ( $current_team != $team_id && ! in_array( $team_id, $past_teams ) ) :\n\t\t\t\t\t\t\t\tadd_post_meta( $player_id, 'sp_past_team', $team_id );\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\tendif;\n\n\t\t\t\tendif;\n\n\t\t\tendforeach;\n\n\t\t\t// Add player performance to last event if available\n\t\t\tif ( isset( $id ) && isset( $players ) && sizeof( $players ) > 0 ) :\n\t\t\t\tupdate_post_meta( $id, 'sp_players', $players );\n\t\t\tendif;\n\n\t\t\t// Show Result\n\t\t\techo '<div class=\"updated settings-error below-h2\"><p>\n\t\t\t\t' . wp_kses_post( sprintf( __( 'Import complete - imported <strong>%1$s</strong> events and skipped <strong>%2$s</strong>.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '\n\t\t\t</p></div>';\n\n\t\t\t$this->import_end();\n\t\t}\n\n\t\t/**\n\t\t * Performs post-import cleanup of files and the cache\n\t\t */\n\t\tfunction import_end() {\n\t\t\techo '<p>' . esc_html__( 'All done!', 'sportspress' ) . ' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=sp_event' ) ) . '\">' . esc_html__( 'View Events', 'sportspress' ) . '</a>' . '</p>';\n\n\t\t\tdo_action( 'import_end' );\n\t\t}\n\n\t\t/**\n\t\t * greet function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction greet() {\n\t\t\techo '<div class=\"narrow\">';\n\t\t\techo '<p>' . esc_html__( 'Hi there! Choose a .csv file to upload, then click \"Upload file and import\".', 'sportspress' ) . '</p>';\n\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Events need to be defined with columns in a specific order (3+ columns). <a href=\"%s\">Click here to download a sample</a>.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/events-sample.csv' ) ) . '</p>';\n\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Supports CSV files generated by <a href=\"%s\">LeagueLobster</a>.', 'sportspress' ), 'http://tboy.co/leaguelobster' ) ) . '</p>';\n\t\t\twp_import_upload_form( 'admin.php?import=sp_event_csv&step=1' );\n\t\t\techo '</div>';\n\t\t}\n\n\t\t/**\n\t\t * options function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction options() {\n\t\t\t?>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label><?php esc_html_e( 'Format', 'sportspress' ); ?></label><br/></th>\n\t\t\t\t\t\t<td class=\"forminp forminp-radio\" id=\"sp_formatdiv\">\n\t\t\t\t\t\t\t<fieldset id=\"post-formats-select\">\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tforeach ( ( new SP_Formats() )->event as $name => $title ) {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<li><input type=\"radio\" name=\"sp_format\" class=\"post-format\" id=\"post-format-<?php echo esc_attr( $name ); ?>\" value=\"<?php echo esc_attr( $name ); ?>\" checked=\"checked\"> <label for=\"post-format-<?php echo esc_attr( $name ); ?>\" class=\"post-format-icon post-format-<?php echo esc_attr( $name ); ?>\"><?php echo esc_html( $title ); ?></label></li>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label><?php esc_html_e( 'League', 'sportspress' ); ?></label><br/></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'taxonomy'         => 'sp_league',\n\t\t\t\t\t\t\t'name'             => 'sp_league',\n\t\t\t\t\t\t\t'values'           => 'slug',\n\t\t\t\t\t\t\t'show_option_none' => esc_attr__( '&mdash; Not set &mdash;', 'sportspress' ),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( ! sp_dropdown_taxonomies( $args ) ) :\n\t\t\t\t\t\t\techo '<p>' . esc_html__( 'None', 'sportspress' ) . '</p>';\n\t\t\t\t\t\t\tsp_taxonomy_adder( 'sp_league', 'sp_team', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label><?php esc_html_e( 'Season', 'sportspress' ); ?></label><br/></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'taxonomy'         => 'sp_season',\n\t\t\t\t\t\t\t'name'             => 'sp_season',\n\t\t\t\t\t\t\t'values'           => 'slug',\n\t\t\t\t\t\t\t'show_option_none' => esc_attr__( '&mdash; Not set &mdash;', 'sportspress' ),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( ! sp_dropdown_taxonomies( $args ) ) :\n\t\t\t\t\t\t\techo '<p>' . esc_html__( 'None', 'sportspress' ) . '</p>';\n\t\t\t\t\t\t\tsp_taxonomy_adder( 'sp_season', 'sp_team', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<?php esc_html_e( 'Date Format', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-radio\">\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"yyyy/mm/dd\" type=\"radio\" checked> yyyy/mm/dd</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"dd/mm/yyyy\" type=\"radio\"> dd/mm/yyyy</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"mm/dd/yyyy\" type=\"radio\"> mm/dd/yyyy</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<?php\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/importers/class-sp-event-performance-importer.php",
    "content": "<?php\n/**\n * Event Performance importer - import box scores into SportsPress.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Importers\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( class_exists( 'WP_Importer' ) ) {\n\tclass SP_Event_Performance_Importer extends SP_Importer {\n\n\t\t/**\n\t\t * __construct function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->import_page  = 'sp_event_performance_csv';\n\t\t\t$this->import_label = esc_attr__( 'Import Box Score', 'sportspress' );\n\t\t\t$this->columns      = array(\n\t\t\t\t'sp_player' => esc_attr__( 'Player', 'sportspress' ),\n\t\t\t);\n\t\t\t$performance_labels = sp_get_var_labels( 'sp_performance' );\n\t\t\tif ( $performance_labels && is_array( $performance_labels ) && sizeof( $performance_labels ) ) {\n\t\t\t\t$this->columns = array_merge( $this->columns, $performance_labels );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * import function.\n\t\t *\n\t\t * @access public\n\t\t * @param array $array\n\t\t * @param array $columns\n\t\t * @return void\n\t\t */\n\t\tfunction import( $array = array(), $columns = array( 'sp_player' ) ) {\n\t\t\t$this->imported = $this->skipped = 0;\n\n\t\t\tif ( ! is_array( $array ) || ! sizeof( $array ) ) :\n\t\t\t\t$this->footer();\n\t\t\t\tdie();\n\t\t\tendif;\n\n\t\t\t$rows = array_chunk( $array, sizeof( $columns ) );\n\n\t\t\t// Get event ID and team ID from post vars\n\t\t\t$event = ( empty( $_POST['sp_event'] ) ? false : sanitize_text_field( wp_unslash( $_POST['sp_event'] ) ) );\n\t\t\t$teams = ( empty( $_POST['sp_teams'] ) ? false : sanitize_text_field( wp_unslash( $_POST['sp_teams'] ) ) );\n\t\t\t$index = ( empty( $_POST['sp_index'] ) ? false : sanitize_text_field( wp_unslash( $_POST['sp_index'] ) ) );\n\t\t\t$team  = ( empty( $_POST['sp_team'] ) ? false : sanitize_text_field( wp_unslash( $_POST['sp_team'] ) ) );\n\n\t\t\t$team_players     = array( 0 );\n\t\t\t$team_performance = array();\n\t\t\t$name_index       = (int) array_search( 'sp_player', $columns );\n\n\t\t\tforeach ( $rows as $row ) :\n\n\t\t\t\t$row = array_filter( $row );\n\n\t\t\t\tif ( empty( $row ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$player_name = sp_array_value( $row, $name_index );\n\n\t\t\t\tif ( ! $player_name ) :\n\t\t\t\t\t$this->skipped ++;\n\t\t\t\t\tcontinue;\n\t\t\t\tendif;\n\n\t\t\t\t$player_object = sp_get_post_by_title( stripslashes( $player_name ), 'sp_player' );\n\n\t\t\t\tif ( $player_object ) :\n\n\t\t\t\t\t// Get player ID\n\t\t\t\t\t$player_id = $player_object->ID;\n\n\t\t\t\telse :\n\n\t\t\t\t\t// Insert player\n\t\t\t\t\t$player_id = wp_insert_post(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'post_type'   => 'sp_player',\n\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $player_name ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t// Flag as import\n\t\t\t\t\tupdate_post_meta( $player_id, '_sp_import', 1 );\n\n\t\t\t\tendif;\n\n\t\t\t\t$team_players[] = $player_id;\n\t\t\t\t$player         = array();\n\n\t\t\t\tforeach ( $columns as $i => $key ) :\n\t\t\t\t\tif ( 'sp_player' === $key ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Get performance object.\n\t\t\t\t\t$perf_column = get_page_by_path( $key, OBJECT, 'sp_performance' );\n\t\t\t\t\t// Check if it has time format and convert it to seconds.\n\t\t\t\t\tif ( is_object( $perf_column ) && 'time' == get_post_meta( $perf_column->ID, 'sp_format', true ) ) {\n\t\t\t\t\t\t$player[ $key ] = sp_value_time( sp_array_value( $row, $i, '0' ) );\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$player[ $key ] = sp_array_value( $row, $i, '' );\n\t\t\t\t\t}\n\t\t\t\tendforeach;\n\n\t\t\t\t$team_performance[ $player_id ] = $player;\n\n\t\t\tendforeach;\n\n\t\t\tif ( $event && $team ) :\n\t\t\t\t$the_players = get_post_meta( $event, 'sp_player', false );\n\t\t\t\t$players     = array();\n\t\t\t\tfor ( $i = 0; $i < $teams; $i++ ) :\n\t\t\t\t\tif ( $index == $i ) :\n\t\t\t\t\t\tarray_push( $players, $team_players );\n\t\t\t\t\telse :\n\t\t\t\t\t\tarray_push( $players, sp_array_between( $the_players, 0, $i ) );\n\t\t\t\t\tendif;\n\t\t\t\tendfor;\n\t\t\t\tsp_update_post_meta_recursive( $event, 'sp_player', $players );\n\n\t\t\t\t$this->imported = sizeof( $team_players ) - 1;\n\n\t\t\t\t$performance          = (array) get_post_meta( $event, 'sp_players', true );\n\t\t\t\t$performance          = array_filter( $performance );\n\t\t\t\t$performance[ $team ] = $team_performance;\n\t\t\t\tupdate_post_meta( $event, 'sp_players', $performance );\n\t\t\tendif;\n\n\t\t\t// Show Result\n\t\t\techo '<div class=\"updated settings-error below-h2\"><p>\n\t\t\t\t' . wp_kses_post( sprintf( __( 'Import complete - imported <strong>%1$s</strong> rows and skipped <strong>%2$s</strong>.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '\n\t\t\t</p></div>';\n\n\t\t\t$this->import_end( $event );\n\t\t}\n\n\t\t/**\n\t\t * Performs post-import cleanup of files and the cache\n\t\t */\n\t\tfunction import_end( $event = 0 ) {\n\t\t\techo '<p>' . esc_html__( 'All done!', 'sportspress' ) . ' <a href=\"' . esc_url( admin_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post'   => $event,\n\t\t\t\t\t\t'action' => 'edit',\n\t\t\t\t\t),\n\t\t\t\t\t'post.php'\n\t\t\t\t)\n\t\t\t) ) . '\">' . esc_html__( 'View Event', 'sportspress' ) . '</a>' . '</p>';\n\n\t\t\tdo_action( 'import_end' );\n\t\t}\n\n\t\t/**\n\t\t * greet function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction greet() {\n\t\t\t$event = sp_array_value( $_REQUEST, 'event', 0 );\n\n\t\t\techo '<div class=\"narrow\">';\n\n\t\t\tif ( $event ) {\n\t\t\t\t$args = array_merge(\n\t\t\t\t\t$_REQUEST,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'import' => 'sp_event_performance_csv',\n\t\t\t\t\t\t'step'   => '1',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\techo '<p>' . esc_html__( 'Hi there! Choose a .csv file to upload, then click \"Upload file and import\".', 'sportspress' ) . '</p>';\n\t\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Box scores need to be defined with columns in a specific order. <a href=\"%s\">Click here to download a sample</a>.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/event-performance-sample.csv' ) ) . '</p>';\n\t\t\t\twp_import_upload_form( add_query_arg( $args, 'admin.php' ) );\n\t\t\t} else {\n\t\t\t\techo '<p><a href=\"' . esc_url( admin_url( add_query_arg( array( 'post_type' => 'sp_event' ), 'edit.php' ) ) ) . '\">' . sprintf( esc_html__( 'Select %s', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ) . '</a></p>';\n\t\t\t}\n\n\t\t\techo '</div>';\n\t\t}\n\n\t\t/**\n\t\t * options function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction options() {\n\t\t\t$event   = sp_array_value( $_REQUEST, 'event', 0, 'key' );\n\t\t\t$teams   = sp_array_value( $_REQUEST, 'teams', 0, 'key' );\n\t\t\t$index   = sp_array_value( $_REQUEST, 'index', 0, 'key' );\n\t\t\t$team    = sp_array_value( $_REQUEST, 'team', 0, 'key' );\n\t\t\t$include = get_post_meta( $event, 'sp_team', false );\n\t\t\t?>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label><?php esc_html_e( 'Event', 'sportspress' ); ?></label><br/></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_post_permalink( $event ) ); ?>\" target=\"_blank\">\n\t\t\t\t\t\t\t\t<?php echo esc_html( get_the_title( $event ) ); ?>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sp_event\" value=\"<?php echo esc_attr( $event ); ?>\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sp_teams\" value=\"<?php echo esc_attr( $teams ); ?>\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sp_index\" value=\"<?php echo esc_attr( $index ); ?>\">\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label><?php esc_html_e( 'Team', 'sportspress' ); ?></label><br/></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t\t'post_type' => 'sp_team',\n\t\t\t\t\t\t\t\t'name'      => 'sp_team',\n\t\t\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t\t\t\t'selected'  => $team,\n\t\t\t\t\t\t\t\t'include'   => $include,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<?php\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/importers/class-sp-fixture-importer.php",
    "content": "<?php\n/**\n * Fixture importer - import fixtures into SportsPress.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Importers\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( class_exists( 'WP_Importer' ) ) {\n\tclass SP_Fixture_Importer extends SP_Importer {\n\n\t\t/**\n\t\t * __construct function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->import_page  = 'sp_fixture_csv';\n\t\t\t$this->import_label = esc_attr__( 'Import Fixtures', 'sportspress' );\n\t\t\t$this->columns      = array(\n\t\t\t\t'post_date' => esc_attr__( 'Date', 'sportspress' ),\n\t\t\t\t'post_time' => esc_attr__( 'Time', 'sportspress' ),\n\t\t\t\t'sp_venue'  => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t'sp_home'   => esc_attr__( 'Home', 'sportspress' ),\n\t\t\t\t'sp_away'   => esc_attr__( 'Away', 'sportspress' ),\n\t\t\t\t'sp_day'    => esc_attr__( 'Match Day', 'sportspress' ),\n\t\t\t);\n\t\t\t$this->optionals    = array( 'sp_day' );\n\t\t}\n\n\t\t/**\n\t\t * import function.\n\t\t *\n\t\t * @access public\n\t\t * @param array $array\n\t\t * @param array $columns\n\t\t * @return void\n\t\t */\n\t\tfunction import( $array = array(), $columns = array( 'post_title' ) ) {\n\t\t\t$this->imported = $this->skipped = 0;\n\n\t\t\tif ( ! is_array( $array ) || ! sizeof( $array ) ) :\n\t\t\t\t$this->footer();\n\t\t\t\tdie();\n\t\t\tendif;\n\n\t\t\t$rows = array_chunk( $array, sizeof( $columns ) );\n\n\t\t\t// Get event format, league, and season from post vars\n\t\t\t$event_format = ( empty( $_POST['sp_format'] ) ? false : sanitize_key( $_POST['sp_format'] ) );\n\t\t\t$league       = ( sp_array_value( $_POST, 'sp_league', '-1' ) == '-1' ? false : $_POST['sp_league'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t$season       = ( sp_array_value( $_POST, 'sp_season', '-1' ) == '-1' ? false : $_POST['sp_season'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t$date_format  = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : sanitize_text_field( wp_unslash( $_POST['sp_date_format'] ) ) );\n\n\t\t\tforeach ( $rows as $row ) :\n\n\t\t\t\t$row = array_filter( $row );\n\n\t\t\t\tif ( empty( $row ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$meta = array();\n\n\t\t\t\tforeach ( $columns as $index => $key ) :\n\t\t\t\t\t$meta[ $key ] = sp_array_value( $row, $index );\n\t\t\t\tendforeach;\n\n\t\t\t\t// Get event details\n\t\t\t\t$event = array(\n\t\t\t\t\tsp_array_value( $meta, 'post_date' ),\n\t\t\t\t\tsp_array_value( $meta, 'post_time' ),\n\t\t\t\t\tsp_array_value( $meta, 'sp_venue' ),\n\t\t\t\t\tsp_array_value( $meta, 'sp_day' ),\n\t\t\t\t);\n\n\t\t\t\t$teams = array(\n\t\t\t\t\tsp_array_value( $meta, 'sp_home' ),\n\t\t\t\t\tsp_array_value( $meta, 'sp_away' ),\n\t\t\t\t);\n\n\t\t\t\t// Add new event if date is given\n\t\t\t\tif ( sizeof( $event ) > 0 && ! empty( $event[0] ) ) :\n\n\t\t\t\t\t// List event columns\n\t\t\t\t\tlist( $date, $time, $venue, $day ) = $event;\n\n\t\t\t\t\t// Format date\n\t\t\t\t\t$date       = str_replace( '/', '-', trim( $date ) );\n\t\t\t\t\t$date_array = explode( '-', $date );\n\t\t\t\t\tswitch ( $date_format ) :\n\t\t\t\t\t\tcase 'dd/mm/yyyy':\n\t\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mm/dd/yyyy':\n\t\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 0, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 2, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\t\tendswitch;\n\n\t\t\t\t\t// Add time to date if given\n\t\t\t\t\tif ( ! empty( $time ) ) :\n\t\t\t\t\t\t$date .= ' ' . trim( $time );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Define post type args\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'   => 'sp_event',\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_date'   => $date,\n\t\t\t\t\t\t'post_title'  => esc_attr__( 'Event', 'sportspress' ),\n\t\t\t\t\t);\n\n\t\t\t\t\t// Insert event\n\t\t\t\t\t$id = wp_insert_post( $args );\n\n\t\t\t\t\t// Flag as import\n\t\t\t\t\tupdate_post_meta( $id, '_sp_import', 1 );\n\n\t\t\t\t\t// Update event format\n\t\t\t\t\tif ( $event_format ) :\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_format', $event_format );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update league\n\t\t\t\t\tif ( $league ) :\n\t\t\t\t\t\twp_set_object_terms( $id, $league, 'sp_league', false );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update season\n\t\t\t\t\tif ( $season ) :\n\t\t\t\t\t\twp_set_object_terms( $id, $season, 'sp_season', false );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Update venue\n\t\t\t\t\tif ( $venue == '' ) {\n\t\t\t\t\t\t$team        = reset( $teams );\n\t\t\t\t\t\t$team_object = sp_get_post_by_title( stripslashes( $team ), 'sp_team' );\n\t\t\t\t\t\t$venue       = sp_get_the_term_id( $team_object->ID, 'sp_venue' );\n\t\t\t\t\t}\n\t\t\t\t\twp_set_object_terms( $id, $venue, 'sp_venue', false );\n\n\t\t\t\t\t// Update match day\n\t\t\t\t\tif ( '' !== $day ) {\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_day', $day );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Increment\n\t\t\t\t\t$this->imported ++;\n\n\t\t\t\tendif;\n\n\t\t\t\t// Add teams to event\n\t\t\t\tif ( sizeof( $teams ) > 0 ) :\n\n\t\t\t\t\tforeach ( $teams as $team_name ) :\n\n\t\t\t\t\t\tif ( '' !== $team_name ) :\n\n\t\t\t\t\t\t\t// Find out if team exists\n\t\t\t\t\t\t\t$team_object = sp_get_post_by_title( stripslashes( $team_name ), 'sp_team' );\n\n\t\t\t\t\t\t\t// Get or insert team\n\t\t\t\t\t\t\tif ( $team_object ) :\n\n\t\t\t\t\t\t\t\t// Make sure team is published\n\t\t\t\t\t\t\t\tif ( $team_object->post_status != 'publish' ) :\n\t\t\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'ID'          => $team_object->ID,\n\t\t\t\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t// Get team ID\n\t\t\t\t\t\t\t\t$team_id = $team_object->ID;\n\n\t\t\t\t\t\t\telse :\n\n\t\t\t\t\t\t\t\t// Insert team\n\t\t\t\t\t\t\t\t$team_id = wp_insert_post(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $team_name ),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t// Flag as import\n\t\t\t\t\t\t\t\tupdate_post_meta( $team_id, '_sp_import', 1 );\n\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t// Update league\n\t\t\t\t\t\t\tif ( $league ) :\n\t\t\t\t\t\t\t\twp_set_object_terms( $team_id, $league, 'sp_league', true );\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t// Update season\n\t\t\t\t\t\t\tif ( $season ) :\n\t\t\t\t\t\t\t\twp_set_object_terms( $team_id, $season, 'sp_season', true );\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t// Add to event if exists\n\t\t\t\t\t\t\tif ( isset( $id ) ) :\n\n\t\t\t\t\t\t\t\t// Add team to event\n\t\t\t\t\t\t\t\tadd_post_meta( $id, 'sp_team', $team_id );\n\n\t\t\t\t\t\t\t\t// Get event name\n\t\t\t\t\t\t\t\t$title = get_the_title( $id );\n\n\t\t\t\t\t\t\t\t// Initialize event name\n\t\t\t\t\t\t\t\tif ( esc_attr__( 'Event', 'sportspress' ) === $title ) {\n\t\t\t\t\t\t\t\t\t$title = '';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$title .= ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Append team name to event name\n\t\t\t\t\t\t\t\t$title .= $team_name;\n\n\t\t\t\t\t\t\t\t// Update event with new name\n\t\t\t\t\t\t\t\t$post = array(\n\t\t\t\t\t\t\t\t\t'ID'         => $id,\n\t\t\t\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t\t\t\t'post_name'  => $id,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\twp_update_post( $post );\n\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\telse :\n\n\t\t\t\t\t\t\t// Add empty team to event\n\t\t\t\t\t\t\tadd_post_meta( $id, 'sp_team', -1 );\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\tendforeach;\n\n\t\t\t\tendif;\n\n\t\t\tendforeach;\n\n\t\t\t// Show Result\n\t\t\techo '<div class=\"updated settings-error below-h2\"><p>\n\t\t\t\t' . wp_kses_post( sprintf( __( 'Import complete - imported <strong>%1$s</strong> events and skipped <strong>%2$s</strong>.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '\n\t\t\t</p></div>';\n\n\t\t\t$this->import_end();\n\t\t}\n\n\t\t/**\n\t\t * Performs post-import cleanup of files and the cache\n\t\t */\n\t\tfunction import_end() {\n\t\t\techo '<p>' . esc_html__( 'All done!', 'sportspress' ) . ' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=sp_event' ) ) . '\">' . esc_html__( 'View Fixtures', 'sportspress' ) . '</a>' . '</p>';\n\n\t\t\tdo_action( 'import_end' );\n\t\t}\n\n\t\t/**\n\t\t * greet function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction greet() {\n\t\t\techo '<div class=\"narrow\">';\n\t\t\techo '<p>' . esc_html__( 'Hi there! Choose a .csv file to upload, then click \"Upload file and import\".', 'sportspress' ) . '</p>';\n\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Fixtures need to be defined with columns in a specific order (4+ columns). <a href=\"%s\">Click here to download a sample</a>.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/fixtures-sample.csv' ) ) . '</p>';\n\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Supports CSV files generated by <a href=\"%s\">LeagueLobster</a>.', 'sportspress' ), 'http://tboy.co/leaguelobster' ) ) . '</p>';\n\t\t\twp_import_upload_form( 'admin.php?import=sp_fixture_csv&step=1' );\n\t\t\techo '</div>';\n\t\t}\n\n\t\t/**\n\t\t * options function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction options() {\n\t\t\t?>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label><?php esc_html_e( 'Format', 'sportspress' ); ?></label><br/></th>\n\t\t\t\t\t\t<td class=\"forminp forminp-radio\" id=\"sp_formatdiv\">\n\t\t\t\t\t\t\t<fieldset id=\"post-formats-select\">\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li><input type=\"radio\" name=\"sp_format\" class=\"post-format\" id=\"post-format-league\" value=\"league\" checked=\"checked\"> <label for=\"post-format-league\" class=\"post-format-icon post-format-league\"><?php esc_html_e( 'Competitive', 'sportspress' ); ?></label></li>\n\t\t\t\t\t\t\t\t\t<li><input type=\"radio\" name=\"sp_format\" class=\"post-format\" id=\"post-format-friendly\" value=\"friendly\"> <label for=\"post-format-friendly\" class=\"post-format-icon post-format-friendly\"><?php esc_html_e( 'Friendly', 'sportspress' ); ?></label></li>\n\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label><?php esc_html_e( 'League', 'sportspress' ); ?></label><br/></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'taxonomy'         => 'sp_league',\n\t\t\t\t\t\t\t'name'             => 'sp_league',\n\t\t\t\t\t\t\t'values'           => 'slug',\n\t\t\t\t\t\t\t'show_option_none' => esc_attr__( '&mdash; Not set &mdash;', 'sportspress' ),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( ! sp_dropdown_taxonomies( $args ) ) :\n\t\t\t\t\t\t\techo '<p>' . esc_html__( 'None', 'sportspress' ) . '</p>';\n\t\t\t\t\t\t\tsp_taxonomy_adder( 'sp_league', 'sp_team', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\"><label><?php esc_html_e( 'Season', 'sportspress' ); ?></label><br/></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'taxonomy'         => 'sp_season',\n\t\t\t\t\t\t\t'name'             => 'sp_season',\n\t\t\t\t\t\t\t'values'           => 'slug',\n\t\t\t\t\t\t\t'show_option_none' => esc_attr__( '&mdash; Not set &mdash;', 'sportspress' ),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( ! sp_dropdown_taxonomies( $args ) ) :\n\t\t\t\t\t\t\techo '<p>' . esc_html__( 'None', 'sportspress' ) . '</p>';\n\t\t\t\t\t\t\tsp_taxonomy_adder( 'sp_season', 'sp_team', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<?php esc_html_e( 'Date Format', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-radio\">\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"yyyy/mm/dd\" type=\"radio\" checked> yyyy/mm/dd</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"dd/mm/yyyy\" type=\"radio\"> dd/mm/yyyy</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"mm/dd/yyyy\" type=\"radio\"> mm/dd/yyyy</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<?php\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/importers/class-sp-importer.php",
    "content": "<?php\n/**\n * SportsPress Importer\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Importers\n * @version     2.7.28\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( class_exists( 'WP_Importer' ) ) {\n\tclass SP_Importer extends WP_Importer {\n\n\t\tvar $id;\n\t\tvar $file_url;\n\t\tvar $import_page;\n\t\tvar $delimiter;\n\t\tvar $posts = array();\n\t\tvar $imported;\n\t\tvar $skipped;\n\t\tvar $import_label;\n\t\tvar $columns   = array();\n\t\tvar $optionals = array();\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );\n\t\t}\n\n\t\t/**\n\t\t * Enqueue scripts\n\t\t */\n\t\tpublic function admin_scripts() {\n\t\t\twp_enqueue_script( 'sportspress-admin', SP()->plugin_url() . '/assets/js/admin/sportspress-admin.js', array( 'jquery', 'chosen', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-tiptip', 'jquery-caret' ), SP_VERSION, true );\n\t\t}\n\n\t\t/**\n\t\t * Registered callback function for the WordPress Importer\n\t\t *\n\t\t * Manages the three separate stages of the CSV import process\n\t\t */\n\t\tfunction dispatch() {\n\t\t\t$this->header();\n\n\t\t\tif ( ! empty( $_POST['delimiter'] ) ) {\n\t\t\t\t$this->delimiter = stripslashes( trim( sanitize_text_field( wp_unslash( $_POST['delimiter'] ) ) ) );\n\t\t\t}\n\n\t\t\tif ( ! $this->delimiter ) {\n\t\t\t\t$this->delimiter = ',';\n\t\t\t}\n\n\t\t\t$step = empty( $_GET['step'] ) ? 0 : (int) $_GET['step'];\n\t\t\tswitch ( $step ) :\n\t\t\t\tcase 0:\n\t\t\t\t\t$this->greet();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tcheck_admin_referer( 'import-upload' );\n\t\t\t\t\tif ( $this->handle_upload() ) :\n\n\t\t\t\t\t\tif ( $this->id ) {\n\t\t\t\t\t\t\t$file = get_attached_file( $this->id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$file = ABSPATH . $this->file_url;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tadd_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );\n\n\t\t\t\t\t\tif ( function_exists( 'gc_enable' ) ) {\n\t\t\t\t\t\t\tgc_enable();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t@set_time_limit( 0 );\n\t\t\t\t\t\t@ob_flush();\n\t\t\t\t\t\t@flush();\n\n\t\t\t\t\t\t$this->table( $file );\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tcheck_admin_referer( 'import-upload' );\n\t\t\t\t\tif ( isset( $_POST['sp_import'] ) ) :\n\t\t\t\t\t\t$columns = array_filter( array_map( 'sanitize_key', array_map( 'wp_unslash', sp_array_value( $_POST, 'sp_columns', array( 'post_title' ) ) ) ) );\n\t\t\t\t\t\t$this->import( $_POST['sp_import'], array_values( $columns ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t\t$this->footer();\n\t\t}\n\n\t\t/**\n\t\t * dropdown function.\n\t\t *\n\t\t * @access public\n\t\t * @param mixed $file\n\t\t * @return void\n\t\t */\n\t\tfunction dropdown( $selected ) {\n\t\t\t?>\n\t\t\t<select name=\"sp_columns[]\" data-index=\"<?php echo esc_attr( array_search( $selected, array_keys( $this->columns ) ) ); ?>\">\n\t\t\t\t<option value=\"0\">&mdash; <?php esc_html_e( 'Disable', 'sportspress' ); ?> &mdash;</option>\n\t\t\t\t<?php foreach ( $this->columns as $key => $label ) : ?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\" <?php selected( $selected, $key ); ?>><?php echo esc_html( $label ); ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * table function.\n\t\t *\n\t\t * @access public\n\t\t * @param mixed $file\n\t\t * @return void\n\t\t */\n\t\tfunction table( $file ) {\n\t\t\tglobal $wpdb;\n\n\t\t\t$this->imported = $this->skipped = 0;\n\n\t\tif ( ! is_file( $file ) ) :\n\t\t\t$this->footer();\n\t\t\tdie();\n\t\tendif;\n\n\t\t// Only set auto_detect_line_endings on PHP versions that support it (< 8.1).\n\t\tif ( version_compare( PHP_VERSION, '8.1', '<' ) ) {\n\t\t\tini_set( 'auto_detect_line_endings', '1' );\n\t\t}\n\n\t\tif ( ( $handle = fopen( $file, 'r' ) ) !== false ) :\n\n\t\t\t\t$header = fgetcsv( $handle, 0, $this->delimiter );\n\n\t\t\t\tif ( sizeof( $header ) >= 1 ) :\n\t\t\t\t\t$action = 'admin.php?import=' . $this->import_page . '&step=2';\n\t\t\t\t\t?>\n\t\t\t\t\t<form enctype=\"multipart/form-data\" id=\"import-upload-form\" class=\"sportspress\" method=\"post\" action=\"<?php echo esc_attr( wp_nonce_url( $action, 'import-upload' ) ); ?>\">\n\t\t\t\t\t\t<?php $this->options(); ?>\n\t\t\t\t\t\t<table class=\"wp-list-table sp-data-table sp-import-table widefat fixed pages\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<?php foreach ( $this->columns as $key => $label ) : ?>\n\t\t\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"manage-column\">\n\t\t\t\t\t\t\t\t\t\t\t<?php $this->dropdown( $key ); ?>\n\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"sp-actions-column\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\" title=\"<?php esc_attr_e( 'Insert row after', 'sportspress' ); ?>\" class=\"dashicons dashicons-plus-alt sp-add-row sp-add-first\"></a>\n\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<?php while ( ( $row = fgetcsv( $handle, 0, $this->delimiter ) ) !== false ) : ?>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t$index = 0;\n\t\t\t\t\t\t\t\t\t\tforeach ( $this->columns as $key => $label ) :\n\t\t\t\t\t\t\t\t\t\t\t$value = sp_array_value( $row, $index );\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"widefat\" value=\"<?php echo esc_attr( $value ); ?>\" name=\"sp_import[]\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( in_array( $key, $this->optionals ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t placeholder=\"<?php esc_attr_e( 'Default', 'sportspress' ); ?>\"<?php } ?>>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t$index ++;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<td class=\"sp-actions-column\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" title=\"<?php esc_attr_e( 'Delete row', 'sportspress' ); ?>\" class=\"dashicons dashicons-dismiss sp-delete-row\"></a>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" title=\"<?php esc_attr_e( 'Insert row after', 'sportspress' ); ?>\" class=\"dashicons dashicons-plus-alt sp-add-row\"></a>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$this->imported++;\nendwhile;\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<?php foreach ( $this->columns as $key => $label ) : ?>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"widefat\" name=\"sp_import[]\">\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t<td class=\"sp-actions-column\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\" title=\"<?php esc_attr_e( 'Insert row after', 'sportspress' ); ?>\" class=\"dashicons dashicons-plus-alt sp-add-row\"></a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<p class=\"sp-post-count alignright\">\n\t\t\t\t\t\t\t<?php printf( esc_html__( 'Displaying %1$s&#8211;%2$s of %3$s', 'sportspress' ), 1, esc_html( $this->imported + 1 ), esc_html( $this->imported + 1 ) ); ?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p class=\"submit\">\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button button-primary button-hero\" value=\"<?php echo esc_attr( $this->import_label ); ?>\" />\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</form>\n\t\t\t\t\t<?php\n\t\t\t\telse :\n\n\t\t\t\t\techo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'sportspress' ) . '</strong><br />';\n\t\t\t\t\tesc_html_e( 'The CSV is invalid.', 'sportspress' ) . '</p>';\n\t\t\t\t\t$this->footer();\n\t\t\t\t\tdie();\n\n\t\t\t\tendif;\n\n\t\t\t\tfclose( $handle );\n\t\t\tendif;\n\t\t}\n\n\t\t/**\n\t\t * format_data_from_csv function.\n\t\t *\n\t\t * @access public\n\t\t * @param mixed  $data\n\t\t * @param string $enc\n\t\t * @return string\n\t\t */\n\t\tfunction format_data_from_csv( $data, $enc ) {\n\t\t\treturn ( $enc == 'UTF-8' ) ? $data : utf8_encode( $data );\n\t\t}\n\n\t\t/**\n\t\t * Handles the CSV upload and initial parsing of the file to prepare for\n\t\t * displaying author import options\n\t\t *\n\t\t * @return bool False if error uploading or invalid file, true otherwise\n\t\t */\n\t\tfunction handle_upload() {\n\n\t\t\tif ( empty( $_POST['file_url'] ) ) {\n\n\t\t\t\t$file = wp_import_handle_upload();\n\n\t\t\t\tif ( isset( $file['error'] ) ) {\n\t\t\t\t\techo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'sportspress' ) . '</strong><br />';\n\t\t\t\t\techo esc_html( $file['error'] ) . '</p>';\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$this->id = (int) $file['id'];\n\n\t\t\t} else {\n\n\t\t\t\tif ( file_exists( ABSPATH . sanitize_url( wp_unslash( $_POST['file_url'] ) ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\n\t\t\t\t\t$this->file_url = sanitize_url( wp_unslash( $_POST['file_url'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\n\t\t\t\t} else {\n\n\t\t\t\t\techo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'sportspress' ) . '</strong></p>';\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * header function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction header() {\n\t\t\techo '<div class=\"wrap\"><h2>' . esc_html( $this->import_label ) . '</h2>';\n\t\t}\n\n\t\t/**\n\t\t * footer function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction footer() {\n\t\t\techo '</div>';\n\t\t}\n\n\t\t/**\n\t\t * options function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction options() {\n\t\t}\n\n\t\t/**\n\t\t * Added to http_request_timeout filter to force timeout at 60 seconds during import\n\t\t *\n\t\t * @param  int $val\n\t\t * @return int 60\n\t\t */\n\t\tfunction bump_request_timeout( $val ) {\n\t\t\treturn 60;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/importers/class-sp-official-importer.php",
    "content": "<?php\n/**\n * Official importer - import officials into SportsPress.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Importers\n * @version     2.7.13\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( class_exists( 'WP_Importer' ) ) {\n\tclass SP_Official_Importer extends SP_Importer {\n\n\t\t/**\n\t\t * __construct function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->import_page  = 'sp_official_csv';\n\t\t\t$this->import_label = esc_attr__( 'Import Officials', 'sportspress' );\n\t\t\t$this->columns      = array(\n\t\t\t\t'post_title' => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t);\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * import function.\n\t\t *\n\t\t * @access public\n\t\t * @param array $array\n\t\t * @param array $columns\n\t\t * @return void\n\t\t */\n\t\tfunction import( $array = array(), $columns = array( 'post_title' ) ) {\n\t\t\t$this->imported = $this->skipped = 0;\n\n\t\t\tif ( ! is_array( $array ) || ! sizeof( $array ) ) :\n\t\t\t\t$this->footer();\n\t\t\t\tdie();\n\t\t\tendif;\n\n\t\t\t$rows = array_chunk( $array, sizeof( $columns ) );\n\n\t\t\tforeach ( $rows as $row ) :\n\n\t\t\t\t$row = array_filter( $row );\n\n\t\t\t\tif ( empty( $row ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$meta = array();\n\n\t\t\t\tforeach ( $columns as $index => $key ) :\n\t\t\t\t\t$meta[ $key ] = sp_array_value( $row, $index );\n\t\t\t\tendforeach;\n\n\t\t\t\t$name = sp_array_value( $meta, 'post_title' );\n\n\t\t\t\tif ( ! $name ) :\n\t\t\t\t\t$this->skipped++;\n\t\t\t\t\tcontinue;\n\t\t\t\tendif;\n\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type'   => 'sp_official',\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t'post_title'  => wp_strip_all_tags( $name ),\n\t\t\t\t);\n\n\t\t\t\t$id = wp_insert_post( $args );\n\n\t\t\t\t$this->imported++;\n\n\t\t\tendforeach;\n\n\t\t\t// Show Result\n\t\t\techo '<div class=\"updated settings-error below-h2\"><p>\n\t\t\t\t' . wp_kses_post( sprintf( __( 'Import complete - imported <strong>%1$s</strong> officials and skipped <strong>%2$s</strong>.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '\n\t\t\t</p></div>';\n\n\t\t\t$this->import_end();\n\t\t}\n\n\t\t/**\n\t\t * Performs post-import cleanup of files and the cache\n\t\t */\n\t\tfunction import_end() {\n\t\t\techo '<p>' . esc_html__( 'All done!', 'sportspress' ) . ' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=sp_official' ) ) . '\">' . esc_html__( 'View Officials', 'sportspress' ) . '</a>' . '</p>';\n\n\t\t\tdo_action( 'import_end' );\n\t\t}\n\n\t\t/**\n\t\t * header function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction header() {\n\t\t\techo '<div class=\"wrap\"><h2>' . esc_html__( 'Import Officials', 'sportspress' ) . '</h2>';\n\t\t}\n\n\t\t/**\n\t\t * greet function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction greet() {\n\t\t\techo '<div class=\"narrow\">';\n\t\t\techo '<p>' . esc_html__( 'Hi there! Choose a .csv file to upload, then click \"Upload file and import\".', 'sportspress' ) . '</p>';\n\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Officials need to be defined with columns in a specific order. <a href=\"%s\">Click here to download a sample</a>.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/officials-sample.csv' ) ) . '</p>';\n\t\t\twp_import_upload_form( 'admin.php?import=sp_official_csv&step=1' );\n\t\t\techo '</div>';\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/importers/class-sp-player-importer.php",
    "content": "<?php\n/**\n * Player importer - import players into SportsPress.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Importers\n * @version   2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( class_exists( 'WP_Importer' ) ) {\n\tclass SP_Player_Importer extends SP_Importer {\n\n\t\t/**\n\t\t * __construct function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->import_page  = 'sp_player_csv';\n\t\t\t$this->import_label = esc_attr__( 'Import Players', 'sportspress' );\n\t\t\t$this->columns      = array(\n\t\t\t\t'sp_number'      => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t'post_title'     => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'sp_position'    => esc_attr__( 'Positions', 'sportspress' ),\n\t\t\t\t'sp_team'        => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t'sp_league'      => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t'sp_season'      => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t'sp_nationality' => esc_attr__( 'Nationality', 'sportspress' ),\n\t\t\t\t'post_date'      => esc_attr__( 'Date of Birth', 'sportspress' ),\n\t\t\t);\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * import function.\n\t\t *\n\t\t * @access public\n\t\t * @param array $array\n\t\t * @param array $columns\n\t\t * @return void\n\t\t */\n\t\tfunction import( $array = array(), $columns = array( 'post_title' ) ) {\n\t\t\t$this->imported = $this->skipped = 0;\n\n\t\t\tif ( ! is_array( $array ) || ! sizeof( $array ) ) :\n\t\t\t\t$this->footer();\n\t\t\t\tdie();\n\t\t\tendif;\n\n\t\t\t$rows = array_chunk( $array, sizeof( $columns ) );\n\n\t\t\t// Get Date of Birth format from post vars\n\t\t\t$date_format = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : sanitize_text_field( wp_unslash( $_POST['sp_date_format'] ) ) );\n\n\t\t\tforeach ( $rows as $row ) :\n\n\t\t\t\t$row = array_filter( $row, 'strlen' );\n\n\t\t\t\tif ( empty( $row ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$meta = array();\n\n\t\t\t\t/**\n\t\t\t\t * Prepare preservable metas keys.\n\t\t\t\t */\n\t\t\t\t$preservable_metas_keys = array(\n\t\t\t\t\t'sp_league',\n\t\t\t\t\t'sp_position',\n\t\t\t\t\t'sp_season',\n\t\t\t\t);\n\t\t\t\tforeach ( $preservable_metas_keys as $p ) {\n\t\t\t\t\t$meta[ $p ] = '';\n\t\t\t\t}\n\n\t\t\t\tforeach ( $columns as $index => $key ) :\n\t\t\t\t\t$meta[ $key ] = sp_array_value( $row, $index );\n\t\t\t\tendforeach;\n\n\t\t\t\t$name = sp_array_value( $meta, 'post_title' );\n\t\t\t\t$date = sp_array_value( $meta, 'post_date' );\n\n\t\t\t\t// Format date of birth\n\t\t\t\t$date       = str_replace( '/', '-', trim( $date ) );\n\t\t\t\t$date_array = explode( '-', $date );\n\t\t\t\tswitch ( $date_format ) :\n\t\t\t\t\tcase 'dd/mm/yyyy':\n\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'mm/dd/yyyy':\n\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$date = substr( str_pad( sp_array_value( $date_array, 0, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .\n\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .\n\t\t\t\t\t\t\tsubstr( str_pad( sp_array_value( $date_array, 2, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );\n\t\t\t\tendswitch;\n\n\t\t\t\tif ( ! $name ) :\n\t\t\t\t\t$this->skipped++;\n\t\t\t\t\tcontinue;\n\t\t\t\tendif;\n\n\t\t\t\t// Get or insert player\n\t\t\t\t$player_object = sp_array_value( $_POST, 'merge', 0 ) ? sp_get_post_by_title( stripslashes( $name ), 'sp_player' ) : false;\n\t\t\t\tif ( $player_object ) :\n\t\t\t\t\tif ( $player_object->post_status != 'publish' ) :\n\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID'          => $player_object->ID,\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tendif;\n\t\t\t\t\t$id = $player_object->ID;\n\t\t\t\t\t// Handle preservable data.\n\t\t\t\t\tforeach ( $preservable_metas_keys as $p ) {\n\t\t\t\t\t\t$terms       = wp_get_object_terms( $id, $p, array( 'fields' => 'names' ) );\n\t\t\t\t\t\t$meta[ $p ] .= '|' . implode( '|', $terms );\n\t\t\t\t\t}\n\t\t\t\telse :\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'   => 'sp_player',\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $name ),\n\t\t\t\t\t);\n\t\t\t\t\t// Check if a DoB was set\n\t\t\t\t\tif ( '0000-00-00' !== $date ) {\n\t\t\t\t\t\t$args['post_date'] = $date;\n\t\t\t\t\t}\n\t\t\t\t\t$id = wp_insert_post( $args );\n\n\t\t\t\t\t// Flag as import\n\t\t\t\t\tupdate_post_meta( $id, '_sp_import', 1 );\n\t\t\t\tendif;\n\n\t\t\t\t// Update number\n\t\t\t\tupdate_post_meta( $id, 'sp_number', sp_array_value( $meta, 'sp_number' ) );\n\n\t\t\t\t// Update positions\n\t\t\t\t$positions = explode( '|', sp_array_value( $meta, 'sp_position' ) );\n\t\t\t\twp_set_object_terms( $id, $positions, 'sp_position', false );\n\n\t\t\t\t// Update leagues\n\t\t\t\t$leagues = explode( '|', sp_array_value( $meta, 'sp_league' ) );\n\t\t\t\twp_set_object_terms( $id, $leagues, 'sp_league', false );\n\n\t\t\t\t// Update seasons\n\t\t\t\t$seasons = explode( '|', sp_array_value( $meta, 'sp_season' ) );\n\t\t\t\twp_set_object_terms( $id, $seasons, 'sp_season', false );\n\n\t\t\t\t// Update teams\n\t\t\t\t$teams = (array) explode( '|', sp_array_value( $meta, 'sp_team' ) );\n\t\t\t\t$i     = 0;\n\t\t\t\tforeach ( $teams as $team ) :\n\t\t\t\t\t// Get or insert team\n\t\t\t\t\t$team_object = sp_get_post_by_title( stripslashes( $team ), 'sp_team' );\n\t\t\t\t\tif ( $team_object ) :\n\t\t\t\t\t\tif ( $team_object->post_status != 'publish' ) :\n\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'ID'          => $team_object->ID,\n\t\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t$team_id = $team_object->ID;\n\t\t\t\t\telse :\n\t\t\t\t\t\t$team_id = wp_insert_post(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $team ),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// Flag as import\n\t\t\t\t\t\tupdate_post_meta( $team_id, '_sp_import', 1 );\n\t\t\t\t\t\twp_set_object_terms( $team_id, $leagues, 'sp_league', false );\n\t\t\t\t\t\twp_set_object_terms( $team_id, $seasons, 'sp_season', false );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Add team to player\n\t\t\t\t\tadd_post_meta( $id, 'sp_team', $team_id );\n\n\t\t\t\t\t// Update current team if first in array, otherwise use as past team\n\t\t\t\t\tif ( $i == 0 ) :\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_current_team', $team_id );\n\t\t\t\t\telse :\n\t\t\t\t\t\tadd_post_meta( $id, 'sp_past_team', $team_id );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$i++;\n\t\t\t\tendforeach;\n\n\t\t\t\t// Update nationality\n\t\t\t\t$nationality = trim( strtolower( sp_array_value( $meta, 'sp_nationality' ) ) );\n\t\t\t\tif ( $nationality == '*' ) {\n\t\t\t\t\t$nationality = '';\n\t\t\t\t}\n\t\t\t\tupdate_post_meta( $id, 'sp_nationality', $nationality );\n\n\t\t\t\t$this->imported++;\n\n\t\t\tendforeach;\n\n\t\t\t// Show Result\n\t\t\techo '<div class=\"updated settings-error below-h2\"><p>\n\t\t\t\t' . wp_kses_post( sprintf( __( 'Import complete - imported <strong>%1$s</strong> players and skipped <strong>%2$s</strong>.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '\n\t\t\t</p></div>';\n\n\t\t\t$this->import_end();\n\t\t}\n\n\t\t/**\n\t\t * Performs post-import cleanup of files and the cache\n\t\t */\n\t\tfunction import_end() {\n\t\t\techo '<p>' . esc_html__( 'All done!', 'sportspress' ) . ' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=sp_player' ) ) . '\">' . esc_html__( 'View Players', 'sportspress' ) . '</a>' . '</p>';\n\n\t\t\tdo_action( 'import_end' );\n\t\t}\n\n\t\t/**\n\t\t * header function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction header() {\n\t\t\techo '<div class=\"wrap\"><h2>' . esc_html__( 'Import Players', 'sportspress' ) . '</h2>';\n\t\t}\n\n\t\t/**\n\t\t * greet function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction greet() {\n\t\t\techo '<div class=\"narrow\">';\n\t\t\techo '<p>' . esc_html__( 'Hi there! Choose a .csv file to upload, then click \"Upload file and import\".', 'sportspress' ) . '</p>';\n\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Players need to be defined with columns in a specific order (8 columns). <a href=\"%s\">Click here to download a sample</a>.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/players-sample.csv' ) ) . '</p>';\n\t\t\twp_import_upload_form( 'admin.php?import=sp_player_csv&step=1' );\n\t\t\techo '</div>';\n\t\t}\n\n\t\t/**\n\t\t * options function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction options() {\n\t\t\t?>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t<?php esc_html_e( 'Date of Birth Format', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td class=\"forminp forminp-radio\">\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"yyyy/mm/dd\" type=\"radio\" checked> yyyy/mm/dd</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"dd/mm/yyyy\" type=\"radio\"> dd/mm/yyyy</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<label><input name=\"sp_date_format\" value=\"mm/dd/yyyy\" type=\"radio\"> mm/dd/yyyy</label>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"merge\" value=\"0\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"merge\" value=\"1\" checked=\"checked\">\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Merge duplicates', 'sportspress' ); ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<?php\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/importers/class-sp-staff-importer.php",
    "content": "<?php\n/**\n * Staff importer - import staff into SportsPress.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Importers\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( class_exists( 'WP_Importer' ) ) {\n\tclass SP_Staff_Importer extends SP_Importer {\n\n\t\t/**\n\t\t * __construct function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->import_page  = 'sp_staff_csv';\n\t\t\t$this->import_label = esc_attr__( 'Import Staff', 'sportspress' );\n\t\t\t$this->columns      = array(\n\t\t\t\t'post_title'     => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'sp_role'        => esc_attr__( 'Jobs', 'sportspress' ),\n\t\t\t\t'sp_team'        => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t'sp_league'      => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t'sp_season'      => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t'sp_nationality' => esc_attr__( 'Nationality', 'sportspress' ),\n\t\t\t);\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * import function.\n\t\t *\n\t\t * @access public\n\t\t * @param array $array\n\t\t * @param array $columns\n\t\t * @return void\n\t\t */\n\t\tfunction import( $array = array(), $columns = array( 'post_title' ) ) {\n\t\t\t$this->imported = $this->skipped = 0;\n\n\t\t\tif ( ! is_array( $array ) || ! sizeof( $array ) ) :\n\t\t\t\t$this->footer();\n\t\t\t\tdie();\n\t\t\tendif;\n\n\t\t\t$rows = array_chunk( $array, sizeof( $columns ) );\n\n\t\t\tforeach ( $rows as $row ) :\n\n\t\t\t\t$row = array_filter( $row );\n\n\t\t\t\tif ( empty( $row ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$meta = array();\n\n\t\t\t\tforeach ( $columns as $index => $key ) :\n\t\t\t\t\t$meta[ $key ] = sp_array_value( $row, $index );\n\t\t\t\tendforeach;\n\n\t\t\t\t$name = sp_array_value( $meta, 'post_title' );\n\n\t\t\t\tif ( ! $name ) :\n\t\t\t\t\t$this->skipped++;\n\t\t\t\t\tcontinue;\n\t\t\t\tendif;\n\n\t\t\t\t// Get or insert staff\n\t\t\t\t$staff_object = sp_array_value( $_POST, 'merge', 0 ) ? sp_get_post_by_title( stripslashes( $name ), 'sp_staff' ) : false;\n\t\t\t\tif ( $staff_object ) :\n\t\t\t\t\tif ( $staff_object->post_status != 'publish' ) :\n\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID'          => $staff_object->ID,\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tendif;\n\t\t\t\t\t$id = $staff_object->ID;\n\t\t\t\telse :\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'   => 'sp_staff',\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $name ),\n\t\t\t\t\t);\n\t\t\t\t\t$id   = wp_insert_post( $args );\n\n\t\t\t\t\t// Flag as import\n\t\t\t\t\tupdate_post_meta( $id, '_sp_import', 1 );\n\t\t\t\tendif;\n\n\t\t\t\t// Update roles\n\t\t\t\t$roles = explode( '|', sp_array_value( $meta, 'sp_role' ) );\n\t\t\t\twp_set_object_terms( $id, $roles, 'sp_role', false );\n\n\t\t\t\t// Update leagues\n\t\t\t\t$leagues = explode( '|', sp_array_value( $meta, 'sp_league' ) );\n\t\t\t\twp_set_object_terms( $id, $leagues, 'sp_league', false );\n\n\t\t\t\t// Update seasons\n\t\t\t\t$seasons = explode( '|', sp_array_value( $meta, 'sp_season' ) );\n\t\t\t\twp_set_object_terms( $id, $seasons, 'sp_season', false );\n\n\t\t\t\t// Update teams\n\t\t\t\t$teams = (array) explode( '|', sp_array_value( $meta, 'sp_team' ) );\n\t\t\t\t$i     = 0;\n\t\t\t\tforeach ( $teams as $team ) :\n\t\t\t\t\t// Get or insert team\n\t\t\t\t\t$team_object = sp_get_post_by_title( stripslashes( $team ), 'sp_team' );\n\t\t\t\t\tif ( $team_object ) :\n\t\t\t\t\t\tif ( $team_object->post_status != 'publish' ) :\n\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'ID'          => $team_object->ID,\n\t\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t$team_id = $team_object->ID;\n\t\t\t\t\telse :\n\t\t\t\t\t\t$team_id = wp_insert_post(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $team ),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// Flag as import\n\t\t\t\t\t\tupdate_post_meta( $team_id, '_sp_import', 1 );\n\t\t\t\t\t\twp_set_object_terms( $team_id, $leagues, 'sp_league', false );\n\t\t\t\t\t\twp_set_object_terms( $team_id, $seasons, 'sp_season', false );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Add team to staff\n\t\t\t\t\tadd_post_meta( $id, 'sp_team', $team_id );\n\n\t\t\t\t\t// Update current team if first in array\n\t\t\t\t\tif ( $i == 0 ) :\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_current_team', $team_id );\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$i++;\n\t\t\t\tendforeach;\n\n\t\t\t\t// Update nationality\n\t\t\t\t$nationality = trim( strtolower( sp_array_value( $meta, 'sp_nationality' ) ) );\n\t\t\t\tif ( $nationality == '*' ) {\n\t\t\t\t\t$nationality = '';\n\t\t\t\t}\n\t\t\t\tupdate_post_meta( $id, 'sp_nationality', $nationality );\n\n\t\t\t\t$this->imported++;\n\n\t\t\tendforeach;\n\n\t\t\t// Show Result\n\t\t\techo '<div class=\"updated settings-error below-h2\"><p>\n\t\t\t\t' . wp_kses_post( sprintf( __( 'Import complete - imported <strong>%1$s</strong> staff and skipped <strong>%2$s</strong>.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '\n\t\t\t</p></div>';\n\n\t\t\t$this->import_end();\n\t\t}\n\n\t\t/**\n\t\t * Performs post-import cleanup of files and the cache\n\t\t */\n\t\tfunction import_end() {\n\t\t\techo '<p>' . esc_html__( 'All done!', 'sportspress' ) . ' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=sp_staff' ) ) . '\">' . esc_html__( 'View Staff', 'sportspress' ) . '</a>' . '</p>';\n\n\t\t\tdo_action( 'import_end' );\n\t\t}\n\n\t\t/**\n\t\t * header function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction header() {\n\t\t\techo '<div class=\"wrap\"><h2>' . esc_html__( 'Import Staff', 'sportspress' ) . '</h2>';\n\t\t}\n\n\t\t/**\n\t\t * greet function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction greet() {\n\t\t\techo '<div class=\"narrow\">';\n\t\t\techo '<p>' . esc_html__( 'Hi there! Choose a .csv file to upload, then click \"Upload file and import\".', 'sportspress' ) . '</p>';\n\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Staff need to be defined with columns in a specific order (6 columns). <a href=\"%s\">Click here to download a sample</a>.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/staff-sample.csv' ) ) . '</p>';\n\t\t\twp_import_upload_form( 'admin.php?import=sp_staff_csv&step=1' );\n\t\t\techo '</div>';\n\t\t}\n\n\t\t/**\n\t\t * options function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction options() {\n\t\t\t?>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"merge\" value=\"0\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"merge\" value=\"1\" checked=\"checked\">\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Merge duplicates', 'sportspress' ); ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<?php\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/importers/class-sp-team-importer.php",
    "content": "<?php\n/**\n * Team importer - import teams into SportsPress.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Importers\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( class_exists( 'WP_Importer' ) ) {\n\tclass SP_Team_Importer extends SP_Importer {\n\n\t\t/**\n\t\t * __construct function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->import_page  = 'sp_team_csv';\n\t\t\t$this->import_label = esc_attr__( 'Import Teams', 'sportspress' );\n\t\t\t$this->columns      = array(\n\t\t\t\t'post_title'      => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'sp_league'       => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t'sp_season'       => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t'sp_url'          => esc_attr__( 'Site URL', 'sportspress' ),\n\t\t\t\t'sp_abbreviation' => esc_attr__( 'Abbreviation', 'sportspress' ),\n\t\t\t\t'sp_venue'        => esc_attr__( 'Home', 'sportspress' ),\n\t\t\t);\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * import function.\n\t\t *\n\t\t * @access public\n\t\t * @param array $array\n\t\t * @param array $columns\n\t\t * @return void\n\t\t */\n\t\tfunction import( $array = array(), $columns = array( 'post_title' ) ) {\n\t\t\t$this->imported = $this->skipped = 0;\n\n\t\t\tif ( ! is_array( $array ) || ! sizeof( $array ) ) :\n\t\t\t\t$this->footer();\n\t\t\t\tdie();\n\t\t\tendif;\n\n\t\t\t$rows = array_chunk( $array, sizeof( $columns ) );\n\n\t\t\tforeach ( $rows as $row ) :\n\n\t\t\t\t$row = array_filter( $row );\n\n\t\t\t\tif ( empty( $row ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$meta = array();\n\n\t\t\t\tforeach ( $columns as $index => $key ) :\n\t\t\t\t\t$meta[ $key ] = sp_array_value( $row, $index );\n\t\t\t\tendforeach;\n\n\t\t\t\t$name = sp_array_value( $meta, 'post_title' );\n\n\t\t\t\tif ( ! $name ) :\n\t\t\t\t\t$this->skipped++;\n\t\t\t\t\tcontinue;\n\t\t\t\tendif;\n\n\t\t\t\t// Get or insert team\n\t\t\t\t$team_object = sp_array_value( $_POST, 'merge', 0 ) ? sp_get_post_by_title( stripslashes( $name ), 'sp_team' ) : false;\n\t\t\t\tif ( $team_object ) :\n\t\t\t\t\tif ( $team_object->post_status != 'publish' ) :\n\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID'          => $team_object->ID,\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tendif;\n\t\t\t\t\t$id = $team_object->ID;\n\t\t\t\telse :\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_title'  => wp_strip_all_tags( $name ),\n\t\t\t\t\t);\n\t\t\t\t\t$id   = wp_insert_post( $args );\n\n\t\t\t\t\t// Flag as import\n\t\t\t\t\tupdate_post_meta( $id, '_sp_import', 1 );\n\t\t\t\tendif;\n\n\t\t\t\t// Update leagues\n\t\t\t\t$leagues = explode( '|', sp_array_value( $meta, 'sp_league' ) );\n\t\t\t\twp_set_object_terms( $id, $leagues, 'sp_league', false );\n\n\t\t\t\t// Update seasons\n\t\t\t\t$seasons = explode( '|', sp_array_value( $meta, 'sp_season' ) );\n\t\t\t\twp_set_object_terms( $id, $seasons, 'sp_season', false );\n\n\t\t\t\t// Update venues\n\t\t\t\t$venues = explode( '|', sp_array_value( $meta, 'sp_venue' ) );\n\t\t\t\twp_set_object_terms( $id, $venues, 'sp_venue', false );\n\n\t\t\t\t// Update meta\n\t\t\t\tupdate_post_meta( $id, 'sp_url', sp_array_value( $meta, 'sp_url' ) );\n\t\t\t\tupdate_post_meta( $id, 'sp_abbreviation', sp_array_value( $meta, 'sp_abbreviation' ) );\n\n\t\t\t\t$this->imported++;\n\n\t\t\tendforeach;\n\n\t\t\t// Show Result\n\t\t\techo '<div class=\"updated settings-error below-h2\"><p>\n\t\t\t\t' . wp_kses_post( sprintf( __( 'Import complete - imported <strong>%1$s</strong> teams and skipped <strong>%2$s</strong>.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '\n\t\t\t</p></div>';\n\n\t\t\t$this->import_end();\n\t\t}\n\n\t\t/**\n\t\t * Performs post-import cleanup of files and the cache\n\t\t */\n\t\tfunction import_end() {\n\t\t\techo '<p>' . esc_html__( 'All done!', 'sportspress' ) . ' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=sp_team' ) ) . '\">' . esc_html__( 'View Teams', 'sportspress' ) . '</a>' . '</p>';\n\n\t\t\tdo_action( 'import_end' );\n\t\t}\n\n\t\t/**\n\t\t * greet function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction greet() {\n\t\t\techo '<div class=\"narrow\">';\n\t\t\techo '<p>' . esc_html__( 'Hi there! Choose a .csv file to upload, then click \"Upload file and import\".', 'sportspress' ) . '</p>';\n\t\t\techo '<p>' . wp_kses_post( sprintf( __( 'Teams need to be defined with columns in a specific order (3 columns). <a href=\"%s\">Click here to download a sample</a>.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/teams-sample.csv' ) ) . '</p>';\n\t\t\twp_import_upload_form( 'admin.php?import=sp_team_csv&step=1' );\n\t\t\techo '</div>';\n\t\t}\n\n\t\t/**\n\t\t * options function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tfunction options() {\n\t\t\t?>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"merge\" value=\"0\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"merge\" value=\"1\" checked=\"checked\">\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Merge duplicates', 'sportspress' ); ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<?php\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-calendar.php",
    "content": "<?php\n/**\n * Admin functions for the calendars post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Calendar' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Calendar Class\n\t */\n\tclass SP_Admin_CPT_Calendar extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_calendar';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_calendar_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_calendar_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Filtering\n\t\t\tadd_action( 'restrict_manage_posts', array( $this, 'filters' ) );\n\t\t\tadd_filter( 'parse_query', array( $this, 'filters_query' ) );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\tunset( $existing_columns['author'], $existing_columns['date'] );\n\t\t\t$columns = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'cb'        => '<input type=\"checkbox\" />',\n\t\t\t\t\t'title'     => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t'sp_league' => esc_attr__( 'League', 'sportspress' ),\n\t\t\t\t\t'sp_season' => esc_attr__( 'Season', 'sportspress' ),\n\t\t\t\t\t'sp_venue'  => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t\t'sp_team'   => esc_attr__( 'Team', 'sportspress' ),\n\t\t\t\t\t'sp_events' => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t'sp_layout' => esc_attr__( 'Layout', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t$existing_columns\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_calendar_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_league':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_league' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_season':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_season' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_venue':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_venue' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_team':\n\t\t\t\t\t$teams = (array) get_post_meta( $post_id, 'sp_team', false );\n\t\t\t\t\t$teams = array_filter( $teams );\n\t\t\t\t\tif ( empty( $teams ) ) :\n\t\t\t\t\t\techo esc_html__( 'All', 'sportspress' );\n\t\t\t\t\telse :\n\t\t\t\t\t\t$current_team = get_post_meta( $post_id, 'sp_current_team', true );\n\t\t\t\t\t\tforeach ( $teams as $team_id ) :\n\t\t\t\t\t\t\tif ( ! $team_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$team = get_post( $team_id );\n\t\t\t\t\t\t\tif ( $team ) :\n\t\t\t\t\t\t\t\techo esc_html( $team->post_title );\n\t\t\t\t\t\t\t\tif ( $team_id == $current_team ) :\n\t\t\t\t\t\t\t\t\techo '<span class=\"dashicons dashicons-yes\" title=\"' . esc_attr__( 'Current Team', 'sportspress' ) . '\"></span>';\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_events':\n\t\t\t\t\t$calendar = new SP_Calendar( $post_id );\n\t\t\t\t\techo esc_html( sizeof( $calendar->data() ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_layout':\n\t\t\t\t\techo esc_html( sp_array_value( SP()->formats->calendar, get_post_meta( $post_id, 'sp_format', true ), '&mdash;' ) );\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\n\t\t/**\n\t\t * Show a category filter box\n\t\t */\n\t\tpublic function filters() {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow != 'sp_calendar' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t'name'            => 'sp_league',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t'name'            => 'sp_season',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'post_type'        => 'sp_team',\n\t\t\t\t'name'             => 'team',\n\t\t\t\t'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ),\n\t\t\t\t'selected'         => $selected,\n\t\t\t\t'values'           => 'ID',\n\t\t\t);\n\t\t\twp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t}\n\n\t\t/**\n\t\t * Filter in admin based on options\n\t\t *\n\t\t * @param mixed $query\n\t\t */\n\t\tpublic function filters_query( $query ) {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow == 'sp_calendar' ) {\n\n\t\t\t\tif ( ! empty( $_GET['team'] ) ) {\n\t\t\t\t\t$query->query_vars['meta_value'] = sanitize_key( $_GET['team'] );\n\t\t\t\t\t$query->query_vars['meta_key']   = 'sp_team';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Calendar();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-column.php",
    "content": "<?php\n/**\n * Admin functions for the columns post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Column' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Column Class\n\t */\n\tclass SP_Admin_CPT_Column extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_column';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_column_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_column_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\t$columns = array(\n\t\t\t\t'cb'             => '<input type=\"checkbox\" />',\n\t\t\t\t'title'          => esc_attr__( 'Label', 'sportspress' ),\n\t\t\t\t'sp_key'         => esc_attr__( 'Key', 'sportspress' ),\n\t\t\t\t'sp_equation'    => esc_attr__( 'Equation', 'sportspress' ),\n\t\t\t\t'sp_precision'   => esc_attr__( 'Decimal Places', 'sportspress' ),\n\t\t\t\t'sp_order'       => esc_attr__( 'Sort Order', 'sportspress' ),\n\t\t\t\t'sp_description' => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_column_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_key':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( $post->post_name );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_equation':\n\t\t\t\t\techo wp_kses_post( sp_get_post_equation( $post_id ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_precision':\n\t\t\t\t\techo esc_html( sp_get_post_precision( $post_id ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_order':\n\t\t\t\t\techo esc_html( sp_get_post_order( $post_id ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_description':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo '<span class=\"description\">' . wp_kses_post( $post->post_excerpt ) . '</span>';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Column();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-event.php",
    "content": "<?php\n/**\n * Admin functions for the events post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Event' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Event Class\n\t */\n\tclass SP_Admin_CPT_Event extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_event';\n\n\t\t\t// Post title fields\n\t\t\tadd_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );\n\n\t\t\t// Empty data filter\n\t\t\tadd_filter( 'wp_insert_post_empty_content', array( $this, 'wp_insert_post_empty_content' ), 99, 2 );\n\n\t\t\t// Before data updates\n\t\t\tadd_filter( 'wp_insert_post_data', array( $this, 'wp_insert_post_data' ), 99, 2 );\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_event_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_filter( 'manage_edit-sp_event_sortable_columns', array( $this, 'sortable_columns' ) );\n\t\t\tadd_action( 'pre_get_posts', array( $this, 'orderby_columns' ) );\n\t\t\tadd_action( 'manage_sp_event_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Filtering\n\t\t\tadd_action( 'restrict_manage_posts', array( $this, 'filters' ) );\n\t\t\tadd_filter( 'parse_query', array( $this, 'filters_query' ) );\n\n\t\t\t// Post states\n\t\t\tadd_filter( 'display_post_states', array( $this, 'post_states' ), 10, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change title boxes in admin.\n\t\t *\n\t\t * @param  string $text\n\t\t * @param  object $post\n\t\t * @return string\n\t\t */\n\t\tpublic function enter_title_here( $text, $post ) {\n\t\t\tif ( $post->post_type == 'sp_event' ) {\n\t\t\t\treturn esc_attr__( '(Auto)', 'sportspress' );\n\t\t\t}\n\n\t\t\treturn $text;\n\t\t}\n\n\t\t/**\n\t\t * Mark as not empty when saving event if teams are selected for auto title.\n\t\t *\n\t\t * @param array $maybe_empty\n\t\t * @param array $postarr\n\t\t * @return bool\n\t\t */\n\t\tpublic function wp_insert_post_empty_content( $maybe_empty, $postarr ) {\n\t\t\tif ( $maybe_empty && 'sp_event' === sp_array_value( $postarr, 'post_type' ) ) :\n\t\t\t\t$teams = sp_array_value( $postarr, 'sp_team', array() );\n\t\t\t\t$teams = array_filter( $teams );\n\t\t\t\tif ( sizeof( $teams ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tendif;\n\n\t\t\treturn $maybe_empty;\n\t\t}\n\n\t\t/**\n\t\t * Auto-generate an event title based on the team playing if left blank.\n\t\t *\n\t\t * @param array $data\n\t\t * @param array $postarr\n\t\t * @return array\n\t\t */\n\t\tpublic function wp_insert_post_data( $data, $postarr ) {\n\t\t\tif ( $data['post_type'] == 'sp_event' && $data['post_title'] == '' ) :\n\n\t\t\t\t$teams = sp_array_value( $postarr, 'sp_team', array() );\n\t\t\t\t$teams = array_filter( $teams );\n\n\t\t\t\t$team_names = array();\n\t\t\t\tforeach ( $teams as $team ) :\n\t\t\t\t\twhile ( is_array( $team ) ) {\n\t\t\t\t\t\t$team = array_shift( array_filter( $team ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( $team > 0 ) {\n\t\t\t\t\t\t$team_names[] = sp_team_short_name( $team );\n\t\t\t\t\t}\n\t\t\t\tendforeach;\n\n\t\t\t\t$team_names = array_unique( $team_names );\n\n\t\t\t\t$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;\n\t\t\t\tif ( $reverse_teams ) {\n\t\t\t\t\t$team_names = array_reverse( $team_names );\n\t\t\t\t}\n\n\t\t\t\t$data['post_title'] = implode( ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ', $team_names );\n\n\t\t\tendif;\n\n\t\t\treturn $data;\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\tunset( $existing_columns['author'], $existing_columns['comments'] );\n\t\t\t$columns = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'cb'        => '<input type=\"checkbox\" />',\n\t\t\t\t\t'sp_format' => '<span class=\"dashicons sp-icon-calendar sp-tip\" title=\"' . esc_attr__( 'Format', 'sportspress' ) . '\"></span>',\n\t\t\t\t\t'title'     => null,\n\t\t\t\t\t'date'      => esc_attr__( 'Date', 'sportspress' ),\n\t\t\t\t\t'sp_time'   => esc_attr__( 'Time', 'sportspress' ),\n\t\t\t\t\t'sp_team'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t'sp_league' => esc_attr__( 'League', 'sportspress' ),\n\t\t\t\t\t'sp_season' => esc_attr__( 'Season', 'sportspress' ),\n\t\t\t\t\t'sp_venue'  => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t\t'sp_day'    => esc_attr__( 'Match Day', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t$existing_columns,\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_attr__( 'Event', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_event_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Change the sortable columns in admin.\n\t\t */\n\t\tpublic function sortable_columns( $columns ) {\n\t\t\t$columns['sp_day'] = 'sp_day';\n\t\t\treturn $columns;\n\t\t}\n\n\t\t/**\n\t\t * Define the sortable columns in admin.\n\t\t */\n\t\tpublic function orderby_columns( $query ) {\n\t\t\tif ( ! is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$orderby = $query->get( 'orderby' );\n\n\t\t\tif ( 'sp_day' == $orderby ) {\n\t\t\t\t$query->set( 'meta_key', 'sp_day' );\n\t\t\t\t$query->set( 'orderby', 'meta_value_num' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_format':\n\t\t\t\t\t$format        = get_post_meta( $post_id, 'sp_format', true );\n\t\t\t\t\t$formats       = new SP_Formats();\n\t\t\t\t\t$event_formats = $formats->event;\n\t\t\t\t\tif ( array_key_exists( $format, $event_formats ) ) :\n\t\t\t\t\t\techo '<span class=\"dashicons sp-icon-' . esc_attr( $format ) . ' sp-tip\" title=\"' . esc_attr( $event_formats[ $format ] ) . '\"></span>';\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_time':\n\t\t\t\t\techo wp_kses_post( apply_filters( 'sportspress_event_time_admin', get_post_time( 'H:i', false, $post_id, true ) ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_team':\n\t\t\t\t\t$teams         = (array) get_post_meta( $post_id, 'sp_team', false );\n\t\t\t\t\t$teams         = array_filter( $teams );\n\t\t\t\t\t$teams         = array_unique( $teams );\n\t\t\t\t\t$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;\n\t\t\t\t\tif ( $reverse_teams ) {\n\t\t\t\t\t\t$teams = array_reverse( $teams, true );\n\t\t\t\t\t}\n\t\t\t\t\tif ( empty( $teams ) ) :\n\t\t\t\t\t\techo '&mdash;';\n\t\t\t\t\telse :\n\t\t\t\t\t\t$results     = get_post_meta( $post_id, 'sp_results', true );\n\t\t\t\t\t\t$main_result = get_option( 'sportspress_primary_result', null );\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"sp_post_id\" value=\"' . esc_attr( $post_id ) . '\">';\n\t\t\t\t\t\techo '<div class=\"sp-results\">';\n\t\t\t\t\t\tforeach ( $teams as $team_id ) :\n\t\t\t\t\t\t\tif ( ! $team_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$team = get_post( $team_id );\n\n\t\t\t\t\t\t\tif ( $team ) :\n\t\t\t\t\t\t\t\t$team_results = sportspress_array_value( $results, $team_id, null );\n\n\t\t\t\t\t\t\t\tif ( $main_result ) :\n\t\t\t\t\t\t\t\t\t$team_result = sportspress_array_value( $team_results, $main_result, null );\n\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\tif ( is_array( $team_results ) ) :\n\t\t\t\t\t\t\t\t\t\tend( $team_results );\n\t\t\t\t\t\t\t\t\t\t$team_result = prev( $team_results );\n\t\t\t\t\t\t\t\t\t\t$main_result = key( $team_results );\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$team_result = null;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\tif ( is_array( $team_results ) ) :\n\t\t\t\t\t\t\t\t\tunset( $team_results['outcome'] );\n\t\t\t\t\t\t\t\t\t$team_results = array_filter( $team_results, 'sp_filter_non_empty' );\n\t\t\t\t\t\t\t\t\t$team_results = implode( ' | ', $team_results );\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\techo '<a class=\"sp-result sp-tip\" tabindex=\"10\" title=\"' . esc_attr( $team_results ) . '\" data-team=\"' . esc_attr( $team_id ) . '\" href=\"#\">' . ( esc_attr( $team_result ) == '' ? '-' : wp_kses_post( apply_filters( 'sportspress_event_team_result_admin', $team_result, $post_id, $team_id ) ) ) . '</a>';\n\t\t\t\t\t\t\t\techo '<input type=\"text\" tabindex=\"10\" class=\"sp-edit-result hidden small-text\" data-team=\"' . esc_attr( $team_id ) . '\" data-key=\"' . esc_attr( $main_result ) . '\" value=\"' . esc_attr( $team_result ) . '\"> ';\n\t\t\t\t\t\t\t\techo esc_html( $team->post_title );\n\t\t\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\tif ( current_user_can( 'edit_others_sp_events' ) ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"row-actions sp-row-actions\"><span class=\"inline hide-if-no-js\"><a href=\"#\" class=\"sp-edit-results\"><?php esc_html_e( 'Edit Results', 'sportspress' ); ?></a></span></div>\n\t\t\t\t\t\t<p class=\"inline-edit-save sp-inline-edit-save hidden\">\n\t\t\t\t\t\t\t<a href=\"#inline-edit\" class=\"button-secondary cancel alignleft\"><?php esc_html_e( 'Cancel' ); ?></a>\n\t\t\t\t\t\t\t<a href=\"#inline-edit\" class=\"button-primary save alignright\"><?php esc_html_e( 'Update' ); ?></a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_league':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_league' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_season':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_season' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_venue':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_venue' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_day':\n\t\t\t\t\t$day = get_post_meta( $post_id, 'sp_day', true );\n\t\t\t\t\tif ( '' === $day ) {\n\t\t\t\t\t\t$day = esc_attr__( 'Default', 'sportspress' );\n\t\t\t\t\t}\n\t\t\t\t\techo esc_html( $day );\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\n\t\t/**\n\t\t * Show a category filter box\n\t\t */\n\t\tpublic function filters() {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow != 'sp_event' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'post_type'        => 'sp_team',\n\t\t\t\t'name'             => 'team',\n\t\t\t\t'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ),\n\t\t\t\t'selected'         => $selected,\n\t\t\t\t'values'           => 'ID',\n\t\t\t);\n\t\t\twp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\n\t\t\t$selected = isset( $_REQUEST['sp_venue'] ) ? sanitize_key( $_REQUEST['sp_venue'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all grounds', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_venue',\n\t\t\t\t'name'            => 'sp_venue',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t'name'            => 'sp_league',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t'name'            => 'sp_season',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['match_day'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['match_day'] ) ) : null;\n\t\t\techo '<input name=\"match_day\" type=\"text\" class=\"sp-tablenav-input\" placeholder=\"' . esc_attr__( 'Match Day', 'sportspress' ) . '\" value=\"' . esc_attr( $selected ) . '\">';\n\n\t\t\tif ( current_user_can( 'edit_others_sp_events' ) ) {\n\t\t\t\twp_nonce_field( 'sp-save-inline-results', 'sp-inline-nonce', false );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filter in admin based on options\n\t\t *\n\t\t * @param mixed $query\n\t\t */\n\t\tpublic function filters_query( $query ) {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow == 'sp_event' ) {\n\t\t\t\t  // Avoid overriding relation operator if already set\n\t\t\t\tif ( ! isset( $query->query_vars['meta_query']['relation'] ) ) {\n\t\t\t\t\t$query->query_vars['meta_query']['relation'] = 'AND';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $_GET['team'] ) ) {\n\t\t\t\t\t$query->query_vars['meta_query'][] = array(\n\t\t\t\t\t\t'key'   => 'sp_team',\n\t\t\t\t\t\t'value' => sanitize_key( $_GET['team'] ),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $_GET['match_day'] ) ) {\n\t\t\t\t\t$query->query_vars['meta_query'][] = array(\n\t\t\t\t\t\t'key'   => 'sp_day',\n\t\t\t\t\t\t'value' => sanitize_text_field( wp_unslash( $_GET['match_day'] ) ),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Replace displayed post state for events\n\t\t *\n\t\t * @param array  $post_states\n\t\t * @param object $post\n\t\t */\n\t\tpublic function post_states( $post_states, $post ) {\n\t\t\t$status = get_post_meta( $post->ID, 'sp_status', true );\n\n\t\t\tif ( 'postponed' == $status ) {\n\t\t\t\t$post_states = array( esc_attr__( 'Postponed', 'sportspress' ) );\n\t\t\t} elseif ( 'cancelled' == $status ) {\n\t\t\t\t$post_states = array( esc_attr__( 'Canceled', 'sportspress' ) );\n\t\t\t} elseif ( 'tbd' == $status ) {\n\t\t\t\t$post_states = array( esc_attr__( 'TBD', 'sportspress' ) );\n\t\t\t}\n\n\t\t\treturn $post_states;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Event();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-list.php",
    "content": "<?php\n/**\n * Admin functions for the player lists post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_List' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_List Class\n\t */\n\tclass SP_Admin_CPT_List extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_list';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_list_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_list_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Filtering\n\t\t\tadd_action( 'restrict_manage_posts', array( $this, 'filters' ) );\n\t\t\tadd_filter( 'parse_query', array( $this, 'filters_query' ) );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\tunset( $existing_columns['author'], $existing_columns['date'] );\n\t\t\t$columns = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'cb'        => '<input type=\"checkbox\" />',\n\t\t\t\t\t'title'     => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t'sp_league' => esc_attr__( 'League', 'sportspress' ),\n\t\t\t\t\t'sp_season' => esc_attr__( 'Season', 'sportspress' ),\n\t\t\t\t\t'sp_team'   => esc_attr__( 'Team', 'sportspress' ),\n\t\t\t\t\t'sp_player' => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t'sp_layout' => esc_attr__( 'Layout', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t$existing_columns\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_list_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_player':\n\t\t\t\t\t$select = get_post_meta( $post_id, 'sp_select', true );\n\t\t\t\t\tif ( 'manual' == $select ) :\n\t\t\t\t\t\t$players = array_filter( get_post_meta( $post_id, 'sp_player' ) );\n\t\t\t\t\t\techo esc_html( sizeof( $players ) );\n\t\t\t\t\telse :\n\t\t\t\t\t\tesc_html_e( 'Auto', 'sportspress' );\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_league':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_league' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_season':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_season' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_team':\n\t\t\t\t\t$teams = (array) get_post_meta( $post_id, 'sp_team', false );\n\t\t\t\t\t$teams = array_filter( $teams );\n\t\t\t\t\tif ( empty( $teams ) ) :\n\t\t\t\t\t\techo esc_html__( 'All', 'sportspress' );\n\t\t\t\t\telse :\n\t\t\t\t\t\tforeach ( $teams as $team_id ) :\n\t\t\t\t\t\t\tif ( ! $team_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$team = get_post( $team_id );\n\t\t\t\t\t\t\tif ( $team ) {\n\t\t\t\t\t\t\t\techo esc_html( $team->post_title ) . '<br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_layout':\n\t\t\t\t\techo esc_html( sp_array_value( SP()->formats->list, get_post_meta( $post_id, 'sp_format', true ), '&mdash;' ) );\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\n\t\t/**\n\t\t * Show a category filter box\n\t\t */\n\t\tpublic function filters() {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow != 'sp_list' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t'name'            => 'sp_league',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t'name'            => 'sp_season',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'post_type'        => 'sp_team',\n\t\t\t\t'name'             => 'team',\n\t\t\t\t'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ),\n\t\t\t\t'selected'         => $selected,\n\t\t\t\t'values'           => 'ID',\n\t\t\t);\n\t\t\twp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t}\n\n\t\t/**\n\t\t * Filter in admin based on options\n\t\t *\n\t\t * @param mixed $query\n\t\t */\n\t\tpublic function filters_query( $query ) {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow == 'sp_list' ) {\n\n\t\t\t\tif ( ! empty( $_GET['team'] ) ) {\n\t\t\t\t\t$query->query_vars['meta_value'] = sanitize_key( $_GET['team'] );\n\t\t\t\t\t$query->query_vars['meta_key']   = 'sp_team';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_List();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-metric.php",
    "content": "<?php\n/**\n * Admin functions for the columns post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Metric' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Metric Class\n\t */\n\tclass SP_Admin_CPT_Metric extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_metric';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_metric_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_metric_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\t$columns = array(\n\t\t\t\t'cb'             => '<input type=\"checkbox\" />',\n\t\t\t\t'title'          => esc_attr__( 'Label', 'sportspress' ),\n\t\t\t\t'sp_key'         => esc_attr__( 'Variable', 'sportspress' ),\n\t\t\t\t'sp_description' => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_metric_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_key':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( $post->post_name );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_description':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo '<span class=\"description\">' . wp_kses_post( $post->post_excerpt ) . '</span>';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Metric();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-official.php",
    "content": "<?php\n/**\n * Admin functions for the officials post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.5.1\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Official' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Official Class\n\t */\n\tclass SP_Admin_CPT_Official extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_official';\n\n\t\t\t// Post title fields\n\t\t\tadd_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change title boxes in admin.\n\t\t *\n\t\t * @param  string $text\n\t\t * @param  object $post\n\t\t * @return string\n\t\t */\n\t\tpublic function enter_title_here( $text, $post ) {\n\t\t\tif ( $post->post_type == 'sp_official' ) {\n\t\t\t\treturn esc_attr__( 'Name', 'sportspress' );\n\t\t\t}\n\n\t\t\treturn $text;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Official();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-outcome.php",
    "content": "<?php\n/**\n * Admin functions for the outcomes post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Outcome' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Outcome Class\n\t */\n\tclass SP_Admin_CPT_Outcome extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_outcome';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_outcome_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_outcome_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\t$columns = array(\n\t\t\t\t'cb'              => '<input type=\"checkbox\" />',\n\t\t\t\t'title'           => esc_attr__( 'Label', 'sportspress' ),\n\t\t\t\t'sp_key'          => esc_attr__( 'Variable', 'sportspress' ),\n\t\t\t\t'sp_abbreviation' => esc_attr__( 'Abbreviation', 'sportspress' ),\n\t\t\t\t'sp_description'  => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_outcome_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_key':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( $post->post_name );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_abbreviation':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( sp_get_post_abbreviation( $post->ID ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_description':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo '<span class=\"description\">' . wp_kses_post( $post->post_excerpt ) . '</span>';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Outcome();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-performance.php",
    "content": "<?php\n/**\n * Admin functions for the performance post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Performance' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Performance Class\n\t */\n\tclass SP_Admin_CPT_Performance extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_performance';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_performance_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_performance_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\t$columns = array(\n\t\t\t\t'cb'               => '<input type=\"checkbox\" />',\n\t\t\t\t'sp_icon'          => esc_attr__( 'Icon', 'sportspress' ),\n\t\t\t\t'title'            => esc_attr__( 'Label', 'sportspress' ),\n\t\t\t\t'sp_key'           => esc_attr__( 'Variable', 'sportspress' ),\n\t\t\t\t'sp_section'       => esc_attr__( 'Category', 'sportspress' ),\n\t\t\t\t'sp_config_format' => esc_attr__( 'Format', 'sportspress' ),\n\t\t\t\t'sp_description'   => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_performance_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_icon':\n\t\t\t\t\techo has_post_thumbnail( $post_id ) ? wp_kses_post( edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-fit-mini' ), '', '', $post_id ) ) : '';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_key':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( $post->post_name );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_section':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( sp_get_post_section( $post->ID ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_config_format':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( sp_get_post_format( $post->ID ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_description':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo '<span class=\"description\">' . wp_kses_post( $post->post_excerpt ) . '</span>';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Performance();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-player.php",
    "content": "<?php\n/**\n * Admin functions for the players post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Player' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Player Class\n\t */\n\tclass SP_Admin_CPT_Player extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_player';\n\n\t\t\t// Post title fields\n\t\t\tadd_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );\n\n\t\t\t// Admin columns\n\t\t\tadd_filter( 'manage_edit-sp_player_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_player_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Filtering\n\t\t\tadd_action( 'restrict_manage_posts', array( $this, 'filters' ) );\n\t\t\tadd_filter( 'parse_query', array( $this, 'filters_query' ) );\n\n\t\t\t// Quick edit\n\t\t\tadd_action( 'quick_edit_custom_box', array( $this, 'quick_edit_number' ), 10, 2 );\n\t\t\tadd_action( 'quick_edit_custom_box', array( $this, 'quick_edit_teams' ), 10, 2 );\n\t\t\tadd_action( 'save_post', array( $this, 'quick_save' ) );\n\n\t\t\t// Bulk edit\n\t\t\tadd_action( 'bulk_edit_custom_box', array( $this, 'bulk_edit_teams' ), 10, 2 );\n\t\t\tadd_action( 'wp_ajax_save_bulk_edit_sp_player', array( $this, 'bulk_save' ) );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change title boxes in admin.\n\t\t *\n\t\t * @param  string $text\n\t\t * @param  object $post\n\t\t * @return string\n\t\t */\n\t\tpublic function enter_title_here( $text, $post ) {\n\t\t\tif ( $post->post_type == 'sp_player' ) {\n\t\t\t\treturn esc_attr__( 'Name', 'sportspress' );\n\t\t\t}\n\n\t\t\treturn $text;\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\tunset( $existing_columns['author'], $existing_columns['date'] );\n\t\t\t$columns = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'cb'          => '<input type=\"checkbox\" />',\n\t\t\t\t\t'sp_number'   => '<span class=\"dashicons sp-icon-tshirt sp-tip\" title=\"' . esc_attr__( 'Squad Number', 'sportspress' ) . '\"></span>',\n\t\t\t\t\t'title'       => null,\n\t\t\t\t\t'sp_position' => esc_attr__( 'Positions', 'sportspress' ),\n\t\t\t\t\t'sp_team'     => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t'sp_league'   => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t\t'sp_season'   => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t$existing_columns,\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_player_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_number':\n\t\t\t\t\techo esc_html( get_post_meta( $post_id, 'sp_number', true ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_position':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_position' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_team':\n\t\t\t\t\t$current_teams = get_post_meta( $post_id, 'sp_current_team', false );\n\t\t\t\t\t$past_teams    = get_post_meta( $post_id, 'sp_past_team', false );\n\t\t\t\t\t$current_teams = array_filter( $current_teams );\n\t\t\t\t\t$past_teams    = array_filter( $past_teams );\n\t\t\t\t\techo '<span class=\"hidden sp-player-teams\" data-current-teams=\"' . implode( ',', array_map( 'esc_attr', $current_teams ) ) . '\" data-past-teams=\"' . implode( ',', array_map( 'esc_attr', $past_teams ) ) . '\"></span>';\n\t\t\t\t\t$teams = (array) get_post_meta( $post_id, 'sp_team', false );\n\t\t\t\t\t$teams = array_filter( $teams );\n\t\t\t\t\t$teams = array_unique( $teams );\n\t\t\t\t\tif ( empty( $teams ) ) :\n\t\t\t\t\t\techo '&mdash;';\n\t\t\t\t\telse :\n\t\t\t\t\t\tforeach ( $teams as $team_id ) :\n\t\t\t\t\t\t\tif ( ! $team_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$team = get_post( $team_id );\n\t\t\t\t\t\t\tif ( $team ) :\n\t\t\t\t\t\t\t\techo esc_html( $team->post_title );\n\t\t\t\t\t\t\t\tif ( in_array( $team_id, $current_teams ) ) :\n\t\t\t\t\t\t\t\t\techo '<span class=\"dashicons dashicons-yes\" title=\"' . esc_attr__( 'Current Team', 'sportspress' ) . '\"></span>';\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_league':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_league' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_season':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_season' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_venue':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_venue' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\n\t\t/**\n\t\t * Show a category filter box\n\t\t */\n\t\tpublic function filters() {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow != 'sp_player' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( taxonomy_exists( 'sp_position' ) ) :\n\t\t\t\t$selected = isset( $_REQUEST['sp_position'] ) ? sanitize_key( $_REQUEST['sp_position'] ) : null;\n\t\t\t\t$args     = array(\n\t\t\t\t\t'show_option_all' => esc_attr__( 'Show all positions', 'sportspress' ),\n\t\t\t\t\t'taxonomy'        => 'sp_position',\n\t\t\t\t\t'name'            => 'sp_position',\n\t\t\t\t\t'selected'        => $selected,\n\t\t\t\t);\n\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\tendif;\n\n\t\t\t$selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'post_type'        => 'sp_team',\n\t\t\t\t'name'             => 'team',\n\t\t\t\t'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ),\n\t\t\t\t'selected'         => $selected,\n\t\t\t\t'values'           => 'ID',\n\t\t\t);\n\t\t\twp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\n\t\t\tif ( taxonomy_exists( 'sp_league' ) ) :\n\t\t\t\t$selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null;\n\t\t\t\t$args     = array(\n\t\t\t\t\t'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ),\n\t\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t\t'name'            => 'sp_league',\n\t\t\t\t\t'selected'        => $selected,\n\t\t\t\t);\n\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\tendif;\n\n\t\t\tif ( taxonomy_exists( 'sp_season' ) ) :\n\t\t\t\t$selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null;\n\t\t\t\t$args     = array(\n\t\t\t\t\t'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ),\n\t\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t\t'name'            => 'sp_season',\n\t\t\t\t\t'selected'        => $selected,\n\t\t\t\t);\n\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\tendif;\n\t\t}\n\n\t\t/**\n\t\t * Filter in admin based on options\n\t\t *\n\t\t * @param mixed $query\n\t\t */\n\t\tpublic function filters_query( $query ) {\n\n\t\t\tif ( empty( $query->query_vars['post_type'] ) || $query->query_vars['post_type'] !== 'sp_player' ) {\n\t\t\t\treturn $query;\n\t\t\t}\n\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow == 'sp_player' ) {\n\n\t\t\t\tif ( ! empty( $_GET['team'] ) ) {\n\t\t\t\t\t$query->query_vars['meta_value'] = sanitize_key( $_GET['team'] );\n\t\t\t\t\t$query->query_vars['meta_key']   = 'sp_team';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $query;\n\t\t}\n\n\t\t/**\n\t\t * Quick edit squad number\n\t\t *\n\t\t * @param string $column_name\n\t\t * @param string $post_type\n\t\t */\n\t\tpublic function quick_edit_number( $column_name, $post_type ) {\n\t\t\tif ( $this->type !== $post_type ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( 'sp_number' !== $column_name ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstatic $print_nonce = true;\n\t\t\tif ( $print_nonce ) {\n\t\t\t\t$print_nonce = false;\n\t\t\t\twp_nonce_field( plugin_basename( __FILE__ ), 'sp_player_edit_nonce' );\n\t\t\t}\n\t\t\t?>\n\t\t<fieldset class=\"inline-edit-col-right\">\n\t\t\t<div class=\"inline-edit-col\">\n\t\t\t\t<label>\n\t\t\t\t\t<span class=\"title\"><?php esc_html_e( 'Squad Number', 'sportspress' ); ?></span>\n\t\t\t\t\t<span class=\"input-text-wrap\"><input type=\"text\" name=\"sp_number\" class=\"inline-edit-menu-order-input\"></span>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t</fieldset>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Quick edit teams\n\t\t *\n\t\t * @param string $column_name\n\t\t * @param string $post_type\n\t\t */\n\t\tpublic function quick_edit_teams( $column_name, $post_type ) {\n\t\t\tif ( $this->type !== $post_type ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( 'sp_team' !== $column_name ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$teams = get_posts(\n\t\t\t\tarray(\n\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t'numberposts' => -1,\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( ! $teams ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t?>\n\t\t<fieldset class=\"inline-edit-col-right\">\n\t\t\t<div class=\"inline-edit-col\">\n\t\t\t\t<span class=\"title inline-edit-categories-label\"><?php esc_html_e( 'Current Teams', 'sportspress' ); ?></span>\n\t\t\t\t<input type=\"hidden\" name=\"sp_current_team[]\" value=\"0\">\n\t\t\t\t<ul class=\"cat-checklist\">\n\t\t\t\t\t<?php foreach ( $teams as $team ) { ?>\n\t\t\t\t\t<li><label class=\"selectit\"><input value=\"<?php echo esc_attr( $team->ID ); ?>\" type=\"checkbox\" name=\"sp_current_team[]\"> <?php echo esc_html( $team->post_title ); ?></label></li>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</ul>\n\t\t\t\t<span class=\"title inline-edit-categories-label\"><?php esc_html_e( 'Past Teams', 'sportspress' ); ?></span>\n\t\t\t\t<input type=\"hidden\" name=\"sp_past_team[]\" value=\"0\">\n\t\t\t\t<ul class=\"cat-checklist\">\n\t\t\t\t\t<?php foreach ( $teams as $team ) { ?>\n\t\t\t\t\t<li><label class=\"selectit\"><input value=\"<?php echo esc_attr( $team->ID ); ?>\" type=\"checkbox\" name=\"sp_past_team[]\"> <?php echo esc_html( $team->post_title ); ?></label></li>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</fieldset>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Save quick edit boxes\n\t\t *\n\t\t * @param int $post_id\n\t\t */\n\t\tpublic function quick_save( $post_id ) {\n\t\t\tif ( empty( $_POST ) ) {\n\t\t\t\treturn $post_id;\n\t\t\t}\n\t\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t\treturn $post_id;\n\t\t\t}\n\n\t\t\t$_POST += array( \"{$this->type}_edit_nonce\" => '' );\n\t\t\tif ( ! isset( $_POST[ \"{$this->type}_edit_nonce\" ] ) || ! wp_verify_nonce( sanitize_key( $_POST[ \"{$this->type}_edit_nonce\" ] ), plugin_basename( __FILE__ ) ) ) {\n\t\t\t\treturn $post_id;\n\t\t\t}\n\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\t\treturn $post_id;\n\t\t\t}\n\t\t\tif ( isset( $post->post_type ) && $post->post_type == 'revision' ) {\n\t\t\t\treturn $post_id;\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['sp_number'] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'sp_number', sanitize_text_field( wp_unslash( $_POST['sp_number'] ) ) );\n\t\t\t}\n\n\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_current_team', sp_array_value( $_POST, 'sp_current_team', array() ) );\n\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_past_team', sp_array_value( $_POST, 'sp_past_team', array() ) );\n\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sp_array_value( $_POST, 'sp_current_team', array() ) ), sp_array_value( $_POST, 'sp_past_team', array() ) ) );\n\t\t}\n\n\t\t/**\n\t\t * Bulk edit teams\n\t\t *\n\t\t * @param string $column_name\n\t\t * @param string $post_type\n\t\t */\n\t\tpublic function bulk_edit_teams( $column_name, $post_type ) {\n\t\t\tif ( $this->type !== $post_type ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( 'sp_team' !== $column_name ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstatic $print_nonce = true;\n\t\t\tif ( $print_nonce ) {\n\t\t\t\t$print_nonce = false;\n\t\t\t\twp_nonce_field( plugin_basename( __FILE__ ), 'sp_player_edit_nonce' );\n\t\t\t}\n\n\t\t\t$teams = get_posts(\n\t\t\t\tarray(\n\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t'numberposts' => -1,\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( ! $teams ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t?>\n\t\t<fieldset class=\"inline-edit-col-right\">\n\t\t\t<div class=\"inline-edit-col\">\n\t\t\t\t<span class=\"title inline-edit-categories-label\"><?php esc_html_e( 'Current Teams', 'sportspress' ); ?></span>\n\t\t\t\t<input type=\"hidden\" name=\"sp_current_team[]\" value=\"0\">\n\t\t\t\t<ul class=\"cat-checklist\">\n\t\t\t\t\t<?php foreach ( $teams as $team ) { ?>\n\t\t\t\t\t<li><label class=\"selectit\"><input value=\"<?php echo esc_attr( $team->ID ); ?>\" type=\"checkbox\" name=\"sp_current_team[]\"> <?php echo esc_attr( $team->post_title ); ?></label></li>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</ul>\n\t\t\t\t<span class=\"title inline-edit-categories-label\"><?php esc_html_e( 'Past Teams', 'sportspress' ); ?></span>\n\t\t\t\t<input type=\"hidden\" name=\"sp_past_team[]\" value=\"0\">\n\t\t\t\t<ul class=\"cat-checklist\">\n\t\t\t\t\t<?php foreach ( $teams as $team ) { ?>\n\t\t\t\t\t<li><label class=\"selectit\"><input value=\"<?php echo esc_attr( $team->ID ); ?>\" type=\"checkbox\" name=\"sp_past_team[]\"> <?php echo esc_attr( $team->post_title ); ?></label></li>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</fieldset>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Save bulk edit boxes\n\t\t */\n\t\tpublic function bulk_save() {\n\t\t\t$_POST += array( 'nonce' => '' );\n\t\t\tif ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['nonce'] ), plugin_basename( __FILE__ ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$post_ids = ( ! empty( $_POST['post_ids'] ) ) ? $_POST['post_ids'] : array(); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\n\t\t\t$current_teams = sp_array_value( $_POST, 'current_teams', array() );\n\t\t\t$past_teams    = sp_array_value( $_POST, 'past_teams', array() );\n\t\t\t$teams         = array_merge( $current_teams, $past_teams );\n\n\t\t\tif ( ! empty( $post_ids ) && is_array( $post_ids ) ) {\n\t\t\t\tforeach ( $post_ids as $post_id ) {\n\t\t\t\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tsp_add_post_meta_recursive( $post_id, 'sp_current_team', $current_teams );\n\t\t\t\t\tsp_add_post_meta_recursive( $post_id, 'sp_past_team', $past_teams );\n\t\t\t\t\tsp_add_post_meta_recursive( $post_id, 'sp_team', $teams );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdie();\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Player();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-result.php",
    "content": "<?php\n/**\n * Admin functions for the results post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Result' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Result Class\n\t */\n\tclass SP_Admin_CPT_Result extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_result';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_result_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_result_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\t$columns = array(\n\t\t\t\t'cb'             => '<input type=\"checkbox\" />',\n\t\t\t\t'title'          => esc_attr__( 'Label', 'sportspress' ),\n\t\t\t\t'sp_key'         => esc_attr__( 'Variable', 'sportspress' ),\n\t\t\t\t'sp_description' => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_result_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_key':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( $post->post_name ) . 'for, ' . esc_html( $post->post_name ) . 'against';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_description':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo '<span class=\"description\">' . wp_kses_post( $post->post_excerpt ) . '</span>';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Result();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-spec.php",
    "content": "<?php\n/**\n * Admin functions for the columns post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Spec' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Spec Class\n\t */\n\tclass SP_Admin_CPT_Spec extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_spec';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_spec_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_spec_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\t$columns = array(\n\t\t\t\t'cb'             => '<input type=\"checkbox\" />',\n\t\t\t\t'title'          => esc_attr__( 'Label', 'sportspress' ),\n\t\t\t\t'sp_key'         => esc_attr__( 'Variable', 'sportspress' ),\n\t\t\t\t'sp_description' => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_spec_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_key':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( $post->post_name );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_description':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo '<span class=\"description\">' . wp_kses_post( $post->post_excerpt ) . '</span>';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Spec();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-staff.php",
    "content": "<?php\n/**\n * Admin functions for the staff post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Staff' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Staff Class\n\t */\n\tclass SP_Admin_CPT_Staff extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_staff';\n\n\t\t\t// Post title fields\n\t\t\tadd_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_staff_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_staff_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Filtering\n\t\t\tadd_action( 'restrict_manage_posts', array( $this, 'filters' ) );\n\t\t\tadd_filter( 'parse_query', array( $this, 'filters_query' ) );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change title boxes in admin.\n\t\t *\n\t\t * @param  string $text\n\t\t * @param  object $post\n\t\t * @return string\n\t\t */\n\t\tpublic function enter_title_here( $text, $post ) {\n\t\t\tif ( $post->post_type == 'sp_staff' ) {\n\t\t\t\treturn esc_attr__( 'Name', 'sportspress' );\n\t\t\t}\n\n\t\t\treturn $text;\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\tunset( $existing_columns['author'], $existing_columns['date'] );\n\t\t\t$columns = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'cb'        => '<input type=\"checkbox\" />',\n\t\t\t\t\t'title'     => null,\n\t\t\t\t\t'sp_role'   => esc_attr__( 'Job', 'sportspress' ),\n\t\t\t\t\t'sp_team'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t'sp_league' => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t\t'sp_season' => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t$existing_columns,\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_staff_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_role':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_role' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_team':\n\t\t\t\t\t$teams = (array) get_post_meta( $post_id, 'sp_team', false );\n\t\t\t\t\t$teams = array_filter( $teams );\n\t\t\t\t\tif ( empty( $teams ) ) :\n\t\t\t\t\t\techo '&mdash;';\n\t\t\t\t\telse :\n\t\t\t\t\t\t$current_teams = get_post_meta( $post_id, 'sp_current_team', false );\n\t\t\t\t\t\tforeach ( $teams as $team_id ) :\n\t\t\t\t\t\t\tif ( ! $team_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$team = get_post( $team_id );\n\t\t\t\t\t\t\tif ( $team ) :\n\t\t\t\t\t\t\t\techo esc_html( $team->post_title );\n\t\t\t\t\t\t\t\tif ( in_array( $team_id, $current_teams ) ) :\n\t\t\t\t\t\t\t\t\techo '<span class=\"dashicons dashicons-yes\" title=\"' . esc_attr__( 'Current Team', 'sportspress' ) . '\"></span>';\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_league':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_league' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_season':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_season' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\n\t\t/**\n\t\t * Show a category filter box\n\t\t */\n\t\tpublic function filters() {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow != 'sp_staff' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'post_type'        => 'sp_team',\n\t\t\t\t'name'             => 'team',\n\t\t\t\t'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ),\n\t\t\t\t'selected'         => $selected,\n\t\t\t\t'values'           => 'ID',\n\t\t\t);\n\t\t\twp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\n\t\t\t$selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t'name'            => 'sp_league',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t'name'            => 'sp_season',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\t\t}\n\n\t\t/**\n\t\t * Filter in admin based on options\n\t\t *\n\t\t * @param mixed $query\n\t\t */\n\t\tpublic function filters_query( $query ) {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow == 'sp_staff' ) {\n\n\t\t\t\tif ( ! empty( $_GET['team'] ) ) {\n\t\t\t\t\t$query->query_vars['meta_value'] = sanitize_key( $_GET['team'] );\n\t\t\t\t\t$query->query_vars['meta_key']   = 'sp_team';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Staff();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-statistic.php",
    "content": "<?php\n/**\n * Admin functions for the statistics post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Statistic' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Statistic Class\n\t */\n\tclass SP_Admin_CPT_Statistic extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_statistic';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_statistic_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_statistic_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\t$columns = array(\n\t\t\t\t'cb'             => '<input type=\"checkbox\" />',\n\t\t\t\t'sp_icon'        => esc_attr__( 'Icon', 'sportspress' ),\n\t\t\t\t'title'          => esc_attr__( 'Label', 'sportspress' ),\n\t\t\t\t'sp_key'         => esc_attr__( 'Key', 'sportspress' ),\n\t\t\t\t'sp_equation'    => esc_attr__( 'Equation', 'sportspress' ),\n\t\t\t\t'sp_precision'   => esc_attr__( 'Decimal Places', 'sportspress' ),\n\t\t\t\t'sp_description' => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_statistic_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_icon':\n\t\t\t\t\techo has_post_thumbnail( $post_id ) ? wp_kses_post( edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-fit-mini' ), '', '', $post_id ) ) : '';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_key':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo esc_html( $post->post_name );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_equation':\n\t\t\t\t\techo esc_html( sp_get_post_equation( $post_id ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_precision':\n\t\t\t\t\techo esc_html( sp_get_post_precision( $post_id ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_description':\n\t\t\t\t\tglobal $post;\n\t\t\t\t\techo '<span class=\"description\">' . wp_kses_post( $post->post_excerpt ) . '</span>';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Statistic();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-table.php",
    "content": "<?php\n/**\n * Admin functions for the league tables post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.29\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Table' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Table Class\n\t */\n\tclass SP_Admin_CPT_Table extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_table';\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_table_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_table_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Filtering\n\t\t\tadd_action( 'restrict_manage_posts', array( $this, 'filters' ) );\n\t\t\tadd_filter( 'parse_query', array( $this, 'filters_query' ) );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\tunset( $existing_columns['date'] );\n\t\t\t$columns = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'cb'        => '<input type=\"checkbox\" />',\n\t\t\t\t\t'title'     => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t'sp_league' => esc_attr__( 'League', 'sportspress' ),\n\t\t\t\t\t'sp_season' => esc_attr__( 'Season', 'sportspress' ),\n\t\t\t\t\t'sp_team'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t$existing_columns\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_table_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_league':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_league' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_season':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_season' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_team':\n\t\t\t\t\t$select = get_post_meta( $post_id, 'sp_select', true );\n\t\t\t\t\tif ( 'manual' == $select ) :\n\t\t\t\t\t\t$teams = array_filter( get_post_meta( $post_id, 'sp_team' ) );\n\t\t\t\t\t\techo esc_html( sizeof( $teams ) );\n\t\t\t\t\telse :\n\t\t\t\t\t\tesc_html_e( 'Auto', 'sportspress' );\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\n\t\t/**\n\t\t * Show a category filter box\n\t\t */\n\t\tpublic function filters() {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow != 'sp_table' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t'name'            => 'sp_league',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t'name'            => 'sp_season',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'post_type'        => 'sp_team',\n\t\t\t\t'name'             => 'team',\n\t\t\t\t'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ),\n\t\t\t\t'selected'         => $selected,\n\t\t\t\t'values'           => 'ID',\n\t\t\t);\n\t\t\twp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t}\n\n\t\t/**\n\t\t * Filter in admin based on options\n\t\t *\n\t\t * @param mixed $query\n\t\t */\n\t\tpublic function filters_query( $query ) {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow == 'sp_table' ) {\n\n\t\t\t\tif ( ! empty( $_GET['team'] ) ) {\n\t\t\t\t\t$query->query_vars['meta_value'] = sanitize_key( $_GET['team'] );\n\t\t\t\t\t$query->query_vars['meta_key']   = 'sp_team';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Table();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt-team.php",
    "content": "<?php\n/**\n * Admin functions for the teams post type\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     2.7.27\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) {\n\trequire 'class-sp-admin-cpt.php';\n}\n\nif ( ! class_exists( 'SP_Admin_CPT_Team' ) ) :\n\n\t/**\n\t * SP_Admin_CPT_Team Class\n\t */\n\tclass SP_Admin_CPT_Team extends SP_Admin_CPT {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->type = 'sp_team';\n\n\t\t\t// Post title fields\n\t\t\tadd_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );\n\n\t\t\t// Admin Columns\n\t\t\tadd_filter( 'manage_edit-sp_team_columns', array( $this, 'edit_columns' ) );\n\t\t\tadd_action( 'manage_sp_team_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );\n\n\t\t\t// Filtering\n\t\t\tadd_action( 'restrict_manage_posts', array( $this, 'filters' ) );\n\n\t\t\t// Call SP_Admin_CPT constructor\n\t\t\tparent::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Change title boxes in admin.\n\t\t *\n\t\t * @param  string $text\n\t\t * @param  object $post\n\t\t * @return string\n\t\t */\n\t\tpublic function enter_title_here( $text, $post ) {\n\t\t\tif ( $post->post_type == 'sp_team' ) {\n\t\t\t\treturn esc_attr__( 'Name', 'sportspress' );\n\t\t\t}\n\n\t\t\treturn $text;\n\t\t}\n\n\t\t/**\n\t\t * Change the columns shown in admin.\n\t\t */\n\t\tpublic function edit_columns( $existing_columns ) {\n\t\t\tunset( $existing_columns['author'], $existing_columns['date'] );\n\t\t\t$columns = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'cb'              => '<input type=\"checkbox\" />',\n\t\t\t\t\t'sp_icon'         => '<span class=\"dashicons sp-icon-shield sp-tip\" title=\"' . esc_attr__( 'Logo', 'sportspress' ) . '\"></span>',\n\t\t\t\t\t'title'           => null,\n\t\t\t\t\t'sp_short_name'   => esc_attr__( 'Short Name', 'sportspress' ),\n\t\t\t\t\t'sp_abbreviation' => esc_attr__( 'Abbreviation', 'sportspress' ),\n\t\t\t\t\t'sp_league'       => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t\t'sp_season'       => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t$existing_columns,\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_attr__( 'Team', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn apply_filters( 'sportspress_team_admin_columns', $columns );\n\t\t}\n\n\t\t/**\n\t\t * Define our custom columns shown in admin.\n\t\t *\n\t\t * @param  string $column\n\t\t */\n\t\tpublic function custom_columns( $column, $post_id ) {\n\t\t\tswitch ( $column ) :\n\t\t\t\tcase 'sp_icon':\n\t\t\t\t\tif ( has_post_thumbnail( $post_id ) ) {\n\t\t\t\t\t\t$edit_link = edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-fit-mini' ), '', '', $post_id );\n\t\t\t\t\t\techo $edit_link ? wp_kses_post( $edit_link ) : '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_short_name':\n\t\t\t\t\t$short_name = get_post_meta( $post_id, 'sp_short_name', true );\n\t\t\t\t\techo $short_name ? esc_html( $short_name ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_abbreviation':\n\t\t\t\t\t$abbreviation = get_post_meta( $post_id, 'sp_abbreviation', true );\n\t\t\t\t\techo $abbreviation ? esc_html( $abbreviation ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_league':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_league' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sp_season':\n\t\t\t\t\t$terms = get_the_terms( $post_id, 'sp_season' );\n\t\t\t\t\techo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '&mdash;';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t}\n\n\t\t/**\n\t\t * Show a category filter box\n\t\t */\n\t\tpublic function filters() {\n\t\t\tglobal $typenow, $wp_query;\n\n\t\t\tif ( $typenow != 'sp_team' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t'name'            => 'sp_league',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\n\t\t\t$selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null;\n\t\t\t$args     = array(\n\t\t\t\t'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ),\n\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t'name'            => 'sp_season',\n\t\t\t\t'selected'        => $selected,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Admin_CPT_Team();\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-cpt.php",
    "content": "<?php\n/**\n * Admin functions for post types\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Post_Types\n * @version     0.7\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Admin_CPT' ) ) :\n\n\t/**\n\t * SP_Admin_CPT Class\n\t */\n\tclass SP_Admin_CPT {\n\n\t\tprotected $type = '';\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Insert into X media browser\n\t\t\tadd_filter( 'media_view_strings', array( $this, 'change_insert_into_post' ) );\n\t\t}\n\n\t\t/**\n\t\t * Change label for insert buttons.\n\t\t *\n\t\t * @access   public\n\t\t * @param array $strings\n\t\t * @return array\n\t\t */\n\t\tfunction change_insert_into_post( $strings ) {\n\t\t\tglobal $post_type;\n\n\t\t\tif ( $post_type == $this->type ) {\n\t\t\t\t$obj = get_post_type_object( $this->type );\n\n\t\t\t\t$strings['insertIntoPost']     = sprintf( esc_attr__( 'Insert into %s', 'sportspress' ), $obj->labels->singular_name );\n\t\t\t\t$strings['uploadedToThisPost'] = sprintf( esc_attr__( 'Uploaded to this %s', 'sportspress' ), $obj->labels->singular_name );\n\t\t\t}\n\n\t\t\treturn $strings;\n\t\t}\n\n\t\t/**\n\t\t * Check if we're editing or adding an event\n\t\t *\n\t\t * @return boolean\n\t\t */\n\t\tprivate function is_editing() {\n\t\t\tif ( ! empty( $_GET['post_type'] ) && $this->type == $_GET['post_type'] ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( ! empty( $_GET['post'] ) && $this->type == get_post_type( sanitize_key( $_GET['post'] ) ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( ! empty( $_REQUEST['post_id'] ) && $this->type == get_post_type( sanitize_key( $_REQUEST['post_id'] ) ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\nendif;\n"
  },
  {
    "path": "includes/admin/post-types/class-sp-admin-meta-boxes.php",
    "content": "<?php\n/**\n * SportsPress Meta Boxes\n *\n * Sets up the write panels used by custom post types\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.6.8\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Admin_Meta_Boxes\n */\nclass SP_Admin_Meta_Boxes {\n\n\t/**\n\t * @var array\n\t */\n\tpublic $meta_boxes = null;\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\t$meta_boxes = array(\n\t\t\t'sp_outcome'     => array(\n\t\t\t\t'details' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Outcome_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Outcome_Details::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_result'      => array(\n\t\t\t\t'details'  => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Result_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Result_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'equation' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Equation', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Result_Equation::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Result_Equation::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_performance' => array(\n\t\t\t\t'details'  => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Performance_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Performance_Details::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t\t'equation' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Equation', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Performance_Equation::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Performance_Equation::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_column'      => array(\n\t\t\t\t'details'  => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Column_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Column_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'equation' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Equation', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Column_Equation::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Column_Equation::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_metric'      => array(\n\t\t\t\t'details' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Metric_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Metric_Details::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_statistic'   => array(\n\t\t\t\t'details'  => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Statistic_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Statistic_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'equation' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Equation', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Statistic_Equation::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Statistic_Equation::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_event'       => array(\n\t\t\t\t'shortcode'   => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Shortcodes', 'sportspress' ),\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Event_Shortcode::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'format'      => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Format', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Event_Format::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Event_Format::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'mode'        => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Mode', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Event_Mode::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Event_Mode::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'details'     => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Event_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Event_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'team'        => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Event_Teams::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Event_Teams::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'results'     => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Results', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Event_Results::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Event_Results::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t\t'performance' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Box Score', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Event_Performance::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Event_Performance::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_team'        => array(\n\t\t\t\t'details' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Team_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Team_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'staff'   => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Team_Staff::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Team_Staff::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_player'      => array(\n\t\t\t\t'shortcode'  => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Shortcodes', 'sportspress' ),\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Player_Shortcode::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'columns'    => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Columns', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Player_Columns::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Player_Columns::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'details'    => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Player_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Player_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'metrics'    => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Metrics', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Player_Metrics::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Player_Metrics::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'statistics' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Statistics', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Player_Statistics::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Player_Statistics::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'sp_staff'       => array(\n\t\t\t\t'shortcode' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Shortcode', 'sportspress' ),\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Staff_Shortcode::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'details'   => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Staff_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Staff_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->meta_boxes = apply_filters( 'sportspress_meta_boxes', $meta_boxes );\n\n\t\tforeach ( $this->meta_boxes as $post_type => $meta_boxes ) {\n\t\t\t$i = 0;\n\t\t\tforeach ( $meta_boxes as $id => $meta_box ) {\n\t\t\t\tif ( array_key_exists( 'save', $meta_box ) ) {\n\t\t\t\t\tadd_action( 'sportspress_process_' . $post_type . '_meta', $meta_box['save'], ( $i + 1 ) * 10, 2 );\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\tadd_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 );\n\t\tadd_action( 'add_meta_boxes', array( $this, 'rename_meta_boxes' ), 20 );\n\t\tadd_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 30 );\n\t\tadd_action( 'save_post', array( $this, 'save_meta_boxes' ), 1, 2 );\n\t}\n\n\t/**\n\t * Add SP Meta boxes\n\t */\n\tpublic function add_meta_boxes() {\n\t\tforeach ( $this->meta_boxes as $post_type => $meta_boxes ) {\n\t\t\tforeach ( $meta_boxes as $id => $meta_box ) {\n\t\t\t\tif ( array_key_exists( 'output', $meta_box ) ) {\n\t\t\t\t\tadd_meta_box( 'sp_' . $id . 'div', $meta_box['title'], $meta_box['output'], $post_type, $meta_box['context'], $meta_box['priority'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Remove bloat\n\t */\n\tpublic function remove_meta_boxes() {\n\n\t\t// Events\n\t\tremove_meta_box( 'sp_venuediv', 'sp_event', 'side' );\n\t\tremove_meta_box( 'sp_leaguediv', 'sp_event', 'side' );\n\t\tremove_meta_box( 'sp_seasondiv', 'sp_event', 'side' );\n\n\t\t// Teams\n\t\tremove_meta_box( 'sp_leaguediv', 'sp_team', 'side' );\n\t\tremove_meta_box( 'sp_seasondiv', 'sp_team', 'side' );\n\t\tremove_meta_box( 'sp_venuediv', 'sp_team', 'side' );\n\n\t\t// Players\n\t\tremove_meta_box( 'sp_seasondiv', 'sp_player', 'side' );\n\t\tremove_meta_box( 'sp_leaguediv', 'sp_player', 'side' );\n\t\tremove_meta_box( 'sp_positiondiv', 'sp_player', 'side' );\n\n\t\t// Staff\n\t\tremove_meta_box( 'sp_rolediv', 'sp_staff', 'side' );\n\t\tremove_meta_box( 'sp_seasondiv', 'sp_staff', 'side' );\n\t\tremove_meta_box( 'sp_leaguediv', 'sp_staff', 'side' );\n\t}\n\n\t/**\n\t * Rename core meta boxes\n\t */\n\tpublic function rename_meta_boxes() {\n\t\tremove_meta_box( 'submitdiv', 'sp_event', 'side' );\n\t\tadd_meta_box( 'submitdiv', esc_attr__( 'Event', 'sportspress' ), 'post_submit_meta_box', 'sp_event', 'side', 'high' );\n\n\t\tremove_meta_box( 'postimagediv', 'sp_team', 'side' );\n\t\tadd_meta_box( 'postimagediv', esc_attr__( 'Logo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_team', 'side', 'low' );\n\n\t\tremove_meta_box( 'postimagediv', 'sp_player', 'side' );\n\t\tadd_meta_box( 'postimagediv', esc_attr__( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_player', 'side', 'low' );\n\n\t\tremove_meta_box( 'postimagediv', 'sp_staff', 'side' );\n\t\tadd_meta_box( 'postimagediv', esc_attr__( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_staff', 'side', 'low' );\n\n\t\tremove_meta_box( 'postimagediv', 'sp_performance', 'side' );\n\t\tadd_meta_box( 'postimagediv', esc_attr__( 'Icon', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_performance', 'side', 'low' );\n\n\t\tremove_meta_box( 'postimagediv', 'sp_statistic', 'side' );\n\t\tadd_meta_box( 'postimagediv', esc_attr__( 'Icon', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_statistic', 'side', 'low' );\n\t}\n\n\t/**\n\t * Check if we're saving, then trigger an action based on the post type\n\t *\n\t * @param  int    $post_id\n\t * @param  object $post\n\t */\n\tpublic function save_meta_boxes( $post_id, $post ) {\n\t\tif ( empty( $post_id ) || empty( $post ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( is_int( wp_is_post_revision( $post ) ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( is_int( wp_is_post_autosave( $post ) ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( empty( $_POST['sportspress_meta_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['sportspress_meta_nonce'] ), 'sportspress_save_data' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! is_sp_post_type( $post->post_type ) && ! is_sp_config_type( $post->post_type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdo_action( 'sportspress_process_' . $post->post_type . '_meta', $post_id, $post );\n\t}\n\n}\n\nnew SP_Admin_Meta_Boxes();\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php",
    "content": "<?php\n/**\n * Calendar Columns\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Calendar_Columns\n */\nclass SP_Meta_Box_Calendar_Columns {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$selected     = (array) get_post_meta( $post->ID, 'sp_columns', true );\n\t\t$title_format = get_option( 'sportspress_event_list_title_format', 'title' );\n\t\t$time_format  = get_option( 'sportspress_event_list_time_format', 'combined' );\n\n\t\tif ( is_array( $selected ) ) {\n\t\t\t$selected = array_filter( $selected );\n\t\t}\n\n\t\t$columns = array();\n\n\t\tif ( 'teams' === $title_format ) {\n\t\t\t$columns['event'] = esc_attr__( 'Home', 'sportspress' ) . ' | ' . esc_attr__( 'Away', 'sportspress' );\n\t\t} elseif ( 'homeaway' === $title_format ) {\n\t\t\t$columns['event'] = esc_attr__( 'Teams', 'sportspress' );\n\t\t} else {\n\t\t\t$columns['event'] = esc_attr__( 'Title', 'sportspress' );\n\t\t}\n\n\t\tif ( 'time' === $time_format || 'separate' === $time_format ) {\n\t\t\t$columns['time'] = esc_attr__( 'Time', 'sportspress' );\n\t\t} elseif ( 'combined' === $time_format ) {\n\t\t\t$columns['time'] = esc_attr__( 'Time/Results', 'sportspress' );\n\t\t}\n\n\t\tif ( 'results' === $time_format || 'separate' === $time_format ) {\n\t\t\t$columns['results'] = esc_attr__( 'Results', 'sportspress' );\n\t\t}\n\n\t\t$columns['league']  = esc_attr__( 'League', 'sportspress' );\n\t\t$columns['season']  = esc_attr__( 'Season', 'sportspress' );\n\t\t$columns['venue']   = esc_attr__( 'Venue', 'sportspress' );\n\t\t$columns['article'] = esc_attr__( 'Article', 'sportspress' );\n\t\t$columns['day']     = esc_attr__( 'Match Day', 'sportspress' );\n\n\t\t$columns = apply_filters( 'sportspress_calendar_columns', $columns );\n\t\t?>\n\t\t<div class=\"sp-instance\">\n\t\t\t<ul class=\"categorychecklist form-no-clear\">\n\t\t\t<?php\n\t\t\tforeach ( $columns as $key => $label ) {\n\t\t\t\t?>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_columns[]\" value=\"<?php echo esc_attr( $key ); ?>\" id=\"sp_columns_<?php echo esc_attr( $key ); ?>\" <?php checked( ! is_array( $selected ) || in_array( $key, $selected ) ); ?>>\n\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php",
    "content": "<?php\n/**\n * Calendar Events\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Calendar_Data\n */\nclass SP_Meta_Box_Calendar_Data {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$calendar   = new SP_Calendar( $post );\n\t\t$data       = $calendar->data();\n\t\t$usecolumns = $calendar->columns;\n\t\tself::table( $data, $usecolumns );\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'text' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $data = array(), $usecolumns = null ) {\n\t\t$title_format = get_option( 'sportspress_event_list_title_format', 'title' );\n\t\t$time_format  = get_option( 'sportspress_event_list_time_format', 'combined' );\n\n\t\tif ( is_array( $usecolumns ) ) {\n\t\t\t$usecolumns = array_filter( $usecolumns );\n\t\t} else {\n\t\t\t$usecolumns = array();\n\t\t}\n\t\t?>\n\t\t<div class=\"sp-data-table-container\">\n\t\t\t<table class=\"widefat sp-data-table sp-calendar-table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"column-date\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Date', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'event', $usecolumns ) ) { ?>\n\t\t\t\t\t\t<th class=\"column-event\">\n\t\t\t\t\t\t\t<label for=\"sp_columns_event\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( 'teams' == $title_format ) {\n\t\t\t\t\t\t\t\t\tesc_attr_e( 'Home', 'sportspress' );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t | \n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tesc_attr_e( 'Away', 'sportspress' );\n\t\t\t\t\t\t\t\t} elseif ( 'homeaway' == $title_format ) {\n\t\t\t\t\t\t\t\t\tesc_attr_e( 'Teams', 'sportspress' );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tesc_attr_e( 'Title', 'sportspress' );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php if ( ( is_array( $usecolumns ) && in_array( 'time', $usecolumns ) ) && in_array( $time_format, array( 'combined', 'separate', 'time' ) ) ) { ?>\n\t\t\t\t\t\t\t<th class=\"column-time\">\n\t\t\t\t\t\t\t\t<label for=\"sp_columns_time\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( 'time' == $time_format || 'separate' == $time_format ) {\n\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Time', 'sportspress' );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Time/Results', 'sportspress' );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php if ( ( is_array( $usecolumns ) && in_array( 'results', $usecolumns ) ) && in_array( $time_format, array( 'separate', 'results' ) ) ) { ?>\n\t\t\t\t\t\t\t<th class=\"column-results\">\n\t\t\t\t\t\t\t\t<label for=\"sp_columns_results\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'Results', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'league', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t<th class=\"column-league\">\n\t\t\t\t\t\t\t\t<label for=\"sp_columns_league\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'League', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'season', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t<th class=\"column-season\">\n\t\t\t\t\t\t\t\t<label for=\"sp_columns_season\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'Season', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'venue', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t<th class=\"column-venue\">\n\t\t\t\t\t\t\t\t<label for=\"sp_columns_venue\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'Venue', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'article', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t<th class=\"column-article\">\n\t\t\t\t\t\t\t\t<label for=\"sp_columns_article\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'Article', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'day', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t<th class=\"column-day\">\n\t\t\t\t\t\t\t\t<label for=\"sp_columns_day\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'Match Day', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php do_action( 'sportspress_calendar_data_meta_box_table_head_row', $usecolumns ); ?>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $data ) ) :\n\t\t\t\t\t\tif ( sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t\t$main_result = get_option( 'sportspress_primary_result', null );\n\t\t\t\t\t\t\t$i           = 0;\n\t\t\t\t\t\t\tforeach ( $data as $event ) :\n\t\t\t\t\t\t\t\t$teams        = get_post_meta( $event->ID, 'sp_team' );\n\t\t\t\t\t\t\t\t$results      = get_post_meta( $event->ID, 'sp_results', true );\n\t\t\t\t\t\t\t\t$video        = get_post_meta( $event->ID, 'sp_video', true );\n\t\t\t\t\t\t\t\t$main_results = array();\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t\t<td><?php echo esc_attr( get_post_time( get_option( 'date_format' ), false, $event, true ) ); ?></td>\n\t\t\t\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'event', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"sp-title-format sp-title-format-title\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\tif ( $title_format && $title_format != 'title' ) :\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t hidden<?php endif; ?>\"><?php echo esc_html( $event->post_title ); ?></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"sp-title-format sp-title-format-teams sp-title-format-homeaway\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\tif ( ! in_array( $title_format, array( 'teams', 'homeaway' ) ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\tif ( $teams ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $teams as $team ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$name = get_the_title( $team );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $name ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team_results = sp_array_value( $results, $team, null );\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $main_result ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team_result = sp_array_value( $team_results, $main_result, null );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( is_array( $team_results ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend( $team_results );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team_result = prev( $team_results );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team_result = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $team_result != null ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team_result    = apply_filters( 'sportspress_calendar_team_result_admin', $team_result, $event->ID, $team );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$main_results[] = $team_result;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tunset( $team_results['outcome'] );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team_results = implode( ' | ', $team_results );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<a class=\"result sp-tip\" title=\"' . esc_attr( $team_results ) . '\" href=\"' . esc_url( get_edit_post_link( $event->ID ) ) . '\">' . esc_attr( $team_result ) . '</a> ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_html( $name ) . '<br>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\tendforeach; else :\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '&mdash;';\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php if ( ( is_array( $usecolumns ) && in_array( 'time', $usecolumns ) ) && in_array( $time_format, array( 'combined', 'separate', 'time' ) ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t<?php if ( 'time' == $time_format || 'separate' == $time_format ) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php echo wp_kses_post( apply_filters( 'sportspress_event_time_admin', get_post_time( get_option( 'time_format' ), false, $event, true ), $event->ID ) ); ?>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\tif ( ! empty( $main_results ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\techo wp_kses_post( implode( ' - ', $main_results ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo wp_kses_post( apply_filters( 'sportspress_event_time_admin', get_post_time( get_option( 'time_format' ), false, $event, true ), $event->ID ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php if ( ( is_array( $usecolumns ) && in_array( 'results', $usecolumns ) ) && in_array( $time_format, array( 'separate', 'results' ) ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\tif ( ! empty( $main_results ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\techo wp_kses_post( implode( ' - ', $main_results ) );\n\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '-';\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'league', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t<td><?php the_terms( $event->ID, 'sp_league' ); ?></td>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'season', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t<td><?php the_terms( $event->ID, 'sp_season' ); ?></td>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'venue', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t<td><?php the_terms( $event->ID, 'sp_venue' ); ?></td>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'article', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_edit_post_link( $event->ID ) ); ?>#sp_articlediv\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $video ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"dashicons dashicons-video-alt\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php elseif ( has_post_thumbnail( $event->ID ) ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"dashicons dashicons-camera\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\tif ( $event->post_content == null ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'None', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\t\t\telseif ( $event->post_status == 'publish' ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Recap', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Preview', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php if ( is_array( $usecolumns ) && in_array( 'day', $usecolumns ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t$day = get_post_meta( $event->ID, 'sp_day', true );\n\t\t\t\t\t\t\t\t\t\t\tif ( '' == $day ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '&mdash;';\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\techo esc_html( $day );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<?php do_action( 'sportspress_calendar_data_meta_box_table_row', $event, $usecolumns ); ?>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"<?php echo esc_attr( sizeof( $usecolumns ) ); ?>\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'No results found.', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\tendif;\n\t\t\t\t\telse :\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t<td colspan=\"<?php echo esc_attr( sizeof( $usecolumns ) ); ?>\">\n\t\t\t\t\t\t\t<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Details', 'sportspress' ) ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php",
    "content": "<?php\n/**\n * Calendar Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Calendar_Details\n */\nclass SP_Meta_Box_Calendar_Details {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$taxonomies    = get_object_taxonomies( 'sp_calendar' );\n\t\t$caption       = get_post_meta( $post->ID, 'sp_caption', true );\n\t\t$status        = get_post_meta( $post->ID, 'sp_status', true );\n\t\t$date          = get_post_meta( $post->ID, 'sp_date', true );\n\t\t$date_from     = get_post_meta( $post->ID, 'sp_date_from', true );\n\t\t$date_to       = get_post_meta( $post->ID, 'sp_date_to', true );\n\t\t$date_past     = get_post_meta( $post->ID, 'sp_date_past', true );\n\t\t$date_future   = get_post_meta( $post->ID, 'sp_date_future', true );\n\t\t$date_relative = get_post_meta( $post->ID, 'sp_date_relative', true );\n\t\t$event_format  = get_post_meta( $post->ID, 'sp_event_format', true );\n\t\t$day           = get_post_meta( $post->ID, 'sp_day', true );\n\t\t$teams         = get_post_meta( $post->ID, 'sp_team', false );\n\t\t$players       = get_post_meta( $post->ID, 'sp_player', false );\n\t\t$table_id      = get_post_meta( $post->ID, 'sp_table', true );\n\t\t$orderby       = get_post_meta( $post->ID, 'sp_orderby', true );\n\t\t$order         = get_post_meta( $post->ID, 'sp_order', true );\n\t\t?>\n\t\t<div>\n\t\t\t<p><strong><?php esc_attr_e( 'Heading', 'sportspress' ); ?></strong></p>\n\t\t\t<p><input type=\"text\" id=\"sp_caption\" name=\"sp_caption\" value=\"<?php echo esc_attr( $caption ); ?>\" placeholder=\"<?php echo esc_attr( get_the_title() ); ?>\"></p>\n\n\t\t\t<p><strong><?php esc_attr_e( 'Status', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'name'     => 'sp_status',\n\t\t\t\t\t'id'       => 'sp_status',\n\t\t\t\t\t'selected' => $status,\n\t\t\t\t);\n\t\t\t\tsp_dropdown_statuses( $args );\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Event Format', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<select name=\"sp_event_format\" class=\"postform\">\n\t\t\t\t\t<option value=\"all\">All</option>\n\t\t\t\t\t<?php foreach ( SP()->formats->event as $key => $format ) : ?>\n\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\" <?php selected( $event_format, $key ); ?>><?php echo esc_html( $format ); ?></option>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<div class=\"sp-date-selector\">\n\t\t\t\t<p><strong><?php esc_attr_e( 'Date', 'sportspress' ); ?></strong></p>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name'     => 'sp_date',\n\t\t\t\t\t\t'id'       => 'sp_date',\n\t\t\t\t\t\t'selected' => $date,\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<div class=\"sp-date-range\">\n\t\t\t\t\t<p class=\"sp-date-range-absolute\">\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-from\" name=\"sp_date_from\" value=\"<?php echo $date_from ? esc_attr( $date_from ) : esc_attr( date_i18n( 'Y-m-d' ) ); ?>\" size=\"10\">\n\t\t\t\t\t\t:\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-to\" name=\"sp_date_to\" value=\"<?php echo $date_to ? esc_attr( $date_to ) : esc_attr( date_i18n( 'Y-m-d' ) ); ?>\" size=\"10\">\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-range-relative\">\n\t\t\t\t\t\t<?php esc_attr_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"sp_date_past\" value=\"<?php echo '' !== $date_past ? esc_attr( $date_past ) : 7; ?>\">\n\t\t\t\t\t\t<?php esc_attr_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t\t&rarr;\n\t\t\t\t\t\t<?php esc_attr_e( 'Next', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"sp_date_future\" value=\"<?php echo '' !== $date_future ? esc_attr( $date_future ) : 7; ?>\">\n\t\t\t\t\t\t<?php esc_attr_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_date_relative\" value=\"1\" id=\"sp_date_relative\" <?php checked( $date_relative ); ?>>\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"sp-event-day-field\">\n\t\t\t\t<p><strong><?php esc_attr_e( 'Match Day', 'sportspress' ); ?></strong></p>\n\t\t\t\t<p>\n\t\t\t\t\t<input name=\"sp_day\" type=\"text\" class=\"medium-text\" placeholder=\"<?php esc_attr_e( 'All', 'sportspress' ); ?>\" value=\"<?php echo esc_attr( $day ); ?>\">\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\tsp_taxonomy_field( $taxonomy, $post, true );\n\t\t\t}\n\t\t\t?>\n\t\t\t<p><strong><?php esc_attr_e( 'Team', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t'name'        => 'sp_team[]',\n\t\t\t\t\t'selected'    => $teams,\n\t\t\t\t\t'values'      => 'ID',\n\t\t\t\t\t'class'       => 'widefat',\n\t\t\t\t\t'property'    => 'multiple',\n\t\t\t\t\t'chosen'      => true,\n\t\t\t\t\t'placeholder' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t);\n\t\t\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\t\t\tsp_post_adder( 'sp_team', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\tendif;\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Player', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type'   => 'sp_player',\n\t\t\t\t\t'name'        => 'sp_player[]',\n\t\t\t\t\t'selected'    => $players,\n\t\t\t\t\t'values'      => 'ID',\n\t\t\t\t\t'class'       => 'widefat',\n\t\t\t\t\t'property'    => 'multiple',\n\t\t\t\t\t'chosen'      => true,\n\t\t\t\t\t'placeholder' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t);\n\t\t\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\t\t\tsp_post_adder( 'sp_player', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\tendif;\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Sort by', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<select name=\"sp_orderby\">\n\t\t\t\t\t<option value=\"date\" <?php selected( 'date', $orderby ); ?>><?php esc_attr_e( 'Date', 'sportspress' ); ?></option>\n\t\t\t\t\t<option value=\"day\" <?php selected( 'day', $orderby ); ?>><?php esc_attr_e( 'Match Day', 'sportspress' ); ?></option>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Sort Order', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<select name=\"sp_order\">\n\t\t\t\t\t<option value=\"ASC\" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t\t\t<option value=\"DESC\" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_caption', sp_array_value( $_POST, 'sp_caption', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_status', sp_array_value( $_POST, 'sp_status', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_event_format', sp_array_value( $_POST, 'sp_event_format', 0, 'key' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_past', sp_array_value( $_POST, 'sp_date_past', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_future', sp_array_value( $_POST, 'sp_date_future', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_relative', sp_array_value( $_POST, 'sp_date_relative', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_day', sp_array_value( $_POST, 'sp_day', null, 'text' ) );\n\t\t$tax_input = sp_array_value( $_POST, 'tax_input', array() );\n\t\tupdate_post_meta( $post_id, 'sp_main_league', in_array( 'auto', sp_array_value( $tax_input, 'sp_league' ) ) );\n\t\tupdate_post_meta( $post_id, 'sp_current_season', in_array( 'auto', sp_array_value( $tax_input, 'sp_season' ) ) );\n\t\tupdate_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', null, 'key' ) );\n\t\tupdate_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', null, 'text' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array(), 'int' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array(), 'int' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-feeds.php",
    "content": "<?php\n/**\n * Calendar Feeds\n *\n * Based on a tutorial by Steve Thomas.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Calendar_Feeds\n */\nclass SP_Meta_Box_Calendar_Feeds {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$feeds          = new SP_Feeds();\n\t\t$calendar_feeds = $feeds->calendar;\n\t\t?>\n\t\t<div>\n\t\t\t<?php foreach ( $calendar_feeds as $slug => $formats ) { ?>\n\t\t\t\t<?php $link = add_query_arg( 'feed', 'sp-' . $slug, untrailingslashit( get_post_permalink( $post ) ) ); ?>\n\t\t\t\t<?php foreach ( $formats as $format ) { ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$protocol = sp_array_value( $format, 'protocol' );\n\t\t\t\t\tif ( $protocol ) {\n\t\t\t\t\t\t$feed = str_replace( array( 'http:', 'https:' ), 'webcal:', $link );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$feed = $link;\n\t\t\t\t\t}\n\t\t\t\t\t$prefix = sp_array_value( $format, 'prefix' );\n\t\t\t\t\tif ( $prefix ) {\n\t\t\t\t\t\t$feed = $prefix . urlencode( $feed );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<strong><?php echo esc_html( sp_array_value( $format, 'name' ) ); ?></strong>\n\t\t\t\t\t\t<a class=\"sp-link\" href=\"<?php echo esc_attr( $feed ); ?>\" target=\"_blank\" title=\"<?php esc_attr_e( 'Link', 'sportspress' ); ?>\"></a>\n\t\t\t\t\t</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<input type=\"text\" value=\"<?php echo esc_attr( $feed ); ?>\" readonly=\"readonly\" class=\"code widefat\">\n\t\t\t\t\t</p>\n\t\t\t\t<?php } ?>\n\t\t\t<?php } ?>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-format.php",
    "content": "<?php\n/**\n * Calendar Format\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Calendar_Format\n */\nclass SP_Meta_Box_Calendar_Format {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$the_format = get_post_meta( $post->ID, 'sp_format', true );\n\t\t?>\n\t\t<div id=\"post-formats-select\">\n\t\t\t<?php foreach ( SP()->formats->calendar as $key => $format ) : ?>\n\t\t\t\t<input type=\"radio\" name=\"sp_format\" class=\"post-format\" id=\"post-format-<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( true, ( $key == 'calendar' && ! $the_format ) || $the_format == $key ); ?>> <label for=\"post-format-<?php echo esc_attr( $key ); ?>\" class=\"post-format-icon post-format-<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $format ); ?></label><br>\n\t\t\t<?php endforeach; ?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'calendar', 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-shortcode.php",
    "content": "<?php\n/**\n * Calendar Shortcode\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     1.6.1\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Calendar_Shortcode\n */\nclass SP_Meta_Box_Calendar_Shortcode {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$the_format = get_post_meta( $post->ID, 'sp_format', true );\n\t\tif ( ! $the_format ) {\n\t\t\t$the_format = 'calendar';\n\t\t}\n\t\t?>\n\t\t<p class=\"howto\">\n\t\t\t<?php esc_attr_e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?>\n\t\t</p>\n\t\t<p><input type=\"text\" value=\"<?php sp_shortcode_template( 'event_' . $the_format, $post->ID ); ?>\" readonly=\"readonly\" class=\"code widefat\"></p>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php",
    "content": "<?php\n/**\n * Column Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Config' ) ) {\n\trequire 'class-sp-meta-box-config.php';\n}\n\n/**\n * SP_Meta_Box_Column_Details\n */\nclass SP_Meta_Box_Column_Details extends SP_Meta_Box_Config {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$equation  = explode( ' ', get_post_meta( $post->ID, 'sp_equation', true ) );\n\t\t$order     = get_post_meta( $post->ID, 'sp_order', true );\n\t\t$priority  = get_post_meta( $post->ID, 'sp_priority', true );\n\t\t$precision = get_post_meta( $post->ID, 'sp_precision', true );\n\n\t\t// Defaults\n\t\tif ( $precision == '' ) {\n\t\t\t$precision = 0;\n\t\t}\n\t\t?>\n\t\t<p><strong><?php esc_html_e( 'Key', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_default_key\" type=\"hidden\" id=\"sp_default_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t\t<input name=\"sp_key\" type=\"text\" id=\"sp_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t</p>\n\t\t<p><strong><?php esc_html_e( 'Decimal Places', 'sportspress' ); ?></strong></p>\n\t\t<p class=\"sp-precision-selector\">\n\t\t\t<input name=\"sp_precision\" type=\"text\" size=\"4\" id=\"sp_precision\" value=\"<?php echo esc_attr( $precision ); ?>\" placeholder=\"0\">\n\t\t</p>\n\t\t<p><strong><?php esc_html_e( 'Sort Order', 'sportspress' ); ?></strong></p>\n\t\t<p class=\"sp-order-selector\">\n\t\t\t<select name=\"sp_priority\">\n\t\t\t\t<?php\n\t\t\t\t$options = array( '0' => esc_attr__( 'Disable', 'sportspress' ) );\n\t\t\t\t$count   = wp_count_posts( 'sp_column' );\n\t\t\t\tfor ( $i = 1; $i <= $count->publish; $i++ ) :\n\t\t\t\t\t$options[ $i ] = $i;\n\t\t\t\tendfor;\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( true, $key == $priority, false ), esc_html( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t\t<select name=\"sp_order\">\n\t\t\t\t<?php\n\t\t\t\t$options = array(\n\t\t\t\t\t'DESC' => esc_attr__( 'Descending', 'sportspress' ),\n\t\t\t\t\t'ASC'  => esc_attr__( 'Ascending', 'sportspress' ),\n\t\t\t\t);\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( true, $key == $order, false ), esc_html( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tself::delete_duplicate( $_POST );\n\t\tupdate_post_meta( $post_id, 'sp_precision', (int) sp_array_value( $_POST, 'sp_precision', 1, 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_priority', sp_array_value( $_POST, 'sp_priority', '0', 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', 'DESC', 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-column-equation.php",
    "content": "<?php\n/**\n * Column Equation\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     1.9.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Equation' ) ) {\n\trequire 'class-sp-meta-box-equation.php';\n}\n\n/**\n * SP_Meta_Box_Column_Equation\n */\nclass SP_Meta_Box_Column_Equation extends SP_Meta_Box_Equation {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$equation = get_post_meta( $post->ID, 'sp_equation', true );\n\t\tself::builder( $post->post_title, $equation, array( 'team_event', 'outcome', 'result', 'subset', 'preset' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-config.php",
    "content": "<?php\n/**\n * Config type meta box functions\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     1.0\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Config\n */\nclass SP_Meta_Box_Config {\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tself::delete_duplicate( $_POST );\n\t}\n\n\tpublic static function delete_duplicate( &$post ) {\n\t\tglobal $wpdb;\n\n\t\t$key = isset( $post['sp_key'] ) ? $post['sp_key'] : null;\n\t\tif ( ! $key ) {\n\t\t\t$key = $post['post_title'];\n\t\t}\n\t\t$id    = sp_array_value( $post, 'post_ID', 'var' );\n\t\t$title = sp_get_eos_safe_slug( $key, $id );\n\n\t\t$check_sql       = \"SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1\";\n\t\t$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $title, $post['post_type'], $id ) );\n\n\t\tif ( $post_name_check ) :\n\t\t\twp_delete_post( $post_name_check, true );\n\t\t\t$post['post_status'] = 'draft';\n\t\tendif;\n\n\t\treturn $post_name_check;\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php",
    "content": "<?php\n/**\n * Equation meta box functions\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Equation\n */\nclass SP_Meta_Box_Equation {\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_equation', implode( ' ', sp_array_value( $_POST, 'sp_equation', array() ) ) );\n\t}\n\n\tpublic static function builder( $title = 'f(x)', $equation = '', $groups = array() ) {\n\t\tif ( $title == '' ) {\n\t\t\t$title = 'f(x)';\n\t\t}\n\t\t$options = array(); // Multidimensional equation part options\n\t\t$parts   = array(); // Flattened equation part options\n\n\t\t// Add groups to options\n\t\tforeach ( $groups as $group ) :\n\t\t\tswitch ( $group ) :\n\t\t\t\tcase 'player_event':\n\t\t\t\t\t$options['Events'] = array(\n\t\t\t\t\t\t'$eventsattended' => esc_attr__( 'Attended', 'sportspress' ),\n\t\t\t\t\t\t'$eventsplayed'   => esc_attr__( 'Played', 'sportspress' ),\n\t\t\t\t\t\t'$eventsstarted'  => esc_attr__( 'Started', 'sportspress' ),\n\t\t\t\t\t\t'$eventssubbed'   => esc_attr__( 'Substituted', 'sportspress' ),\n\t\t\t\t\t\t'$eventminutes'   => esc_attr__( 'Minutes', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'team_event':\n\t\t\t\t\t$options['Events'] = array(\n\t\t\t\t\t\t'$eventsplayed' => esc_attr__( 'Played', 'sportspress' ),\n\t\t\t\t\t\t'$eventminutes' => esc_attr__( 'Minutes', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'result':\n\t\t\t\t\t$options['Results'] = self::optgroup(\n\t\t\t\t\t\t'sp_result',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'for'     => '(' . esc_attr__( 'for', 'sportspress' ) . ')',\n\t\t\t\t\t\t\t'against' => '(' . esc_attr__(\n\t\t\t\t\t\t\t\t'against',\n\t\t\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t\t\t) . ')',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'outcome':\n\t\t\t\t\t$options['Outcomes'] = self::optgroup( 'sp_outcome' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'preset':\n\t\t\t\t\t$options['Presets'] = array(\n\t\t\t\t\t\t'$gamesback'  => esc_attr__( 'Games Back', 'sportspress' ),\n\t\t\t\t\t\t'$homerecord' => esc_attr__( 'Home Record', 'sportspress' ),\n\t\t\t\t\t\t'$awayrecord' => esc_attr__( 'Away Record', 'sportspress' ),\n\t\t\t\t\t\t'$streak'     => esc_attr__( 'Streak', 'sportspress' ),\n\t\t\t\t\t\t'$form'       => esc_attr__( 'Form', 'sportspress' ),\n\t\t\t\t\t\t'$last5'      => esc_attr__( 'Last 5', 'sportspress' ),\n\t\t\t\t\t\t'$last10'     => esc_attr__( 'Last 10', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'subset':\n\t\t\t\t\t$options['Subsets'] = array(\n\t\t\t\t\t\t'_home'  => '@' . esc_attr__( 'Home', 'sportspress' ),\n\t\t\t\t\t\t'_away'  => '@' . esc_attr__( 'Away', 'sportspress' ),\n\t\t\t\t\t\t'_venue' => '@' . esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'performance':\n\t\t\t\t\t$options['Performance'] = self::optgroup( 'sp_performance' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'metric':\n\t\t\t\t\t$options['Metrics'] = self::optgroup( 'sp_metric' );\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\tendforeach;\n\n\t\t// Add operators to options\n\t\t$options['Operators'] = array(\n\t\t\t'+' => '&#43;',\n\t\t\t'-' => '&minus;',\n\t\t\t'*' => '&times;',\n\t\t\t'/' => '&divide;',\n\t\t\t'(' => '(',\n\t\t\t')' => ')',\n\t\t);\n\n\t\t// Create array of constants\n\t\t$max       = 10;\n\t\t$constants = array();\n\t\tfor ( $i = 0; $i <= $max; $i ++ ) :\n\t\t\t$constants[ $i ] = $i;\n\t\tendfor;\n\n\t\t// Add 100 to constants\n\t\t$constants[100] = 100;\n\n\t\t// Add constants to options\n\t\t$options['Constants'] = (array) $constants;\n\n\t\t$options = apply_filters( 'sportspress_equation_options', $options );\n\t\t?>\n\t\t<div class=\"sp-equation-builder\">\n\t\t\t<div class=\"sp-data-table-container sp-equation-parts\">\n\t\t\t\t<table class=\"widefat sp-data-table\">\n\t\t\t\t\t<?php $i = 0; foreach ( $options as $label => $option ) : ?>\n\t\t\t\t\t\t<tr\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $i % 2 == 0 ) :\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t class=\"alternate\"<?php endif; ?>>\n\t\t\t\t\t\t\t<th><?php esc_attr_e( $label, 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $option as $key => $value ) :\n\t\t\t\t\t\t\t\t\t$parts[ $key ] = $value;\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<span class=\"button\" data-variable=\"<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $value ); ?></span>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$i++;\nendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div class=\"sp-equation\">\n\t\t\t\t<span class=\"sp-equation-variable\"><?php echo esc_html( $title ); ?> = </span>\n\t\t\t\t<span class=\"sp-equation-formula\">\n\t\t\t\t<?php\n\t\t\t\t\t$equation = trim( $equation );\n\t\t\t\tif ( $equation !== '' ) :\n\t\t\t\t\t$equation = explode( ' ', $equation );\n\t\t\t\t\tforeach ( $equation as $part ) :\n\t\t\t\t\t\tif ( array_key_exists( $part, $parts ) ) {\n\t\t\t\t\t\t\t$name = $parts[ $part ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$name = $part;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<span class=\"button\"><?php echo esc_html( $name ); ?><span class=\"remove\">&times;</span><input type=\"hidden\" name=\"sp_equation[]\" value=\"<?php echo esc_attr( $part ); ?>\"></span>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\tendforeach;\n\t\t\t\t\tendif;\n\t\t\t\t?>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}\n\n\tpublic static function optgroup( $type = null, $variations = null, $defaults = null, $totals = true ) {\n\t\t$arr = array();\n\n\t\t// Get posts\n\t\t$args = array(\n\t\t\t'post_type'      => $type,\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t\t'meta_query'     => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t'value'   => 'number',\n\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t'value'   => array( 'equation', 'text' ),\n\t\t\t\t\t'compare' => 'NOT IN',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$vars = get_posts( $args );\n\n\t\t// Add extra vars to the array\n\t\tif ( isset( $defaults ) && is_array( $defaults ) ) :\n\t\t\tforeach ( $defaults as $key => $value ) :\n\t\t\t\t$arr[ $key ] = $value;\n\t\t\tendforeach;\n\t\tendif;\n\n\t\t// Add vars to the array\n\t\tif ( isset( $variations ) && is_array( $variations ) ) :\n\t\t\tforeach ( $vars as $var ) :\n\t\t\t\tif ( $totals ) {\n\t\t\t\t\t$arr[ '$' . $var->post_name ] = $var->post_title;\n\t\t\t\t}\n\t\t\t\tforeach ( $variations as $key => $value ) :\n\t\t\t\t\t$arr[ '$' . $var->post_name . $key ] = $var->post_title . ' ' . $value;\n\t\t\t\tendforeach;\n\t\t\tendforeach;\n\t\telse :\n\t\t\tforeach ( $vars as $var ) :\n\t\t\t\t$arr[ '$' . $var->post_name ] = $var->post_title;\n\t\t\tendforeach;\n\t\tendif;\n\n\t\treturn (array) $arr;\n\t}\n\n\t/**\n\t * Equation part labels for localization\n\t *\n\t * @return null\n\t */\n\tpublic static function equation_part_labels() {\n\t\t__( 'Presets', 'sportspress' );\n\t\t__( 'Operators', 'sportspress' );\n\t\t__( 'Subsets', 'sportspress' );\n\t\t__( 'Constants', 'sportspress' );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php",
    "content": "<?php\n/**\n * Event Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Details\n */\nclass SP_Meta_Box_Event_Details {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$day        = get_post_meta( $post->ID, 'sp_day', true );\n\t\t$taxonomies = get_object_taxonomies( 'sp_event' );\n\t\t$minutes    = get_post_meta( $post->ID, 'sp_minutes', true );\n\t\t?>\n\t\t<?php do_action( 'sportspress_event_details_meta_box', $post ); ?>\n\t\t<div class=\"sp-event-day-field\">\n\t\t\t<p><strong><?php esc_attr_e( 'Match Day', 'sportspress' ); ?></strong> <span class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Optional', 'sportspress' ); ?>\"></span></p>\n\t\t\t<p>\n\t\t\t\t<input name=\"sp_day\" type=\"text\" class=\"medium-text\" placeholder=\"<?php esc_attr_e( 'Default', 'sportspress' ); ?>\" value=\"<?php echo esc_attr( $day ); ?>\">\n\t\t\t</p>\n\t\t</div>\n\t\t<div class=\"sp-event-minutes-field\">\n\t\t\t<p><strong><?php esc_attr_e( 'Full Time', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<input name=\"sp_minutes\" type=\"number\" step=\"1\" min=\"0\" class=\"small-text\" placeholder=\"<?php echo esc_attr( get_option( 'sportspress_event_minutes', 90 ) ); ?>\" value=\"<?php echo esc_attr( $minutes ); ?>\">\n\t\t\t\t<?php esc_attr_e( 'mins', 'sportspress' ); ?>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\tif ( 'sp_venue' == $taxonomy ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tsp_taxonomy_field( $taxonomy, $post, true, true, esc_attr__( 'None', 'sportspress' ) );\n\t\t}\n\t\t?>\n\t\t<div class=\"sp-event-sp_venue-field\">\n\t\t\t<p><strong><?php esc_attr_e( 'Venue', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t$terms = get_the_terms( $post->ID, 'sp_venue' );\n\t\t\t\t$args  = array(\n\t\t\t\t\t'taxonomy'         => 'sp_venue',\n\t\t\t\t\t'name'             => 'tax_input[sp_venue][]',\n\t\t\t\t\t'class'            => 'sp-has-dummy',\n\t\t\t\t\t'selected'         => sp_get_the_term_id_or_meta( $post->ID, 'sp_venue' ),\n\t\t\t\t\t'values'           => 'term_id',\n\t\t\t\t\t'show_option_none' => esc_attr__( '&mdash; Not set &mdash;', 'sportspress' ),\n\t\t\t\t\t'chosen'           => true,\n\t\t\t\t);\n\t\t\t\tif ( in_array( 'sp_venue', apply_filters( 'sportspress_event_auto_taxonomies', array( 'sp_venue' ) ) ) ) {\n\t\t\t\t\t$args['show_option_all'] = esc_attr__( '(Auto)', 'sportspress' );\n\t\t\t\t}\n\t\t\t\tif ( ! sp_dropdown_taxonomies( $args ) ) {\n\t\t\t\t\tsp_taxonomy_adder( 'sp_venue', 'sp_event', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_day', sp_array_value( $_POST, 'sp_day', null, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_minutes', sp_array_value( $_POST, 'sp_minutes', get_option( 'sportspress_event_minutes', 90 ), 'int' ) );\n\t\t$venues = array_filter( sp_array_value( sp_array_value( $_POST, 'tax_input', array() ), 'sp_venue', array() ) );\n\t\tif ( empty( $venues ) ) {\n\t\t\t$teams = sp_array_value( $_POST, 'sp_team', array(), 'int' );\n\t\t\t$team  = reset( $teams );\n\t\t\t$venue = sp_get_the_term_id( $team, 'sp_venue' );\n\t\t\twp_set_post_terms( $post_id, $venue, 'sp_venue' );\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-format.php",
    "content": "<?php\n/**\n * Event Format\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Format\n */\nclass SP_Meta_Box_Event_Format {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$the_format = get_post_meta( $post->ID, 'sp_format', true );\n\t\t?>\n\t\t<div id=\"post-formats-select\">\n\t\t\t<?php foreach ( SP()->formats->event as $key => $format ) : ?>\n\t\t\t\t<input type=\"radio\" name=\"sp_format\" class=\"post-format\" id=\"post-format-<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( true, ( $key == 'league' && ! $the_format ) || $the_format == $key ); ?>> <label for=\"post-format-<?php echo esc_attr( $key ); ?>\" class=\"post-format-icon post-format-<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $format ); ?></label><br>\n\t\t\t<?php endforeach; ?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'league', 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-mode.php",
    "content": "<?php\n/**\n * Event Mode\n *\n * @author     ThemeBoy\n * @category   Admin\n * @package   SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Mode\n */\nclass SP_Meta_Box_Event_Mode {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$the_mode = sp_get_post_mode( $post->ID );\n\t\t?>\n\t<div id=\"post-formats-select\">\n\t\t<?php\n\t\tforeach ( array(\n\t\t\t'team'   => esc_attr__( 'Team vs team', 'sportspress' ),\n\t\t\t'player' => esc_attr__( 'Player vs player', 'sportspress' ),\n\t\t) as $key => $mode ) :\n\t\t\t?>\n\t\t<input type=\"radio\" name=\"sp_mode\" class=\"post-format\" id=\"post-format-<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( $the_mode, $key ); ?>> <label for=\"post-format-<?php echo esc_attr( $key ); ?>\" class=\"post-format-icon post-format-<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $mode ); ?></label><br>\n\t  <?php endforeach; ?>\n\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_mode', sp_array_value( $_POST, 'sp_mode', 'team', 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php",
    "content": "<?php\n/**\n * Event Officials\n *\n * @author    Rob Tucker <rtucker-scs>\n * @author    ThemeBoy\n * @category  Admin\n * @package   SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Officials\n */\nclass SP_Meta_Box_Event_Officials {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$duties = get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy'   => 'sp_duty',\n\t\t\t\t'hide_empty' => false,\n\t\t\t\t'orderby'    => 'meta_value_num',\n\t\t\t\t'meta_query' => array(\n\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$officials = (array) get_post_meta( $post->ID, 'sp_officials', true );\n\n\t\tif ( is_array( $duties ) && sizeof( $duties ) ) {\n\t\t\tforeach ( $duties as $duty ) {\n\t\t\t\t?>\n\t\t  <p><strong><?php echo esc_html( $duty->name ); ?></strong></p>\n\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type'   => 'sp_official',\n\t\t\t\t\t'name'        => 'sp_officials[' . $duty->term_id . '][]',\n\t\t\t\t\t'selected'    => sp_array_value( $officials, $duty->term_id, array() ),\n\t\t\t\t\t'values'      => 'ID',\n\t\t\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Officials', 'sportspress' ) ),\n\t\t\t\t\t'class'       => 'widefat',\n\t\t\t\t\t'property'    => 'multiple',\n\t\t\t\t\t'chosen'      => true,\n\t\t\t\t);\n\n\t\t\t\tif ( ! sp_dropdown_pages( $args ) ) {\n\t\t\t\t\t  sp_post_adder( 'sp_official', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t</p>\n\t\t\t\t<?php\n\t\t\t}\n\t\t} else {\n\t\t\tsp_taxonomy_adder( 'sp_duty', 'sp_official', esc_attr__( 'Duty', 'sportspress' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_officials', sp_array_value( $_POST, 'sp_officials', array(), 'int' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php",
    "content": "<?php\n/**\n * Event Performance\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.11\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Performance\n */\nclass SP_Meta_Box_Event_Performance {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$event = new SP_Event( $post );\n\t\tlist( $labels, $columns, $stats, $teams, $formats, $order, $timed, $stars ) = $event->performance( true );\n\n\t\tif ( 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'no' ) ) {\n\t\t\t$timeline = $event->timeline( true );\n\t\t} else {\n\t\t\t$timeline = false;\n\t\t}\n\n\t\t// Determine if columns are auto or manual\n\t\tif ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) ) {\n\t\t\t$manual = true;\n\t\t} else {\n\t\t\t$manual = false;\n\t\t}\n\n\t\t// Determine if we need checkboxes\n\t\tif ( $manual ) {\n\t\t\t$has_checkboxes = true;\n\t\t} else {\n\t\t\t$has_checkboxes = false;\n\t\t}\n\n\t\t// Get player number option\n\t\t$numbers = 'yes' == get_option( 'sportspress_event_show_player_numbers', 'yes' ) ? true : false;\n\n\t\t// Get positions\n\t\t$positions = array();\n\t\tif ( 'yes' == get_option( 'sportspress_event_show_position', 'yes' ) && taxonomy_exists( 'sp_position' ) ) :\n\t\t\t$args      = array(\n\t\t\t\t'hide_empty'       => false,\n\t\t\t\t'parent'           => 0,\n\t\t\t\t'include_children' => true,\n\t\t\t);\n\t\t\t$positions = get_terms( 'sp_position', $args );\n\t\tendif;\n\n\t\t// Apply filters to labels\n\t\t$labels = apply_filters( 'sportspress_event_performance_labels_admin', $labels );\n\n\t\t// Check if individual mode\n\t\t$is_individual = 'player' === sp_get_post_mode( $post->ID );\n\n\t\t// Get status option\n\t\t$status = ! $is_individual;\n\n\t\tself::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual, $timeline, $timed, $stars );\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array(), 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_timeline', sp_array_value( $_POST, 'sp_timeline', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_stars', sp_array_value( $_POST, 'sp_stars', array(), 'text' ) );\n\n\t\tif ( isset( $_POST['sp_columns'] ) ) {\n\t\t\t$columns = array_filter( (array) sp_array_value( $_POST, 'sp_columns', array(), 'key' ) );\n\t\t\tupdate_post_meta( $post_id, 'sp_columns', $columns );\n\t\t}\n\t}\n\n\t/**\n\t * Admin edit tables\n\t */\n\tpublic static function tables( $post_id, $stats = array(), $labels = array(), $columns = array(), $teams = array(), $has_checkboxes = false, $positions = array(), $status = true, $formats = array(), $order = array(), $numbers = true, $is_individual = false, $timeline = array(), $timed = array(), $stars = array() ) {\n\t\t$sections = get_option( 'sportspress_event_performance_sections', -1 );\n\t\tglobal $pagenow;\n\n\t\tif ( $pagenow === 'post-new.php' || $is_individual ) {\n\t\t\t?>\n\t\t\t<div class=\"sp-data-table-container\">\n\t\t\t\t<table class=\"widefat sp-data-table sp-performance-table sp-sortable-table\">\n\t\t\t\t\t<?php self::header( $columns, $labels, $positions, $has_checkboxes, $status, false, $numbers, -1, $formats ); ?>\n\t\t\t\t\t<?php self::footer( sp_array_value( $stats, -1 ), $labels, 0, $positions, $status, false, $numbers, -1, $formats ); ?>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $teams as $key => $team_id ) :\n\t\t\t\t\t\t\tif ( -1 == $team_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Get results for players in the team\n\t\t\t\t\t\t\t$players   = sp_array_between( (array) get_post_meta( $post_id, 'sp_player', false ), 0, $key );\n\t\t\t\t\t\t\t$players[] = -1;\n\t\t\t\t\t\t\t$data      = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );\n\n\t\t\t\t\t\t\t// Get team timeline\n\t\t\t\t\t\t\tif ( is_array( $timeline ) ) :\n\t\t\t\t\t\t\t\t$team_timeline = (array) sp_array_value( $timeline, $team_id, array() );\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$team_timeline = false;\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\tforeach ( $data as $player_id => $player_performance ) :\n\n\t\t\t\t\t\t\t\t// Get player timeline\n\t\t\t\t\t\t\t\tif ( is_array( $team_timeline ) ) :\n\t\t\t\t\t\t\t\t\t$player_timeline = (array) sp_array_value( $team_timeline, $player_id, array() );\n\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t$player_timeline = false;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\tself::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, false, $numbers, -1, $formats, $player_timeline, $timed, $stars );\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t?>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<?php\n\t\t} else {\n\t\t\t$i = 0;\n\n\t\t\tforeach ( $teams as $key => $team_id ) :\n\t\t\t\tif ( -1 == $team_id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( -1 == $sections ) {\n\t\t\t\t\t// Get results for players in the team\n\t\t\t\t\t$players   = sp_array_between( (array) get_post_meta( $post_id, 'sp_player', false ), 0, $key );\n\t\t\t\t\t$players[] = -1;\n\t\t\t\t\t$data      = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );\n\n\t\t\t\t\t// Get team timeline\n\t\t\t\t\tif ( is_array( $timeline ) ) :\n\t\t\t\t\t\t$team_timeline = (array) sp_array_value( $timeline, $team_id, array() );\n\t\t\t\t\telse :\n\t\t\t\t\t\t$team_timeline = false;\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<strong><?php echo wp_kses_post( get_the_title( $team_id ) ); ?></strong>\n\t\t\t\t\t\t\t<a class=\"add-new-h2 sp-add-new-h2\" href=\"\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'import' => 'sp_event_performance_csv',\n\t\t\t\t\t\t\t\t\t\t\t'event'  => $post_id,\n\t\t\t\t\t\t\t\t\t\t\t'team'   => $team_id,\n\t\t\t\t\t\t\t\t\t\t\t'teams'  => sizeof( $teams ),\n\t\t\t\t\t\t\t\t\t\t\t'index'  => $key,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php esc_html_e( 'Import', 'sportspress' ); ?></a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<?php self::table( $labels, $columns, $data, $team_id, $has_checkboxes && $i === 0, $positions, $status, -1, $formats, $order, $numbers, $team_timeline, $timed, $stars ); ?>\n\t\t\t\t\t\t<?php do_action( 'sportspress_after_event_performance_table_admin', $labels, $columns, $data, $team_id ); ?>\n\t\t\t\t\t</div>\n\t\t\t\t<?php } else { ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t// Get labels by section\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'      => 'sp_performance',\n\t\t\t\t\t\t'numberposts'    => 100,\n\t\t\t\t\t\t'posts_per_page' => 100,\n\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t'meta_query'     => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t\t\t\t'value'   => 'number',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t\t\t\t'value'   => 'equation',\n\t\t\t\t\t\t\t\t'compare' => '!=',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\n\t\t\t\t\t$performances = get_posts( $args );\n\n\t\t\t\t\t$labels = array( array(), array() );\n\t\t\t\t\tforeach ( $performances as $performance ) :\n\t\t\t\t\t\t$section = get_post_meta( $performance->ID, 'sp_section', true );\n\t\t\t\t\t\tif ( '' === $section ) {\n\t\t\t\t\t\t\t$section = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch ( $section ) :\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t$labels[1][ $performance->post_name ] = $performance->post_title;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$labels[0][ $performance->post_name ] = $performance->post_title;\n\t\t\t\t\t\tendswitch;\n\t\t\t\t\tendforeach;\n\n\t\t\t\t\t$offense = (array) get_post_meta( $post_id, 'sp_offense', false );\n\t\t\t\t\t$defense = (array) get_post_meta( $post_id, 'sp_defense', false );\n\t\t\t\t\t$data    = array();\n\t\t\t\t\tif ( sizeof( $offense ) || sizeof( $defense ) ) {\n\t\t\t\t\t\t// Get results for offensive players in the team\n\t\t\t\t\t\t$offense   = sp_array_between( $offense, 0, $key );\n\t\t\t\t\t\t$offense[] = -1;\n\t\t\t\t\t\t$data[0]   = sp_array_combine( $offense, sp_array_value( $stats, $team_id, array() ) );\n\n\t\t\t\t\t\t// Get results for defensive players in the team\n\t\t\t\t\t\t$defense   = sp_array_between( $defense, 0, $key );\n\t\t\t\t\t\t$defense[] = -1;\n\t\t\t\t\t\t$data[1]   = sp_array_combine( $defense, sp_array_value( $stats, $team_id, array() ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Get results for all players in the team\n\t\t\t\t\t\t$players   = sp_array_between( (array) get_post_meta( $post_id, 'sp_player', false ), 0, $key );\n\t\t\t\t\t\t$players[] = -1;\n\t\t\t\t\t\t$data[0]   = $data[1] = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get team timeline\n\t\t\t\t\tif ( is_array( $timeline ) ) :\n\t\t\t\t\t\t$team_timeline = (array) sp_array_value( $timeline, $team_id, array() );\n\t\t\t\t\telse :\n\t\t\t\t\t\t$team_timeline = false;\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Determine order of sections\n\t\t\t\t\tif ( 1 == $sections ) {\n\t\t\t\t\t\t$section_order = array(\n\t\t\t\t\t\t\t1 => esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$section_order = array( esc_attr__( 'Offense', 'sportspress' ), esc_attr__( 'Defense', 'sportspress' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $section_order as $section_id => $section_label ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong><?php echo wp_kses_post( get_the_title( $team_id ) ); ?> &mdash; <?php echo esc_html( $section_label ); ?></strong>\n\t\t\t\t\t\t\t\t<a class=\"add-new-h2 sp-add-new-h2\" href=\"\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'import' => 'sp_event_performance_csv',\n\t\t\t\t\t\t\t\t\t\t\t\t'event'  => $post_id,\n\t\t\t\t\t\t\t\t\t\t\t\t'team'   => $team_id,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php esc_html_e( 'Import', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<?php self::table( $labels[ $section_id ], $columns, $data[ $section_id ], $team_id, ( $has_checkboxes && 0 === $i ), $positions, $status, $section_id, $formats, $order, $numbers, $team_timeline, $timed, $stars ); ?>\n\t\t\t\t\t\t\t<?php do_action( 'sportspress_after_event_performance_table_admin', $labels[ $section_id ], $columns, $data[ $section_id ], $team_id ); ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i ++;\n\t\t\tendforeach;\n\t\t}\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $labels = array(), $columns = array(), $data = array(), $team_id = null, $has_checkboxes = false, $positions = array(), $status = true, $section = -1, $formats = array(), $order = array(), $numbers = true, $team_timeline = array(), $timed = array(), $stars = array() ) {\n\t\t?>\n\t\t<div class=\"sp-data-table-container\">\n\t\t\t<table class=\"widefat sp-data-table sp-performance-table sp-sortable-table\">\n\t\t\t\t<?php self::header( $columns, $labels, $positions, $has_checkboxes, $status, true, $numbers, $section, $formats ); ?>\n\t\t\t\t<?php self::footer( $data, $labels, $team_id, $positions, $status, true, $numbers, $section, $formats ); ?>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( 1 == $section && is_array( $order ) && sizeof( $order ) ) {\n\t\t\t\t\t\t$players      = array();\n\t\t\t\t\t\t$player_order = sp_array_value( $order, $team_id, array() );\n\t\t\t\t\t\tif ( is_array( $player_order ) && sizeof( $player_order ) ) {\n\t\t\t\t\t\t\tforeach ( $player_order as $key ) {\n\t\t\t\t\t\t\t\tif ( array_key_exists( $key, $data ) ) :\n\t\t\t\t\t\t\t\t\t$players[ $key ] = $data[ $key ];\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach ( $data as $key => $player ) {\n\t\t\t\t\t\t\tif ( ! array_key_exists( $key, $players ) ) {\n\t\t\t\t\t\t\t\t$players[ $key ] = $player;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$data = $players;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $data as $player_id => $player_performance ) :\n\n\t\t\t\t\t\t// Get player timeline\n\t\t\t\t\t\tif ( is_array( $team_timeline ) ) :\n\t\t\t\t\t\t\t$player_timeline = (array) sp_array_value( $team_timeline, $player_id, array() );\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t$player_timeline = false;\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tself::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, true, $numbers, $section, $formats, $player_timeline, $timed, $stars );\n\n\t\t\t\t\tendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Admin edit table header\n\t */\n\tpublic static function header( $columns = array(), $labels = array(), $positions = array(), $has_checkboxes = false, $status = true, $sortable = true, $numbers = true, $section = -1, $formats = array() ) {\n\t\t$stars_type = get_option( 'sportspress_event_performance_stars_type', 0 );\n\t\t?>\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<?php if ( $sortable ) { ?>\n\t\t\t\t\t<th class=\"icon\">&nbsp;</th>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( apply_filters( 'sportspress_event_performance_show_numbers', $numbers, $section ) ) { ?>\n\t\t\t\t\t<th>#</th>\n\t\t\t\t<?php } ?>\n\t\t\t\t<th><?php esc_html_e( 'Player', 'sportspress' ); ?></th>\n\t\t\t\t<?php if ( ! empty( $positions ) ) { ?>\n\t\t\t\t\t<th class=\"column-position\">\n\t\t\t\t\t\t<?php esc_html_e( 'Position', 'sportspress' ); ?>\n\t\t\t\t\t</th>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php $i = 0; foreach ( $labels as $key => $label ) : ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( 'equation' === sp_array_value( $formats, $key, 'number' ) ) {\n\t\t\t\t\t\tcontinue;}\n\t\t\t\t\t?>\n\t\t\t\t\t<th>\n\t\t\t\t\t\t<?php if ( $has_checkboxes ) : ?>\n\t\t\t\t\t\t\t<?php if ( 0 == $i ) : ?>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sp_columns[]\" value=\"\">\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<label for=\"sp_columns_<?php echo esc_attr( $key ); ?>\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_columns[]\" value=\"<?php echo esc_attr( $key ); ?>\" id=\"sp_columns_<?php echo esc_attr( $key ); ?>\" <?php checked( ! is_array( $columns ) || in_array( $key, $columns ) ); ?>>\n\t\t\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</th>\n\t\t\t\t\t<?php\n\t\t\t\t\t$i++;\nendforeach;\n\t\t\t\t?>\n\t\t\t\t<?php if ( apply_filters( 'sportspress_event_performance_show_status', $status, $section ) ) { ?>\n\t\t\t\t\t<th>\n\t\t\t\t\t\t<?php esc_html_e( 'Status', 'sportspress' ); ?>\n\t\t\t\t\t</th>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( $stars_type ) { ?>\n\t\t\t\t\t<th><i class=\"dashicons dashicons-star-filled\" title=\"<?php 1 == $stars_type ? esc_attr_e( 'Player of the Match', 'sportspress' ) : esc_attr_e( 'Stars', 'sportspress' ); ?>\"></i></th>\n\t\t\t\t<?php } ?>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<?php\n\t}\n\n\t/**\n\t * Admin edit table footer\n\t */\n\tpublic static function footer( $data = array(), $labels = array(), $team_id = 0, $positions = array(), $status = true, $sortable = true, $numbers = true, $section = -1, $formats = array() ) {\n\t\t?>\n\t\t<tfoot>\n\t\t\t<?php do_action( 'sportspress_event_performance_meta_box_table_footer', $data, $labels, $team_id, $positions, $status, $sortable, $numbers, $section ); ?>\n\t\t\t<?php if ( $team_id ) { ?>\n\t\t\t\t<tr class=\"sp-row sp-total\">\n\t\t\t\t\t<?php if ( $sortable ) { ?>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php if ( apply_filters( 'sportspress_event_performance_show_numbers', $numbers, $section ) ) { ?>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<td><strong><?php esc_html_e( 'Total', 'sportspress' ); ?></strong></td>\n\t\t\t\t\t<?php if ( ! empty( $positions ) ) { ?>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $labels as $column => $label ) :\n\t\t\t\t\t\tif ( 'equation' === sp_array_value( $formats, $column, 'number' ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$player_id          = 0;\n\t\t\t\t\t\t$player_performance = sp_array_value( $data, $player_id, array() );\n\t\t\t\t\t\t$value              = sp_array_value( $player_performance, $column, '' );\n\t\t\t\t\t\t$format             = sp_array_value( $formats, $column, 'number' );\n\t\t\t\t\t\t$placeholder        = sp_get_format_placeholder( $format );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"sp_players[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>]\" placeholder=\"<?php echo esc_attr( trim( $placeholder ) ); ?>\" value=\"<?php echo esc_attr( $value ); ?>\" data-sp-format=\"<?php echo esc_attr( $format ); ?>\" /></td>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t<?php if ( apply_filters( 'sportspress_event_performance_show_status', $status, $section ) ) { ?>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php if ( get_option( 'sportspress_event_performance_stars_type', 0 ) ) { ?>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</tr>\n\t\t\t<?php } ?>\n\t\t</tfoot>\n\t\t<?php\n\t}\n\n\t/**\n\t * Admin edit table row\n\t */\n\tpublic static function row( $labels = array(), $player_id = 0, $player_performance = array(), $team_id = 0, $data = array(), $positions = true, $status = true, $sortable = true, $numbers = true, $section = -1, $formats = array(), $player_timeline = array(), $timed = array(), $stars = array() ) {\n\t\tif ( $player_id <= 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$stars_type = get_option( 'sportspress_event_performance_stars_type', 0 );\n\t\t$value      = sp_array_value( $player_performance, 'number', '' );\n\t\t?>\n\t\t<tr class=\"sp-row sp-post\" data-player=\"<?php echo esc_attr( $player_id ); ?>\">\n\t\t\t<?php if ( $sortable ) { ?>\n\t\t\t\t<td class=\"icon\"><span class=\"dashicons dashicons-menu post-state-format\"></span></td>\n\t\t\t<?php } ?>\n\t\t\t<?php if ( apply_filters( 'sportspress_event_performance_show_numbers', $numbers, $section ) ) { ?>\n\t\t\t\t<td>\n\t\t\t\t\t<input class=\"small-text sp-player-number-input sp-sync-input\" type=\"text\" name=\"sp_players[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][number]\" value=\"<?php echo esc_attr( $value ); ?>\" />\n\t\t\t\t</td>\n\t\t\t<?php } ?>\n\t\t\t<td>\n\t\t\t\t<?php echo wp_kses_post( apply_filters( 'sportspress_event_performance_player_selection', get_the_title( $player_id ), $player_id ) ); ?>\n\t\t\t\t<?php if ( 1 == $section ) { ?>\n\t\t\t\t\t<input type=\"hidden\" name=\"sp_order[<?php echo esc_attr( $team_id ); ?>][]\" value=\"<?php echo esc_attr( $player_id ); ?>\">\n\t\t\t\t<?php } ?>\n\t\t\t</td>\n\t\t\t<?php if ( $positions ) { ?>\n\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t$selected = (array) sp_array_value( $player_performance, 'position', null );\n\t\t\t\t\tif ( $selected == null ) :\n\t\t\t\t\t\t$selected = (array) sp_get_the_term_id( $player_id, 'sp_position', 0 );\n\t\t\t\t\tendif;\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'         => 'sp_position',\n\t\t\t\t\t\t'name'             => 'sp_players[' . $team_id . '][' . $player_id . '][position][]',\n\t\t\t\t\t\t'values'           => 'term_id',\n\t\t\t\t\t\t'orderby'          => 'meta_value_num',\n\t\t\t\t\t\t'meta_query'       => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'selected'         => $selected,\n\t\t\t\t\t\t'class'            => 'sp-position',\n\t\t\t\t\t\t'property'         => 'multiple',\n\t\t\t\t\t\t'chosen'           => true,\n\t\t\t\t\t\t'include_children' => ( 'no' == get_option( 'sportspress_event_hide_child_positions', 'no' ) ),\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t<?php } ?>\n\t\t\t<?php\n\t\t\tforeach ( $labels as $column => $label ) :\n\t\t\t\tif ( 'equation' === sp_array_value( $formats, $column, 'number' ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$value       = sp_array_value( $player_performance, $column, '' );\n\t\t\t\t$intval      = intval( $value );\n\t\t\t\t$placeholder = sp_get_format_placeholder( sp_array_value( $formats, $column, 'number' ) );\n\t\t\t\t?>\n\t\t\t\t<td>\n\t\t\t\t\t<?php $format = sp_array_value( $formats, $column, 'number' ); ?>\n\t\t\t\t\t<?php if ( 'time' === $format ) { ?>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$intval  = intval( $value );\n\t\t\t\t\t\t\t$timeval = gmdate( 'i:s', $intval );\n\t\t\t\t\t\t\t$hours   = floor( $intval / 3600 );\n\n\t\t\t\t\t\tif ( '00' != $hours ) {\n\t\t\t\t\t\t\t$timeval = $hours . ':' . $timeval;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$timeval = preg_replace( '/^0/', '', $timeval );\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<input class=\"sp-player-<?php echo esc_attr( $column ); ?>-input sp-convert-time-input sp-sync-input\" type=\"text\" name=\"sp_times[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"<?php echo esc_attr( $timeval ); ?>\" placeholder=\"<?php echo esc_attr( $placeholder ); ?>\" />\n\t\t\t\t\t\t<input class=\"sp-convert-time-output\" type=\"hidden\" name=\"sp_players[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"<?php echo esc_attr( $value ); ?>\" />\n\t\t\t\t\t<?php } elseif ( 'checkbox' === $format ) { ?>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"sp_players[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"0\" />\n\t\t\t\t\t\t<input class=\"sp-player-<?php echo esc_attr( $column ); ?>-input sp-sync-input\" type=\"checkbox\" name=\"sp_players[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"1\" data-value=\"<?php echo esc_attr( $value ); ?>\" <?php checked( $value ); ?> />\n\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t<input class=\"sp-player-<?php echo esc_attr( $column ); ?>-input sp-sync-input\" type=\"text\" name=\"sp_players[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"<?php echo esc_attr( $value ); ?>\" placeholder=\"<?php echo esc_attr( $placeholder ); ?>\" />\n\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<?php if ( $intval && in_array( $column, $timed ) ) { ?>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t// Get performance times\n\t\t\t\t\t\tif ( is_array( $player_timeline ) ) {\n\t\t\t\t\t\t\t$times = sp_array_value( $player_timeline, $column, array() );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$times = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( is_array( $times ) ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<hr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tfor ( $i = 0; $i < $intval; $i++ ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<input class=\"sp-sync-input small-text\" type=\"text\" name=\"sp_timeline[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>][<?php echo esc_attr( $i ); ?>]\" value=\"<?php echo esc_attr( sp_array_value( $times, $i, '' ) ); ?>\" placeholder=\"-\" /><?php } ?>\n\t\t\t\t\t\t\t<span class=\"description\"><?php esc_html_e( 'mins', 'sportspress' ); ?></span>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t<?php endforeach; ?>\n\t\t\t<?php if ( apply_filters( 'sportspress_event_performance_show_status', $status, $section ) ) { ?>\n\t\t\t\t<td class=\"sp-status-selector\">\n\t\t\t\t\t<?php\n\t\t\t\t\t// Get substitute times\n\t\t\t\t\tif ( is_array( $player_timeline ) ) {\n\t\t\t\t\t\t$times = sp_array_value( $player_timeline, 'sub', array() );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$times = false;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<?php echo wp_kses( self::status_select( $team_id, $player_id, sp_array_value( $player_performance, 'status', null ) ), array( 'select' => array( 'class' => array(), 'name' => array() ), 'option' => array( 'value' => array(), 'selected' => array() ) ) ); ?><br>\n\t\t\t\t\t<?php echo wp_kses( self::sub_select( $team_id, $player_id, sp_array_value( $player_performance, 'sub', null ), $data ), array( 'select' => array( 'class' => array(), 'name' => array() ), 'option' => array( 'value' => array(), 'selected' => array() ) ) ); ?><br>\n\t\t\t\t\t<?php if ( is_array( $times ) ) { ?>\n\t\t\t\t\t\t<input class=\"sp-sync-input small-text\" type=\"text\" name=\"sp_timeline[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $player_id ); ?>][sub][]\" value=\"<?php echo esc_attr( sp_array_value( $times, 0, '' ) ); ?>\" placeholder=\"-\" />\n\t\t\t\t\t\t<span class=\"description\"><?php esc_html_e( 'mins', 'sportspress' ); ?></span>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</td>\n\t\t\t<?php } ?>\n\t\t\t<?php if ( $stars_type ) { ?>\n\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\tswitch ( $stars_type ) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\techo '<input type=\"checkbox\" name=\"sp_stars[' . esc_attr( $player_id ) . ']\" value=\"1\" ' . checked( sp_array_value( $stars, $player_id, '' ) == '', false, false ) . '>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\techo '<input type=\"text\" name=\"sp_stars[' . esc_attr( $player_id ) . ']\" class=\"tiny-text sp-player-stars-input sp-sync-input\" value=\"' . esc_attr( sp_array_value( $stars, $player_id, '' ) ) . '\">';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t<?php } ?>\n\t\t</tr>\n\t\t<?php\n\t}\n\n\t/**\n\t * Status selector\n\t */\n\tpublic static function status_select( $team_id, $player_id, $value = null ) {\n\n\t\tif ( ! $team_id || ! $player_id ) {\n\t\t\treturn '&mdash;';\n\t\t}\n\n\t\t$options = apply_filters(\n\t\t\t'sportspress_event_performance_status_options',\n\t\t\tarray(\n\t\t\t\t'lineup' => esc_attr__( 'Starting Lineup', 'sportspress' ),\n\t\t\t\t'sub'    => esc_attr__( 'Substitute', 'sportspress' ),\n\t\t\t)\n\t\t);\n\n\t\t$output = '<select class=\"sp-sync-select\" name=\"sp_players[' . $team_id . '][' . $player_id . '][status]\">';\n\n\t\tforeach ( $options as $key => $name ) :\n\t\t\t$output .= '<option value=\"' . $key . '\"' . ( $key == $value ? ' selected' : '' ) . '>' . $name . '</option>';\n\t\tendforeach;\n\n\t\t$output .= '</select>';\n\n\t\treturn $output;\n\n\t}\n\n\t/**\n\t * Substitute selector\n\t */\n\tpublic static function sub_select( $team_id, $player_id, $value, $data = array() ) {\n\n\t\tif ( ! $team_id || ! $player_id ) {\n\t\t\treturn '&mdash;';\n\t\t}\n\n\t\t$output = '<select class=\"sp-sync-select\" name=\"sp_players[' . $team_id . '][' . $player_id . '][sub]\" style=\"display: none;\">';\n\n\t\t$output .= '<option value=\"0\">' . esc_attr__( 'None', 'sportspress' ) . '</option>';\n\n\t\t// Add players as selectable options\n\t\tforeach ( $data as $id => $performance ) :\n\t\t\tif ( ! $id || $id == $player_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$number  = get_post_meta( $id, 'sp_number', true );\n\t\t\t$output .= '<option value=\"' . $id . '\"' . ( $id == $value ? ' selected' : '' ) . '>' . ( $number ? $number . '. ' : '' ) . get_the_title( $id ) . '</option>';\n\t\tendforeach;\n\n\t\t$output .= '</select>';\n\n\t\treturn $output;\n\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php",
    "content": "<?php\n/**\n * Event Results\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.18\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Results\n */\nclass SP_Meta_Box_Event_Results {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t// Determine if we need checkboxes\n\t\tif ( 'manual' == get_option( 'sportspress_event_result_columns', 'auto' ) ) {\n\t\t\t$has_checkboxes = true;\n\t\t} else {\n\t\t\t$has_checkboxes = false;\n\t\t}\n\n\t\t$event                               = new SP_Event( $post );\n\t\tlist( $columns, $usecolumns, $data ) = $event->results( true );\n\t\tself::table( $columns, $usecolumns, $data, $has_checkboxes );\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\t$results     = (array) sp_array_value( $_POST, 'sp_results', array(), 'text' );\n\t\t$main_result = get_option( 'sportspress_primary_result', null );\n\n\t\t// Get player performance\n\t\t$performance = sp_array_value( $_POST, 'sp_players', array(), 'text' );\n\n\t\t// Initialize finished\n\t\t$finished = false;\n\n\t\t// Check if any results are recorded\n\t\tforeach ( $results as $team => $team_results ) {\n\t\t\tforeach ( $team_results as $result ) {\n\t\t\t\tif ( '' !== $result ) {\n\t\t\t\t\t$finished = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if any performance is recorded\n\t\tif ( ! $finished ) {\n\t\t\tforeach ( $performance as $team => $players ) {\n\t\t\t\tforeach ( $players as $player => $pp ) {\n\t\t\t\t\tif ( 0 >= $player ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tforeach ( $pp as $pk => $pv ) {\n\t\t\t\t\t\tif ( in_array( $pk, apply_filters( 'sportspress_event_auto_result_bypass_keys', array( 'number', 'status', 'sub' ) ) ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( is_array( $pv ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$pv = trim( $pv );\n\t\t\t\t\t\tif ( '' == $pv ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! ctype_digit( $pv ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$finished = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $finished ) {\n\t\t\t// Get results with equations\n\t\t\t$args            = array(\n\t\t\t\t'post_type'      => 'sp_result',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_equation',\n\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t\t$dynamic_results = get_posts( $args );\n\n\t\t\t$equations = array();\n\t\t\t$precision = array();\n\t\t\tforeach ( $dynamic_results as $result ) {\n\t\t\t\t$equations[ $result->post_name ] = get_post_meta( $result->ID, 'sp_equation', true );\n\t\t\t\t$precision[ $result->post_name ] = (int) get_post_meta( $result->ID, 'sp_precision', true );\n\t\t\t}\n\n\t\t\t// Apply equations to empty results\n\t\t\tforeach ( $equations as $key => $equation ) {\n\t\t\t\tif ( '' == $equation ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach ( $results as $team => $team_results ) {\n\t\t\t\t\tif ( '' === sp_array_value( $team_results, $key, '' ) ) {\n\t\t\t\t\t\t$totals  = array();\n\t\t\t\t\t\t$players = sp_array_value( $performance, $team, array() );\n\t\t\t\t\t\tforeach ( $players as $player => $pp ) {\n\t\t\t\t\t\t\tforeach ( $pp as $pk => $pv ) {\n\t\t\t\t\t\t\t\t$value         = sp_array_value( $totals, $pk, 0 );\n\t\t\t\t\t\t\t\t$value        += floatval( $pv );\n\t\t\t\t\t\t\t\t$totals[ $pk ] = $value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$totals['eventsplayed']   = 1;\n\t\t\t\t\t\t$totals                   = apply_filters( 'sportspress_event_result_equation_vars', $totals, $performance, $team );\n\t\t\t\t\t\t$results[ $team ][ $key ] = sp_solve( $equation, $totals, sp_array_value( $precision, $key, 0 ), '' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Auto outcome\n\t\t$primary_results = array();\n\t\tforeach ( $results as $team => $team_results ) {\n\t\t\tif ( $main_result ) {\n\t\t\t\t$primary_results[ $team ] = sp_array_value( $team_results, $main_result, null );\n\t\t\t} else {\n\t\t\t\tif ( is_array( $team_results ) ) {\n\t\t\t\t\tend( $team_results );\n\t\t\t\t\t$primary_results[ $team ] = prev( $team_results );\n\t\t\t\t} else {\n\t\t\t\t\t$primary_results[ $team ] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tarsort( $primary_results );\n\n\t\tif ( count( $primary_results ) && ! in_array( null, $primary_results ) ) {\n\t\t\tif ( count( array_unique( $primary_results ) ) === 1 ) {\n\t\t\t\t$args     = array(\n\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'meta_key'       => 'sp_condition',\n\t\t\t\t\t'meta_value'     => '=',\n\t\t\t\t);\n\t\t\t\t$outcomes = get_posts( $args );\n\t\t\t\tforeach ( $results as $team => $team_results ) {\n\t\t\t\t\tif ( array_key_exists( 'outcome', $team_results ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $outcomes ) {\n\t\t\t\t\t\t$results[ $team ]['outcome'] = array();\n\t\t\t\t\t\tforeach ( $outcomes as $outcome ) {\n\t\t\t\t\t\t\t$results[ $team ]['outcome'][] = $outcome->post_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Get default outcomes\n\t\t\t\t$args             = array(\n\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'meta_key'       => 'sp_condition',\n\t\t\t\t\t'meta_value'     => 'else',\n\t\t\t\t);\n\t\t\t\t$default_outcomes = get_posts( $args );\n\n\t\t\t\t// Get greater than outcomes\n\t\t\t\t$args        = array(\n\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_condition',\n\t\t\t\t\t\t\t'value'   => '&gt;',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_condition',\n\t\t\t\t\t\t\t'value'   => '>',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\t$gt_outcomes = get_posts( $args );\n\t\t\t\tif ( empty( $gt_outcomes ) ) {\n\t\t\t\t\t$gt_outcomes = $default_outcomes;\n\t\t\t\t}\n\n\t\t\t\t// Get less than outcomes\n\t\t\t\t$args        = array(\n\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_condition',\n\t\t\t\t\t\t\t'value'   => '&lt;',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_condition',\n\t\t\t\t\t\t\t'value'   => '<',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\t$lt_outcomes = get_posts( $args );\n\t\t\t\tif ( empty( $lt_outcomes ) ) {\n\t\t\t\t\t$lt_outcomes = $default_outcomes;\n\t\t\t\t}\n\n\t\t\t\t// Get min and max values\n\t\t\t\t$min = min( $primary_results );\n\t\t\t\t$max = max( $primary_results );\n\n\t\t\t\tforeach ( $primary_results as $key => $value ) {\n\t\t\t\t\tif ( ! array_key_exists( 'outcome', $results[ $key ] ) ) {\n\t\t\t\t\t\tif ( $min == $value ) {\n\t\t\t\t\t\t\t$outcomes = $lt_outcomes;\n\t\t\t\t\t\t} elseif ( $max == $value ) {\n\t\t\t\t\t\t\t$outcomes = $gt_outcomes;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$outcomes = $default_outcomes;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$results[ $key ]['outcome'] = array();\n\t\t\t\t\t\tforeach ( $outcomes as $outcome ) {\n\t\t\t\t\t\t\t$results[ $key ]['outcome'][] = $outcome->post_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update meta\n\t\tupdate_post_meta( $post_id, 'sp_results', $results );\n\t\tupdate_post_meta( $post_id, 'sp_result_columns', sp_array_value( $_POST, 'sp_result_columns', array(), 'key' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $columns = array(), $usecolumns = array(), $data = array(), $has_checkboxes = false ) {\n\t\t// Get results with equations\n\t\t$args            = array(\n\t\t\t'post_type'      => 'sp_result',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'meta_query'     => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_equation',\n\t\t\t\t\t'compare' => 'NOT IN',\n\t\t\t\t\t'value'   => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$dynamic_results = get_posts( $args );\n\t\t$auto_columns    = wp_list_pluck( $dynamic_results, 'post_name' );\n\t\t?>\n\t\t<div class=\"sp-data-table-container\">\n\t\t\t<table class=\"widefat sp-data-table sp-results-table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"column-team\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Team', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php foreach ( $columns as $key => $label ) : ?>\n\t\t\t\t\t\t\t<th class=\"column-<?php echo esc_attr( $key ); ?>\">\n\t\t\t\t\t\t\t\t<?php if ( $has_checkboxes ) : ?>\n\t\t\t\t\t\t\t\t\t<label for=\"sp_result_columns_<?php echo esc_attr( $key ); ?>\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_result_columns[]\" value=\"<?php echo esc_attr( $key ); ?>\" id=\"sp_result_columns_<?php echo esc_attr( $key ); ?>\" <?php checked( ! is_array( $usecolumns ) || in_array( $key, $usecolumns ) ); ?>>\n\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t<th class=\"column-outcome\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Outcome', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ( $data as $team_id => $team_results ) :\n\t\t\t\t\t\tif ( ! $team_id || -1 == $team_id ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\" data-team=\"<?php echo esc_attr( $team_id ); ?>\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php echo esc_attr( get_the_title( $team_id ) ); ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $columns as $column => $label ) :\n\t\t\t\t\t\t\t\t$value = sp_array_value( $team_results, $column, '' );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<td><input class=\"sp-team-<?php echo esc_attr( $column ); ?>-input\" type=\"text\" name=\"sp_results[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"<?php echo esc_attr( $value ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( in_array( $column, $auto_columns ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t placeholder=\"<?php esc_attr_e( '(Auto)', 'sportspress' ); ?>\"<?php } ?> /></td>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$values = sp_array_value( $team_results, 'outcome', '' );\n\t\t\t\t\t\t\t\tif ( ! is_array( $values ) ) {\n\t\t\t\t\t\t\t\t\t$values = array( $values );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t\t\t'post_type'         => 'sp_outcome',\n\t\t\t\t\t\t\t\t\t'name'              => 'sp_results[' . $team_id . '][outcome][]',\n\t\t\t\t\t\t\t\t\t'option_none_value' => '',\n\t\t\t\t\t\t\t\t\t'sort_order'        => 'ASC',\n\t\t\t\t\t\t\t\t\t'sort_column'       => 'menu_order',\n\t\t\t\t\t\t\t\t\t'selected'          => $values,\n\t\t\t\t\t\t\t\t\t'class'             => 'sp-outcome',\n\t\t\t\t\t\t\t\t\t'property'          => 'multiple',\n\t\t\t\t\t\t\t\t\t'chosen'            => true,\n\t\t\t\t\t\t\t\t\t'placeholder'       => esc_attr__( '(Auto)', 'sportspress' ),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$i++;\n\t\t\t\t\tendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php",
    "content": "<?php\n/**\n * Event Shortcode\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Shortcode\n */\nclass SP_Meta_Box_Event_Shortcode {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$shortcodes = apply_filters(\n\t\t\t'sportspress_event_shortcodes',\n\t\t\tarray(\n\t\t\t\t'event_results'     => esc_attr__( 'Results', 'sportspress' ),\n\t\t\t\t'event_details'     => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t'event_performance' => esc_attr__( 'Box Score', 'sportspress' ),\n\t\t\t\t'event_venue'       => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t'event_officials'   => esc_attr__( 'Officials', 'sportspress' ),\n\t\t\t\t'event_teams'       => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t'event_full'        => esc_attr__( 'Full Info', 'sportspress' ),\n\t\t\t)\n\t\t);\n\t\tif ( $shortcodes ) {\n\t\t\t?>\n\t\t<p class=\"howto\">\n\t\t\t<?php esc_attr_e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?>\n\t\t</p>\n\t\t\t<?php foreach ( $shortcodes as $id => $label ) { ?>\n\t\t<p>\n\t\t\t<strong><?php echo esc_html( $label ); ?></strong>\n\t\t</p>\n\t\t<p><input type=\"text\" value=\"<?php sp_shortcode_template( $id, $post->ID ); ?>\" readonly=\"readonly\" class=\"code widefat\"></p>\n\t\t<?php } ?>\n\t\t\t<?php\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-specs.php",
    "content": "<?php\n/**\n * Event Specs\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Specs\n */\nclass SP_Meta_Box_Event_Specs {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\n\t\t$metrics = get_post_meta( $post->ID, 'sp_specs', true );\n\n\t\t$args = array(\n\t\t\t'post_type'      => 'sp_spec',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\n\t\t$vars = get_posts( $args );\n\n\t\tif ( $vars ) :\n\t\t\tforeach ( $vars as $var ) :\n\t\t\t\t?>\n\t\t\t<p><strong><?php echo esc_html( $var->post_title ); ?></strong></p>\n\t\t\t<p><input type=\"text\" name=\"sp_specs[<?php echo esc_attr( $var->post_name ); ?>]\" value=\"<?php echo esc_attr( sp_array_value( $metrics, $var->post_name, '' ) ); ?>\" /></p>\n\t\t\t\t<?php\n\t\t\tendforeach;\n\t\telse :\n\t\t\tsp_post_adder( 'sp_spec', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_specs', sp_array_value( $_POST, 'sp_specs', array(), 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php",
    "content": "<?php\n/**\n * Event Teams\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Teams\n */\nclass SP_Meta_Box_Event_Teams {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$limit     = get_option( 'sportspress_event_teams', 2 );\n\t\t$teams     = (array) get_post_meta( $post->ID, 'sp_team', false );\n\t\t$post_type = sp_get_post_mode_type( $post->ID );\n\t\tif ( $limit && 'sp_player' !== $post_type ) {\n\t\t\tfor ( $i = 0; $i < $limit; $i ++ ) :\n\t\t\t\t$team = array_shift( $teams );\n\t\t\t\t?>\n\t\t\t\t<div class=\"sp-instance\">\n\t\t\t\t\t<p class=\"sp-tab-select sp-title-generator\">\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'        => $post_type,\n\t\t\t\t\t\t'name'             => 'sp_team[]',\n\t\t\t\t\t\t'class'            => 'sportspress-pages',\n\t\t\t\t\t\t'show_option_none' => esc_attr__( '&mdash; None &mdash;', 'sportspress' ),\n\t\t\t\t\t\t'values'           => 'ID',\n\t\t\t\t\t\t'selected'         => $team,\n\t\t\t\t\t\t'chosen'           => true,\n\t\t\t\t\t\t'tax_query'        => array(),\n\t\t\t\t\t);\n\t\t\t\t\tif ( 'yes' == get_option( 'sportspress_event_filter_teams_by_league', 'no' ) ) {\n\t\t\t\t\t\t$league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 );\n\t\t\t\t\t\tif ( $league_id ) {\n\t\t\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t\t\t\t'terms'    => $league_id,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( 'yes' == get_option( 'sportspress_event_filter_teams_by_season', 'no' ) ) {\n\t\t\t\t\t\t$season_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 );\n\t\t\t\t\t\tif ( $season_id ) {\n\t\t\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t\t\t\t'terms'    => $season_id,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! sp_dropdown_pages( $args ) ) {\n\t\t\t\t\t\tunset( $args['tax_query'] );\n\t\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</p>\n\t\t\t\t\t<?php\n\t\t\t\t\t$tabs     = array();\n\t\t\t\t\t$sections = get_option( 'sportspress_event_performance_sections', -1 );\n\t\t\t\t\tif ( 0 == $sections ) {\n\t\t\t\t\t\t$tabs['sp_offense'] = array(\n\t\t\t\t\t\t\t'label'     => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t\t'post_type' => 'sp_player',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$tabs['sp_defense'] = array(\n\t\t\t\t\t\t\t'label'     => esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t\t\t'post_type' => 'sp_player',\n\t\t\t\t\t\t);\n\t\t\t\t\t} elseif ( 1 == $sections ) {\n\t\t\t\t\t\t$tabs['sp_defense'] = array(\n\t\t\t\t\t\t\t'label'     => esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t\t\t'post_type' => 'sp_player',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$tabs['sp_offense'] = array(\n\t\t\t\t\t\t\t'label'     => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t\t'post_type' => 'sp_player',\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tabs['sp_player'] = array(\n\t\t\t\t\t\t\t'label'     => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t\t\t'post_type' => 'sp_player',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$tabs['sp_staff'] = array(\n\t\t\t\t\t\t'label'     => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t'post_type' => 'sp_staff',\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t\t<?php if ( $tabs ) { ?>\n\t\t\t\t\t<ul id=\"sp_team-tabs\" class=\"sp-tab-bar category-tabs\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$j = 0;\n\t\t\t\t\t\tforeach ( $tabs as $slug => $tab ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<li class=\"\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( 0 == $j ) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\ttabs<?php } ?>\"><a href=\"#<?php echo esc_attr( $slug ); ?>-all\"><?php echo esc_html( $tab['label'] ); ?></a></li>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</ul>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$j = 0;\n\t\t\t\t\t\tforeach ( $tabs as $slug => $tab ) {\n\t\t\t\t\t\t\tdo_action( 'sportspress_event_teams_meta_box_checklist', $post->ID, $tab['post_type'], ( 0 == $j ? 'block' : 'none' ), $team, $i, $slug );\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\tendfor;\n\t\t} else {\n\t\t\t?>\n\t\t\t<p><strong><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr( sp_get_post_mode_label( $post->ID ) ) ); ?></strong></p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'post_type'   => $post_type,\n\t\t\t\t'name'        => 'sp_team[]',\n\t\t\t\t'selected'    => $teams,\n\t\t\t\t'values'      => 'ID',\n\t\t\t\t'class'       => 'widefat',\n\t\t\t\t'property'    => 'multiple',\n\t\t\t\t'chosen'      => true,\n\t\t\t\t'placeholder' => esc_attr__( 'None', 'sportspress' ),\n\t\t\t);\n\t\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\t\tsp_post_adder( $post_type, esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\tendif;\n\t\t}\n\t\twp_nonce_field( 'sp-get-players', 'sp-get-players-nonce', false );\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\t$teams = sp_array_value( $_POST, 'sp_team', array(), 'int' );\n\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_team', $teams );\n\n\t\t$post_type = sp_get_post_mode_type( $post->ID );\n\n\t\tif ( 'sp_player' === $post_type ) {\n\t\t\t$players = array();\n\t\t\tforeach ( $teams as $player ) {\n\t\t\t\t$players[] = array( 0, $player );\n\t\t\t}\n\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_player', $players );\n\t\t} else {\n\t\t\t$tabs     = array();\n\t\t\t$sections = get_option( 'sportspress_event_performance_sections', -1 );\n\t\t\tif ( -1 == $sections ) {\n\t\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array(), 'int' ) );\n\t\t\t} else {\n\t\t\t\t$players = array_merge( sp_array_value( $_POST, 'sp_offense', array() ), sp_array_value( $_POST, 'sp_defense', array(), 'int' ) );\n\t\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_offense', sp_array_value( $_POST, 'sp_offense', array(), 'int' ) );\n\t\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_defense', sp_array_value( $_POST, 'sp_defense', array(), 'int' ) );\n\t\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_player', $players );\n\t\t\t}\n\t\t\tsp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array(), 'int' ) );\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php",
    "content": "<?php\n/**\n * Event Video\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Event_Video\n */\nclass SP_Meta_Box_Event_Video {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$video = get_post_meta( $post->ID, 'sp_video', true );\n\t\tif ( $video ) :\n\t\t\t?>\n\t\t<fieldset class=\"sp-video-embed\">\n\t\t\t<?php echo wp_kses( apply_filters( 'the_content', '[embed width=\"254\"]' . esc_url( $video ) . '[/embed]' ), array( 'iframe' => array( 'title' => array(), 'width' => array(), 'height' => array(), 'src' => array(), 'frameborder' => array(), 'allow' => array(), 'allowfullscreen' => array(), 'style' => array()) ) ); ?>\n\t\t\t<p><a href=\"#\" class=\"sp-remove-video\"><?php esc_attr_e( 'Remove video', 'sportspress' ); ?></a></p>\n\t\t</fieldset>\n\t\t<?php endif; ?>\n\t\t<fieldset class=\"sp-video-field hidden\">\n\t\t\t<p><strong><?php esc_attr_e( 'URL', 'sportspress' ); ?></strong></p>\n\t\t\t<p><input class=\"widefat\" type=\"text\" name=\"sp_video\" id=\"sp_video\" value=\"<?php echo esc_url( $video ); ?>\"></p>\n\t\t\t<p><a href=\"#\" class=\"sp-remove-video\"><?php esc_attr_e( 'Cancel', 'sportspress' ); ?></a></p>\n\t\t</fieldset>\n\t\t<fieldset class=\"sp-video-adder\n\t\t<?php\n\t\tif ( $video ) :\n\t\t\t?>\n\t\t\t hidden<?php endif; ?>\">\n\t\t\t<p><a href=\"#\" class=\"sp-add-video\"><?php esc_attr_e( 'Add video', 'sportspress' ); ?></a></p>\n\t\t</fieldset>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_video', sp_array_value( $_POST, 'sp_video', null, 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php",
    "content": "<?php\n/**\n * List Columns\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_List_Columns\n */\nclass SP_Meta_Box_List_Columns {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$selected = (array) get_post_meta( $post->ID, 'sp_columns', true );\n\t\t$orderby  = get_post_meta( $post->ID, 'sp_orderby', true );\n\t\t?>\n\t\t<p><strong><?php esc_attr_e( 'General', 'sportspress' ); ?></strong></p>\n\t\t<ul class=\"categorychecklist form-no-clear\">\n\t\t\t<li>\n\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t<input value=\"number\" type=\"checkbox\" name=\"sp_columns[]\" id=\"sp_columns_number\" <?php checked( in_array( 'number', $selected ) ); ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( in_array( $orderby, array( 'number', 'name' ) ) ) {\n\t\t\t\t\t\tesc_attr_e( 'Squad Number', 'sportspress' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tesc_attr_e( 'Rank', 'sportspress' );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t\t\n\t\t\t\t</label>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t<input value=\"team\" type=\"checkbox\" name=\"sp_columns[]\" id=\"sp_columns_team\" <?php checked( in_array( 'team', $selected ) ); ?>>\n\t\t\t\t\t<?php esc_attr_e( 'Team', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t<input value=\"position\" type=\"checkbox\" name=\"sp_columns[]\" id=\"sp_columns_position\" <?php checked( in_array( 'position', $selected ) ); ?>>\n\t\t\t\t\t<?php esc_attr_e( 'Position', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</li>\n\t\t\t<?php do_action( 'sportspress_list_general_columns', $selected ); ?>\n\t\t</ul>\n\t\t<p><strong><?php esc_attr_e( 'Data', 'sportspress' ); ?></strong></p>\n\t\t<div class=\"sp-instance\">\n\t\t\t<ul id=\"sp_column-tabs\" class=\"sp-tab-bar category-tabs\">\n\t\t\t\t<li class=\"tabs\"><a href=\"#sp_performance-all\"><?php esc_attr_e( 'Performance', 'sportspress' ); ?></a></li>\n\t\t\t\t<li><a href=\"#sp_metric-all\"><?php esc_attr_e( 'Metrics', 'sportspress' ); ?></a></li>\n\t\t\t\t<li><a href=\"#sp_statistic-all\"><?php esc_attr_e( 'Statistics', 'sportspress' ); ?></a></li>\n\t\t\t</ul>\n\t\t\t<?php\n\t\t\tsp_column_checklist( $post->ID, 'sp_performance', 'block', $selected );\n\t\t\tsp_column_checklist( $post->ID, 'sp_metric', 'none', $selected );\n\t\t\tsp_column_checklist( $post->ID, 'sp_statistic', 'none', $selected );\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'key' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php",
    "content": "<?php\n/**\n * List Data\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_List_Data\n */\nclass SP_Meta_Box_List_Data {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\tglobal $pagenow;\n\t\tif ( is_admin() && in_array( $pagenow, array( 'post-new.php' ) ) && 'sp_list' == get_post_type() ) {\n\t\t\tself::table();\n\t\t} else {\n\t\t\t$list = new SP_Player_List( $post );\n\t\t\tlist( $columns, $data, $placeholders, $merged, $orderby ) = $list->data( true );\n\t\t\t$adjustments = $list->adjustments;\n\t\t\tself::table( $columns, $data, $placeholders, $adjustments, $orderby );\n\t\t}\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_adjustments', sp_array_value( $_POST, 'sp_adjustments', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array(), 'text' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $columns = array(), $data = array(), $placeholders = array(), $adjustments = array(), $orderby = 'number' ) {\n\t\t$show_player_photo = get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false;\n\t\t?>\n\t\t<ul class=\"subsubsub sp-table-bar\">\n\t\t\t<li><a href=\"#sp-table-values\" class=\"current\"><?php esc_attr_e( 'Values', 'sportspress' ); ?></a></li> | \n\t\t\t<li><a href=\"#sp-table-adjustments\" class=\"\"><?php esc_attr_e( 'Adjustments', 'sportspress' ); ?></a></li>\n\t\t</ul>\n\t\t<div class=\"sp-data-table-container sp-table-panel sp-table-values\" id=\"sp-table-values\">\n\t\t\t<table class=\"widefat sp-data-table sp-player-list-table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<?php if ( array_key_exists( 'number', $columns ) ) { ?>\n\t\t\t\t\t\t\t<th><?php echo in_array( $orderby, array( 'number', 'name' ) ) ? '#' : esc_attr__( 'Rank', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<th><?php esc_attr_e( 'Player', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php if ( array_key_exists( 'team', $columns ) ) { ?>\n\t\t\t\t\t\t\t<th><?php esc_attr_e( 'Team', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php if ( array_key_exists( 'position', $columns ) ) { ?>\n\t\t\t\t\t\t\t<th><?php esc_attr_e( 'Position', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php foreach ( $columns as $key => $label ) : ?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( in_array( $key, array( 'number', 'team', 'position' ) ) ) {\n\t\t\t\t\t\t\t\tcontinue;}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<th><label for=\"sp_columns_<?php echo esc_attr( $key ); ?>\">\n\t\t\t\t\t\t\t\t<?php echo wp_kses_post( $label ); ?>\n\t\t\t\t\t\t\t</label></th>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $data ) && sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\tforeach ( $data as $player_id => $player_stats ) :\n\t\t\t\t\t\t\tif ( ! $player_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$teams  = get_post_meta( $player_id, 'sp_team', false );\n\t\t\t\t\t\t\t$div    = get_term( $player_id, 'sp_season' );\n\t\t\t\t\t\t\t$number = get_post_meta( $player_id, 'sp_number', true );\n\n\t\t\t\t\t\t\t$default_name = sp_array_value( $player_stats, 'name', '' );\n\t\t\t\t\t\t\tif ( $default_name == null ) {\n\t\t\t\t\t\t\t\t$default_name = get_the_title( $player_id );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t<?php if ( array_key_exists( 'number', $columns ) ) { ?>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tif ( 'number' == $orderby ) {\n\t\t\t\t\t\t\t\t\t\t\techo ( $number ? esc_html( $number ) : '&nbsp;' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\techo esc_html( $i + 1 );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $show_player_photo ) {\n\t\t\t\t\t\t\t\t\t\techo get_the_post_thumbnail( $player_id, 'sportspress-fit-mini' );}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<span class=\"sp-default-value\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"sp-default-value-input\"><?php echo esc_html( $default_name ); ?></span>\n\t\t\t\t\t\t\t\t\t\t<a class=\"dashicons dashicons-edit sp-edit\" title=\"<?php esc_attr_e( 'Edit', 'sportspress' ); ?>\"></a>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"hidden sp-custom-value\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"sp_players[<?php echo esc_attr( $player_id ); ?>][name]\" class=\"name sp-custom-value-input\" value=\"<?php echo esc_attr( sp_array_value( $player_stats, 'name', '' ) ); ?>\" placeholder=\"<?php echo esc_attr( get_the_title( $player_id ) ); ?>\" size=\"6\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"button button-secondary sp-cancel\"><?php esc_attr_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t\t\t\t<a class=\"button button-primary sp-save\"><?php esc_attr_e( 'Save', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php if ( array_key_exists( 'team', $columns ) ) { ?>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t$selected = sp_array_value( $player_stats, 'team', get_post_meta( get_the_ID(), 'sp_team', true ) );\n\t\t\t\t\t\t\t\t\t\tif ( ! $selected ) {\n\t\t\t\t\t\t\t\t\t\t\t$selected = get_post_meta( $player_id, 'sp_team', true );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$include = get_post_meta( $player_id, 'sp_team' );\n\t\t\t\t\t\t\t\t\t\t$args    = array(\n\t\t\t\t\t\t\t\t\t\t\t'post_type' => 'sp_team',\n\t\t\t\t\t\t\t\t\t\t\t'name'      => 'sp_players[' . esc_attr( $player_id ) . '][team]',\n\t\t\t\t\t\t\t\t\t\t\t'include'   => $include,\n\t\t\t\t\t\t\t\t\t\t\t'selected'  => $selected,\n\t\t\t\t\t\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\twp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<?php if ( array_key_exists( 'position', $columns ) ) { ?>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t$selected = sp_array_value( $player_stats, 'position', null );\n\t\t\t\t\t\t\t\t\t\t$args     = array(\n\t\t\t\t\t\t\t\t\t\t\t'taxonomy'   => 'sp_position',\n\t\t\t\t\t\t\t\t\t\t\t'name'       => 'sp_players[' . $player_id . '][position]',\n\t\t\t\t\t\t\t\t\t\t\t'show_option_blank' => esc_attr__( '(Auto)', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t\t\t'values'     => 'term_id',\n\t\t\t\t\t\t\t\t\t\t\t'orderby'    => 'meta_value_num',\n\t\t\t\t\t\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'key' => 'sp_order',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'key' => 'sp_order',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'selected'   => $selected,\n\t\t\t\t\t\t\t\t\t\t\t'include_children' => ( 'no' == get_option( 'sportspress_event_hide_child_positions', 'no' ) ),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $columns as $column => $label ) :\n\t\t\t\t\t\t\t\t\tif ( in_array( $column, array( 'number', 'team', 'position' ) ) ) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$value       = sp_array_value( $player_stats, $column, '' );\n\t\t\t\t\t\t\t\t\t$placeholder = sp_array_value( sp_array_value( $placeholders, $player_id, array() ), $column, 0 );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<td><input type=\"text\" name=\"sp_players[<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"<?php echo esc_attr( $value ); ?>\" placeholder=\"<?php echo esc_attr( $placeholder ); ?>\" data-placeholder=\"<?php echo esc_attr( $placeholder ); ?>\" data-matrix=\"<?php echo esc_attr( $player_id ); ?>_<?php echo esc_attr( $column ); ?>\" data-adjustment=\"<?php echo esc_attr( sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $column, 0 ) ); ?>\" /></td>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\telse :\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t<td colspan=\"\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$colspan = sizeof( $columns ) + ( apply_filters( 'sportspress_has_teams', true ) ? 3 : 2 );\n\t\t\t\t\t\techo esc_attr( $colspan );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Data', 'sportspress' ) ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<div class=\"sp-data-table-container sp-table-panel sp-table-adjustments hidden\" id=\"sp-table-adjustments\">\n\t\t\t<table class=\"widefat sp-data-table sp-player-list-table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>#</th>\n\t\t\t\t\t\t<th><?php esc_attr_e( 'Player', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $columns as $key => $label ) :\n\t\t\t\t\t\t\tif ( in_array( $key, array( 'number', 'team', 'position' ) ) ) {\n\t\t\t\t\t\t\t\tcontinue;}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<th><?php echo esc_html( $label ); ?></th>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $data ) && sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\tforeach ( $data as $player_id => $player_stats ) :\n\t\t\t\t\t\t\tif ( ! $player_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$div    = get_term( $player_id, 'sp_season' );\n\t\t\t\t\t\t\t$number = get_post_meta( $player_id, 'sp_number', true );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t<td><?php echo ( $number ? esc_html( $number ) : '&nbsp;' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php echo esc_html( get_the_title( $player_id ) ); ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $columns as $column => $label ) :\n\t\t\t\t\t\t\t\t\tif ( in_array( $column, array( 'number', 'team', 'position' ) ) ) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$value = sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $column, '' );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<td><input type=\"text\" name=\"sp_adjustments[<?php echo esc_attr( $player_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"<?php echo esc_attr( $value ); ?>\" placeholder=\"0\" data-matrix=\"<?php echo esc_attr( $player_id ); ?>_<?php echo esc_attr( $column ); ?>\" /></td>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\telse :\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t<td colspan=\"\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$colspan = sizeof( $columns ) + 3;\n\t\t\t\t\t\techo esc_attr( $colspan );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Details', 'sportspress' ) ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php",
    "content": "<?php\n/**\n * List Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_List_Details\n */\nclass SP_Meta_Box_List_Details {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$taxonomies          = get_object_taxonomies( 'sp_list' );\n\t\t$caption             = get_post_meta( $post->ID, 'sp_caption', true );\n\t\t$team_id             = get_post_meta( $post->ID, 'sp_team', true );\n\t\t$era                 = get_post_meta( $post->ID, 'sp_era', true );\n\t\t$grouping            = get_post_meta( $post->ID, 'sp_grouping', true );\n\t\t$orderby             = get_post_meta( $post->ID, 'sp_orderby', true );\n\t\t$order               = get_post_meta( $post->ID, 'sp_order', true );\n\t\t$select              = get_post_meta( $post->ID, 'sp_select', true );\n\t\t$number              = get_post_meta( $post->ID, 'sp_number', true );\n\t\t$crop                = get_post_meta( $post->ID, 'sp_crop', true );\n\t\t$date                = get_post_meta( $post->ID, 'sp_date', true );\n\t\t$date_from           = get_post_meta( $post->ID, 'sp_date_from', true );\n\t\t$date_to             = get_post_meta( $post->ID, 'sp_date_to', true );\n\t\t$date_past           = get_post_meta( $post->ID, 'sp_date_past', true );\n\t\t$date_relative       = get_post_meta( $post->ID, 'sp_date_relative', true );\n\t\t$continents          = SP()->countries->continents;\n\t\t$nationalities       = get_post_meta( $post->ID, 'sp_nationality', false );\n\t\t$default_nationality = get_option( 'sportspress_default_nationality', false );\n\t\t?>\n\t\t<div>\n\t\t\t<p><strong><?php esc_attr_e( 'Heading', 'sportspress' ); ?></strong></p>\n\t\t\t<p><input type=\"text\" id=\"sp_caption\" name=\"sp_caption\" value=\"<?php echo esc_attr( $caption ); ?>\" placeholder=\"<?php echo esc_attr( get_the_title() ); ?>\"></p>\n\n\t\t\t<div class=\"sp-date-selector\">\n\t\t\t\t<p><strong><?php esc_attr_e( 'Date', 'sportspress' ); ?></strong></p>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name'     => 'sp_date',\n\t\t\t\t\t\t'id'       => 'sp_date',\n\t\t\t\t\t\t'selected' => $date,\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<div class=\"sp-date-range\">\n\t\t\t\t\t<p class=\"sp-date-range-absolute\" <?php echo '1' == $date_relative ? ' style=\"display:none;\"' : ''; ?>>\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-from\" name=\"sp_date_from\" value=\"<?php echo esc_attr( $date_from ? $date_from : date_i18n( 'Y-m-d' ) ); ?>\" size=\"10\">\n\t\t\t\t\t\t:\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-to\" name=\"sp_date_to\" value=\"<?php echo esc_attr( $date_to ? $date_to : date_i18n( 'Y-m-d' ) ); ?>\" size=\"10\">\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-range-relative\" <?php echo '1' !== $date_relative ? ' style=\"display:none;\"' : ''; ?>>\n\t\t\t\t\t\t<?php esc_attr_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"sp_date_past\" value=\"<?php echo '' !== $date_past ? esc_attr( $date_past ) : 7; ?>\">\n\t\t\t\t\t\t<?php esc_attr_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_date_relative\" value=\"1\" id=\"sp_date_relative\" <?php checked( $date_relative ); ?>>\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<?php\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\tsp_taxonomy_field( $taxonomy, $post, true );\n\t\t\t}\n\t\t\t?>\n\t\t\t<p><strong><?php esc_attr_e( 'Team', 'sportspress' ); ?></strong></p>\n\t\t\t<p class=\"sp-tab-select sp-team-era-selector\">\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type'       => 'sp_team',\n\t\t\t\t\t'name'            => 'sp_team',\n\t\t\t\t\t'show_option_all' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t\t'selected'        => $team_id,\n\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t);\n\t\t\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\t\t\tsp_post_adder( 'sp_team', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t\tendif;\n\t\t\t\t?>\n\t\t\t\t<select name=\"sp_era\">\n\t\t\t\t\t<option value=\"all\" <?php selected( 'all', $era ); ?>><?php esc_attr_e( 'All', 'sportspress' ); ?></option>\n\t\t\t\t\t<option value=\"current\" <?php selected( 'current', $era ); ?>><?php esc_attr_e( 'Current', 'sportspress' ); ?></option>\n\t\t\t\t\t<option value=\"past\" <?php selected( 'past', $era ); ?>><?php esc_attr_e( 'Past', 'sportspress' ); ?></option>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Nationality', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<select id=\"sp_nationality\" name=\"sp_nationality[]\" data-placeholder=\"<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Nationality', 'sportspress' ) ); ?>\" class=\"widefat chosen-select\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( is_rtl() ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t chosen-rtl<?php endif; ?>\" multiple=\"multiple\">\n\t\t\t\t\t<option value=\"\"></option>\n\t\t\t\t\t<?php foreach ( $continents as $continent => $countries ) : ?>\n\t\t\t\t\t\t<optgroup label=\"<?php echo esc_attr( $continent ); ?>\">\n\t\t\t\t\t\t\t<?php foreach ( $countries as $code => $country ) : ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $code ); ?>\" <?php selected( in_array( $code, $nationalities ) ); ?>><?php echo esc_html( $country ); ?></option>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t</optgroup>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Grouping', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t<select name=\"sp_grouping\">\n\t\t\t\t<option value=\"0\"><?php esc_attr_e( 'None', 'sportspress' ); ?></option>\n\t\t\t\t<option value=\"position\" <?php selected( $grouping, 'position' ); ?>><?php esc_attr_e( 'Position', 'sportspress' ); ?></option>\n\t\t\t</select>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Sort by', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'prepend_options' => array(\n\t\t\t\t\t'number' => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t\t'name'   => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t'post_type'       => array( 'sp_performance', 'sp_metric', 'sp_statistic' ),\n\t\t\t\t'name'            => 'sp_orderby',\n\t\t\t\t'selected'        => $orderby,\n\t\t\t\t'values'          => 'slug',\n\t\t\t);\n\t\t\tsp_dropdown_pages( $args );\n\t\t\t?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t<input type=\"checkbox\" name=\"sp_crop\" value=\"1\" <?php checked( $crop ); ?>>\n\t\t\t\t\t<?php esc_attr_e( 'Skip if zero?', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Sort Order', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<select name=\"sp_order\">\n\t\t\t\t\t<option value=\"ASC\" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t\t\t<option value=\"DESC\" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<p><strong><?php esc_attr_e( 'Players', 'sportspress' ); ?></strong></p>\n\t\t\t<p class=\"sp-select-setting\">\n\t\t\t\t<select name=\"sp_select\">\n\t\t\t\t\t<option value=\"auto\" <?php selected( 'auto', $select ); ?>><?php esc_attr_e( 'Auto', 'sportspress' ); ?></option>\n\t\t\t\t\t<option value=\"manual\" <?php selected( 'manual', $select ); ?>><?php esc_attr_e( 'Manual', 'sportspress' ); ?></option>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<?php\n\t\t\tif ( 'manual' == $select ) {\n\t\t\t\t$player_filters = array( 'sp_league', 'sp_season' );\n\t\t\t\tif ( $team_id ) {\n\t\t\t\t\tif ( in_array( $era, array( 'all', 'past' ) ) ) {\n\t\t\t\t\t\t$player_filters[] = 'sp_past_team';\n\t\t\t\t\t}\n\t\t\t\t\tif ( in_array( $era, array( 'all', 'current' ) ) ) {\n\t\t\t\t\t\t$player_filters[] = 'sp_current_team';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), $player_filters );\n\t\t\t\tsp_post_adder( 'sp_player', esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<p><strong><?php esc_attr_e( 'Display', 'sportspress' ); ?></strong></p>\n\t\t\t\t<p><input name=\"sp_number\" id=\"sp_number\" type=\"number\" step=\"1\" min=\"0\" class=\"small-text\" placeholder=\"<?php esc_attr_e( 'All', 'sportspress' ); ?>\" value=\"<?php echo esc_attr( $number ); ?>\"> <?php esc_attr_e( 'players', 'sportspress' ); ?></p>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_caption', sp_array_value( $_POST, 'sp_caption', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_past', sp_array_value( $_POST, 'sp_date_past', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_relative', sp_array_value( $_POST, 'sp_date_relative', 0, 'text' ) );\n\t\t$tax_input = sp_array_value( $_POST, 'tax_input', array() );\n\t\tupdate_post_meta( $post_id, 'sp_main_league', in_array( 'auto', sp_array_value( $tax_input, 'sp_league' ) ) );\n\t\tupdate_post_meta( $post_id, 'sp_current_season', in_array( 'auto', sp_array_value( $tax_input, 'sp_season' ) ) );\n\t\tupdate_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array(), 'id' ) );\n\t\tupdate_post_meta( $post_id, 'sp_era', sp_array_value( $_POST, 'sp_era', array(), 'key' ) );\n\t\tupdate_post_meta( $post_id, 'sp_grouping', sp_array_value( $_POST, 'sp_grouping', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array(), 'key' ) );\n\t\tupdate_post_meta( $post_id, 'sp_crop', sp_array_value( $_POST, 'sp_crop', 0, 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_select', sp_array_value( $_POST, 'sp_select', array(), 'key' ) );\n\t\tupdate_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', array(), 'int' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array(), 'int' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', array(), 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-list-format.php",
    "content": "<?php\n/**\n * List Format\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_List_Format\n */\nclass SP_Meta_Box_List_Format {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$the_format = get_post_meta( $post->ID, 'sp_format', true );\n\t\t?>\n\t\t<div id=\"post-formats-select\">\n\t\t\t<?php foreach ( SP()->formats->list as $key => $format ) : ?>\n\t\t\t\t<input type=\"radio\" name=\"sp_format\" class=\"post-format\" id=\"post-format-<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( true, ( $key == 'list' && ! $the_format ) || $the_format == $key ); ?>> <label for=\"post-format-<?php echo esc_attr( $key ); ?>\" class=\"post-format-icon post-format-<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $format ); ?></label><br>\n\t\t\t<?php endforeach; ?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'list', 'key' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-list-shortcode.php",
    "content": "<?php\n/**\n * List Shortcode\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     1.6.1\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_List_Shortcode\n */\nclass SP_Meta_Box_List_Shortcode {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$the_format = get_post_meta( $post->ID, 'sp_format', true );\n\t\tif ( ! $the_format ) {\n\t\t\t$the_format = 'list';\n\t\t}\n\t\t?>\n\t\t<p class=\"howto\">\n\t\t\t<?php esc_html_e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?>\n\t\t</p>\n\t\t<p><input type=\"text\" value=\"<?php sp_shortcode_template( 'player_' . $the_format, $post->ID ); ?>\" readonly=\"readonly\" class=\"code widefat\"></p>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php",
    "content": "<?php\n/**\n * Metric Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Config' ) ) {\n\trequire 'class-sp-meta-box-config.php';\n}\n\n/**\n * SP_Meta_Box_Metric_Details\n */\nclass SP_Meta_Box_Metric_Details extends SP_Meta_Box_Config {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$visible = get_post_meta( $post->ID, 'sp_visible', true );\n\t\tif ( '' === $visible ) {\n\t\t\t$visible = 1;\n\t\t}\n\t\t?>\n\t\t<p><strong><?php esc_attr_e( 'Variable', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_default_key\" type=\"hidden\" id=\"sp_default_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t\t<input name=\"sp_key\" type=\"text\" id=\"sp_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t</p>\n\t\t<p>\n\t\t\t<strong><?php esc_attr_e( 'Visible', 'sportspress' ); ?></strong>\n\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Display in player profile?', 'sportspress' ); ?>\"></i>\n\t\t</p>\n\t\t<ul class=\"sp-visible-selector\">\n\t\t\t<li>\n\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t<input name=\"sp_visible\" id=\"sp_visible_yes\" type=\"radio\" value=\"1\" <?php checked( $visible ); ?>>\n\t\t\t\t\t<?php esc_attr_e( 'Yes', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t<input name=\"sp_visible\" id=\"sp_visible_no\" type=\"radio\" value=\"0\" <?php checked( ! $visible ); ?>>\n\t\t\t\t\t<?php esc_attr_e( 'No', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</li>\n\t\t</ul>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tself::delete_duplicate( $_POST );\n\t\tupdate_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1, 'int' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php",
    "content": "<?php\n/**\n * Outcome Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Config' ) ) {\n\trequire 'class-sp-meta-box-config.php';\n}\n\n/**\n * SP_Meta_Box_Outcome_Details\n */\nclass SP_Meta_Box_Outcome_Details extends SP_Meta_Box_Config {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\tglobal $pagenow;\n\t\tif ( 'post.php' == $pagenow && 'draft' !== get_post_status() ) {\n\t\t\t$readonly = true;\n\t\t} else {\n\t\t\t$readonly = false;\n\t\t}\n\t\t$abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );\n\t\t$color        = get_post_meta( $post->ID, 'sp_color', true );\n\t\t$condition    = get_post_meta( $post->ID, 'sp_condition', true );\n\t\t$main_result  = get_option( 'sportspress_primary_result', null );\n\t\t$result       = get_page_by_path( $main_result, ARRAY_A, 'sp_result' );\n\t\t$label        = sp_array_value( $result, 'post_title', esc_attr__( 'Primary', 'sportspress' ) );\n\n\t\tif ( '' === $color ) {\n\t\t\t$color = '#888888';\n\t\t}\n\t\t?>\n\t\t<p><strong><?php esc_html_e( 'Variable', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_default_key\" type=\"hidden\" id=\"sp_default_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t\t<input name=\"sp_key\" type=\"text\" id=\"sp_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $readonly ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t readonly=\"readonly\"<?php } ?>>\n\t\t</p>\n\t\t<p><strong><?php esc_html_e( 'Abbreviation', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_abbreviation\" type=\"text\" id=\"sp_abbreviation\" value=\"<?php echo esc_attr( $abbreviation ); ?>\" placeholder=\"<?php echo esc_attr( sp_substr( $post->post_title, 0, 1 ) ); ?>\">\n\t\t</p>\n\t\t<p><strong><?php esc_attr_e( 'Color', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<div class=\"sp-color-box\">\n\t\t\t\t<input name=\"sp_color\" id=\"sp_color\" type=\"text\" value=\"<?php echo esc_attr( $color ); ?>\" class=\"colorpick\">\n\t\t\t\t<div id=\"sp_color\" class=\"colorpickdiv\"></div>\n\t\t\t</div>\n\t\t</p>\n\t\t<p><strong><?php esc_html_e( 'Condition', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<select name=\"sp_condition\">\n\t\t\t\t<?php\n\t\t\t\t$options = array(\n\t\t\t\t\t'0'    => '&mdash;',\n\t\t\t\t\t'>'    => sprintf( esc_attr__( 'Most %s', 'sportspress' ), $label ),\n\t\t\t\t\t'<'    => sprintf( esc_attr__( 'Least %s', 'sportspress' ), $label ),\n\t\t\t\t\t'='    => sprintf( esc_attr__( 'Equal %s', 'sportspress' ), $label ),\n\t\t\t\t\t'else' => sprintf( esc_attr__( 'Default', 'sportspress' ), $label ),\n\t\t\t\t);\n\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( true, $key == wp_specialchars_decode( $condition ), false ), esc_attr( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_abbreviation', sp_array_value( $_POST, 'sp_abbreviation', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_color', sp_array_value( $_POST, 'sp_color', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_condition', sp_array_value( $_POST, 'sp_condition', array(), 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php",
    "content": "<?php\n/**\n * Performance Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.15\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Config' ) ) {\n\trequire 'class-sp-meta-box-config.php';\n}\n\n/**\n * SP_Meta_Box_Performance_Details\n */\nclass SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\tglobal $pagenow;\n\t\tif ( 'post.php' == $pagenow && 'draft' !== get_post_status() ) {\n\t\t\t$readonly = true;\n\t\t} else {\n\t\t\t$readonly = false;\n\t\t}\n\n\t\t// Post Meta\n\t\t$singular = get_post_meta( $post->ID, 'sp_singular', true );\n\t\t$section  = get_post_meta( $post->ID, 'sp_section', true );\n\t\tif ( '' === $section ) {\n\t\t\t$section = -1;\n\t\t}\n\t\t$format = get_post_meta( $post->ID, 'sp_format', true );\n\t\tif ( '' === $format ) {\n\t\t\t$format = 'number';\n\t\t}\n\t\t$precision = get_post_meta( $post->ID, 'sp_precision', true );\n\t\tif ( '' === $precision ) {\n\t\t\t$precision = 0;\n\t\t}\n\t\t$timed = get_post_meta( $post->ID, 'sp_timed', true );\n\t\tif ( '' === $timed ) {\n\t\t\t$timed = true;\n\t\t}\n\t\t$sendoff = get_post_meta( $post->ID, 'sp_sendoff', true );\n\t\tif ( '' === $sendoff ) {\n\t\t\t$sendoff = false;\n\t\t}\n\t\t?>\n\t\t<p><strong><?php esc_html_e( 'Variable', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_default_key\" type=\"hidden\" id=\"sp_default_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t\t<input name=\"sp_key\" type=\"text\" id=\"sp_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $readonly ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t readonly=\"readonly\"<?php } ?>>\n\t\t</p>\n\t\t<p><strong><?php esc_html_e( 'Singular', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_singular\" type=\"text\" id=\"sp_singular\" placeholder=\"<?php echo esc_attr( $post->post_title ); ?>\" value=\"<?php echo esc_attr( $singular ); ?>\">\n\t\t</p>\n\t\t<p><strong><?php esc_html_e( 'Category', 'sportspress' ); ?></strong></p>\n\t\t<p class=\"sp-section-selector\">\n\t\t\t<select name=\"sp_section\">\n\t\t\t\t<?php\n\t\t\t\t$options = apply_filters(\n\t\t\t\t\t'sportspress_performance_sections',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t-1 => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t\t\t0  => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t1  => esc_attr__(\n\t\t\t\t\t\t\t'Defense',\n\t\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( $key == $section, true, false ), esc_html( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p><strong><?php esc_html_e( 'Format', 'sportspress' ); ?></strong></p>\n\t\t<p class=\"sp-format-selector\">\n\t\t\t<select name=\"sp_format\">\n\t\t\t\t<?php\n\t\t\t\t$options = apply_filters(\n\t\t\t\t\t'sportspress_performance_formats',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'number'   => esc_attr__( 'Number', 'sportspress' ),\n\t\t\t\t\t\t'time'     => esc_attr__( 'Time', 'sportspress' ),\n\t\t\t\t\t\t'text'     => esc_attr__( 'Text', 'sportspress' ),\n\t\t\t\t\t\t'equation' => esc_attr__( 'Equation', 'sportspress' ),\n\t\t\t\t\t\t'checkbox' => esc_attr__(\n\t\t\t\t\t\t\t'Checkbox',\n\t\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( $key == $format, true, false ), esc_html( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<div id=\"sp_precisiondiv\">\n\t\t\t<p><strong><?php esc_html_e( 'Decimal Places', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<input name=\"sp_precision\" type=\"text\" size=\"4\" id=\"sp_precision\" value=\"<?php echo esc_attr( $precision ); ?>\" placeholder=\"0\">\n\t\t\t</p>\n\t\t</div>\n\t\t<div id=\"sp_timeddiv\">\n\t\t\t<p>\n\t\t\t\t<strong><?php esc_html_e( 'Timed', 'sportspress' ); ?></strong>\n\t\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Record minutes?', 'sportspress' ); ?>\"></i>\n\t\t\t</p>\n\t\t\t<ul class=\"sp-timed-selector\">\n\t\t\t\t<li>\n\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t<input name=\"sp_timed\" id=\"sp_timed_yes\" type=\"radio\" value=\"1\" <?php checked( $timed ); ?>>\n\t\t\t\t\t\t<?php esc_html_e( 'Yes', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t<input name=\"sp_timed\" id=\"sp_timed_no\" type=\"radio\" value=\"0\" <?php checked( ! $timed ); ?>>\n\t\t\t\t\t\t<?php esc_html_e( 'No', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t\t<div id=\"sp_sendoffdiv\">\n\t\t\t<p>\n\t\t\t\t<strong><?php esc_html_e( 'Send Off', 'sportspress' ); ?></strong>\n\t\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( \"Don't count minutes after?\", 'sportspress' ); ?>\"></i>\n\t\t\t</p>\n\t\t\t<ul class=\"sp-sendoff-selector\">\n\t\t\t\t<li>\n\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t<input name=\"sp_sendoff\" id=\"sp_sendoff_yes\" type=\"radio\" value=\"1\" <?php checked( $sendoff ); ?>>\n\t\t\t\t\t\t<?php esc_html_e( 'Yes', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t<input name=\"sp_sendoff\" id=\"sp_sendoff_no\" type=\"radio\" value=\"0\" <?php checked( ! $sendoff ); ?>>\n\t\t\t\t\t\t<?php esc_html_e( 'No', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t\t<?php\n\t\tif ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {\n\t\t\t$visible = get_post_meta( $post->ID, 'sp_visible', true );\n\t\t\tif ( '' === $visible ) {\n\t\t\t\t$visible = 1;\n\t\t\t}\n\t\t\t?>\n\t\t\t<p>\n\t\t\t\t<strong><?php esc_html_e( 'Visible', 'sportspress' ); ?></strong>\n\t\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Display in player profile?', 'sportspress' ); ?>\"></i>\n\t\t\t</p>\n\t\t\t<ul class=\"sp-visible-selector\">\n\t\t\t\t<li>\n\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t<input name=\"sp_visible\" id=\"sp_visible_yes\" type=\"radio\" value=\"1\" <?php checked( $visible ); ?>>\n\t\t\t\t\t\t<?php esc_html_e( 'Yes', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t<input name=\"sp_visible\" id=\"sp_visible_no\" type=\"radio\" value=\"0\" <?php checked( ! $visible ); ?>>\n\t\t\t\t\t\t<?php esc_html_e( 'No', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<?php\n\t\t}\n\n\t\tdo_action( 'sportspress_meta_box_performance_details', $post );\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tself::delete_duplicate( $_POST );\n\t\tupdate_post_meta( $post_id, 'sp_singular', sp_array_value( $_POST, 'sp_singular', '', 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1, 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number', 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0, 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_timed', sp_array_value( $_POST, 'sp_timed', 0, 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_sendoff', sp_array_value( $_POST, 'sp_sendoff', 0, 'int' ) );\n\t\tif ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {\n\t\t\tupdate_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1, 'int' ) );\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-equation.php",
    "content": "<?php\n/**\n * Performance Equation\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.1.6\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Equation' ) ) {\n\trequire 'class-sp-meta-box-equation.php';\n}\n\n/**\n * SP_Meta_Box_Performance_Equation\n */\nclass SP_Meta_Box_Performance_Equation extends SP_Meta_Box_Equation {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$equation = get_post_meta( $post->ID, 'sp_equation', true );\n\t\t$groups   = array( 'performance' );\n\t\tself::builder( $post->post_title, $equation, $groups );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-player-columns.php",
    "content": "<?php\n/**\n * Player Columns\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Player_Columns\n */\nclass SP_Meta_Box_Player_Columns {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$selected = (array) get_post_meta( $post->ID, 'sp_columns', true );\n\t\t$tabs     = apply_filters( 'sportspress_player_column_tabs', array( 'sp_performance', 'sp_statistic' ) );\n\t\t?>\n\t\t<div class=\"sp-instance\">\n\t\t\t<?php if ( $tabs ) { ?>\n\t\t\t<ul id=\"sp_column-tabs\" class=\"sp-tab-bar category-tabs\">\n\t\t\t\t<?php\n\t\t\t\tforeach ( $tabs as $index => $post_type ) {\n\t\t\t\t\t$object = get_post_type_object( $post_type );\n\t\t\t\t\t?>\n\t\t\t\t<li class=\"\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( 0 == $index ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\ttabs<?php } ?>\"><a href=\"#<?php echo esc_attr( $post_type ); ?>-all\"><?php echo esc_html( $object->labels->menu_name ); ?></a></li>\n\t\t\t\t<?php } ?>\n\t\t\t</ul>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $tabs as $index => $post_type ) {\n\t\t\t\t\tsp_column_checklist( $post->ID, $post_type, ( 0 == $index ? 'block' : 'none' ), $selected );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t<?php } ?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'key' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php",
    "content": "<?php\n/**\n * Player Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Player_Details\n */\nclass SP_Meta_Box_Player_Details {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$continents = SP()->countries->continents;\n\n\t\t$number              = get_post_meta( $post->ID, 'sp_number', true );\n\t\t$nationalities       = get_post_meta( $post->ID, 'sp_nationality', false );\n\t\t$default_nationality = get_option( 'sportspress_default_nationality', false );\n\n\t\tif ( empty( $nationalities ) && $default_nationality ) {\n\t\t\tif ( $default_nationality != '' ) {\n\t\t\t\t$nationalities[] = $default_nationality;\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $nationalities as $index => $nationality ) :\n\t\t\tif ( 2 == strlen( $nationality ) ) :\n\t\t\t\t$legacy                  = SP()->countries->legacy;\n\t\t\t\t$nationality             = strtolower( $nationality );\n\t\t\t\t$nationality             = sp_array_value( $legacy, $nationality, null );\n\t\t\t\t$nationalities[ $index ] = $nationality;\n\t\t\tendif;\n\t\tendforeach;\n\n\t\tif ( taxonomy_exists( 'sp_league' ) ) :\n\t\t\t$leagues    = get_the_terms( $post->ID, 'sp_league' );\n\t\t\t$league_ids = array();\n\t\t\tif ( $leagues ) :\n\t\t\t\tforeach ( $leagues as $league ) :\n\t\t\t\t\t$league_ids[] = $league->term_id;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\tendif;\n\n\t\tif ( taxonomy_exists( 'sp_season' ) ) :\n\t\t\t$seasons    = get_the_terms( $post->ID, 'sp_season' );\n\t\t\t$season_ids = array();\n\t\t\tif ( $seasons ) :\n\t\t\t\tforeach ( $seasons as $season ) :\n\t\t\t\t\t$season_ids[] = $season->term_id;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\tendif;\n\n\t\tif ( taxonomy_exists( 'sp_position' ) ) :\n\t\t\t$positions    = get_the_terms( $post->ID, 'sp_position' );\n\t\t\t$position_ids = array();\n\t\t\tif ( $positions ) :\n\t\t\t\tforeach ( $positions as $position ) :\n\t\t\t\t\t$position_ids[] = $position->term_id;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\tendif;\n\n\t\t$teams         = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type'      => 'sp_team',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t)\n\t\t);\n\t\t$past_teams    = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) );\n\t\t$current_teams = array_filter( get_post_meta( $post->ID, 'sp_current_team', false ) );\n\t\t?>\n\n\t\t<p><strong><?php esc_attr_e( 'Squad Number', 'sportspress' ); ?></strong></p>\n\t\t<p><input type=\"text\" size=\"4\" id=\"sp_number\" name=\"sp_number\" value=\"<?php echo esc_attr( $number ); ?>\"></p>\n\n\t\t<p><strong><?php esc_attr_e( 'Nationality', 'sportspress' ); ?></strong></p>\n\t\t<p><select id=\"sp_nationality\" name=\"sp_nationality[]\" data-placeholder=\"<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Nationality', 'sportspress' ) ); ?>\" class=\"widefat chosen-select\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( is_rtl() ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t chosen-rtl<?php endif; ?>\" multiple=\"multiple\">\n\t\t\t<option value=\"\"></option>\n\t\t\t<?php foreach ( $continents as $continent => $countries ) : ?>\n\t\t\t\t<optgroup label=\"<?php echo esc_attr( $continent ); ?>\">\n\t\t\t\t\t<?php foreach ( $countries as $code => $country ) : ?>\n\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $code ); ?>\" <?php selected( in_array( $code, $nationalities ) ); ?>><?php echo esc_html( $country ); ?></option>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</optgroup>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\n\t\t<?php if ( taxonomy_exists( 'sp_position' ) ) { ?>\n\t\t\t<p><strong><?php esc_attr_e( 'Positions', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'taxonomy'    => 'sp_position',\n\t\t\t\t'name'        => 'tax_input[sp_position][]',\n\t\t\t\t'selected'    => $position_ids,\n\t\t\t\t'values'      => 'term_id',\n\t\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Positions', 'sportspress' ) ),\n\t\t\t\t'class'       => 'widefat',\n\t\t\t\t'property'    => 'multiple',\n\t\t\t\t'chosen'      => true,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t?>\n\t\t\t</p>\n\t\t<?php } ?>\n\n\t\t<p><strong><?php esc_attr_e( 'Current Teams', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'   => 'sp_team',\n\t\t\t'name'        => 'sp_current_team[]',\n\t\t\t'selected'    => $current_teams,\n\t\t\t'values'      => 'ID',\n\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Teams', 'sportspress' ) ),\n\t\t\t'class'       => 'sp-current-teams widefat',\n\t\t\t'property'    => 'multiple',\n\t\t\t'chosen'      => true,\n\t\t);\n\t\tsp_dropdown_pages( $args );\n\t\t?>\n\t\t</p>\n\n\t\t<p><strong><?php esc_attr_e( 'Past Teams', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'   => 'sp_team',\n\t\t\t'name'        => 'sp_past_team[]',\n\t\t\t'selected'    => $past_teams,\n\t\t\t'values'      => 'ID',\n\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Teams', 'sportspress' ) ),\n\t\t\t'class'       => 'sp-past-teams widefat',\n\t\t\t'property'    => 'multiple',\n\t\t\t'chosen'      => true,\n\t\t);\n\t\tsp_dropdown_pages( $args );\n\t\t?>\n\t\t</p>\n\n\t\t<?php if ( taxonomy_exists( 'sp_league' ) ) { ?>\n\t\t<p><strong><?php esc_attr_e( 'Leagues', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'taxonomy'    => 'sp_league',\n\t\t\t\t'name'        => 'tax_input[sp_league][]',\n\t\t\t\t'selected'    => $league_ids,\n\t\t\t\t'values'      => 'term_id',\n\t\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Leagues', 'sportspress' ) ),\n\t\t\t\t'class'       => 'widefat',\n\t\t\t\t'property'    => 'multiple',\n\t\t\t\t'chosen'      => true,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t?>\n\t\t</p>\n\t\t<?php } ?>\n\n\t\t<?php if ( taxonomy_exists( 'sp_season' ) ) { ?>\n\t\t<p><strong><?php esc_attr_e( 'Seasons', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'taxonomy'    => 'sp_season',\n\t\t\t\t'name'        => 'tax_input[sp_season][]',\n\t\t\t\t'selected'    => $season_ids,\n\t\t\t\t'values'      => 'term_id',\n\t\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Seasons', 'sportspress' ) ),\n\t\t\t\t'class'       => 'widefat',\n\t\t\t\t'property'    => 'multiple',\n\t\t\t\t'chosen'      => true,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t?>\n\t\t</p>\n\t\t<?php } ?>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', '', 'text' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', array(), 'text' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_current_team', sp_array_value( $_POST, 'sp_current_team', array(), 'int' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_past_team', sp_array_value( $_POST, 'sp_past_team', array(), 'int' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sp_array_value( $_POST, 'sp_current_team', array(), 'int' ) ), sp_array_value( $_POST, 'sp_past_team', array() ) ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-player-metrics.php",
    "content": "<?php\n/**\n * Player Metrics\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Player_Metrics\n */\nclass SP_Meta_Box_Player_Metrics {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\n\t\t$metrics = get_post_meta( $post->ID, 'sp_metrics', true );\n\n\t\t$args = array(\n\t\t\t'post_type'      => 'sp_metric',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\n\t\t$vars = get_posts( $args );\n\n\t\tif ( $vars ) :\n\t\t\tforeach ( $vars as $var ) :\n\t\t\t\t?>\n\t\t\t<p><strong><?php echo esc_html( $var->post_title ); ?></strong></p>\n\t\t\t<p><input type=\"text\" name=\"sp_metrics[<?php echo esc_attr( $var->post_name ); ?>]\" value=\"<?php echo esc_attr( sp_array_value( $metrics, $var->post_name, '' ) ); ?>\" /></p>\n\t\t\t\t<?php\n\t\t\tendforeach;\n\t\telse :\n\t\t\tsp_post_adder( 'sp_metric', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_metrics', sp_array_value( $_POST, 'sp_metrics', array(), 'text' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-player-shortcode.php",
    "content": "<?php\n/**\n * Player Shortcode\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     1.6.1\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Player_Shortcode\n */\nclass SP_Meta_Box_Player_Shortcode {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t?>\n\t\t<p class=\"howto\">\n\t\t\t<?php esc_attr_e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?>\n\t\t</p>\n\t\t<p>\n\t\t\t<strong><?php esc_attr_e( 'Details', 'sportspress' ); ?></strong>\n\t\t</p>\n\t\t<p><input type=\"text\" value=\"<?php sp_shortcode_template( 'player_details', $post->ID ); ?>\" readonly=\"readonly\" class=\"code widefat\"></p>\n\t\t<p>\n\t\t\t<strong><?php esc_attr_e( 'Statistics', 'sportspress' ); ?></strong>\n\t\t</p>\n\t\t<p><input type=\"text\" value=\"<?php sp_shortcode_template( 'player_statistics', $post->ID ); ?>\" readonly=\"readonly\" class=\"code widefat\"></p>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php",
    "content": "<?php\n/**\n * Player Statistics\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.14\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Player_Statistics\n */\nclass SP_Meta_Box_Player_Statistics {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$player  = new SP_Player( $post );\n\t\t$leagues = $player->get_terms_sorted_by_sp_order( 'sp_league' );\n\t\tif ( is_array( $leagues ) ) {\n\t\t\t$league_num = sizeof( $leagues );\n\t\t} else {\n\t\t\t$league_num = 0;\n\t\t}\n\t\t$sections           = get_option( 'sportspress_player_performance_sections', -1 );\n\t\t$show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;\n\n\t\tif ( $leagues ) {\n\t\t\tif ( -1 == $sections ) {\n\t\t\t\t// Loop through statistics for each league\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ( $leagues as $league ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<p><strong><?php echo esc_html( $league->name ); ?></strong></p>\n\t\t\t\t\t<?php\n\t\t\t\t\tlist( $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes, $formats, $total_types ) = $player->data( $league->term_id, true );\n\t\t\t\t\tself::table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0, true, $formats, $total_types );\n\t\t\t\t\t$i ++;\n\t\t\t\tendforeach;\n\t\t\t\tif ( $show_career_totals ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<p><strong><?php esc_attr_e( 'Career Total', 'sportspress' ); ?></strong></p>\n\t\t\t\t\t<?php\n\t\t\t\t\tlist( $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes, $formats, $total_types ) = $player->data( 0, true );\n\t\t\t\t\tself::table( $post->ID, 0, $columns, $data, $placeholders, $merged, $seasons_teams, false, false, $formats, $total_types );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Determine order of sections\n\t\t\t\tif ( 1 == $sections ) {\n\t\t\t\t\t$section_order = array(\n\t\t\t\t\t\t1 => esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$section_order = array( esc_attr__( 'Offense', 'sportspress' ), esc_attr__( 'Defense', 'sportspress' ) );\n\t\t\t\t}\n\n\t\t\t\t$s = 0;\n\t\t\t\tforeach ( $section_order as $section_id => $section_label ) {\n\t\t\t\t\t// Loop through statistics for each league\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ( $leagues as $league ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p><strong><?php echo esc_html( $league->name ); ?> &mdash; <?php echo esc_html( $section_label ); ?></strong></p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tlist( $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes, $formats, $total_types ) = $player->data( $league->term_id, true, $section_id );\n\t\t\t\t\t\tself::table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0 && $s == 0, $s == 0, $formats, $total_types );\n\t\t\t\t\t\t$i ++;\n\t\t\t\t\tendforeach;\n\t\t\t\t\tif ( $show_career_totals ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p><strong><?php esc_attr_e( 'Career Total', 'sportspress' ); ?> &mdash; <?php echo esc_html( $section_label ); ?></strong></p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tlist( $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes, $formats, $total_types ) = $player->data( 0, true, $section_id );\n\t\t\t\t\t\tself::table( $post->ID, 0, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0 && $s == 0, $s == 0, $formats, $total_types );\n\t\t\t\t\t}\n\t\t\t\t\t$s ++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_leagues', sp_array_value( $_POST, 'sp_leagues', array(), 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_statistics', sp_array_value( $_POST, 'sp_statistics', array(), 'text' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $id = null, $league_id = null, $columns = array(), $data = array(), $placeholders = array(), $merged = array(), $leagues = array(), $has_checkboxes = false, $team_select = false, $formats = array(), $total_types = array() ) {\n\t\t$readonly = false;\n\t\t$teams    = array_filter( get_post_meta( $id, 'sp_team', false ) );\n\t\t$buffer   = apply_filters(\n\t\t\t'sportspress_meta_box_player_statistics_table_buffer',\n\t\t\tarray(\n\t\t\t\t'teams'    => $teams,\n\t\t\t\t'readonly' => $readonly,\n\t\t\t),\n\t\t\t$id\n\t\t);\n\t\t?>\n\t\t<div class=\"sp-data-table-container\">\n\t\t\t<table class=\"widefat sp-data-table sp-player-statistics-table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th><?php esc_attr_e( 'Season', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php if ( $team_select && apply_filters( 'sportspress_player_team_statistics', $league_id ) ) : ?>\n\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t<?php esc_attr_e( 'Team', 'sportspress' ); ?>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $columns as $key => $label ) :\n\t\t\t\t\t\t\tif ( $key == 'team' ) {\n\t\t\t\t\t\t\t\tcontinue;}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<th><?php echo wp_kses_post( $label ); ?></th>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t<?php do_action( 'sportspress_meta_box_player_statistics_table_header_row', $id, $league_id ); ?>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tfoot>\n\t\t\t\t\t<?php $div_stats = sp_array_value( $data, 0, array() ); ?>\n\t\t\t\t\t<tr class=\"sp-row sp-total\">\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<label><strong><?php esc_attr_e( 'Total', 'sportspress' ); ?></strong></label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<?php if ( $team_select && apply_filters( 'sportspress_player_team_statistics', $league_id ) ) { ?>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $columns as $column => $label ) :\n\t\t\t\t\t\t\tif ( $column == 'team' ) {\n\t\t\t\t\t\t\t\tcontinue;}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$value       = sp_array_value( sp_array_value( $data, 0, array() ), $column, null );\n\t\t\t\t\t\t\t\t$placeholder = sp_array_value( sp_array_value( $placeholders, 0, array() ), $column, 0 );\n\n\t\t\t\t\t\t\t\t// Convert value and placeholder to time format\n\t\t\t\t\t\t\tif ( 'time' === sp_array_value( $formats, $column, 'number' ) ) {\n\t\t\t\t\t\t\t\t$timeval     = sp_time_value( $value );\n\t\t\t\t\t\t\t\t$placeholder = sp_time_value( $placeholder );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( $readonly ) {\n\t\t\t\t\t\t\t\techo $value ? esc_html( $value ) : esc_html( $placeholder );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ( 'time' === sp_array_value( $formats, $column, 'number' ) ) {\n\t\t\t\t\t\t\t\t\techo '<input class=\"sp-convert-time-input\" type=\"text\" name=\"sp_times[' . esc_attr( $league_id ) . '][0][' . esc_attr( $column ) . ']\" value=\"' . ( '' === $value ? '' : esc_attr( $timeval ) ) . '\" placeholder=\"' . esc_attr( $placeholder ) . '\"' . ( $readonly ? ' disabled=\"disabled\"' : '' ) . '  />'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\t\t\t\t\t\techo '<input class=\"sp-convert-time-output\" type=\"hidden\" name=\"sp_statistics[' . esc_attr( $league_id ) . '][0][' . esc_attr( $column ) . ']\" value=\"' . esc_attr( $value ) . '\" data-sp-format=\"' . esc_attr( sp_array_value( $formats, $column, 'number' ) ) . '\" data-sp-total-type=\"' . esc_attr( sp_array_value( $total_types, $column, 'total' ) ) . '\" />';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\techo '<input type=\"text\" name=\"sp_statistics[' . esc_attr( $league_id ) . '][0][' . esc_attr( $column ) . ']\" value=\"' . esc_attr( $value ) . '\" placeholder=\"' . esc_attr( $placeholder ) . '\"' . ( $readonly ? ' disabled=\"disabled\"' : '' ) . ' data-sp-format=\"' . esc_attr( sp_array_value( $formats, $column, 'number' ) ) . '\" data-sp-total-type=\"' . esc_attr( sp_array_value( $total_types, $column, 'total' ) ) . '\" />';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t<?php do_action( 'sportspress_meta_box_player_statistics_table_footer_row', $id, $league_id ); ?>\n\t\t\t\t\t</tr>\n\t\t\t\t</tfoot>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ( $data as $div_id => $div_stats ) :\n\t\t\t\t\t\tif ( $div_id === 'statistics' ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $div_id === 0 ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$div = get_term( $div_id, 'sp_season' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t <?php echo esc_attr( implode( ' ', apply_filters( 'sportspress_meta_box_player_statistics_row_classes', array(), $league_id, $div_id ) ) ); ?>\" data-league=\"<?php echo (int) $league_id; ?>\" data-season=\"<?php echo (int) $div_id; ?>\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<?php if ( ! apply_filters( 'sportspress_player_team_statistics', $league_id ) ) : ?>\n\t\t\t\t\t\t\t\t\t\t<?php $value = sp_array_value( $leagues, $div_id, '-1' ); ?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sp_leagues[<?php echo esc_attr( $league_id ); ?>][<?php echo esc_attr( $div_id ); ?>]\" value=\"-1\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_leagues[<?php echo esc_attr( $league_id ); ?>][<?php echo esc_attr( $div_id ); ?>]\" value=\"1\" <?php checked( $value ); ?>>\n\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( 0 === $div_id ) {\n\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Total', 'sportspress' );\n\t\t\t\t\t\t\t\t\t} elseif ( 'WP_Error' != get_class( $div ) ) {\n\t\t\t\t\t\t\t\t\t\t$allowed_html = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'input'      => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'  => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'size' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'placeholder' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'readonly' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo wp_kses( apply_filters( 'sportspress_meta_box_player_statistics_season_name', $div->name, $league_id, $div_id, $div_stats ), $allowed_html );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<?php if ( $team_select && apply_filters( 'sportspress_player_team_statistics', $league_id ) ) : ?>\n\t\t\t\t\t\t\t\t<?php if ( $div_id == 0 ) : ?>\n\t\t\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<?php $value = sp_array_value( $leagues, $div_id, '-1' ); ?>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t\t\t\t\t'post_type'   => 'sp_team',\n\t\t\t\t\t\t\t\t\t\t\t'name'        => 'sp_leagues[' . $league_id . '][' . $div_id . ']',\n\t\t\t\t\t\t\t\t\t\t\t'show_option_none' => esc_attr__( '&mdash; None &mdash;', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t\t\t'sort_order'  => 'ASC',\n\t\t\t\t\t\t\t\t\t\t\t'sort_column' => 'menu_order',\n\t\t\t\t\t\t\t\t\t\t\t'selected'    => $value,\n\t\t\t\t\t\t\t\t\t\t\t'values'      => 'ID',\n\t\t\t\t\t\t\t\t\t\t\t'include'     => $teams,\n\t\t\t\t\t\t\t\t\t\t\t'tax_query'   => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'terms' => $league_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'field' => 'term_id',\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'terms' => $div_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'field' => 'term_id',\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( '&mdash; None &mdash;', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$collection = array(\n\t\t\t\t\t\t\t\t'columns'        => $columns,\n\t\t\t\t\t\t\t\t'data'           => $data,\n\t\t\t\t\t\t\t\t'placeholders'   => $placeholders,\n\t\t\t\t\t\t\t\t'merged'         => $merged,\n\t\t\t\t\t\t\t\t'seasons_teams'  => array(),\n\t\t\t\t\t\t\t\t'has_checkboxes' => $has_checkboxes,\n\t\t\t\t\t\t\t\t'formats'        => $formats,\n\t\t\t\t\t\t\t\t'total_types'    => $total_types,\n\t\t\t\t\t\t\t\t'buffer'         => $buffer,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tlist( $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes, $formats, $total_types, $buffer ) = array_values( apply_filters( 'sportspress_meta_box_player_statistics_collection', $collection, $id, $league_id, $div_id, $value ) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $columns as $column => $label ) :\n\t\t\t\t\t\t\t\tif ( $column == 'team' ) {\n\t\t\t\t\t\t\t\t\tcontinue;}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$value       = sp_array_value( sp_array_value( $data, $div_id, array() ), $column, null );\n\t\t\t\t\t\t\t\t\t$placeholder = sp_array_value( sp_array_value( $placeholders, $div_id, array() ), $column, 0 );\n\n\t\t\t\t\t\t\t\t\t// Convert value and placeholder to time format\n\t\t\t\t\t\t\t\tif ( 'time' === sp_array_value( $formats, $column, 'number' ) ) {\n\t\t\t\t\t\t\t\t\t$timeval     = sp_time_value( $value );\n\t\t\t\t\t\t\t\t\t$placeholder = sp_time_value( $placeholder );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( $readonly ) {\n\t\t\t\t\t\t\t\t\techo $timeval ? esc_html( $timeval ) : esc_html( $placeholder );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif ( 'time' === sp_array_value( $formats, $column, 'number' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<input class=\"sp-convert-time-input\" type=\"text\" name=\"sp_times[' . esc_attr( $league_id ) . '][' . esc_attr( $div_id ) . '][' . esc_attr( $column ) . ']\" value=\"' . ( '' === $value ? '' : esc_attr( $timeval ) ) . '\" placeholder=\"' . esc_attr( $placeholder ) . '\"' . ( $readonly ? ' disabled=\"disabled\"' : '' ) . ' data-column=\"' . esc_attr( $column ) . '\" />'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\t\t\t\t\t\t\techo '<input class=\"sp-convert-time-output\" type=\"hidden\" name=\"sp_statistics[' . esc_attr( $league_id ) . '][' . esc_attr( $div_id ) . '][' . esc_attr( $column ) . ']\" value=\"' . esc_attr( $value ) . '\" />';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\techo '<input type=\"text\" name=\"sp_statistics[' . esc_attr( $league_id ) . '][' . esc_attr( $div_id ) . '][' . esc_attr( $column ) . ']\" value=\"' . esc_attr( $value ) . '\" placeholder=\"' . esc_attr( $placeholder ) . '\"' . ( $readonly ? ' disabled=\"disabled\"' : '' ) . ' data-column=\"' . esc_attr( $column ) . '\" />';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t<?php do_action( 'sportspress_meta_box_player_statistics_table_row', $id, $league_id, $div_id, $team_select, $buffer, $i ); ?>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tdo_action( 'sportspress_meta_box_player_statistics_table_after_row', $id, $league_id, $div_id, $team_select, $buffer, $i );\n\t\t\t\t\tendforeach;\n\t\t\t\t\tdo_action( 'sportspress_meta_box_player_statistics_table_tbody', $id, $league_id, $div_id, $team_select, $buffer );\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php",
    "content": "<?php\n/**\n * Result Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Config' ) ) {\n\trequire 'class-sp-meta-box-config.php';\n}\n\n/**\n * SP_Meta_Box_Result_Details\n */\nclass SP_Meta_Box_Result_Details extends SP_Meta_Box_Config {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$precision = get_post_meta( $post->ID, 'sp_precision', true );\n\t\tglobal $pagenow;\n\t\tif ( 'post.php' == $pagenow && 'draft' !== get_post_status() ) {\n\t\t\t$readonly = true;\n\t\t} else {\n\t\t\t$readonly = false;\n\t\t}\n\t\t?>\n\t\t<p><strong><?php esc_attr_e( 'Variable', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_default_key\" type=\"hidden\" id=\"sp_default_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t\t<input name=\"sp_key\" type=\"text\" id=\"sp_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $readonly ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t readonly=\"readonly\"<?php } ?>> <span class=\"description\">(for, against)</span>\n\t\t</p>\n\t\t<p><strong><?php esc_attr_e( 'Decimal Places', 'sportspress' ); ?></strong></p>\n\t\t<p class=\"sp-precision-selector\">\n\t\t\t<input name=\"sp_precision\" type=\"text\" size=\"4\" id=\"sp_precision\" value=\"<?php echo esc_attr( $precision ); ?>\" placeholder=\"0\">\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tself::delete_duplicate( $_POST );\n\t\tupdate_post_meta( $post_id, 'sp_precision', (int) sp_array_value( $_POST, 'sp_precision', 1, 'int' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-result-equation.php",
    "content": "<?php\n/**\n * Result Equation\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     1.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Equation' ) ) {\n\trequire 'class-sp-meta-box-equation.php';\n}\n\n/**\n * SP_Meta_Box_Result_Equation\n */\nclass SP_Meta_Box_Result_Equation extends SP_Meta_Box_Equation {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$equation = get_post_meta( $post->ID, 'sp_equation', true );\n\t\t$groups   = array( 'performance' );\n\t\tself::builder( $post->post_title, $equation, $groups );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php",
    "content": "<?php\n/**\n * Spec Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Config' ) ) {\n\trequire 'class-sp-meta-box-config.php';\n}\n\n/**\n * SP_Meta_Box_Spec_Details\n */\nclass SP_Meta_Box_Spec_Details extends SP_Meta_Box_Config {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$visible = get_post_meta( $post->ID, 'sp_visible', true );\n\t\tif ( '' === $visible ) {\n\t\t\t$visible = 1;\n\t\t}\n\t\t?>\n\t\t<p><strong><?php esc_attr_e( 'Variable', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_default_key\" type=\"hidden\" id=\"sp_default_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t\t<input name=\"sp_key\" type=\"text\" id=\"sp_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t</p>\n\t\t<p>\n\t\t\t<strong><?php esc_attr_e( 'Visible', 'sportspress' ); ?></strong>\n\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Display in event pages?', 'sportspress' ); ?>\"></i>\n\t\t</p>\n\t\t<ul class=\"sp-visible-selector\">\n\t\t\t<li>\n\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t<input name=\"sp_visible\" id=\"sp_visible_yes\" type=\"radio\" value=\"1\" <?php checked( $visible ); ?>>\n\t\t\t\t\t<?php esc_attr_e( 'Yes', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t<input name=\"sp_visible\" id=\"sp_visible_no\" type=\"radio\" value=\"0\" <?php checked( ! $visible ); ?>>\n\t\t\t\t\t<?php esc_attr_e( 'No', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</li>\n\t\t</ul>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tself::delete_duplicate( $_POST );\n\t\tupdate_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1, 'int' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php",
    "content": "<?php\n/**\n * Staff Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.18\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Staff_Details\n */\nclass SP_Meta_Box_Staff_Details {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$continents = SP()->countries->continents;\n\n\t\t$nationalities = get_post_meta( $post->ID, 'sp_nationality', false );\n\t\tforeach ( $nationalities as $index => $nationality ) :\n\t\t\tif ( 2 == strlen( $nationality ) ) :\n\t\t\t\t$legacy                  = SP()->countries->legacy;\n\t\t\t\t$nationality             = strtolower( $nationality );\n\t\t\t\t$nationality             = sp_array_value( $legacy, $nationality, null );\n\t\t\t\t$nationalities[ $index ] = $nationality;\n\t\t\tendif;\n\t\tendforeach;\n\n\t\t$leagues    = get_the_terms( $post->ID, 'sp_league' );\n\t\t$league_ids = array();\n\t\tif ( $leagues ) :\n\t\t\tforeach ( $leagues as $league ) :\n\t\t\t\t$league_ids[] = $league->term_id;\n\t\t\tendforeach;\n\t\tendif;\n\n\t\t$seasons    = get_the_terms( $post->ID, 'sp_season' );\n\t\t$season_ids = array();\n\t\tif ( $seasons ) :\n\t\t\tforeach ( $seasons as $season ) :\n\t\t\t\t$season_ids[] = $season->term_id;\n\t\t\tendforeach;\n\t\tendif;\n\n\t\t$roles    = get_the_terms( $post->ID, 'sp_role' );\n\t\t$role_ids = is_array( $roles ) ? wp_list_pluck( $roles, 'term_id' ) : array();\n\n\t\t$teams         = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type'      => 'sp_team',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t)\n\t\t);\n\t\t$past_teams    = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) );\n\t\t$current_teams = array_filter( get_post_meta( $post->ID, 'sp_current_team', false ) );\n\t\t?>\n\t\t<p><strong><?php esc_attr_e( 'Jobs', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'taxonomy'    => 'sp_role',\n\t\t\t'name'        => 'tax_input[sp_role][]',\n\t\t\t'selected'    => $role_ids,\n\t\t\t'values'      => 'term_id',\n\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Jobs', 'sportspress' ) ),\n\t\t\t'class'       => 'widefat',\n\t\t\t'property'    => 'multiple',\n\t\t\t'chosen'      => true,\n\t\t);\n\t\tif ( ! sp_dropdown_taxonomies( $args ) ) :\n\t\t\tsp_taxonomy_adder( 'sp_role', 'sp_staff', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><strong><?php esc_attr_e( 'Nationality', 'sportspress' ); ?></strong></p>\n\t\t<p><select id=\"sp_nationality\" name=\"sp_nationality[]\" data-placeholder=\"<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Nationality', 'sportspress' ) ); ?>\" class=\"widefat chosen-select\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( is_rtl() ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t chosen-rtl<?php endif; ?>\" multiple=\"multiple\">\n\t\t\t<option value=\"\"></option>\n\t\t\t<?php foreach ( $continents as $continent => $countries ) : ?>\n\t\t\t\t<optgroup label=\"<?php echo esc_attr( $continent ); ?>\">\n\t\t\t\t\t<?php foreach ( $countries as $code => $country ) : ?>\n\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $code ); ?>\" <?php selected( in_array( $code, $nationalities ) ); ?>><?php echo esc_html( $country ); ?></option>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</optgroup>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\n\t\t<p><strong><?php esc_attr_e( 'Current Teams', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'   => 'sp_team',\n\t\t\t'name'        => 'sp_current_team[]',\n\t\t\t'selected'    => $current_teams,\n\t\t\t'values'      => 'ID',\n\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Teams', 'sportspress' ) ),\n\t\t\t'class'       => 'sp-current-teams widefat',\n\t\t\t'property'    => 'multiple',\n\t\t\t'chosen'      => true,\n\t\t);\n\t\tsp_dropdown_pages( $args );\n\t\t?>\n\t\t</p>\n\n\t\t<p><strong><?php esc_attr_e( 'Past Teams', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'   => 'sp_team',\n\t\t\t'name'        => 'sp_past_team[]',\n\t\t\t'selected'    => $past_teams,\n\t\t\t'values'      => 'ID',\n\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Teams', 'sportspress' ) ),\n\t\t\t'class'       => 'sp-past-teams widefat',\n\t\t\t'property'    => 'multiple',\n\t\t\t'chosen'      => true,\n\t\t);\n\t\tsp_dropdown_pages( $args );\n\t\t?>\n\t\t</p>\n\n\t\t<p><strong><?php esc_attr_e( 'Leagues', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'taxonomy'    => 'sp_league',\n\t\t\t'name'        => 'tax_input[sp_league][]',\n\t\t\t'selected'    => $league_ids,\n\t\t\t'values'      => 'term_id',\n\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Leagues', 'sportspress' ) ),\n\t\t\t'class'       => 'widefat',\n\t\t\t'property'    => 'multiple',\n\t\t\t'chosen'      => true,\n\t\t);\n\t\tsp_dropdown_taxonomies( $args );\n\t\t?>\n\t\t</p>\n\n\t\t<p><strong><?php esc_attr_e( 'Seasons', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'taxonomy'    => 'sp_season',\n\t\t\t'name'        => 'tax_input[sp_season][]',\n\t\t\t'selected'    => $season_ids,\n\t\t\t'values'      => 'term_id',\n\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Seasons', 'sportspress' ) ),\n\t\t\t'class'       => 'widefat',\n\t\t\t'property'    => 'multiple',\n\t\t\t'chosen'      => true,\n\t\t);\n\t\tsp_dropdown_taxonomies( $args );\n\t\t?>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', array(), 'key' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_current_team', sp_array_value( $_POST, 'sp_current_team', array(), 'id' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_past_team', sp_array_value( $_POST, 'sp_past_team', array(), 'id' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sp_array_value( $_POST, 'sp_current_team', array(), 'id' ) ), sp_array_value( $_POST, 'sp_past_team', array(), 'id' ) ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-shortcode.php",
    "content": "<?php\n/**\n * Staff Shortcode\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version   2.5.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Staff_Shortcode\n */\nclass SP_Meta_Box_Staff_Shortcode {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t?>\n\t\t<p class=\"howto\">\n\t\t\t<?php esc_attr_e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?>\n\t\t</p>\n\t\t<p><input type=\"text\" value=\"<?php sp_shortcode_template( 'staff_profile', $post->ID ); ?>\" readonly=\"readonly\" class=\"code widefat\"></p>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php",
    "content": "<?php\n/**\n * Statistic Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Config' ) ) {\n\trequire 'class-sp-meta-box-config.php';\n}\n\n/**\n * SP_Meta_Box_Statistic_Details\n */\nclass SP_Meta_Box_Statistic_Details extends SP_Meta_Box_Config {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$precision = get_post_meta( $post->ID, 'sp_precision', true );\n\t\t$section   = get_post_meta( $post->ID, 'sp_section', true );\n\t\t$format    = get_post_meta( $post->ID, 'sp_format', true );\n\t\t$total     = get_post_meta( $post->ID, 'sp_type', true );\n\t\t$visible   = get_post_meta( $post->ID, 'sp_visible', true );\n\n\t\t// Defaults\n\t\tif ( '' === $precision ) {\n\t\t\t$precision = 0;\n\t\t}\n\t\tif ( '' === $section ) {\n\t\t\t$section = -1;\n\t\t}\n\t\tif ( '' === $format ) {\n\t\t\t$format = 'number';\n\t\t}\n\t\t?>\n\t\t<p><strong><?php esc_attr_e( 'Key', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<input name=\"sp_default_key\" type=\"hidden\" id=\"sp_default_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t\t<input name=\"sp_key\" type=\"text\" id=\"sp_key\" value=\"<?php echo esc_attr( $post->post_name ); ?>\">\n\t\t</p>\n\t\t<p><strong><?php esc_attr_e( 'Decimal Places', 'sportspress' ); ?></strong></p>\n\t\t<p class=\"sp-precision-selector\">\n\t\t\t<input name=\"sp_precision\" type=\"text\" size=\"4\" id=\"sp_precision\" value=\"<?php echo esc_attr( $precision ); ?>\" placeholder=\"0\">\n\t\t</p>\n\t\t<p><strong><?php esc_attr_e( 'Category', 'sportspress' ); ?></strong></p>\n\t\t<p class=\"sp-section-selector\">\n\t\t\t<select name=\"sp_section\">\n\t\t\t\t<?php\n\t\t\t\t$options = apply_filters(\n\t\t\t\t\t'sportspress_performance_sections',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t-1 => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t\t\t0  => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t1  => esc_attr__(\n\t\t\t\t\t\t\t'Defense',\n\t\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( $key == $section, true, false ), esc_attr( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p><strong><?php esc_attr_e( 'Format', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<select name=\"sp_format\">\n\t\t\t\t<?php\n\t\t\t\t$options = apply_filters(\n\t\t\t\t\t'sportspress_statistic_formats',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'number' => esc_attr__( 'Number', 'sportspress' ),\n\t\t\t\t\t\t'time'   => esc_attr__(\n\t\t\t\t\t\t\t'Time',\n\t\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( $key == $format, true, false ), esc_attr( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p><strong><?php esc_attr_e( 'Type', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<select name=\"sp_type\">\n\t\t\t\t<?php\n\t\t\t\t$options = apply_filters(\n\t\t\t\t\t'sportspress_statistic_total_types',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'total'   => esc_attr__( 'Total', 'sportspress' ),\n\t\t\t\t\t\t'average' => esc_attr__(\n\t\t\t\t\t\t\t'Average',\n\t\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $options as $key => $value ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $key ), selected( $key == $total, true, false ), esc_attr( $value ) );\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<?php\n\t\tif ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {\n\t\t\t$visible = get_post_meta( $post->ID, 'sp_visible', true );\n\t\t\tif ( '' === $visible ) {\n\t\t\t\t$visible = 1;\n\t\t\t}\n\t\t\t?>\n\t\t\t<p>\n\t\t\t\t<strong><?php esc_attr_e( 'Visible', 'sportspress' ); ?></strong>\n\t\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Display in player profile?', 'sportspress' ); ?>\"></i>\n\t\t\t</p>\n\t\t\t<ul class=\"sp-visible-selector\">\n\t\t\t\t<li>\n\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t<input name=\"sp_visible\" id=\"sp_visible_yes\" type=\"radio\" value=\"1\" <?php checked( $visible ); ?>>\n\t\t\t\t\t\t<?php esc_attr_e( 'Yes', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t<input name=\"sp_visible\" id=\"sp_visible_no\" type=\"radio\" value=\"0\" <?php checked( ! $visible ); ?>>\n\t\t\t\t\t\t<?php esc_attr_e( 'No', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t<?php\n\t\t}\n\n\t\tdo_action( 'sportspress_meta_box_statistic_details', $post );\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tself::delete_duplicate( $_POST );\n\t\tupdate_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1, 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_type', sp_array_value( $_POST, 'sp_type', 'total', 'key' ) );\n\t\tupdate_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number', 'key' ) );\n\t\tupdate_post_meta( $post_id, 'sp_precision', (int) sp_array_value( $_POST, 'sp_precision', 1, 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1, 'int' ) );\n\t}\n\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-equation.php",
    "content": "<?php\n/**\n * Statistic Equation\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     1.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Meta_Box_Equation' ) ) {\n\trequire 'class-sp-meta-box-equation.php';\n}\n\n/**\n * SP_Meta_Box_Statistic_Equation\n */\nclass SP_Meta_Box_Statistic_Equation extends SP_Meta_Box_Equation {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$equation = get_post_meta( $post->ID, 'sp_equation', true );\n\t\t$groups   = array( 'player_event', 'outcome', 'result', 'performance', 'metric' );\n\t\tself::builder( $post->post_title, $equation, $groups );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php",
    "content": "<?php\n/**\n * Table Data\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Table_Data\n */\nclass SP_Meta_Box_Table_Data {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\tglobal $pagenow;\n\t\tif ( is_admin() && in_array( $pagenow, array( 'post-new.php' ) ) && 'sp_table' == get_post_type() ) {\n\t\t\tself::table();\n\t\t} else {\n\t\t\t$table = new SP_League_Table( $post );\n\t\t\tlist( $columns, $usecolumns, $data, $placeholders, $merged ) = $table->data( true );\n\t\t\t$adjustments = $table->adjustments;\n\t\t\t$highlight   = get_post_meta( $table->ID, 'sp_highlight', true );\n\t\t\tself::table( $table->ID, $columns, $usecolumns, $data, $placeholders, $adjustments, $highlight );\n\t\t}\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_highlight', sp_array_value( $_POST, 'sp_highlight', array(), 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_adjustments', sp_array_value( $_POST, 'sp_adjustments', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_teams', sp_array_value( $_POST, 'sp_teams', array(), 'text' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $id = 0, $columns = array(), $usecolumns = null, $data = array(), $placeholders = array(), $adjustments = array(), $highlight = null, $readonly = false ) {\n\t\tif ( is_array( $usecolumns ) ) {\n\t\t\t$usecolumns = array_filter( $usecolumns );\n\t\t}\n\n\t\t$mode = sp_get_post_mode( $id );\n\n\t\tif ( 'player' === $mode ) {\n\t\t\t$show_team_logo = get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false;\n\t\t\t$icon_class     = 'sp-icon-tshirt';\n\t\t} else {\n\t\t\t$show_team_logo = get_option( 'sportspress_table_show_logos', 'no' ) == 'yes' ? true : false;\n\t\t\t$icon_class     = 'sp-icon-shield';\n\t\t}\n\t\t?>\n\n\t\t<?php if ( $readonly ) { ?>\n\t\t\t<p>\n\t\t\t\t<strong><?php echo esc_attr( get_the_title( $id ) ); ?></strong>\n\t\t\t\t<a class=\"add-new-h2 sp-add-new-h2\" href=\"\n\t\t\t\t<?php\n\t\t\t\techo esc_url(\n\t\t\t\t\tadmin_url(\n\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post'   => $id,\n\t\t\t\t\t\t\t\t'action' => 'edit',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'post.php'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php esc_attr_e( 'Edit', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t<?php } else { ?>\n\t\t\t<input type=\"hidden\" name=\"sp_highlight\" value=\"0\">\n\t\t\t<ul class=\"subsubsub sp-table-bar\">\n\t\t\t\t<li><a href=\"#sp-table-values\" class=\"current\"><?php esc_attr_e( 'Values', 'sportspress' ); ?></a></li> | \n\t\t\t\t<li><a href=\"#sp-table-adjustments\" class=\"\"><?php esc_attr_e( 'Adjustments', 'sportspress' ); ?></a></li>\n\t\t\t</ul>\n\t\t<?php } ?>\n\n\t\t<div class=\"sp-data-table-container sp-table-panel sp-table-values\" id=\"sp-table-values\">\n\t\t\t<table class=\"widefat sp-data-table sp-league-table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<?php if ( ! $readonly ) { ?>\n\t\t\t\t\t\t\t<th class=\"radio\"><span class=\"dashicons <?php echo esc_attr( $icon_class ); ?> sp-tip\" title=\"<?php esc_attr_e( 'Highlight', 'sportspress' ); ?>\"></span></th>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<th><?php esc_attr_e( 'Team', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php foreach ( $columns as $key => $label ) : ?>\n\t\t\t\t\t\t\t<th><label for=\"sp_columns_<?php echo esc_attr( $key ); ?>\">\n\t\t\t\t\t\t\t\t<?php if ( ! $readonly ) { ?>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_columns[]\" value=\"<?php echo esc_attr( $key ); ?>\" id=\"sp_columns_<?php echo esc_attr( $key ); ?>\" <?php checked( ! is_array( $usecolumns ) || in_array( $key, $usecolumns ) ); ?>>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t\t\t</label></th>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $data ) && sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\tforeach ( $data as $team_id => $team_stats ) :\n\t\t\t\t\t\t\tif ( ! $team_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$default_name = sp_array_value( $team_stats, 'name', '' );\n\t\t\t\t\t\t\tif ( $default_name == null ) {\n\t\t\t\t\t\t\t\t$default_name = get_the_title( $team_id );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t<?php if ( ! $readonly ) { ?>\n\t\t\t\t\t\t\t\t\t<td><input type=\"radio\" class=\"sp-radio-toggle\" name=\"sp_highlight\" value=\"<?php echo esc_attr( $team_id ); ?>\" <?php checked( $highlight, $team_id ); ?> <?php disabled( $readonly ); ?>></td>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $show_team_logo ) {\n\t\t\t\t\t\t\t\t\t\techo get_the_post_thumbnail( $team_id, 'sportspress-fit-mini' );}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<?php if ( $readonly ) { ?>\n\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $default_name ); ?>\n\t\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sp-default-value\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"sp-default-value-input\"><?php echo esc_html( $default_name ); ?></span>\n\t\t\t\t\t\t\t\t\t\t\t<a class=\"dashicons dashicons-edit sp-edit\" title=\"<?php esc_attr_e( 'Edit', 'sportspress' ); ?>\"></a>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"hidden sp-custom-value\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"sp_teams[<?php echo esc_attr( $team_id ); ?>][name]\" class=\"name sp-custom-value-input\" value=\"<?php echo esc_attr( sp_array_value( $team_stats, 'name', '' ) ); ?>\" placeholder=\"<?php echo esc_attr( get_the_title( $team_id ) ); ?>\" size=\"6\">\n\t\t\t\t\t\t\t\t\t\t\t<a class=\"button button-secondary sp-cancel\"><?php esc_attr_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t\t\t\t\t<a class=\"button button-primary sp-save\"><?php esc_attr_e( 'Save', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $columns as $column => $label ) :\n\t\t\t\t\t\t\t\t\t$value       = sp_array_value( $team_stats, $column, '' );\n\t\t\t\t\t\t\t\t\t$placeholder = sp_array_value( sp_array_value( $placeholders, $team_id, array() ), $column, 0 );\n\t\t\t\t\t\t\t\t\t$placeholder = wp_strip_all_tags( $placeholder );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<td><input type=\"text\" name=\"sp_teams[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"<?php echo esc_attr( $value ); ?>\" placeholder=\"<?php echo esc_attr( $placeholder ); ?>\" data-placeholder=\"<?php echo esc_attr( $placeholder ); ?>\" data-matrix=\"<?php echo esc_attr( $team_id ); ?>_<?php echo esc_attr( $column ); ?>\" data-adjustment=\"<?php echo esc_attr( sp_array_value( sp_array_value( $adjustments, $team_id, array() ), $column, 0 ) ); ?>\" <?php disabled( $readonly ); ?> /></td>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\telse :\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t<td colspan=\"\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$colspan = sizeof( $columns ) + ( $readonly ? 1 : 2 );\n\t\t\t\t\t\techo esc_attr( $colspan );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Data', 'sportspress' ) ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<div class=\"sp-data-table-container sp-table-panel sp-table-adjustments hidden\" id=\"sp-table-adjustments\">\n\t\t\t<table class=\"widefat sp-data-table sp-league-table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th><?php esc_attr_e( 'Team', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php foreach ( $columns as $key => $label ) : ?>\n\t\t\t\t\t\t\t<th><?php echo esc_html( $label ); ?></th>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $data ) && sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\tforeach ( $data as $team_id => $team_stats ) :\n\t\t\t\t\t\t\tif ( ! $team_id ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php echo esc_attr( get_the_title( $team_id ) ); ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $columns as $column => $label ) :\n\t\t\t\t\t\t\t\t\t$value = sp_array_value( sp_array_value( $adjustments, $team_id, array() ), $column, '' );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<td><input type=\"text\" name=\"sp_adjustments[<?php echo esc_attr( $team_id ); ?>][<?php echo esc_attr( $column ); ?>]\" value=\"<?php echo esc_attr( $value ); ?>\" placeholder=\"0\" data-matrix=\"<?php echo esc_attr( $team_id ); ?>_<?php echo esc_attr( $column ); ?>\" /></td>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\telse :\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t<td colspan=\"\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$colspan = sizeof( $columns ) + 1;\n\t\t\t\t\t\techo esc_attr( $colspan );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Data', 'sportspress' ) ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php",
    "content": "<?php\n/**\n * Table Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version   2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Table_Details\n */\nclass SP_Meta_Box_Table_Details {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$taxonomies    = get_object_taxonomies( 'sp_table' );\n\t\t$caption       = get_post_meta( $post->ID, 'sp_caption', true );\n\t\t$select        = get_post_meta( $post->ID, 'sp_select', true );\n\t\t$post_type     = sp_get_post_mode_type( $post->ID );\n\t\t$date          = get_post_meta( $post->ID, 'sp_date', true );\n\t\t$date_from     = get_post_meta( $post->ID, 'sp_date_from', true );\n\t\t$date_to       = get_post_meta( $post->ID, 'sp_date_to', true );\n\t\t$date_past     = get_post_meta( $post->ID, 'sp_date_past', true );\n\t\t$date_relative = get_post_meta( $post->ID, 'sp_date_relative', true );\n\t\t$orderby       = get_post_meta( $post->ID, 'sp_orderby', true );\n\t\t$order         = get_post_meta( $post->ID, 'sp_order', true );\n\t\t$event_status  = get_post_meta( $post->ID, 'sp_event_status', true );\n\t\tif ( empty( $event_status ) ) {\n\t\t\t$event_status = array( 'publish', 'future' );\n\t\t}\n\t\t?>\n\t\t<div>\n\t\t\t<p><strong><?php esc_attr_e( 'Heading', 'sportspress' ); ?></strong></p>\n\t\t\t<p><input type=\"text\" id=\"sp_caption\" name=\"sp_caption\" value=\"<?php echo esc_attr( $caption ); ?>\" placeholder=\"<?php echo esc_attr( get_the_title() ); ?>\"></p>\n\n\t\t\t<div class=\"sp-date-selector\">\n\t\t\t\t<p><strong><?php esc_attr_e( 'Date', 'sportspress' ); ?></strong></p>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name'     => 'sp_date',\n\t\t\t\t\t\t'id'       => 'sp_date',\n\t\t\t\t\t\t'selected' => $date,\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<div class=\"sp-date-range\">\n\t\t\t\t\t<p class=\"sp-date-range-absolute\">\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-from\" name=\"sp_date_from\" value=\"<?php echo $date_from ? esc_attr( $date_from ) : esc_attr( date_i18n( 'Y-m-d' ) ); ?>\" size=\"10\">\n\t\t\t\t\t\t:\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-to\" name=\"sp_date_to\" value=\"<?php echo $date_to ? esc_attr( $date_to ) : esc_attr( date_i18n( 'Y-m-d' ) ); ?>\" size=\"10\">\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-range-relative\">\n\t\t\t\t\t\t<?php esc_attr_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"sp_date_past\" value=\"<?php echo '' !== $date_past ? esc_attr( $date_past ) : 7; ?>\">\n\t\t\t\t\t\t<?php esc_attr_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_date_relative\" value=\"1\" id=\"sp_date_relative\" <?php checked( $date_relative ); ?>>\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<?php\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\tsp_taxonomy_field( $taxonomy, $post, true );\n\t\t\t}\n\t\t\tdo_action( 'sportspress_meta_box_table_details', $post->ID );\n\t\t\t?>\n\t\t\t<p><strong>\n\t\t\t\t<?php echo esc_html( sp_get_post_mode_label( $post->ID ) ); ?>\n\t\t\t</strong></p>\n\t\t\t<p class=\"sp-select-setting\">\n\t\t\t\t<select name=\"sp_select\">\n\t\t\t\t\t<option value=\"auto\" <?php selected( 'auto', $select ); ?>><?php esc_attr_e( 'Auto', 'sportspress' ); ?></option>\n\t\t\t\t\t<option value=\"manual\" <?php selected( 'manual', $select ); ?>><?php esc_attr_e( 'Manual', 'sportspress' ); ?></option>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<?php\n\t\t\tif ( 'manual' == $select ) {\n\t\t\t\tsp_post_checklist( $post->ID, $post_type, ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season' ), null, 'sp_team' );\n\t\t\t\tsp_post_adder( $post_type, esc_attr__( 'Add New', 'sportspress' ) );\n\t\t\t}\n\t\t\t?>\n\t\t\t<p><strong><?php esc_attr_e( 'Event Status (with results)', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t\t<input type=\"checkbox\" name=\"sp_event_status[]\" value=\"publish\" <?php echo ( in_array( 'publish', $event_status ) ) ? 'checked' : false; ?>> Published/Played<br>\n\t\t\t\t<input type=\"checkbox\" name=\"sp_event_status[]\" value=\"future\" <?php echo ( in_array( 'future', $event_status ) ) ? 'checked' : false; ?>> Scheduled/Future<br>\n\t\t\t</p>\n\t\t</div>\n\t\t<p><strong><?php esc_attr_e( 'Sort by', 'sportspress' ); ?></strong></p>\n\t\t\t<p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'prepend_options' => array(\n\t\t\t\t\t'default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t'name'    => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t'post_type'       => array( 'sp_column' ),\n\t\t\t\t'name'            => 'sp_orderby',\n\t\t\t\t'selected'        => $orderby,\n\t\t\t\t'values'          => 'slug',\n\t\t\t);\n\t\t\tsp_dropdown_pages( $args );\n\t\t\t?>\n\t\t\t</p>\n\t\t<div id=\"sp_order\" <?php echo ( $orderby === 'default' || $orderby === '' ? 'style=\"display: none;\"' : '' ); ?>>\n\t\t\t<p><strong><?php esc_attr_e( 'Sort Order', 'sportspress' ); ?></strong></p>\n\t\t\t\t<p>\n\t\t\t\t\t<select name=\"sp_order\">\n\t\t\t\t\t\t<option value=\"ASC\" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"DESC\" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_caption', sp_array_value( $_POST, 'sp_caption', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_past', sp_array_value( $_POST, 'sp_date_past', 0, 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_date_relative', sp_array_value( $_POST, 'sp_date_relative', 0, 'text' ) );\n\t\t$tax_input = sp_array_value( $_POST, 'tax_input', array() );\n\t\tupdate_post_meta( $post_id, 'sp_main_league', in_array( 'auto', sp_array_value( $tax_input, 'sp_league' ) ) );\n\t\tupdate_post_meta( $post_id, 'sp_current_season', in_array( 'auto', sp_array_value( $tax_input, 'sp_season' ) ) );\n\t\tupdate_post_meta( $post_id, 'sp_select', sp_array_value( $_POST, 'sp_select', array(), 'key' ) );\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array(), 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array(), 'key' ) );\n\t\tupdate_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array(), 'text' ) );\n\t\tupdate_post_meta( $post_id, 'sp_event_status', sp_array_value( $_POST, 'sp_event_status', array(), 'key' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-table-format.php",
    "content": "<?php\n/**\n * Table Format\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Table_Format\n */\nclass SP_Meta_Box_Table_Format {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t\t$the_format = get_post_meta( $post->ID, 'sp_format', true );\n\t\t?>\n\t\t<div id=\"post-formats-select\">\n\t\t\t<?php foreach ( SP()->formats->table as $key => $format ) : ?>\n\t\t\t\t<input type=\"radio\" name=\"sp_format\" class=\"post-format\" id=\"post-format-<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( true, ( $key == 'standings' && ! $the_format ) || $the_format == $key ); ?>> <label for=\"post-format-<?php echo esc_attr( $key ); ?>\" class=\"post-format-icon post-format-<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $format ); ?></label><br>\n\t\t\t<?php endforeach; ?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'standings', 'key' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php",
    "content": "<?php\n/**\n * League Table Mode\n *\n * @author     ThemeBoy\n * @category   Admin\n * @package   SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Table_Mode\n */\nclass SP_Meta_Box_Table_Mode {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$the_mode = sp_get_post_mode( $post->ID );\n\t\t?>\n\t<div id=\"post-formats-select\">\n\t\t<?php\n\t\tforeach ( array(\n\t\t\t'team'   => esc_attr__( 'Team vs team', 'sportspress' ),\n\t\t\t'player' => esc_attr__( 'Player vs player', 'sportspress' ),\n\t\t) as $key => $mode ) :\n\t\t\t?>\n\t\t<input type=\"radio\" name=\"sp_mode\" class=\"post-format\" id=\"post-format-<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( $the_mode, $key ); ?>> <label for=\"post-format-<?php echo esc_attr( $key ); ?>\" class=\"post-format-icon post-format-<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $mode ); ?></label><br>\n\t  <?php endforeach; ?>\n\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_mode', sp_array_value( $_POST, 'sp_mode', 'team', 'key' ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-table-shortcode.php",
    "content": "<?php\n/**\n * Table Shortcode\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version   2.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Table_Shortcode\n */\nclass SP_Meta_Box_Table_Shortcode {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$the_format = get_post_meta( $post->ID, 'sp_format', true );\n\t\tif ( ! $the_format ) {\n\t\t\t$the_format = 'standings';\n\t\t}\n\t\t?>\n\t\t<p class=\"howto\">\n\t\t\t<?php esc_attr_e( 'Copy this code and paste it into your post, page or text widget content.', 'sportspress' ); ?>\n\t\t</p>\n\t\t<p><input type=\"text\" value=\"<?php sp_shortcode_template( 'team_' . $the_format, $post->ID ); ?>\" readonly=\"readonly\" class=\"code widefat\"></p>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-team-columns.php",
    "content": "<?php\n/**\n * Team Columns\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Team_Columns\n */\nclass SP_Meta_Box_Team_Columns {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\t$team       = new SP_Team( $post );\n\t\t$leagues    = get_the_terms( $post->ID, 'sp_league' );\n\t\t$league_num = sizeof( $leagues );\n\n\t\t// Loop through columns for each league\n\t\tif ( $leagues ) :\n\t\t\tforeach ( $leagues as $league ) :\n\n\t\t\t\t$league_id = $league->term_id;\n\t\t\t\t?>\n\t\t\t<p><strong><?php echo esc_html( $league->name ); ?></strong></p>\n\t\t\t\t<?php\n\t\t\t\tlist( $columns, $data, $placeholders ) = $team->columns( $league_id );\n\t\t\t\tself::table( $league_id, $columns, $data, $placeholders );\n\n\t\tendforeach;\nendif;\n\t\t?>\n\t\t<p><strong><?php esc_attr_e( 'Total', 'sportspress' ); ?></strong></p>\n\t\t<?php\n\t\tlist( $columns, $data, $placeholders ) = $team->columns( 0 );\n\t\tself::table( 0, $columns, $data, $placeholders );\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'key' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $league_id, $columns = array(), $data = array(), $placeholders = array() ) {\n\t\t?>\n\t\t<div class=\"sp-data-table-container\">\n\t\t\t<table class=\"widefat sp-data-table sp-team-column-table sp-select-all-range\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th><?php esc_attr_e( 'Season', 'sportspress' ); ?></th>\n\t\t\t\t\t\t<?php foreach ( $columns as $label ) : ?>\n\t\t\t\t\t\t\t<th><?php echo esc_html( $label ); ?></th>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ( $data as $div_id => $div_stats ) :\n\t\t\t\t\t\t$div = get_term( $div_id, 'sp_season' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"sp_leagues_<?php echo esc_attr( $league_id ); ?>_<?php echo esc_attr( $div_id ); ?>\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( 'WP_Error' == get_class( $div ) ) :\n\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Total', 'sportspress' );\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\techo esc_html( $div->name );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $columns as $column => $label ) :\n\t\t\t\t\t\t\t\t$value = sp_array_value( sp_array_value( $data, $div_id, array() ), $column, 0 );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$value       = sp_array_value( sp_array_value( $data, $div_id, array() ), $column, null );\n\t\t\t\t\t\t\t\t\t$placeholder = sp_array_value( sp_array_value( $placeholders, $div_id, array() ), $column, 0 );\n\t\t\t\t\t\t\t\t\techo '<input type=\"text\" name=\"sp_columns[' . esc_attr( $league_id ) . '][' . esc_attr( $div_id ) . '][' . esc_attr( $column ) . ']\" value=\"' . esc_attr( $value ) . '\" placeholder=\"' . esc_attr( $placeholder ) . '\" />';\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$i++;\n\t\t\t\t\tendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php",
    "content": "<?php\n/**\n * Team Details\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Team_Details\n */\nclass SP_Meta_Box_Team_Details {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\n\t\tif ( taxonomy_exists( 'sp_league' ) ) :\n\t\t\t$leagues    = get_the_terms( $post->ID, 'sp_league' );\n\t\t\t$league_ids = array();\n\t\t\tif ( $leagues ) :\n\t\t\t\tforeach ( $leagues as $league ) :\n\t\t\t\t\t$league_ids[] = $league->term_id;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\tendif;\n\n\t\tif ( taxonomy_exists( 'sp_season' ) ) :\n\t\t\t$seasons    = get_the_terms( $post->ID, 'sp_season' );\n\t\t\t$season_ids = array();\n\t\t\tif ( $seasons ) :\n\t\t\t\tforeach ( $seasons as $season ) :\n\t\t\t\t\t$season_ids[] = $season->term_id;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\tendif;\n\n\t\tif ( taxonomy_exists( 'sp_venue' ) ) :\n\t\t\t$venues    = get_the_terms( $post->ID, 'sp_venue' );\n\t\t\t$venue_ids = array();\n\t\t\tif ( $venues ) :\n\t\t\t\tforeach ( $venues as $venue ) :\n\t\t\t\t\t$venue_ids[] = $venue->term_id;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\tendif;\n\n\t\t$short_name   = get_post_meta( $post->ID, 'sp_short_name', true );\n\t\t$abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );\n\t\t$redirect     = get_post_meta( $post->ID, 'sp_redirect', true );\n\t\t$url          = get_post_meta( $post->ID, 'sp_url', true );\n\t\t?>\n\n\t\t<?php if ( taxonomy_exists( 'sp_league' ) ) { ?>\n\t\t<p><strong><?php esc_attr_e( 'Leagues', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'taxonomy'    => 'sp_league',\n\t\t\t\t'name'        => 'tax_input[sp_league][]',\n\t\t\t\t'selected'    => $league_ids,\n\t\t\t\t'values'      => 'term_id',\n\t\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Leagues', 'sportspress' ) ),\n\t\t\t\t'class'       => 'widefat',\n\t\t\t\t'property'    => 'multiple',\n\t\t\t\t'chosen'      => true,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t?>\n\t\t</p>\n\t\t<?php } ?>\n\n\t\t<?php if ( taxonomy_exists( 'sp_season' ) ) { ?>\n\t\t<p><strong><?php esc_attr_e( 'Seasons', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'taxonomy'    => 'sp_season',\n\t\t\t\t'name'        => 'tax_input[sp_season][]',\n\t\t\t\t'selected'    => $season_ids,\n\t\t\t\t'values'      => 'term_id',\n\t\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Seasons', 'sportspress' ) ),\n\t\t\t\t'class'       => 'widefat',\n\t\t\t\t'property'    => 'multiple',\n\t\t\t\t'chosen'      => true,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t?>\n\t\t</p>\n\t\t<?php } ?>\n\n\t\t<?php if ( taxonomy_exists( 'sp_venue' ) ) { ?>\n\t\t<p><strong><?php esc_attr_e( 'Home', 'sportspress' ); ?></strong></p>\n\t\t<p>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'taxonomy'    => 'sp_venue',\n\t\t\t\t'name'        => 'tax_input[sp_venue][]',\n\t\t\t\t'selected'    => $venue_ids,\n\t\t\t\t'values'      => 'term_id',\n\t\t\t\t'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Venue', 'sportspress' ) ),\n\t\t\t\t'class'       => 'widefat',\n\t\t\t\t'property'    => 'multiple',\n\t\t\t\t'chosen'      => true,\n\t\t\t);\n\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t?>\n\t\t</p>\n\t\t<?php } ?>\n\n\t\t<p><strong><?php esc_attr_e( 'Site URL', 'sportspress' ); ?></strong></p>\n\t\t<p><input type=\"text\" class=\"widefat\" id=\"sp_url\" name=\"sp_url\" value=\"<?php echo esc_url( $url ); ?>\"></p>\n\t\t<p><label class=\"selectit\"><input type=\"checkbox\" name=\"sp_redirect\" value=\"1\" <?php checked( $redirect ); ?>> <?php esc_attr_e( 'Redirect', 'sportspress' ); ?></label></p>\n\n\t\t<p><strong><?php esc_attr_e( 'Short Name', 'sportspress' ); ?></strong></p>\n\t\t<p><input type=\"text\" id=\"sp_short_name\" name=\"sp_short_name\" value=\"<?php echo esc_attr( $short_name ); ?>\"></p>\n\n\t\t<p><strong><?php esc_attr_e( 'Abbreviation', 'sportspress' ); ?></strong></p>\n\t\t<p><input type=\"text\" id=\"sp_abbreviation\" name=\"sp_abbreviation\" value=\"<?php echo esc_attr( $abbreviation ); ?>\"></p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tupdate_post_meta( $post_id, 'sp_url', esc_url( sp_array_value( $_POST, 'sp_url', '', 'text' ) ) );\n\t\tupdate_post_meta( $post_id, 'sp_redirect', sp_array_value( $_POST, 'sp_redirect', 0, 'int' ) );\n\t\tupdate_post_meta( $post_id, 'sp_short_name', esc_attr( sp_array_value( $_POST, 'sp_short_name', '', 'text' ) ) );\n\t\tupdate_post_meta( $post_id, 'sp_abbreviation', esc_attr( sp_array_value( $_POST, 'sp_abbreviation', '', 'text' ) ) );\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php",
    "content": "<?php\n/**\n * Team Player Lists\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Team_Lists\n */\nclass SP_Meta_Box_Team_Lists {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\tglobal $pagenow;\n\n\t\tif ( $pagenow != 'post-new.php' ) :\n\n\t\t\t$team                   = new SP_Team( $post );\n\t\t\tlist( $data, $checked ) = $team->lists( true );\n\t\t\tself::table( $data, $checked );\n\n\t\telse :\n\n\t\t\tprintf( esc_attr__( 'No results found.', 'sportspress' ) );\n\n\t\tendif;\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_list', sp_array_value( $_POST, 'sp_list', array(), 'int' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $data = array(), $checked = array() ) {\n\t\t?>\n\t\t<div class=\"sp-data-table-container\">\n\t\t\t<table class=\"widefat sp-data-table sp-team-list-table sp-select-all-range\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"check-column\"><input class=\"sp-select-all\" type=\"checkbox\"></th>\n\t\t\t\t\t\t<th class=\"column-list\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Player List', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-players\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Players', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-league\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'League', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-season\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Season', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-layout\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Layout', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $data ) ) :\n\t\t\t\t\t\tif ( sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\t\tforeach ( $data as $list ) :\n\t\t\t\t\t\t\t\t$players = array_filter( get_post_meta( $list->ID, 'sp_player' ) );\n\t\t\t\t\t\t\t\t$format  = get_post_meta( $list->ID, 'sp_format', true );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_list[]\" id=\"sp_list_<?php echo esc_attr( $list->ID ); ?>\" value=\"<?php echo esc_attr( $list->ID ); ?>\" <?php checked( in_array( $list->ID, $checked ) ); ?>>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_edit_post_link( $list->ID ) ); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $list->post_title ); ?>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td><?php echo esc_attr( sizeof( $players ) ); ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo get_the_terms( $list->ID, 'sp_league' ) ? wp_kses_post( the_terms( $list->ID, 'sp_league' ) ) : '&mdash;'; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo get_the_terms( $list->ID, 'sp_season' ) ? wp_kses_post( the_terms( $list->ID, 'sp_season' ) ) : '&mdash;'; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_array_value( SP()->formats->list, $format, '&mdash;' ) ); ?></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"6\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'No results found.', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\tendif;\n\t\t\t\t\telse :\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t<td colspan=\"6\">\n\t\t\t\t\t\t\t<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Details', 'sportspress' ) ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php",
    "content": "<?php\n/**\n * Team Player Staff\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Team_Staff\n */\nclass SP_Meta_Box_Team_Staff {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\tglobal $pagenow;\n\n\t\tif ( $pagenow != 'post-new.php' ) :\n\n\t\t\t$team                   = new SP_Team( $post );\n\t\t\tlist( $data, $checked ) = $team->staff( true );\n\t\t\tself::table( $data, $checked );\n\n\t\telse :\n\n\t\t\tprintf( esc_attr__( 'No results found.', 'sportspress' ) );\n\n\t\tendif;\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array(), 'int' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $data = array(), $checked = array() ) {\n\t\t?>\n\t\t<div class=\"sp-data-table-container\">\n\t\t\t<table class=\"widefat sp-data-table sp-team-staff-table sp-select-all-range\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"check-column\"><input class=\"sp-select-all\" type=\"checkbox\"></th>\n\t\t\t\t\t\t<th class=\"column-staff\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Staff', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-role\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Job', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-league\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'League', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-season\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Season', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $data ) ) :\n\t\t\t\t\t\tif ( sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\t\tforeach ( $data as $staff ) :\n\t\t\t\t\t\t\t\t$role = get_post_meta( $staff->ID, 'sp_role', true );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_staff[]\" id=\"sp_staff_<?php echo esc_attr( $staff->ID ); ?>\" value=\"<?php echo esc_attr( $staff->ID ); ?>\" <?php checked( in_array( $staff->ID, $checked ) ); ?>>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_edit_post_link( $staff->ID ) ); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $staff->post_title ); ?>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td><?php echo get_the_terms( $staff->ID, 'sp_role' ) ? wp_kses_post( the_terms( $staff->ID, 'sp_role' ) ) : '&mdash;'; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo get_the_terms( $staff->ID, 'sp_league' ) ? wp_kses_post( the_terms( $staff->ID, 'sp_league' ) ) : '&mdash;'; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo get_the_terms( $staff->ID, 'sp_season' ) ? wp_kses_post( the_terms( $staff->ID, 'sp_season' ) ) : '&mdash;'; ?></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"5\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'No results found.', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\tendif;\n\t\t\t\t\telse :\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t<td colspan=\"5\">\n\t\t\t\t\t\t\t<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Details', 'sportspress' ) ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php",
    "content": "<?php\n/**\n * Team League Tables\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SP_Meta_Box_Team_Tables\n */\nclass SP_Meta_Box_Team_Tables {\n\n\t/**\n\t * Output the metabox\n\t */\n\tpublic static function output( $post ) {\n\t\tglobal $pagenow;\n\n\t\tif ( $pagenow != 'post-new.php' ) :\n\n\t\t\t$team                   = new SP_Team( $post );\n\t\t\tlist( $data, $checked ) = $team->tables( true );\n\t\t\tself::table( $data, $checked );\n\n\t\telse :\n\n\t\t\tprintf( esc_attr__( 'No results found.', 'sportspress' ) );\n\n\t\tendif;\n\t}\n\n\t/**\n\t * Save meta box data\n\t */\n\tpublic static function save( $post_id, $post ) {\n\t\tsp_update_post_meta_recursive( $post_id, 'sp_table', sp_array_value( $_POST, 'sp_table', array(), 'text' ) );\n\t}\n\n\t/**\n\t * Admin edit table\n\t */\n\tpublic static function table( $data = array(), $checked = array() ) {\n\t\t?>\n\t\t<div class=\"sp-data-table-container\">\n\t\t\t<table class=\"widefat sp-data-table sp-team-table-table sp-select-all-range\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"check-column\"><input class=\"sp-select-all\" type=\"checkbox\"></th>\n\t\t\t\t\t\t<th class=\"column-table\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'League Table', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-teams\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Teams', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-league\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'League', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"column-season\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Season', 'sportspress' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $data ) ) :\n\t\t\t\t\t\tif ( sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\t\tforeach ( $data as $table ) :\n\t\t\t\t\t\t\t\t$teams  = array_filter( get_post_meta( $table->ID, 'sp_team' ) );\n\t\t\t\t\t\t\t\t$format = get_post_meta( $table->ID, 'sp_format', true );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<tr class=\"sp-row sp-post\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' alternate';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sp_table[]\" id=\"sp_table_<?php echo esc_attr( $table->ID ); ?>\" value=\"<?php echo esc_attr( $table->ID ); ?>\" <?php checked( in_array( $table->ID, $checked ) ); ?>>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_edit_post_link( $table->ID ) ); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $table->post_title ); ?>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td><?php echo esc_attr( sizeof( $teams ) ); ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo get_the_terms( $table->ID, 'sp_league' ) ? wp_kses_post( the_terms( $table->ID, 'sp_league' ) ) : '&mdash;'; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo get_the_terms( $table->ID, 'sp_season' ) ? wp_kses_post( the_terms( $table->ID, 'sp_season' ) ) : '&mdash;'; ?></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"6\">\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'No results found.', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\tendif;\n\t\t\t\t\telse :\n\t\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row alternate\">\n\t\t\t\t\t\t<td colspan=\"5\">\n\t\t\t\t\t\t\t<?php printf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Details', 'sportspress' ) ); ?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}\n}\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-events.php",
    "content": "<?php\n/**\n * SportsPress Event Settings\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Events' ) ) :\n\n\t/**\n\t * SP_Settings_Events\n\t */\n\tclass SP_Settings_Events extends SP_Settings_Page {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id       = 'events';\n\t\t\t$this->label    = esc_attr__( 'Events', 'sportspress' );\n\t\t\t$this->template = 'event';\n\n\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t\tadd_action( 'sportspress_admin_field_delimiter', array( $this, 'delimiter_setting' ) );\n\t\t\tadd_action( 'sportspress_admin_field_event_layout', array( $this, 'layout_setting' ) );\n\t\t\tadd_action( 'sportspress_admin_field_event_tabs', array( $this, 'tabs_setting' ) );\n\t\t\tadd_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Get settings array\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function get_settings() {\n\n\t\t\t$settings = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Event Options', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'event_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_event_options',\n\t\t\t\t\tarray_merge(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Link', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Link events', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_link_events',\n\t\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tapply_filters(\n\t\t\t\t\t\t\t'sportspress_event_template_options',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tarray( 'type' => 'event_layout' ),\n\n\t\t\t\t\t\t\t\tarray( 'type' => 'event_tabs' ),\n\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'title'         => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Date', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_date',\n\t\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Time', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_time',\n\t\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Match Day', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_day',\n\t\t\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Full Time', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_full_time',\n\t\t\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'    => esc_attr__( 'Default mode', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'       => 'sportspress_mode',\n\t\t\t\t\t\t\t\t'default'  => 'team',\n\t\t\t\t\t\t\t\t'type'     => 'radio',\n\t\t\t\t\t\t\t\t'options'  => array(\n\t\t\t\t\t\t\t\t\t'team'   => esc_attr__( 'Team vs team', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'player' => esc_attr__( 'Player vs player', 'sportspress' ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'desc_tip' => _x( 'Who competes in events?', 'mode setting description', 'sportspress' ),\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'             => esc_attr__( 'Limit', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'                => 'sportspress_event_teams',\n\t\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t\t'default'           => '2',\n\t\t\t\t\t\t\t\t'desc'              => esc_attr__( 'teams', 'sportspress' ),\n\t\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t\t'min'  => 0,\n\t\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray( 'type' => 'delimiter' ),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'         => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Filter by league', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_filter_teams_by_league',\n\t\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Filter by season', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_filter_teams_by_season',\n\t\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'             => esc_attr__( 'Full Time', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'                => 'sportspress_event_minutes',\n\t\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t\t'default'           => '90',\n\t\t\t\t\t\t\t\t'desc'              => esc_attr__( 'mins', 'sportspress' ),\n\t\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t\t'min'  => 0,\n\t\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Comments', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Allow people to post comments on new articles', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_event_comment_status',\n\t\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'event_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Venues', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'venue_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_venue_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Link', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Link venues', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_link_venues',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Venue Map', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display venue map', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_show_maps',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Type', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_map_type',\n\t\t\t\t\t\t\t'default' => 'ROADMAP',\n\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'ROADMAP'   => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t\t\t'SATELLITE' => esc_attr__( 'Satellite', 'sportspress' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'             => esc_attr__( 'Zoom', 'sportspress' ),\n\t\t\t\t\t\t\t'id'                => 'sportspress_map_zoom',\n\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t'default'           => '15',\n\t\t\t\t\t\t\t'desc'              => '0 - 21',\n\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t'min'  => 0,\n\t\t\t\t\t\t\t\t'max'  => 21,\n\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'venue_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'event_logo_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_event_logo_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Order', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Reverse order', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_reverse_teams',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Layout', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_logos_format',\n\t\t\t\t\t\t\t'default' => 'inline',\n\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'inline' => esc_attr__( 'Inline', 'sportspress' ),\n\t\t\t\t\t\t\t\t'block'  => esc_attr__( 'Block', 'sportspress' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'         => esc_attr__( 'Display', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_event_logos_show_team_names',\n\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Time', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_event_logos_show_time',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Results', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_event_logos_show_results',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'event_logo_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'eventplayer_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_eventplayer_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'    => esc_attr__( 'Order', 'sportspress' ),\n\t\t\t\t\t\t\t'id'       => 'sportspress_event_player_sort',\n\t\t\t\t\t\t\t'default'  => 'jersey',\n\t\t\t\t\t\t\t'type'     => 'radio',\n\t\t\t\t\t\t\t'options'  => array(\n\t\t\t\t\t\t\t\t'jersey' => esc_attr__( 'Jersey (e.g. \"33. John Doe\")', 'sportspress' ),\n\t\t\t\t\t\t\t\t'name'   => esc_attr__( 'Name (e.g. \"John Doe (33)\")', 'sportspress' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'desc_tip' => 'When editing an event, this determines how the checklist of players are sorted in the Teams metabox.  This does not affect the Box Score section.',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'eventplayer_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Event Results', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'result_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_result_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Columns', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_result_columns',\n\t\t\t\t\t\t\t'default' => 'auto',\n\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'auto'   => esc_attr__( 'Auto', 'sportspress' ),\n\t\t\t\t\t\t\t\t'manual' => esc_attr__( 'Manual', 'sportspress' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Outcome', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display outcome', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_show_outcome',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'result_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Box Score', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'performance_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_performance_options',\n\t\t\t\t\tarray_merge(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'         => esc_attr__( 'Rows', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_staff',\n\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_players',\n\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Total', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_total',\n\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Columns', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_event_performance_columns',\n\t\t\t\t\t\t\t\t'default' => 'auto',\n\t\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'auto'   => esc_attr__( 'Auto', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'manual' => esc_attr__( 'Manual', 'sportspress' ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Mode', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_event_performance_mode',\n\t\t\t\t\t\t\t\t'default' => 'values',\n\t\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'values' => esc_attr__( 'Values', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'icons'  => esc_attr__( 'Icons', 'sportspress' ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Awards', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_event_performance_stars_type',\n\t\t\t\t\t\t\t\t'default' => 0,\n\t\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t__( 'None', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t__( 'Player of the Match', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t__( 'Stars', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t__( 'Star Number', 'sportspress' ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Positions', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Top-level only', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_event_hide_child_positions',\n\t\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tapply_filters(\n\t\t\t\t\t\t\t'sportspress_event_performance_display_options',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'title'         => esc_attr__( 'Display', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_player_numbers',\n\t\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Position', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_show_position',\n\t\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Minutes', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'id'            => 'sportspress_event_performance_show_minutes',\n\t\t\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Performance', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_event_performance_sections',\n\t\t\t\t\t\t\t\t'default' => -1,\n\t\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t-1 => esc_attr__( 'Combined', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t0  => esc_attr__( 'Offense', 'sportspress' ) . ' &rarr; ' . esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t1  => esc_attr__( 'Defense', 'sportspress' ) . ' &rarr; ' . esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Total', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_event_total_performance',\n\t\t\t\t\t\t\t\t'default' => 'all',\n\t\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'all'     => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'primary' => esc_attr__( 'Primary', 'sportspress' ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'performance_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn apply_filters( 'sportspress_event_settings', $settings );\n\t\t}\n\n\t\t/**\n\t\t * Save settings\n\t\t */\n\t\tpublic function save() {\n\t\t\tparent::save();\n\n\t\t\tif ( isset( $_POST['sportspress_event_teams_delimiter'] ) ) {\n\t\t\t\tupdate_option( 'sportspress_event_teams_delimiter', sanitize_text_field( wp_unslash( $_POST['sportspress_event_teams_delimiter'] ) ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Delimiter settings\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function delimiter_setting() {\n\t\t\t$selection = get_option( 'sportspress_event_teams_delimiter', 'vs' );\n\t\t\t$limit     = get_option( 'sportspress_event_teams', 2 );\n\t\t\t\n\t\t\t// Cast to integer and ensure it's a valid positive number.\n\t\t\t$limit = absint( $limit );\n\t\t\tif ( 0 == $limit ) {\n\t\t\t\t$limit = 2;\n\t\t\t}\n\t\t\tif ( 3 >= $limit ) {\n\t\t\t\t$example = str_repeat( esc_attr__( 'Team', 'sportspress' ) . ' %1$s ', $limit );\n\t\t\t} else {\n\t\t\t\t$example = str_repeat( esc_attr__( 'Team', 'sportspress' ) . ' %1$s ', 3 ) . '&hellip;';\n\t\t\t}\n\t\t\t$example = rtrim( $example, ' %1$s ' );\n\t\t\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t<?php esc_html_e( 'Delimiter', 'sportspress' ); ?>\n\t\t\t</th>\n\t\t\t<td class=\"forminp\">\n\t\t\t\t<fieldset class=\"sp-custom-input-wrapper\">\n\t\t\t\t\t<legend class=\"screen-reader-text\"><span><?php esc_html_e( 'Delimiter', 'sportspress' ); ?></span></legend>\n\t\t\t\t\t<?php $delimiters = array( 'vs', 'v', '&mdash;', '/' ); ?>\n\t\t\t\t\t<?php foreach ( $delimiters as $delimiter ) : ?>\n\t\t\t\t\t\t<label title=\"<?php echo esc_attr( $delimiter ); ?>\"><input type=\"radio\" class=\"preset\" name=\"sportspress_event_teams_delimiter_preset\" value=\"<?php echo esc_attr( $delimiter ); ?>\" data-example=\"<?php printf( esc_attr( $example ), esc_attr( $delimiter ) ); ?>\" <?php checked( $delimiter, $selection ); ?>> <span><?php printf( esc_attr( $example ), esc_attr( $delimiter ) ); ?></span></label><br>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t<label><input type=\"radio\" class=\"preset\" name=\"sportspress_event_teams_delimiter_preset\" value=\"\\c\\u\\s\\t\\o\\m\" <?php checked( false, in_array( $selection, $delimiters ) ); ?>> <?php esc_html_e( 'Custom:', 'sportspress' ); ?> </label><input type=\"text\" class=\"small-text value\" name=\"sportspress_event_teams_delimiter\" value=\"<?php echo esc_attr( $selection ); ?>\" data-example-format=\"<?php printf( esc_attr( $example ), '__val__' ); ?>\">\n\t\t\t\t\t<span class=\"example\"><?php printf( esc_html( $example ), esc_html( $selection ) ); ?></span>\n\t\t\t\t</fieldset>\n\t\t\t</td>\n\t\t</tr>\n\t\t\t<?php\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_Events();\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-general.php",
    "content": "<?php\n/**\n * SportsPress General Settings\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.13\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_General' ) ) :\n\n\t/**\n\t * SP_Settings_General\n\t */\n\tclass SP_Settings_General extends SP_Settings_Page {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id    = 'general';\n\t\t\t$this->label = esc_attr__( 'General', 'sportspress' );\n\n\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t\tadd_action( 'sportspress_admin_field_timezone', array( $this, 'timezone_setting' ) );\n\t\t\tadd_action( 'sportspress_admin_field_colors', array( $this, 'colors_setting' ) );\n\t\t\tadd_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Get settings array\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function get_settings() {\n\n\t\t\t$presets = SP_Admin_Sports::get_preset_options();\n\n\t\t\t$leagues = array( '' => esc_attr__( '&mdash; Select &mdash;', 'sportspress' ) );\n\n\t\t\t$terms = get_terms(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy'   => 'sp_league',\n\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( $terms ) {\n\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t$leagues[ $term->term_id ] = $term->name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$seasons = array( '' => esc_attr__( '&mdash; Select &mdash;', 'sportspress' ) );\n\n\t\t\t$terms = get_terms(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy'   => 'sp_season',\n\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( $terms ) {\n\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t$seasons[ $term->term_id ] = $term->name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$settings = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'General Options', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'general_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_general_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray( 'type' => 'timezone' ),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Sport', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_sport',\n\t\t\t\t\t\t\t'default' => 'none',\n\t\t\t\t\t\t\t'type'    => 'sport',\n\t\t\t\t\t\t\t'options' => $presets,\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Main League', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_league',\n\t\t\t\t\t\t\t'default' => null,\n\t\t\t\t\t\t\t'type'    => 'select',\n\t\t\t\t\t\t\t'options' => $leagues,\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Current Season', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_season',\n\t\t\t\t\t\t\t'default' => null,\n\t\t\t\t\t\t\t'type'    => 'select',\n\t\t\t\t\t\t\t'options' => $seasons,\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'general_options',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Styles and Scripts', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'script_styling_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$options = array(\n\t\t\t\tarray( 'type' => 'colors' ),\n\t\t\t);\n\n\t\t\tif ( ( $styles = SP_Frontend_Scripts::get_styles() ) && array_key_exists( 'sportspress-general', $styles ) ) :\n\t\t\t\t$options = array_merge(\n\t\t\t\t\t$options,\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Align', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_table_text_align',\n\t\t\t\t\t\t\t'default' => 'default',\n\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t\t\t'left'    => esc_attr__( 'Left', 'sportspress' ),\n\t\t\t\t\t\t\t\t'center'  => esc_attr__( 'Center', 'sportspress' ),\n\t\t\t\t\t\t\t\t'right'   => esc_attr__( 'Right', 'sportspress' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'             => esc_attr__( 'Padding', 'sportspress' ),\n\t\t\t\t\t\t\t'id'                => 'sportspress_table_padding',\n\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t'default'           => null,\n\t\t\t\t\t\t\t'placeholder'       => esc_attr__( 'Auto', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'              => 'px',\n\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\t$options = array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Custom CSS', 'sportspress' ),\n\t\t\t\t\t\t'id'    => 'sportspress_custom_css',\n\t\t\t\t\t\t'css'   => 'width:100%; height: 130px;',\n\t\t\t\t\t\t'type'  => 'textarea',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_general_script_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'         => esc_attr__( 'Scripts', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Live countdowns', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_enable_live_countdowns',\n\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t\t'desc_tip'      => esc_attr__( 'This will enable a script allowing the countdowns to be animated.', 'sportspress' ),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Shortcode menu', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_rich_editing',\n\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t\t'desc_tip'      => esc_attr__( 'This will enable a shortcode menu to be displayed in the visual editor.', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'         => esc_attr__( 'Tables', 'sportspress' ),\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Responsive', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_enable_responsive_tables',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Scrollable', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_enable_scrollable_tables',\n\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Sortable', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_enable_sortable_tables',\n\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'    => esc_attr__( 'Widgets', 'sportspress' ),\n\t\t\t\t\t\t'desc'     => esc_attr__( 'Unique', 'sportspress' ),\n\t\t\t\t\t\t'id'       => 'sportspress_widget_unique',\n\t\t\t\t\t\t'default'  => 'no',\n\t\t\t\t\t\t'type'     => 'checkbox',\n\t\t\t\t\t\t'desc_tip' => esc_attr__( 'Hide widget when same as content.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( apply_filters( 'sportspress_enable_header', false ) ) {\n\t\t\t\t$options[] = array(\n\t\t\t\t\t'title'             => esc_attr__( 'Header Offset', 'sportspress' ),\n\t\t\t\t\t'id'                => 'sportspress_header_offset',\n\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t'default'           => null,\n\t\t\t\t\t'placeholder'       => esc_attr__( 'Auto', 'sportspress' ),\n\t\t\t\t\t'desc'              => 'px',\n\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$settings = array_merge(\n\t\t\t\t$settings,\n\t\t\t\tapply_filters( 'sportspress_script_styling_options', $options ),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'script_styling_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn apply_filters( 'sportspress_general_settings', $settings ); // End general settings\n\t\t}\n\n\t\t/**\n\t\t * Save settings\n\t\t */\n\t\tpublic function save() {\n\t\t\tif ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) !== $_POST['sportspress_sport'] ) :\n\t\t\t\t$sport = sanitize_key( $_POST['sportspress_sport'] );\n\t\t\t\tSP_Admin_Sports::apply_preset( $sport );\n\t\t\t\tdelete_option( '_sp_needs_welcome' );\n\t\t\t\tupdate_option( 'sportspress_installed', 1 );\n\t\t\tendif;\n\n\t\t\tif ( isset( $_POST['add_sample_data'] ) ) :\n\t\t\t\tSP_Admin_Sample_Data::delete_posts();\n\t\t\t\tSP_Admin_Sample_Data::insert_posts();\n\t\t\tendif;\n\n\t\t\t$settings = $this->get_settings();\n\t\t\tSP_Admin_Settings::save_fields( $settings );\n\n\t\t\t// Map UTC+- timezones to gmt_offsets and set timezone_string to empty.\n\t\t\tif ( ! empty( $_POST['timezone_string'] ) && preg_match( '/^UTC[+-]/', $_POST['timezone_string'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t\t$_POST['gmt_offset']      = preg_replace( '/UTC\\+?/', '', sanitize_text_field( wp_unslash( $_POST['timezone_string'] ) ) );\n\t\t\t\t$_POST['timezone_string'] = '';\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['timezone_string'] ) ) {\n\t\t\t\tupdate_option( 'timezone_string', sanitize_option( 'timezone_string', wp_unslash( $_POST['timezone_string'] ) ) );\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['gmt_offset'] ) ) {\n\t\t\t\tupdate_option( 'gmt_offset', sanitize_option( 'gmt_offset', wp_unslash( $_POST['gmt_offset'] ) ) );\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['sportspress_frontend_css_primary'] ) ) {\n\n\t\t\t\t// Save settings\n\t\t\t\t$primary    = ( ! empty( $_POST['sportspress_frontend_css_primary'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_primary'] ) ) ) : '';\n\t\t\t\t$background = ( ! empty( $_POST['sportspress_frontend_css_background'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_background'] ) ) ) : '';\n\t\t\t\t$text       = ( ! empty( $_POST['sportspress_frontend_css_text'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_text'] ) ) ) : '';\n\t\t\t\t$heading    = ( ! empty( $_POST['sportspress_frontend_css_heading'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_heading'] ) ) ) : '';\n\t\t\t\t$link       = ( ! empty( $_POST['sportspress_frontend_css_link'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_link'] ) ) ) : '';\n\t\t\t\t$customize  = ( ! empty( $_POST['sportspress_frontend_css_customize'] ) ) ? 1 : '';\n\n\t\t\t\t$colors = array(\n\t\t\t\t\t'primary'    => $primary,\n\t\t\t\t\t'background' => $background,\n\t\t\t\t\t'text'       => $text,\n\t\t\t\t\t'heading'    => $heading,\n\t\t\t\t\t'link'       => $link,\n\t\t\t\t\t'customize'  => $customize,\n\t\t\t\t);\n\n\t\t\t\t// Merge with existing options if available\n\t\t\t\t$options = get_option( 'themeboy' );\n\t\t\t\tif ( is_array( $options ) ) {\n\t\t\t\t\t$colors = array_merge( $options, $colors );\n\t\t\t\t}\n\n\t\t\t\tupdate_option( 'themeboy', $colors );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Timezone settings\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function timezone_setting() {\n\t\t\t$current_offset = get_option( 'gmt_offset' );\n\t\t\t$tzstring       = get_option( 'timezone_string' );\n\n\t\t\t$check_zone_info = true;\n\n\t\t\t// Remove old Etc mappings. Fallback to gmt_offset.\n\t\t\tif ( false !== strpos( $tzstring, 'Etc/GMT' ) ) {\n\t\t\t\t$tzstring = '';\n\t\t\t}\n\n\t\t\tif ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists\n\t\t\t\t$check_zone_info = false;\n\t\t\t\tif ( 0 == $current_offset ) {\n\t\t\t\t\t$tzstring = 'UTC+0';\n\t\t\t\t} elseif ( $current_offset < 0 ) {\n\t\t\t\t\t$tzstring = 'UTC' . $current_offset;\n\t\t\t\t} else {\n\t\t\t\t\t$tzstring = 'UTC+' . $current_offset;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' );\n\t\t\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t<label for=\"timezone_string\"><?php esc_html_e( 'Timezone', 'sportspress' ); ?> <i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_attr_e( 'Choose a city in the same timezone as you.', 'sportspress' ); ?>\"></i></label>\n\t\t\t</th>\n\t\t\t<td class=\"forminp\">\n\t\t\t\t<legend class=\"screen-reader-text\"><span><?php esc_html_e( 'Timezone', 'sportspress' ); ?></span></legend>\n\t\t\t\t<select id=\"timezone_string\" name=\"timezone_string\" class=\"<?php echo esc_attr( $class ); ?>\">\n\t\t\t\t\t<?php echo wp_kses( wp_timezone_choice( $tzstring ), array( 'option' => array( 'value' => array(), 'selected' => array() ) ) ); ?>\n\t\t\t\t</select>\n\t\t\t   </td>\n\t\t   </tr>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Output the frontend styles settings.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function colors_setting() {\n\t\t\t// Define color schemes each with 5 colors: Primary, Background, Text, Heading, Link\n\t\t\t$color_schemes = apply_filters(\n\t\t\t\t'sportspress_color_schemes',\n\t\t\t\tarray(\n\t\t\t\t\t'ThemeBoy' => array( '2b353e', 'f4f4f4', '222222', 'ffffff', '00a69c' ),\n\t\t\t\t\t'Gold'     => array( '333333', 'f7f7f7', '333333', 'd8bf94', '9f8958' ),\n\t\t\t\t\t'Denim'    => array( '0e2440', 'eae5e0', '0e2440', 'ffffff', '2b6291' ),\n\t\t\t\t\t'Patriot'  => array( '0d4785', 'ecedee', '333333', 'ffffff', 'c51d27' ),\n\t\t\t\t\t'Metro'    => array( '3a7895', '223344', 'ffffff', 'ffffff', 'ffa800' ),\n\t\t\t\t\t'Stellar'  => array( '313150', '050528', 'ffffff', 'ffffff', 'e00034' ),\n\t\t\t\t\t'Carbon'   => array( '353535', '191919', 'ededed', 'ffffff', 'f67f17' ),\n\t\t\t\t\t'Avocado'  => array( '00241e', '013832', 'ffffff', 'ffffff', 'efb11e' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t<tr valign=\"top\" class=\"themeboy\">\n\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t<?php esc_html_e( 'Color Scheme', 'sportspress' ); ?>\n\t\t\t</th>\n\t\t\t<td class=\"forminp\">\n\t\t\t\t<fieldset>\n\t\t\t\t\t<?php foreach ( $color_schemes as $name => $colors ) { ?>\n\t\t\t\t\t\t<div class=\"color-option sp-color-option\">\n\t\t\t\t\t\t\t<label data-sp-colors=\"<?php echo implode( ',', array_map( 'esc_attr', $colors ) ); ?>\"><?php echo esc_html( $name ); ?></label>\n\t\t\t\t\t\t\t<table class=\"color-palette\">\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td style=\"background-color: #<?php echo esc_attr( $colors[0] ); ?>\">&nbsp;</td>\n\t\t\t\t\t\t\t\t\t\t<td style=\"background-color: #<?php echo esc_attr( $colors[0] ); ?>\">&nbsp;</td>\n\t\t\t\t\t\t\t\t\t\t<td style=\"background-color: #<?php echo esc_attr( $colors[4] ); ?>\">&nbsp;</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<div class=\"sp-custom-colors\">\n\t\t\t\t\t\t<label data-sp-colors=\"<?php echo implode( ',', array_map( 'esc_attr', $colors ) ); ?>\"><?php esc_html_e( 'Customize', 'sportspress' ); ?></label><br>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t// Get settings\n\t\t\t\t\t\t$colors = array_map( 'esc_attr', (array) get_option( 'themeboy', array() ) );\n\t\t\t\t\t\tif ( empty( $colors ) ) {\n\t\t\t\t\t\t\t$colors = array_map( 'esc_attr', (array) get_option( 'sportspress_frontend_css_colors', array() ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Fallback\n\t\t\t\t\t\tif ( ! isset( $colors['customize'] ) ) {\n\t\t\t\t\t\t\t$colors['customize'] = ( 'yes' == get_option( 'sportspress_enable_frontend_css', 'no' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Defaults\n\t\t\t\t\t\tif ( empty( $colors['primary'] ) ) {\n\t\t\t\t\t\t\t$colors['primary'] = '#2b353e';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( empty( $colors['background'] ) ) {\n\t\t\t\t\t\t\t$colors['background'] = '#f4f4f4';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( empty( $colors['text'] ) ) {\n\t\t\t\t\t\t\t$colors['text'] = '#222222';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( empty( $colors['heading'] ) ) {\n\t\t\t\t\t\t\t$colors['heading'] = '#ffffff';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( empty( $colors['link'] ) ) {\n\t\t\t\t\t\t\t$colors['link'] = '#00a69c';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Show inputs\n\t\t\t\t\t\t$this->color_picker( esc_attr__( 'Primary', 'sportspress' ), 'sportspress_frontend_css_primary', $colors['primary'] );\n\t\t\t\t\t\t$this->color_picker( esc_attr__( 'Background', 'sportspress' ), 'sportspress_frontend_css_background', $colors['background'] );\n\t\t\t\t\t\t$this->color_picker( esc_attr__( 'Text', 'sportspress' ), 'sportspress_frontend_css_text', $colors['text'] );\n\t\t\t\t\t\t$this->color_picker( esc_attr__( 'Heading', 'sportspress' ), 'sportspress_frontend_css_heading', $colors['heading'] );\n\t\t\t\t\t\t$this->color_picker( esc_attr__( 'Link', 'sportspress' ), 'sportspress_frontend_css_link', $colors['link'] );\n\n\t\t\t\t\t\tif ( ( $styles = SP_Frontend_Scripts::get_styles() ) && array_key_exists( 'sportspress-general', $styles ) ) :\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t<label for=\"sportspress_frontend_css_customize\">\n\t\t\t\t\t\t\t\t<input name=\"sportspress_frontend_css_customize\" id=\"sportspress_frontend_css_customize\" type=\"checkbox\" value=\"1\" <?php checked( $colors['customize'] ); ?>>\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Enable', 'sportspress' ); ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\t\t\t</td>\n\t\t</tr>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Output a colour picker input box.\n\t\t *\n\t\t * @access public\n\t\t * @param mixed $name\n\t\t * @param mixed $id\n\t\t * @param mixed $value\n\t\t * @return void\n\t\t */\n\t\tfunction color_picker( $name, $id, $value ) {\n\t\t\techo '<div class=\"sp-color-box\"><strong>' . esc_html( $name ) . '</strong>\n\t   \t\t<input name=\"' . esc_attr( $id ) . '\" id=\"' . esc_attr( $id ) . '\" type=\"text\" value=\"' . esc_attr( $value ) . '\" class=\"colorpick\" /> <div id=\"colorPickerDiv_' . esc_attr( $id ) . '\" class=\"colorpickdiv\"></div>\n\t    </div>';\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_General();\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-licenses.php",
    "content": "<?php\n/**\n * SportsPress License Settings\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Licenses' ) ) :\n\n\t/**\n\t * SP_Settings_Licenses\n\t */\n\tclass SP_Settings_Licenses extends SP_Settings_Page {\n\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\tpublic $licenses = array();\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id    = 'licenses';\n\t\t\t$this->label = esc_attr__( 'Licenses', 'sportspress' );\n\n\t\t\t$this->licenses = apply_filters(\n\t\t\t\t'sportspress_licenses',\n\t\t\t\tarray(\n\t\t\t\t\t'pro' => array(\n\t\t\t\t\t\t'name' => 'SportsPress Pro',\n\t\t\t\t\t\t'url'  => 'https://account.themeboy.com',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( sizeof( $this->licenses ) <= 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t\tadd_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Output licenses\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function output() {\n\t\t\t?>\n\t\t\t<?php wp_nonce_field( 'sp_license_nonce', 'sp_license_nonce' ); ?>\n\t\t<div class=\"sp-modules-wrapper\">\n\t\t\t<div class=\"sp-modules-main\">\n\t\t\t\t<?php\n\t\t\t\tforeach ( $this->licenses as $id => $license ) {\n\t\t\t\t\t$key    = get_site_option( 'sportspress_' . $id . '_license_key' );\n\t\t\t\t\t$key    = trim( $key );\n\t\t\t\t\t$status = get_site_option( 'sportspress_' . $id . '_license_status', false );\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"sp-settings-section sp-settings-section-license_options\">\n\t\t\t\t\t\t<h3><?php echo esc_html( $license['name'] ); ?></h3>\n\t\t\t\t\t\t<table class=\"form-table sp-licenses-table\">\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'License Key', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t\t\t<?php if ( $key && $status && 'valid' == $status ) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"dashicons dashicons-yes sp-desc-active\"></i>\n\t\t\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_html_e( 'Enter the license key from your purchase receipt.', 'sportspress' ); ?>\"></i>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<?php if ( false !== $status && 'valid' == $status ) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"sp_license_key_<?php echo esc_attr( $id ); ?>\" size=\"40\" value=\"<?php esc_attr_e( $key ); ?>\" readonly=\"readonly\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input name=\"sp_license_deactivate_<?php echo esc_attr( $id ); ?>\" class=\"button button-secondary button-small\" type=\"submit\" value=\"<?php esc_attr_e( 'Deactivate', 'sportspress' ); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"sp_license_key_<?php echo esc_attr( $id ); ?>\" size=\"40\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input name=\"sp_license_activate_<?php echo esc_attr( $id ); ?>\" class=\"button button-primary button-small\" type=\"submit\" value=\"<?php esc_attr_e( 'Activate', 'sportspress' ); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t</div>\n\t\t\t<?php\n\n\t\t\t$GLOBALS['hide_save_button'] = true;\n\t\t}\n\n\t\t/**\n\t\t * Save license\n\t\t */\n\t\tpublic function save() {\n\t\t\t// run a quick security check\n\t\t\tif ( ! check_admin_referer( 'sp_license_nonce', 'sp_license_nonce' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $_POST as $name => $value ) {\n\t\t\t\tif ( 'sp_license_activate_' === substr( $name, 0, 20 ) ) {\n\t\t\t\t\t$this->activate( substr( $name, 20 ) );\n\t\t\t\t} elseif ( 'sp_license_deactivate_' === substr( $name, 0, 22 ) ) {\n\t\t\t\t\t$this->deactivate( substr( $name, 22 ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Activate license\n\t\t */\n\t\tpublic function activate( $id ) {\n\n\t\t\t// return if a license key isn't set\n\t\t\tif ( ! isset( $_POST[ 'sp_license_key_' . $id ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// retrieve the license key\n\t\t\t$license = trim( sanitize_text_field( wp_unslash( $_POST[ 'sp_license_key_' . $id ] ) ) );\n\n\t\t\t// get the name of the product\n\t\t\t$name = $this->licenses[ $id ]['name'];\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license'    => $license,\n\t\t\t\t'item_name'  => urlencode( $name ), // the name of our product in EDD\n\t\t\t\t'url'        => home_url(),\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post(\n\t\t\t\t$this->licenses[ $id ]['url'],\n\t\t\t\tarray(\n\t\t\t\t\t'timeout'   => 15,\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'body'      => $api_params,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\tSP_Admin_Settings::add_error( esc_attr__( 'Sorry, there has been an error.', 'sportspress' ) );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t// Update license status\n\t\t\tupdate_site_option( 'sportspress_' . $id . '_license_status', $license_data->license );\n\n\t\t\t// Update License or display error\n\t\t\tif ( 'valid' == $license_data->license ) {\n\t\t\t\tupdate_site_option( 'sportspress_' . $id . '_license_key', $license );\n\t\t\t\tSP_Admin_Settings::add_override( esc_attr__( 'License activated.', 'sportspress' ) );\n\t\t\t} else {\n\t\t\t\tSP_Admin_Settings::add_error( esc_attr__( 'License invalid.', 'sportspress' ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Deactivate license\n\t\t */\n\t\tpublic function deactivate( $id ) {\n\n\t\t\t// return if a license key isn't set\n\t\t\tif ( ! isset( $_POST[ 'sp_license_key_' . $id ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// retrieve the license key\n\t\t\t$license = trim( sanitize_text_field( wp_unslash( $_POST[ 'sp_license_key_' . $id ] ) ) );\n\n\t\t\t// get the name of the product\n\t\t\t$name = $this->licenses[ $id ]['name'];\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'deactivate_license',\n\t\t\t\t'license'    => $license,\n\t\t\t\t'item_name'  => urlencode( $name ), // the name of our product in EDD\n\t\t\t\t'url'        => home_url(),\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post(\n\t\t\t\t$this->licenses[ $id ]['url'],\n\t\t\t\tarray(\n\t\t\t\t\t'timeout'   => 15,\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'body'      => $api_params,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\tSP_Admin_Settings::add_error( esc_attr__( 'Sorry, there has been an error.', 'sportspress' ) );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\t\tif ( $license_data->license == 'deactivated' ) {\n\t\t\t\tdelete_site_option( 'sportspress_' . $id . '_license_status' );\n\t\t\t\tSP_Admin_Settings::add_override( esc_attr__( 'License deactivated.', 'sportspress' ) );\n\t\t\t} else {\n\t\t\t\tSP_Admin_Settings::add_error( esc_attr__( 'Sorry, there has been an error.', 'sportspress' ) );\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_Licenses();\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-modules.php",
    "content": "<?php\n/**\n * SportsPress Module Settings\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Modules' ) ) :\n\n\t/**\n\t * SP_Settings_Modules\n\t */\n\tclass SP_Settings_Modules extends SP_Settings_Page {\n\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\tpublic $sections = array();\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id    = 'modules';\n\t\t\t$this->label = esc_attr__( 'Modules', 'sportspress' );\n\n\t\t\t$this->sections = apply_filters(\n\t\t\t\t'sportspress_module_sections',\n\t\t\t\tarray(\n\t\t\t\t\t'general'      => esc_attr__( 'General', 'sportspress' ),\n\t\t\t\t\t'event'        => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t'team'         => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t'player_staff' => esc_attr__( 'Players', 'sportspress' ) . ' &amp; ' . esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t'admin'        => esc_attr__( 'Dashboard', 'sportspress' ),\n\t\t\t\t\t'other'        => esc_attr__( 'Other', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t\tadd_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Output modules\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function output() {\n\t\t\t?>\n\t\t<div class=\"sp-modules-wrapper\">\n\t\t\t<div class=\"sp-modules-sidebar\">\n\t\t\t\t<?php do_action( 'sportspress_modules_sidebar' ); ?>\n\n\t\t\t\t<?php if ( ! class_exists( 'SportsPress_Pro' ) ) { ?>\n\t\t\t\t<table class=\"widefat\" cellspacing=\"0\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr><th>\n\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) ); ?>\" target=\"_blank\"><img src=\"<?php echo esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ); ?>/assets/images/modules/sportspress-pro.png\" alt=\"<?php esc_html_e( 'SportsPress Pro', 'sportspress' ); ?>\" width=\"174\"></a>\n\t\t\t\t\t\t</th></tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr><td>\n\t\t\t\t\t\t\t<p><?php esc_html_e( 'Get SportsPress Pro to get access to all modules. You can upgrade any time without losing any of your data.', 'sportspress' ); ?></p>\n\t\t\t\t\t\t\t<p class=\"sp-module-actions\">\n\t\t\t\t\t\t\t\t<span><?php esc_html_e( 'Premium', 'sportspress' ); ?></span>\n\t\t\t\t\t\t\t\t<a class=\"button button-primary\" href=\"<?php echo esc_url( apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) ); ?>\" target=\"_blank\"><?php esc_html_e( 'Upgrade Now', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t\t<?php } ?>\n\n\t\t\t\t<?php if ( ! class_exists( 'SportsPress_Twitter' ) || ! class_exists( 'SportsPress_Facebook' ) ) { ?>\n\t\t\t\t<table class=\"widefat\" cellspacing=\"0\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr><th>\n\t\t\t\t\t\t\t<strong><?php esc_html_e( 'Get Freebies', 'sportspress' ); ?></strong>\n\t\t\t\t\t\t</th></tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr><td>\n\t\t\t\t\t\t\t<p><?php esc_html_e( 'Instant access to exclusive SportsPress extensions and free downloads.', 'sportspress' ); ?></p>\n\t\t\t\t\t\t\t<p class=\"sp-module-actions\">\n\t\t\t\t\t\t\t\t<span><?php esc_html_e( 'Create a free account', 'sportspress' ); ?></span>\n\t\t\t\t\t\t\t\t<a class=\"button\" href=\"http://tboy.co/account\" target=\"_blank\"><?php esc_html_e( 'Sign Up', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t\t<?php } ?>\n\n\t\t\t\t<?php if ( current_user_can( 'install_themes' ) ) { ?>\n\t\t\t\t\t<?php $theme = wp_get_theme(); ?>\n\t\t\t\t\t<?php if ( 'rookie' == $theme->stylesheet ) { ?>\n\t\t\t\t\t\t<table class=\"widefat\" cellspacing=\"0\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr><th>\n\t\t\t\t\t\t\t\t\t<strong><?php esc_html_e( 'Current Theme', 'sportspress' ); ?></strong>\n\t\t\t\t\t\t\t\t</th></tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr><td>\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo esc_url( $theme->get_screenshot() ); ?>\" class=\"sp-theme-screenshot\">\n\t\t\t\t\t\t\t\t\t<p><?php esc_html_e( 'Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress' ); ?></p>\n\t\t\t\t\t\t\t\t\t<p class=\"sp-module-actions\">\n\t\t\t\t\t\t\t\t\t\t<span><?php esc_html_e( 'Need a better theme?', 'sportspress' ); ?></span>\n\t\t\t\t\t\t\t\t\t\t<a class=\"button\" href=\"<?php echo esc_url( apply_filters( 'sportspress_pro_url', 'http://tboy.co/themes' ) ); ?>\" target=\"_blank\"><?php esc_html_e( 'Upgrade', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t<?php } elseif ( ! current_theme_supports( 'sportspress' ) ) { ?>\n\t\t\t\t\t\t<table class=\"widefat\" cellspacing=\"0\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr><th>\n\t\t\t\t\t\t\t\t\t<strong><?php esc_html_e( 'Free SportsPress Theme', 'sportspress' ); ?></strong>\n\t\t\t\t\t\t\t\t</th></tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr><td>\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ); ?>/assets/images/welcome/rookie.png\" class=\"sp-theme-screenshot\">\n\t\t\t\t\t\t\t\t\t<p><?php esc_html_e( 'Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress' ); ?></p>\n\t\t\t\t\t\t\t\t\t<p class=\"sp-module-actions\">\n\t\t\t\t\t\t\t\t\t\t<span><?php esc_html_e( 'Free', 'sportspress' ); ?></span>\n\t\t\t\t\t\t\t\t\t\t<a class=\"button\" href=\"<?php echo esc_url( add_query_arg( array( 'theme' => 'rookie' ), network_admin_url( 'theme-install.php' ) ) ); ?>\"><?php esc_html_e( 'Install Now', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t<?php } ?>\n\n\t\t\t\t<?php\n\t\t\t\t$categories = array(\n\t\t\t\t\t'documentation' => array(\n\t\t\t\t\t\t'icon'  => 'sp-icon-book',\n\t\t\t\t\t\t'label' => esc_attr__( 'Documentation', 'sportspress' ),\n\t\t\t\t\t\t'links' => array(\n\t\t\t\t\t\t\t'http://tboy.co/installation' => esc_attr__( 'Getting Started', 'sportspress' ),\n\t\t\t\t\t\t\t'http://tboy.co/manuals'      => esc_attr__( 'Manuals', 'sportspress' ),\n\t\t\t\t\t\t\t'http://tboy.co/videos'       => esc_attr__( 'Videos', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'help'          => array(\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-heart',\n\t\t\t\t\t\t'label' => esc_attr__( 'Help', 'sportspress' ),\n\t\t\t\t\t\t'links' => array(\n\t\t\t\t\t\t\t'http://tboy.co/forums' => esc_attr__( 'Support Forums', 'sportspress' ),\n\t\t\t\t\t\t\t'http://tboy.co/ideas'  => esc_attr__( 'Feature Requests', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'social'        => array(\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-share',\n\t\t\t\t\t\t'label' => esc_attr__( 'Connect', 'sportspress' ),\n\t\t\t\t\t\t'links' => array(\n\t\t\t\t\t\t\t'http://tboy.co/twitter'  => esc_attr__( 'Twitter', 'sportspress' ),\n\t\t\t\t\t\t\t'http://tboy.co/facebook' => esc_attr__( 'Facebook', 'sportspress' ),\n\t\t\t\t\t\t\t'http://tboy.co/youtube'  => esc_attr__( 'YouTube', 'sportspress' ),\n\t\t\t\t\t\t\t'http://tboy.co/gplus'    => esc_attr__( 'Google+', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'developers'    => array(\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-editor-code',\n\t\t\t\t\t\t'label' => esc_attr__( 'Developers', 'sportspress' ),\n\t\t\t\t\t\t'links' => array(\n\t\t\t\t\t\t\t'http://tboy.co/developers' => esc_attr__( 'Reference', 'sportspress' ),\n\t\t\t\t\t\t\t'http://tboy.co/slack'      => esc_attr__( 'Slack', 'sportspress' ),\n\t\t\t\t\t\t\t'http://tboy.co/github'     => esc_attr__( 'GitHub', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\tif ( class_exists( 'SportsPress_Pro' ) ) {\n\t\t\t\t\t$categories['help']['links']['http://support.themeboy.com/'] = esc_attr__( 'Premium Support', 'sportspress' );\n\t\t\t\t} else {\n\t\t\t\t\t$categories['help']['links'][ apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) ] = '<span class=\"sp-desc-tip\" title=\"' . esc_attr__( 'Upgrade to Pro', 'sportspress' ) . '\">' . esc_attr__( 'Premium Support', 'sportspress' ) . '</span>';\n\t\t\t\t}\n\n\t\t\t\t$categories = apply_filters( 'sportspress_modules_welcome_links', $categories );\n\n\t\t\t\tif ( sizeof( $categories ) ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<table class=\"widefat\" cellspacing=\"0\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr><th>\n\t\t\t\t\t\t\t\t<strong><?php esc_html_e( 'Welcome to SportsPress', 'sportspress' ); ?></strong>\n\t\t\t\t\t\t\t</th></tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr><td>\n\t\t\t\t\t\t\t<?php foreach ( $categories as $slug => $category ) { ?>\n\t\t\t\t\t\t\t\t\t<p><strong><i class=\"<?php echo esc_attr( $category['icon'] ); ?>\"></i> <?php echo esc_html( $category['label'] ); ?></strong></p>\n\t\t\t\t\t\t\t\t\t<ul class=\"sp-<?php echo esc_attr( $slug ); ?>-links\">\n\t\t\t\t\t\t\t\t\t\t<?php foreach ( $category['links'] as $url => $text ) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<li><a href=\"<?php echo esc_url( $url ); ?>\" target=\"_blank\"><?php echo wp_kses_post( $text ); ?></a></li>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<?php do_action( 'sportspress_modules_after_sidebar' ); ?>\n\t\t\t</div>\n\n\t\t\t<div class=\"sp-modules-main\">\n\t\t\t\t\t<?php foreach ( SP()->modules->data as $section => $modules ) { ?>\n\t\t\t\t<table class=\"sp-modules-table widefat\" cellspacing=\"0\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr><th>\n\t\t\t\t\t\t\t<?php echo esc_html( sp_array_value( $this->sections, $section, esc_attr__( 'Modules', 'sportspress' ) ) ); ?>\n\t\t\t\t\t\t</th></tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<?php foreach ( $modules as $id => $module ) { ?>\n\t\t\t\t\t\t\t<?php if ( isset( $module['class'] ) && ! class_exists( $module['class'] ) ) { ?>\n\t\t\t\t\t\t\t<tr class=\"sp-module-unavailable\"><td>\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" disabled=\"disabled\">\n\t\t\t\t\t\t\t\t<span class=\"sp-desc-tip\" title=\"<?php echo esc_attr( sp_array_value( $module, 'tip', esc_attr__( 'Upgrade to Pro', 'sportspress' ) ) ); ?>\">\n\t\t\t\t\t\t\t\t\t<i class=\"<?php echo esc_attr( sp_array_value( $module, 'icon', 'dashicons dashicons-admin-generic' ) ); ?>\"></i>\n\t\t\t\t\t\t\t\t\t<?php echo esc_html( sp_array_value( $module, 'label', $id ) ); ?>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<?php if ( isset( $module['desc'] ) ) { ?>\n\t\t\t\t\t\t\t\t\t<span class=\"sp-desc\">\n\t\t\t\t\t\t\t\t\t\t<?php echo wp_kses_post( $module['desc'] ); ?>\n\t\t\t\t\t\t\t\t\t\t<?php if ( array_key_exists( 'link', $module ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( apply_filters( 'sportspress_pro_url', $module['link'] ) ); ?>\" target=\"_blank\"><?php echo esc_html( sp_array_value( $module, 'action', esc_attr__( 'Learn more', 'sportspress' ) ) ); ?></a>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t<tr><td>\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sportspress_load_<?php echo esc_attr( $id ); ?>_module\" id=\"sportspress_load_<?php echo esc_attr( $id ); ?>_module\" <?php checked( 'yes' == get_option( 'sportspress_load_' . $id . '_module', sp_array_value( $module, 'default', 'yes' ) ) ); ?>>\n\t\t\t\t\t\t\t\t<label for=\"sportspress_load_<?php echo esc_attr( $id ); ?>_module\">\n\t\t\t\t\t\t\t\t\t<i class=\"<?php echo esc_attr( sp_array_value( $module, 'icon', 'dashicons dashicons-admin-generic' ) ); ?>\"></i>\n\t\t\t\t\t\t\t\t\t<?php echo esc_html( sp_array_value( $module, 'label', $id ) ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<?php if ( isset( $module['desc'] ) ) { ?>\n\t\t\t\t\t\t\t\t\t<span class=\"sp-desc\"><?php echo wp_kses_post( $module['desc'] ); ?></span>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t\t<?php } ?>\n\n\t\t\t\t<p class=\"submit\">\n\t\t\t\t\t<input name=\"save\" class=\"button button-primary\" type=\"submit\" value=\"<?php esc_attr_e( 'Save Changes', 'sportspress' ); ?>\" />\n\t\t\t\t\t<?php $GLOBALS['hide_save_button'] = true; ?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<input type=\"hidden\" name=\"sportspress_update_modules\" value=\"1\">\n\n\t\t\t<?php if ( isset( $_POST['sportspress_update_modules'] ) ) { ?>\n\t\t<script type=\"text/javascript\">\n\t\twindow.onload = function() {\n\t\t\twindow.location = window.location.href;\n\t\t}\n\t\t</script>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\tflush_rewrite_rules();\n\t\t}\n\n\t\t/**\n\t\t * Save settings\n\t\t */\n\t\tpublic function save() {\n\t\t\tforeach ( SP()->modules->data as $sections => $modules ) {\n\t\t\t\tforeach ( $modules as $id => $module ) {\n\t\t\t\t\t$name = 'sportspress_load_' . $id . '_module';\n\t\t\t\t\tupdate_option( $name, isset( $_POST[ $name ] ) ? 'yes' : 'no' );\n\t\t\t\t}\n\t\t\t}\n\t\t\tflush_rewrite_rules();\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_Modules();\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-page.php",
    "content": "<?php\n/**\n * SportsPress Settings Page/Tab\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Page' ) ) :\n\n\t/**\n\t * SP_Settings_Page\n\t */\n\tclass SP_Settings_Page {\n\n\t\tprotected $id       = '';\n\t\tprotected $label    = '';\n\t\tprotected $template = '';\n\t\t/**\n\t\t * Add this page to settings\n\t\t */\n\t\tpublic function add_settings_page( $pages ) {\n\t\t\t$pages[ $this->id ] = $this->label;\n\n\t\t\treturn $pages;\n\t\t}\n\n\t\t/**\n\t\t * Get settings array\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function get_settings() {\n\t\t\treturn array();\n\t\t}\n\n\t\t/**\n\t\t * Templates\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function templates() {\n\t\t\tif ( ! isset( $this->template ) ) {\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\t$template = $this->template;\n\t\t\treturn SP()->templates->$template;\n\t\t}\n\n\t\t/**\n\t\t * Output the settings\n\t\t */\n\t\tpublic function output() {\n\t\t\t$settings = $this->get_settings();\n\n\t\t\tSP_Admin_Settings::output_fields( $settings );\n\t\t}\n\n\t\t/**\n\t\t * Save settings\n\t\t */\n\t\tpublic function save() {\n\t\t\tglobal $current_section;\n\n\t\t\t$settings = $this->get_settings();\n\t\t\tSP_Admin_Settings::save_fields( $settings );\n\n\t\t\tif ( $current_section ) {\n\t\t\t\tdo_action( 'sportspress_update_options_' . $this->template . '_' . $current_section );\n\t\t\t}\n\n\t\t\t$templates = $this->templates();\n\t\t\tif ( ! empty( $templates ) ) {\n\t\t\t\tupdate_option( 'sportspress_' . $this->template . '_template_order', sp_array_value( $_POST, 'sportspress_' . $this->template . '_template_order', false, 'key' ) );\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['sportspress_template_visibility'] ) && is_array( $_POST['sportspress_template_visibility'] ) ) {\n\t\t\t\tforeach ( $_POST['sportspress_template_visibility'] as $option => $toggled ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t\t\tif ( $toggled ) {\n\t\t\t\t\t\tupdate_option( $option, 'yes' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tupdate_option( $option, 'no' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * Layout settings\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function layout_setting() {\n\t\t\t$templates = $this->templates();\n\t\t\t$templates = apply_filters( 'sportspress_' . $this->template . '_templates', $templates );\n\n\t\t\t$layout = get_option( 'sportspress_' . $this->template . '_template_order' );\n\t\t\tif ( false === $layout ) {\n\t\t\t\t$layout = array_keys( $templates );\n\t\t\t}\n\n\t\t\t$templates = array_merge( array_flip( (array) $layout ), $templates );\n\n\t\t\t$slice = array_search( 'tabs', array_keys( $templates ) );\n\t\t\tif ( $slice ) {\n\t\t\t\t$templates = array_slice( $templates, 0, $slice );\n\t\t\t}\n\t\t\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th>\n\t\t\t\t<?php esc_html_e( 'Layout', 'sportspress' ); ?>\n\t\t\t</th>\n\t\t\t<td class=\"sp-sortable-list-container\">\n\t\t\t\t<p class=\"description\"><?php esc_html_e( 'Drag each item into the order you prefer.', 'sportspress' ); ?></p>\n\n\t\t\t\t<ul class=\"sp-layout sp-sortable-list sp-connected-list ui-sortable\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $templates as $template => $details ) {\n\t\t\t\t\t\tif ( ! is_array( $details ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$option     = sp_array_value( $details, 'option', 'sportspress_' . $this->template . '_show_' . $template );\n\t\t\t\t\t\t$visibility = get_option( $option, sp_array_value( $details, 'default', 'yes' ) );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class=\"sp-item-bar sp-layout-item-bar\">\n\t\t\t\t\t\t\t\t<div class=\"sp-item-handle sp-layout-item-handle ui-sortable-handle\">\n\t\t\t\t\t\t\t\t\t<span class=\"sp-item-title item-title\"><?php echo esc_html( sp_array_value( $details, 'title', ucfirst( $template ) ) ); ?></span>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sportspress_<?php echo esc_attr( $this->template ); ?>_template_order[]\" value=\"<?php echo esc_attr( $template ); ?>\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sportspress_template_visibility[<?php echo esc_attr( $option ); ?>]\" value=\"0\">\n\t\t\t\t\t\t\t\t<input class=\"sp-toggle-switch\" type=\"checkbox\" name=\"sportspress_template_visibility[<?php echo esc_attr( $option ); ?>]\" id=\"<?php echo esc_attr( $option ); ?>\" value=\"1\" <?php checked( $visibility, 'yes' ); ?>>\n\t\t\t\t\t\t\t\t<label for=\"sportspress_<?php echo esc_attr( $this->template ); ?>_show_<?php echo esc_attr( $template ); ?>\"></label>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t </ul>\n\t\t\t</td>\n\t\t</tr>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Tabs settings\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function tabs_setting() {\n\t\t\t$templates = $this->templates();\n\t\t\t$templates = apply_filters( 'sportspress_' . $this->template . '_templates', $templates );\n\n\t\t\t$layout = get_option( 'sportspress_' . $this->template . '_template_order' );\n\t\t\tif ( false === $layout ) {\n\t\t\t\t$layout = array_keys( $templates );\n\t\t\t}\n\n\t\t\t$templates = array_merge( array_flip( (array) $layout ), $templates );\n\n\t\t\t$slice = array_search( 'tabs', array_keys( $templates ) );\n\t\t\tif ( $slice ) {\n\t\t\t\t$templates = array_slice( $templates, $slice );\n\t\t\t} else {\n\t\t\t\t$templates = array();\n\t\t\t}\n\t\t\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th>\n\t\t\t\t<?php esc_html_e( 'Tabs', 'sportspress' ); ?>\n\t\t\t</th>\n\t\t\t<td class=\"sp-sortable-list-container\">\n\t\t\t\t<p class=\"description\"><?php esc_html_e( 'Drag items here to display them as tabs.', 'sportspress' ); ?></p>\n\t\t\t\t<input type=\"hidden\" name=\"sportspress_<?php echo esc_attr( $this->template ); ?>_template_order[]\" value=\"tabs\">\n\n\t\t\t\t<ul class=\"sp-layout sp-sortable-list sp-connected-list ui-sortable\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $templates as $template => $details ) {\n\t\t\t\t\t\tif ( ! is_array( $details ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$option     = sp_array_value( $details, 'option', 'sportspress_' . $this->template . '_show_' . $template );\n\t\t\t\t\t\t$visibility = get_option( $option, sp_array_value( $details, 'default', 'yes' ) );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class=\"sp-item-bar sp-layout-item-bar\">\n\t\t\t\t\t\t\t\t<div class=\"sp-item-handle sp-layout-item-handle ui-sortable-handle\">\n\t\t\t\t\t\t\t\t\t<span class=\"sp-item-title item-title\"><?php echo esc_html( sp_array_value( $details, 'title', ucfirst( $template ) ) ); ?></span>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sportspress_<?php echo esc_attr( $this->template ); ?>_template_order[]\" value=\"<?php echo esc_attr( $template ); ?>\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"sportspress_template_visibility[<?php echo esc_attr( $option ); ?>]\" value=\"0\">\n\t\t\t\t\t\t\t\t<input class=\"sp-toggle-switch\" type=\"checkbox\" name=\"sportspress_template_visibility[<?php echo esc_attr( $option ); ?>]\" id=\"<?php echo esc_attr( $option ); ?>\" value=\"1\" <?php checked( $visibility, 'yes' ); ?>>\n\t\t\t\t\t\t\t\t<label for=\"sportspress_<?php echo esc_attr( $this->template ); ?>_show_<?php echo esc_attr( $template ); ?>\"></label>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t </ul>\n\t\t\t</td>\n\t\t</tr>\n\t\t\t<?php\n\t\t}\n\t}\n\nendif;\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-players.php",
    "content": "<?php\n/**\n * SportsPress Player Settings\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.6.8\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Players' ) ) :\n\n\t/**\n\t * SP_Settings_Players\n\t */\n\tclass SP_Settings_Players extends SP_Settings_Page {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id       = 'players';\n\t\t\t$this->label    = esc_attr__( 'Players', 'sportspress' );\n\t\t\t$this->template = 'player';\n\n\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t\tadd_action( 'sportspress_admin_field_player_layout', array( $this, 'layout_setting' ) );\n\t\t\tadd_action( 'sportspress_admin_field_player_tabs', array( $this, 'tabs_setting' ) );\n\t\t\tadd_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Get settings array\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function get_settings() {\n\n\t\t\t$settings = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Player Options', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'player_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_player_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray( 'type' => 'player_layout' ),\n\n\t\t\t\t\t\tarray( 'type' => 'player_tabs' ),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Link', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Link players', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_link_players',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'         => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_player_show_number',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_player_show_name',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Nationality', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_player_show_nationality',\n\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Position', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_player_show_positions',\n\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Current Team', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_player_show_current_teams',\n\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Past Teams', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_player_show_past_teams',\n\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_player_show_leagues',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_player_show_seasons',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Nationality', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display national flags', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_player_show_flags',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'player_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Statistics', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'player_statistic_options',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Columns', 'sportspress' ),\n\t\t\t\t\t\t'id'      => 'sportspress_player_columns',\n\t\t\t\t\t\t'default' => 'auto',\n\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'auto'   => esc_attr__( 'Auto', 'sportspress' ),\n\t\t\t\t\t\t\t'manual' => esc_attr__( 'Manual', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Mode', 'sportspress' ),\n\t\t\t\t\t\t'id'      => 'sportspress_player_statistics_mode',\n\t\t\t\t\t\t'default' => 'values',\n\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'values' => esc_attr__( 'Values', 'sportspress' ),\n\t\t\t\t\t\t\t'icons'  => esc_attr__( 'Icons', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Categories', 'sportspress' ),\n\t\t\t\t\t\t'id'      => 'sportspress_player_performance_sections',\n\t\t\t\t\t\t'default' => -1,\n\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t-1 => esc_attr__( 'Combined', 'sportspress' ),\n\t\t\t\t\t\t\t0  => esc_attr__( 'Offense', 'sportspress' ) . ' &rarr; ' . esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t\t\t1  => esc_attr__( 'Defense', 'sportspress' ) . ' &rarr; ' . esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'         => esc_attr__( 'Display', 'sportspress' ),\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Total', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_player_show_total',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Career Total', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_player_show_career_total',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_player_statistic_options',\n\t\t\t\t\tarray()\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'player_statistic_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn apply_filters( 'sportspress_player_settings', $settings );\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_Players();\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-staff.php",
    "content": "<?php\n/**\n * SportsPress Staff Settings\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.1.6\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Staff' ) ) :\n\n\t/**\n\t * SP_Settings_Staff\n\t */\n\tclass SP_Settings_Staff extends SP_Settings_Page {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id       = 'staff';\n\t\t\t$this->label    = esc_attr__( 'Staff', 'sportspress' );\n\t\t\t$this->template = 'staff';\n\n\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t\tadd_action( 'sportspress_admin_field_staff_layout', array( $this, 'layout_setting' ) );\n\t\t\tadd_action( 'sportspress_admin_field_staff_tabs', array( $this, 'tabs_setting' ) );\n\t\t\tadd_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Get settings array\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function get_settings() {\n\n\t\t\treturn apply_filters(\n\t\t\t\t'sportspress_staff_settings',\n\t\t\t\tarray_merge(\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title' => esc_attr__( 'Staff Options', 'sportspress' ),\n\t\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t\t'id'    => 'staff_options',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tapply_filters(\n\t\t\t\t\t\t'sportspress_staff_options',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray( 'type' => 'staff_layout' ),\n\n\t\t\t\t\t\t\tarray( 'type' => 'staff_tabs' ),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Link', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Link staff', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_link_staff',\n\t\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'         => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Nationality', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_staff_show_nationality',\n\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Current Team', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_staff_show_current_teams',\n\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Past Teams', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_staff_show_past_teams',\n\t\t\t\t\t\t\t\t'default'       => 'yes',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Nationality', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display national flags', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_staff_show_flags',\n\t\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t\t'id'   => 'staff_options',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t); // End staff settings\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_Staff();\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-status.php",
    "content": "<?php\n/**\n * SportsPress System Status\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7.13\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Status' ) ) :\n\n\t/**\n\t * SP_Settings_Status\n\t */\n\tclass SP_Settings_Status extends SP_Settings_Page {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id    = 'status';\n\t\t\t$this->label = esc_attr__( 'System Status', 'sportspress' );\n\n\t\t\tif ( defined( 'WP_DEBUG' ) && true === WP_DEBUG && current_user_can( 'manage_options' ) ) {\n\t\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 99 );\n\t\t\t}\n\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t}\n\n\t\t/**\n\t\t * Output system status\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function output() {\n\t\t\t?>\n\t\t<h3><?php esc_html_e( 'System Status', 'sportspress' ); ?></h3>\n\t\t<div class=\"updated sportspress-message\">\n\t\t\t<p><?php esc_html_e( 'Please include this information when requesting support:', 'sportspress' ); ?> </p>\n\t\t\t<p class=\"submit\"><a href=\"#\" class=\"button-primary debug-report\"><?php esc_html_e( 'Get System Report', 'sportspress' ); ?></a></p>\n\t\t\t<div id=\"debug-report\"><textarea readonly=\"readonly\"></textarea></div>\n\t\t</div>\n\t\t<br/>\n\t\t<table class=\"sp-status-table widefat\" cellspacing=\"0\">\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"2\"><?php esc_html_e( 'Environment', 'sportspress' ); ?></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Home URL', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td><?php echo esc_url( home_url() ); ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Site URL', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td><?php echo esc_url( site_url() ); ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'SP Version', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td><?php echo esc_html( SP()->version ); ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'WP Version', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td><?php bloginfo( 'version' ); ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'WP Multisite Enabled', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_multisite() ) {\n\t\t\t\t\t\tesc_html_e( 'Yes', 'sportspress' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tesc_html_e( 'No', 'sportspress' );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Web Server Info', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td><?php echo esc_html( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'PHP Version', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( function_exists( 'phpversion' ) ) {\n\t\t\t\t\t\techo esc_html( phpversion() );}\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'WP Memory Limit', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$memory = sp_let_to_num( WP_MEMORY_LIMIT );\n\n\t\t\t\t\tif ( $memory < 67108864 ) {\n\t\t\t\t\t\techo '<mark class=\"error\">' . wp_kses_post( sprintf( __( '%1$s - We recommend setting memory to at least 64MB. See: <a href=\"%2$s\">Increasing memory allocated to PHP</a>', 'sportspress' ), esc_html( size_format( $memory ) ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) ) . '</mark>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '<mark class=\"yes\">' . esc_html( size_format( $memory ) ) . '</mark>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'WP Debug Mode', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\n\t\t\t\t\t\techo '<mark class=\"yes\">' . esc_html__( 'Yes', 'sportspress' ) . '</mark>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '<mark class=\"no\">' . esc_html__( 'No', 'sportspress' ) . '</mark>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'WP Language', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( defined( 'WPLANG' ) && WPLANG ) {\n\t\t\t\t\t\techo esc_html( WPLANG );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tesc_html_e( 'Default', 'sportspress' );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'WP Max Upload Size', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td><?php echo esc_html( size_format( wp_max_upload_size() ) ); ?></td>\n\t\t\t\t</tr>\n\t\t\t\t\t<?php if ( function_exists( 'ini_get' ) ) : ?>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><?php esc_html_e( 'PHP Post Max Size', 'sportspress' ); ?>:</td>\n\t\t\t\t\t\t<td><?php echo esc_html( size_format( sp_let_to_num( ini_get( 'post_max_size' ) ) ) ); ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><?php esc_html_e( 'PHP Time Limit', 'sportspress' ); ?>:</td>\n\t\t\t\t\t\t<td><?php echo esc_html( ini_get( 'max_execution_time' ) ); ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><?php esc_html_e( 'PHP Max Input Vars', 'sportspress' ); ?>:</td>\n\t\t\t\t\t\t<td><?php echo esc_html( ini_get( 'max_input_vars' ) ); ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><?php esc_html_e( 'SUHOSIN Installed', 'sportspress' ); ?>:</td>\n\t\t\t\t\t\t<td><?php echo extension_loaded( 'suhosin' ) ? esc_html__( 'Yes', 'sportspress' ) : esc_html__( 'No', 'sportspress' ); ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Default Timezone', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$default_timezone = date_default_timezone_get();\n\t\t\t\t\tif ( 'UTC' !== $default_timezone ) {\n\t\t\t\t\t\techo '<mark class=\"error\">' . sprintf( esc_html__( 'Default timezone is %s - it should be UTC', 'sportspress' ), esc_attr( $default_timezone ) ) . '</mark>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '<mark class=\"yes\">' . sprintf( esc_html__( 'Default timezone is %s', 'sportspress' ), esc_attr( $default_timezone ) ) . '</mark>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t\t<?php\n\t\t\t\t\t$posting = array();\n\n\t\t\t\t\t// fsockopen/cURL\n\t\t\t\t\t$posting['fsockopen_curl']['name'] = esc_attr__( 'fsockopen/cURL', 'sportspress' );\n\t\t\t\t\tif ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) {\n\t\t\t\t\t\tif ( function_exists( 'fsockopen' ) && function_exists( 'curl_init' ) ) {\n\t\t\t\t\t\t\t$posting['fsockopen_curl']['note'] = esc_attr__( 'Your server has fsockopen and cURL enabled.', 'sportspress' );\n\t\t\t\t\t\t} elseif ( function_exists( 'fsockopen' ) ) {\n\t\t\t\t\t\t\t$posting['fsockopen_curl']['note'] = esc_attr__( 'Your server has fsockopen enabled, cURL is disabled.', 'sportspress' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$posting['fsockopen_curl']['note'] = esc_attr__( 'Your server has cURL enabled, fsockopen is disabled.', 'sportspress' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$posting['fsockopen_curl']['success'] = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$posting['fsockopen_curl']['note']    = esc_attr__( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'sportspress' ) . '</mark>';\n\t\t\t\t\t\t$posting['fsockopen_curl']['success'] = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// SOAP\n\t\t\t\t\t$posting['soap_client']['name'] = esc_attr__( 'SOAP Client', 'sportspress' );\n\t\t\t\t\tif ( class_exists( 'SoapClient' ) ) {\n\t\t\t\t\t\t$posting['soap_client']['note']    = esc_attr__( 'Your server has the SOAP Client class enabled.', 'sportspress' );\n\t\t\t\t\t\t$posting['soap_client']['success'] = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$posting['soap_client']['note']    = wp_kses_post( sprintf( __( 'Your server does not have the <a href=\"%s\">SOAP Client</a> class enabled - some gateway plugins which use SOAP may not work as expected.', 'sportspress' ), 'http://php.net/manual/en/class.soapclient.php' ) ) . '</mark>';\n\t\t\t\t\t\t$posting['soap_client']['success'] = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$posting = apply_filters( 'sportspress_debug_posting', $posting );\n\n\t\t\t\t\tforeach ( $posting as $post ) {\n\t\t\t\t\t\t$mark = ( isset( $post['success'] ) && $post['success'] == true ) ? 'yes' : 'error';\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><?php echo esc_html( $post['name'] ); ?>:</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<mark class=\"<?php echo esc_attr( $mark ); ?>\">\n\t\t\t\t\t\t\t\t<?php echo wp_kses_data( $post['note'] ); ?>\n\t\t\t\t\t\t\t\t</mark>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t</tbody>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"2\"><?php esc_html_e( 'Plugins', 'sportspress' ); ?></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Installed Plugins', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\n\n\t\t\t\t\tif ( is_multisite() ) {\n\t\t\t\t\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t\t$sp_plugins = array();\n\n\t\t\t\t\tforeach ( $active_plugins as $plugin ) {\n\n\t\t\t\t\t\t$plugin_data    = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );\n\t\t\t\t\t\t$dirname        = dirname( $plugin );\n\t\t\t\t\t\t$version_string = '';\n\n\t\t\t\t\t\tif ( ! empty( $plugin_data['Name'] ) ) {\n\n\t\t\t\t\t\t\t// link the plugin name to the plugin url if available\n\t\t\t\t\t\t\t$plugin_name = $plugin_data['Name'];\n\t\t\t\t\t\t\tif ( ! empty( $plugin_data['PluginURI'] ) ) {\n\t\t\t\t\t\t\t\t$plugin_name = '<a href=\"' . esc_url( $plugin_data['PluginURI'] ) . '\" title=\"' . esc_attr__( 'Visit plugin homepage', 'sportspress' ) . '\">' . $plugin_name . '</a>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( strstr( $dirname, 'sportspress' ) ) {\n\n\t\t\t\t\t\t\t\tif ( false === ( $version_data = get_transient( md5( $plugin ) . '_version_data' ) ) ) {\n\t\t\t\t\t\t\t\t\t$changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' );\n\t\t\t\t\t\t\t\t\t$cl_lines  = explode( \"\\n\", wp_remote_retrieve_body( $changelog ) );\n\t\t\t\t\t\t\t\t\tif ( ! empty( $cl_lines ) ) {\n\t\t\t\t\t\t\t\t\t\tforeach ( $cl_lines as $line_num => $cl_line ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( preg_match( '/^[0-9]/', $cl_line ) ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t$date         = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) );\n\t\t\t\t\t\t\t\t\t\t\t\t$version      = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t$update       = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) );\n\t\t\t\t\t\t\t\t\t\t\t\t$version_data = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'date' => $date,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'version' => $version,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'update' => $update,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'changelog' => $changelog,\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tset_transient( md5( $plugin ) . '_version_data', $version_data, 60 * 60 * 12 );\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( ! empty( $version_data['version'] ) && version_compare( $version_data['version'], $plugin_data['Version'], '>' ) ) {\n\t\t\t\t\t\t\t\t\t$version_string = ' &ndash; <strong style=\"color:red;\">' . $version_data['version'] . ' ' . esc_attr__( 'is available', 'sportspress' ) . '</strong>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$sp_plugins[] = $plugin_name . ' ' . esc_attr__( 'by', 'sportspress' ) . ' ' . $plugin_data['Author'] . ' ' . esc_attr__( 'version', 'sportspress' ) . ' ' . $plugin_data['Version'] . $version_string;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( sizeof( $sp_plugins ) == 0 ) {\n\t\t\t\t\t\techo '-';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo implode( ', <br/>', array_map( 'wp_kses_post', $sp_plugins ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"2\"><?php esc_html_e( 'SP Configuration', 'sportspress' ); ?></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Sport', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td><?php echo esc_attr( get_option( 'sportspress_sport', __( 'None', 'sportspress' ) ) ); ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Event Outcomes', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_posts = array();\n\t\t\t\t\t\t$posts         = get_posts(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Event Results', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_posts = array();\n\t\t\t\t\t\t$posts         = get_posts(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'      => 'sp_result',\n\t\t\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Player Performance', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_posts = array();\n\t\t\t\t\t\t$posts         = get_posts(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'      => 'sp_performance',\n\t\t\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Table Columns', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_posts = array();\n\t\t\t\t\t\t$posts         = get_posts(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'      => 'sp_column',\n\t\t\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t\t$sort_order      = sp_get_post_order( $post->ID );\n\t\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ' = ' . get_post_meta( $post->ID, 'sp_equation', true ) . ') [' . $post->menu_order . ']' . ( '&mdash;' == $sort_order ? '' : ' {' . $sort_order . '}' );\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Player Metrics', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_posts = array();\n\t\t\t\t\t\t$posts         = get_posts(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'      => 'sp_metric',\n\t\t\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Player Statistics', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_posts = array();\n\t\t\t\t\t\t$posts         = get_posts(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type'      => 'sp_statistic',\n\t\t\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ' = ' . get_post_meta( $post->ID, 'sp_equation', true ) . ') [' . $post->menu_order . ']';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"2\"><?php esc_html_e( 'SP Taxonomies', 'sportspress' ); ?></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Leagues', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_terms = array();\n\t\t\t\t\t\t$terms         = get_terms( 'sp_league', array( 'hide_empty' => 0 ) );\n\t\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t\t$display_terms[] = $term->name . ' (' . $term->slug . ')';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_terms ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Seasons', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_terms = array();\n\t\t\t\t\t\t$terms         = get_terms( 'sp_season', array( 'hide_empty' => 0 ) );\n\t\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t\t$display_terms[] = $term->name . ' (' . $term->slug . ')';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_terms ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Venues', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_terms = array();\n\t\t\t\t\t\t$terms         = get_terms( 'sp_venue', array( 'hide_empty' => 0 ) );\n\t\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t\t$display_terms[] = $term->name . ' (' . $term->slug . ')';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_terms ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php esc_html_e( 'Positions', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$display_terms = array();\n\t\t\t\t\t\t$terms         = get_terms( 'sp_position', array( 'hide_empty' => 0 ) );\n\t\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t\t$display_terms[] = $term->name . ' (' . $term->slug . ')';\n\t\t\t\t\t}\n\t\t\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_terms ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"2\"><?php esc_html_e( 'SP Post Types', 'sportspress' ); ?></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\t$post_types = sp_post_types();\n\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t?>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$object = get_post_type_object( $post_type );\n\t\t\t\t\t\techo esc_html( $object->labels->name );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php $count = wp_count_posts( $post_type ); ?>\n\t\t\t\t\t\t<?php echo esc_html( $count->publish ); ?> publish, <?php echo esc_html( $count->future ); ?> future, <?php echo esc_html( $count->draft ); ?> draft, <?php echo esc_html( $count->private ); ?> private, <?php echo esc_html( $count->trash ); ?> trash, <?php echo esc_html( $count->{'auto-draft'} ); ?> auto-draft, <?php echo esc_html( $count->inherit ); ?> inherit\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t</tbody>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"2\"><?php esc_html_e( 'Theme', 'sportspress' ); ?></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t\t\t<?php\n\t\t\t\t\t$active_theme = wp_get_theme();\n\t\t\t\t\tif ( $active_theme->{'Author URI'} == 'http://themeboy.com' ) :\n\n\t\t\t\t\t\t$theme_dir = substr( strtolower( str_replace( ' ', '', $active_theme->Name ) ), 0, 45 );\n\n\t\t\t\t\t\tif ( false === ( $theme_version_data = get_transient( $theme_dir . '_version_data' ) ) ) :\n\n\t\t\t\t\t\t\t$theme_changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt' );\n\t\t\t\t\t\t\t$cl_lines        = explode( \"\\n\", wp_remote_retrieve_body( $theme_changelog ) );\n\t\t\t\t\t\t\tif ( ! empty( $cl_lines ) ) :\n\n\t\t\t\t\t\t\t\tforeach ( $cl_lines as $line_num => $cl_line ) {\n\t\t\t\t\t\t\t\t\tif ( preg_match( '/^[0-9]/', $cl_line ) ) :\n\n\t\t\t\t\t\t\t\t\t\t$theme_date         = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) );\n\t\t\t\t\t\t\t\t\t\t$theme_version      = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) );\n\t\t\t\t\t\t\t\t\t\t$theme_update       = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) );\n\t\t\t\t\t\t\t\t\t\t$theme_version_data = array(\n\t\t\t\t\t\t\t\t\t\t\t'date'      => $theme_date,\n\t\t\t\t\t\t\t\t\t\t\t'version'   => $theme_version,\n\t\t\t\t\t\t\t\t\t\t\t'update'    => $theme_update,\n\t\t\t\t\t\t\t\t\t\t\t'changelog' => $theme_changelog,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tset_transient( $theme_dir . '_version_data', $theme_version_data, 60 * 60 * 12 );\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><?php esc_html_e( 'Theme Name', 'sportspress' ); ?>:</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_html( $active_theme->Name );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><?php esc_html_e( 'Theme Version', 'sportspress' ); ?>:</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_html( $active_theme->Version );\n\n\t\t\t\t\t\tif ( ! empty( $theme_version_data['version'] ) && version_compare( $theme_version_data['version'], $active_theme->Version, '!=' ) ) {\n\t\t\t\t\t\t\techo ' &ndash; <strong style=\"color:red;\">' . esc_html( $theme_version_data['version'] ) . ' ' . esc_html__( 'is available', 'sportspress' ) . '</strong>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><?php esc_html_e( 'Author URL', 'sportspress' ); ?>:</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_url( $active_theme->{'Author URI'} );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t</tbody>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"2\"><?php esc_html_e( 'Templates', 'sportspress' ); ?></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t$status = include SP()->plugin_path() . '/includes/admin/class-sp-admin-status.php';\n\n\t\t\t\t\t\t$template_paths = apply_filters( 'sportspress_template_overrides_scan_paths', array( 'SportsPress' => SP()->plugin_path() . '/templates/' ) );\n\t\t\t\t\t\t$found_files    = array();\n\n\t\t\t\t\t\tforeach ( $template_paths as $plugin_name => $template_path ) {\n\t\t\t\t\t\t\t$scanned_files[ $plugin_name ] = $status->scan_template_files( $template_path );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ( $scanned_files as $plugin_name => $files ) {\n\t\t\t\t\t\t\tforeach ( $files as $file ) {\n\t\t\t\t\t\t\t\tif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {\n\t\t\t\t\t\t\t\t\t$theme_file = get_stylesheet_directory() . '/' . $file;\n\t\t\t\t\t\t\t\t} elseif ( file_exists( get_stylesheet_directory() . '/sportspress/' . $file ) ) {\n\t\t\t\t\t\t\t\t\t$theme_file = get_stylesheet_directory() . '/sportspress/' . $file;\n\t\t\t\t\t\t\t\t} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {\n\t\t\t\t\t\t\t\t\t$theme_file = get_template_directory() . '/' . $file;\n\t\t\t\t\t\t\t\t} elseif ( file_exists( get_template_directory() . '/sportspress/' . $file ) ) {\n\t\t\t\t\t\t\t\t\t$theme_file = get_template_directory() . '/sportspress/' . $file;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$theme_file = false;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( $theme_file ) {\n\t\t\t\t\t\t\t\t\t$core_version  = $status->get_file_version( SP()->plugin_path() . '/templates/' . $file );\n\t\t\t\t\t\t\t\t\t$theme_version = $status->get_file_version( $theme_file );\n\n\t\t\t\t\t\t\t\t\tif ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) {\n\t\t\t\t\t\t\t\t\t\t$found_files[ $plugin_name ][] = wp_kses_post( sprintf( __( '<code>%1$s</code> version <strong style=\"color:red\">%2$s</strong> is out of date. The core version is %3$s', 'sportspress' ), basename( $theme_file ), $theme_version ? $theme_version : '-', $core_version ) );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$found_files[ $plugin_name ][] = sprintf( '<code>%s</code>', basename( $theme_file ) );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $found_files ) {\n\t\t\t\t\t\t\tforeach ( $found_files as $plugin_name => $found_plugin_files ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<td><?php esc_html_e( 'Template Overrides', 'sportspress' ); ?> (<?php echo wp_kses_post( $plugin_name ); ?>):</td>\n\t\t\t\t\t\t\t\t<td><?php echo implode( ', <br/>', array_map( 'wp_kses_post', $found_plugin_files ) ); ?></td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<td><?php esc_html_e( 'Template Overrides', 'sportspress' ); ?>:</td>\n\t\t\t\t\t\t\t<td><?php esc_html_e( 'No overrides present in theme.', 'sportspress' ); ?></td>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\n\t\t</table>\n\n\t\t<script type=\"text/javascript\">\n\t\t\t/*\n\t\t\t@var i string default\n\t\t\t@var l how many repeat s\n\t\t\t@var s string to repeat\n\t\t\t@var w where s should indent\n\t\t\t*/\n\t\t\tjQuery.sp_strPad = function(i,l,s,w) {\n\t\t\t\tvar o = i.toString();\n\t\t\t\tif (!s) { s = '0'; }\n\t\t\t\twhile (o.length < l) {\n\t\t\t\t\t// empty\n\t\t\t\t\tif(w == 'undefined'){\n\t\t\t\t\t\to = s + o;\n\t\t\t\t\t}else{\n\t\t\t\t\t\to = o + s;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn o;\n\t\t\t};\n\n\n\t\t\tjQuery('a.debug-report').click(function(){\n\n\t\t\t\tvar report = \"\";\n\n\t\t\t\tjQuery('.sp-status-table thead, .sp-status-table tbody').each(function(){\n\n\t\t\t\t\tif ( jQuery( this ).is('thead') ) {\n\n\t\t\t\t\t\treport = report + \"\\n### \" + jQuery.trim( jQuery( this ).text() ) + \" ###\\n\\n\";\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tjQuery('tr', jQuery( this )).each(function(){\n\n\t\t\t\t\t\t\tvar the_name    = jQuery.sp_strPad( jQuery.trim( jQuery( this ).find('td:eq(0)').text() ), 25, ' ' );\n\t\t\t\t\t\t\tvar the_value   = jQuery.trim( jQuery( this ).find('td:eq(1)').text() );\n\t\t\t\t\t\t\tvar value_array = the_value.split( ', ' );\n\n\t\t\t\t\t\t\tif ( value_array.length > 1 ){\n\n\t\t\t\t\t\t\t\t// if value have a list of plugins ','\n\t\t\t\t\t\t\t\t// split to add new line\n\t\t\t\t\t\t\t\tvar output = '';\n\t\t\t\t\t\t\t\tvar temp_line ='';\n\t\t\t\t\t\t\t\tjQuery.each( value_array, function(key, line){\n\t\t\t\t\t\t\t\t\tvar tab = ( key == 0 )?0:25;\n\t\t\t\t\t\t\t\t\ttemp_line = temp_line + jQuery.sp_strPad( '', tab, ' ', 'f' ) + line +'\\n';\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tthe_value = temp_line;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treport = report +''+ the_name + the_value + \"\\n\";\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\ttry {\n\t\t\t\t\tjQuery(\"#debug-report\").slideDown();\n\t\t\t\t\tjQuery(\"#debug-report textarea\").val( report ).focus().select();\n\t\t\t\t\tjQuery(this).fadeOut();\n\t\t\t\t\treturn false;\n\t\t\t\t} catch(e){ console.log( e ); }\n\n\t\t\t\treturn false;\n\t\t\t});\n\t\t</script>\n\t\t\t<?php\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_Status();\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-teams.php",
    "content": "<?php\n/**\n * SportsPress Team Settings\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     2.7\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Teams' ) ) :\n\n\t/**\n\t * SP_Settings_Teams\n\t */\n\tclass SP_Settings_Teams extends SP_Settings_Page {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id       = 'teams';\n\t\t\t$this->label    = esc_attr__( 'Teams', 'sportspress' );\n\t\t\t$this->template = 'team';\n\n\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t\tadd_action( 'sportspress_admin_field_team_layout', array( $this, 'layout_setting' ) );\n\t\t\tadd_action( 'sportspress_admin_field_team_tabs', array( $this, 'tabs_setting' ) );\n\t\t\tadd_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Get settings array\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function get_settings() {\n\n\t\t\t$settings = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Team Options', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'desc'  => '',\n\t\t\t\t\t\t'id'    => 'team_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_team_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray( 'type' => 'team_layout' ),\n\n\t\t\t\t\t\tarray( 'type' => 'team_tabs' ),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Link staff', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_team_link_staff',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Link', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Link teams', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_link_teams',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Link venues', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_team_link_venues',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Visit Site', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Open link in a new window/tab', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_team_site_target_blank',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Comments', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Allow people to post comments on Team page', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_team_comment_status',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'team_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn apply_filters( 'sportspress_team_settings', $settings );\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_Teams();\n"
  },
  {
    "path": "includes/admin/settings/class-sp-settings-text.php",
    "content": "<?php\n/**\n * SportsPress Text Settings\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin\n * @version     1.6\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Settings_Text' ) ) :\n\n\t/**\n\t * SP_Settings_Text\n\t */\n\tclass SP_Settings_Text extends SP_Settings_Page {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->id    = 'text';\n\t\t\t$this->label = esc_attr__( 'Text', 'sportspress' );\n\n\t\t\tadd_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );\n\t\t\tadd_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );\n\t\t\tadd_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );\n\t\t}\n\n\t\t/**\n\t\t * Get settings array\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function get_settings() {\n\n\t\t\t$settings = array(\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_attr__( 'Text', 'sportspress' ),\n\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t'desc'  => esc_attr__( 'The following options affect how words are displayed on the frontend.', 'sportspress' ),\n\t\t\t\t\t'id'    => 'text_options',\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$strings = sp_get_text_options();\n\t\t\t$options = get_option( 'sportspress_text' );\n\n\t\t\t$options = array();\n\t\t\tforeach ( $strings as $string ) :\n\t\t\t\t$options[] = array(\n\t\t\t\t\t'title'       => $string,\n\t\t\t\t\t'id'          => 'sportspress_text[' . $string . ']',\n\t\t\t\t\t'default'     => '',\n\t\t\t\t\t'placeholder' => $string,\n\t\t\t\t\t'value'       => sp_array_value( $options, $string, null ),\n\t\t\t\t\t'type'        => 'text',\n\t\t\t\t);\n\t\t\tendforeach;\n\n\t\t\t$settings = array_merge(\n\t\t\t\t$settings,\n\t\t\t\tapply_filters( 'sportspress_text_options', $options ),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'text_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn apply_filters( 'sportspress_text_settings', $settings ); // End event settings\n\t\t}\n\n\t\t/**\n\t\t * Save settings\n\t\t */\n\t\tpublic function save() {\n\t\t\tif ( isset( $_POST['sportspress_text'] ) ) {\n\t\t\t\tupdate_option( 'sportspress_text', array_map( 'sanitize_text_field', array_map( 'wp_unslash', $_POST['sportspress_text'] ) ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Settings_Text();\n"
  },
  {
    "path": "includes/admin/sp-admin-functions.php",
    "content": "<?php\n/**\n * SportsPress Admin Functions\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     SportsPress/Admin/Functions\n * @version     2.5.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * Get all SportsPress screen ids\n *\n * @return array\n */\nfunction sp_get_screen_ids() {\n\treturn apply_filters(\n\t\t'sportspress_screen_ids',\n\t\tarray(\n\t\t\t'admin',\n\t\t\t'widgets',\n\t\t\t'dashboard',\n\t\t\t'dashboard_page_sp-about',\n\t\t\t'dashboard_page_sp-credits',\n\t\t\t'dashboard_page_sp-translators',\n\t\t\t'toplevel_page_sportspress',\n\t\t\t'edit-sp_result',\n\t\t\t'sp_result',\n\t\t\t'edit-sp_outcome',\n\t\t\t'sp_outcome',\n\t\t\t'edit-sp_performance',\n\t\t\t'sp_performance',\n\t\t\t'edit-sp_column',\n\t\t\t'sp_column',\n\t\t\t'edit-sp_metric',\n\t\t\t'sp_metric',\n\t\t\t'edit-sp_statistic',\n\t\t\t'sp_statistic',\n\t\t\t'edit-sp_event',\n\t\t\t'sp_event',\n\t\t\t'edit-sp_calendar',\n\t\t\t'sp_calendar',\n\t\t\t'edit-sp_team',\n\t\t\t'sp_team',\n\t\t\t'edit-sp_table',\n\t\t\t'sp_table',\n\t\t\t'edit-sp_player',\n\t\t\t'sp_player',\n\t\t\t'edit-sp_list',\n\t\t\t'sp_list',\n\t\t\t'edit-sp_staff',\n\t\t\t'sp_staff',\n\t\t\t'edit-sp_venue',\n\t\t\t'edit-sp_league',\n\t\t\t'edit-sp_season',\n\t\t\t'edit-sp_position',\n\t\t\t'edit-sp_role',\n\t\t)\n\t);\n}\n\nfunction add_codemirror_to_custom_css() {\n\t// Enqueue code editor and settings for manipulating HTML.\n\t$settings = wp_enqueue_code_editor( array( 'type' => 'css' ) );\n\t// Bail if user disabled CodeMirror.\n\tif ( false === $settings ) {\n\t\treturn;\n\t}\n\twp_add_inline_script(\n\t\t'code-editor',\n\t\tsprintf(\n\t\t\t'jQuery( function() { wp.codeEditor.initialize( \"sportspress_custom_css\", %s ); } );',\n\t\t\twp_json_encode( $settings )\n\t\t)\n\t);\n}\nif ( function_exists( 'wp_enqueue_code_editor' ) ) {\n\tadd_action( 'sportspress_settings_general', 'add_codemirror_to_custom_css' );\n}\n"
  },
  {
    "path": "includes/admin/views/html-admin-config.php",
    "content": "<?php\n$columns = get_option( 'sportspress_player_columns', 'auto' );\n?>\n\n<div class=\"wrap sportspress sportspress-config-wrap\">\n\t<h2>\n\t\t<?php esc_html_e( 'Configure', 'sportspress' ); ?>\n\t</h2>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$data = get_posts( $args );\n\t\t\t?>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<?php esc_html_e( 'Event Outcomes', 'sportspress' ); ?>\n\t\t\t\t\t<p class=\"description\"><?php esc_html_e( 'Used for events.', 'sportspress' ); ?></p>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"forminp\">\n\t\t\t\t\t<table class=\"widefat sp-admin-config-table\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Label', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Variable', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Abbreviation', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Condition', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Description', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"edit\"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $data ) :\n\t\t\t\t\t\t\t$i = 0; foreach ( $data as $row ) :\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' class=\"alternate\"';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<td class=\"row-title\"><?php echo esc_html( $row->post_title ); ?></td>\n\t\t\t\t\t\t\t\t<td><code><?php echo esc_html( $row->post_name ); ?></code></td>\n\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_abbreviation( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_condition( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t<td><p class=\"description\"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>\n\t\t\t\t\t\t\t\t<td class=\"edit\"><a class=\"button\" href=\"<?php echo esc_url( get_edit_post_link( $row->ID ) ); ?>\"><?php esc_html_e( 'Edit', 'sportspress' ); ?></s></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\nendforeach; else :\n\t?>\n\t\t\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"6\"><?php esc_html_e( 'No results found.', 'sportspress' ); ?></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</table>\n\t\t\t\t\t<div class=\"tablenav bottom\">\n\t\t\t\t\t\t<a class=\"button alignleft\" href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_outcome' ) ); ?>\"><?php esc_html_e( 'View All', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<a class=\"button button-primary alignright\" href=\"<?php echo esc_url( admin_url( 'post-new.php?post_type=sp_outcome' ) ); ?>\"><?php esc_html_e( 'Add New', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t\t<?php\n\t\t\t$selection = get_option( 'sportspress_primary_result', 0 );\n\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_result',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$data = get_posts( $args );\n\t\t\t?>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<?php esc_html_e( 'Event Results', 'sportspress' ); ?>\n\t\t\t\t\t<p class=\"description\"><?php esc_html_e( 'Used for events.', 'sportspress' ); ?></p>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"forminp\">\n\t\t\t\t\t<legend class=\"screen-reader-text\"><span><?php esc_html_e( 'Event Results', 'sportspress' ); ?></span></legend>\n\t\t\t\t\t<form>\n\t\t\t\t\t\t<?php wp_nonce_field( 'sp-save-primary-result', 'sp-primary-result-nonce', false ); ?>\n\t\t\t\t\t\t<table class=\"widefat sp-admin-config-table\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"radio\" scope=\"col\"><?php esc_html_e( 'Primary', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Label', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Variables', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Equation', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Decimal Places', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Description', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"edit\"></th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tfoot>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"radio\"><input type=\"radio\" class=\"sp-primary-result-option\" id=\"sportspress_primary_result_0\" name=\"sportspress_primary_result\" value=\"0\" <?php checked( $selection, 0 ); ?>></th>\n\t\t\t\t\t\t\t\t\t<th colspan=\"6\"><label for=\"sportspress_primary_result_0\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tif ( sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t\t\t\t\t\t$default = end( $data );\n\t\t\t\t\t\t\t\t\t\t\treset( $data );\n\t\t\t\t\t\t\t\t\t\t\tprintf( esc_html__( 'Default (%s)', 'sportspress' ), esc_html( $default->post_title ) );\n\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Default', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</label></th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tfoot>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $data ) :\n\t\t\t\t\t\t\t\t$i = 0; foreach ( $data as $row ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<tr\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\t\techo ' class=\"alternate\"';}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<td class=\"radio\"><input type=\"radio\" class=\"sp-primary-result-option\" id=\"sportspress_primary_result_<?php echo esc_attr( $row->post_name ); ?>\" name=\"sportspress_primary_result\" value=\"<?php echo esc_attr( $row->post_name ); ?>\" <?php checked( $selection, $row->post_name ); ?>></td>\n\t\t\t\t\t\t\t\t\t<td class=\"row-title\"><label for=\"sportspress_primary_result_<?php echo esc_attr( $row->post_name ); ?>\"><?php echo esc_html( $row->post_title ); ?></label></td>\n\t\t\t\t\t\t\t\t\t<td><code><?php echo esc_html( $row->post_name ); ?>for</code>, <code><?php echo esc_html( $row->post_name ); ?>against</code></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo wp_kses_post( sp_get_post_equation( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_precision( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t\t<td><p class=\"description\"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>\n\t\t\t\t\t\t\t\t\t<td class=\"edit\"><a class=\"button\" href=\"<?php echo esc_url( get_edit_post_link( $row->ID ) ); ?>\"><?php esc_html_e( 'Edit', 'sportspress' ); ?></s></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\nendforeach; else :\n\t?>\n\t\t\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"7\"><?php esc_html_e( 'No results found.', 'sportspress' ); ?></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</form>\n\t\t\t\t\t<div class=\"tablenav bottom\">\n\t\t\t\t\t\t<a class=\"button alignleft\" href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_result' ) ); ?>\"><?php esc_html_e( 'View All', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<a class=\"button button-primary alignright\" href=\"<?php echo esc_url( admin_url( 'post-new.php?post_type=sp_result' ) ); ?>\"><?php esc_html_e( 'Add New', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t\t<?php\n\t\t\t$selection = get_option( 'sportspress_primary_performance', 0 );\n\t\t\t$colspan   = 8;\n\n\t\t\tif ( 'auto' === $columns ) {\n\t\t\t\t$colspan ++;\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_performance',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$data = get_posts( $args );\n\t\t\t?>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<?php esc_html_e( 'Player Performance', 'sportspress' ); ?>\n\t\t\t\t\t<p class=\"description\"><?php esc_html_e( 'Used for events.', 'sportspress' ); ?></p>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"forminp\">\n\t\t\t\t\t<legend class=\"screen-reader-text\"><span><?php esc_html_e( 'Player Performance', 'sportspress' ); ?></span></legend>\n\t\t\t\t\t<form>\n\t\t\t\t\t\t<?php wp_nonce_field( 'sp-save-primary-performance', 'sp-primary-performance-nonce', false ); ?>\n\t\t\t\t\t\t<table class=\"widefat sp-admin-config-table\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"radio\" scope=\"col\"><?php esc_html_e( 'Primary', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th class=\"icon\" scope=\"col\"><?php esc_html_e( 'Icon', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Label', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Variable', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Category', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Format', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<?php if ( 'auto' === $columns ) { ?>\n\t\t\t\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Visible', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_html_e( 'Display in player profile?', 'sportspress' ); ?>\"></i>\n\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Description', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"edit\"></th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tfoot>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"radio\"><input type=\"radio\" class=\"sp-primary-performance-option\" id=\"sportspress_primary_performance_0\" name=\"sportspress_primary_performance\" value=\"0\" <?php checked( $selection, 0 ); ?>></th>\n\t\t\t\t\t\t\t\t\t<th class=\"icon\">&nbsp;</td>\n\t\t\t\t\t\t\t\t\t<th colspan=\"<?php echo esc_html( $colspan - 1 ); ?>\"><label for=\"sportspress_primary_performance_0\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tif ( sizeof( $data ) > 0 ) :\n\t\t\t\t\t\t\t\t\t\t\t$default = reset( $data );\n\t\t\t\t\t\t\t\t\t\t\tprintf( esc_html__( 'Default (%s)', 'sportspress' ), esc_html( $default->post_title ) );\n\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Default', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</label></th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tfoot>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $data ) :\n\t\t\t\t\t\t\t\t$i = 0; foreach ( $data as $row ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$visible = get_post_meta( $row->ID, 'sp_visible', true );\n\t\t\t\t\t\t\t\t\tif ( '' === $visible ) {\n\t\t\t\t\t\t\t\t\t\t$visible = 1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<tr\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\t\techo ' class=\"alternate\"';}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<td class=\"radio\"><input type=\"radio\" class=\"sp-primary-performance-option\" id=\"sportspress_primary_performance_<?php echo esc_attr( $row->post_name ); ?>\" name=\"sportspress_primary_performance\" value=\"<?php echo esc_attr( $row->post_name ); ?>\" <?php checked( $selection, $row->post_name ); ?>></td>\n\t\t\t\t\t\t\t\t\t<td class=\"icon\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tif ( has_post_thumbnail( $row->ID ) ) {\n\t\t\t\t\t\t\t\t\t\t\t$icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$icon = '&nbsp;';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\techo wp_kses_post( apply_filters( 'sportspress_performance_icon', $icon, $row->ID ) );\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td class=\"row-title\"><?php echo esc_html( $row->post_title ); ?></td>\n\t\t\t\t\t\t\t\t\t<td><code><?php echo esc_html( $row->post_name ); ?></code></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_section( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_format( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( 'auto' === $columns ) { ?>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $visible ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"dashicons dashicons-yes\"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t&nbsp;<?php } ?>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t<td><p class=\"description\"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>\n\t\t\t\t\t\t\t\t\t<td class=\"edit\"><a class=\"button\" href=\"<?php echo esc_url( get_edit_post_link( $row->ID ) ); ?>\"><?php esc_html_e( 'Edit', 'sportspress' ); ?></s></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\nendforeach; else :\n\t?>\n\t\t\t\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo esc_attr( $colspan ); ?>\"><?php esc_html_e( 'No results found.', 'sportspress' ); ?></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</form>\n\t\t\t\t\t<div class=\"tablenav bottom\">\n\t\t\t\t\t\t<a class=\"button alignleft\" href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_performance' ) ); ?>\"><?php esc_html_e( 'View All', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<a class=\"button button-primary alignright\" href=\"<?php echo esc_url( admin_url( 'post-new.php?post_type=sp_performance' ) ); ?>\"><?php esc_html_e( 'Add New', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_column',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$data = get_posts( $args );\n\t\t\t?>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<?php esc_html_e( 'Table Columns', 'sportspress' ); ?>\n\t\t\t\t\t<p class=\"description\"><?php esc_html_e( 'Used for league tables.', 'sportspress' ); ?></p>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"forminp\">\n\t\t\t\t\t<table class=\"widefat sp-admin-config-table\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Label', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Equation', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Decimal Places', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Sort Order', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Description', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"edit\"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $data ) :\n\t\t\t\t\t\t\t$i = 0; foreach ( $data as $row ) :\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' class=\"alternate\"';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<td class=\"row-title\"><?php echo esc_html( $row->post_title ); ?></td>\n\t\t\t\t\t\t\t\t<td><?php echo wp_kses_post( sp_get_post_equation( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_precision( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_order( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t<td><p class=\"description\"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>\n\t\t\t\t\t\t\t\t<td class=\"edit\"><a class=\"button\" href=\"<?php echo esc_url( get_edit_post_link( $row->ID ) ); ?>\"><?php esc_html_e( 'Edit', 'sportspress' ); ?></s></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\nendforeach; else :\n\t?>\n\t\t\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"7\"><?php esc_html_e( 'No results found.', 'sportspress' ); ?></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</table>\n\t\t\t\t\t<div class=\"tablenav bottom\">\n\t\t\t\t\t\t<a class=\"button alignleft\" href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_column' ) ); ?>\"><?php esc_html_e( 'View All', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<a class=\"button button-primary alignright\" href=\"<?php echo esc_url( admin_url( 'post-new.php?post_type=sp_column' ) ); ?>\"><?php esc_html_e( 'Add New', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\t\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_metric',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$data = get_posts( $args );\n\t\t\t?>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<?php esc_html_e( 'Player Metrics', 'sportspress' ); ?>\n\t\t\t\t\t<p class=\"description\"><?php esc_html_e( 'Used for player lists.', 'sportspress' ); ?></p>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"forminp\">\n\t\t\t\t\t<table class=\"widefat sp-admin-config-table\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Label', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Variable', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Description', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"edit\"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $data ) :\n\t\t\t\t\t\t\t$i = 0; foreach ( $data as $row ) :\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' class=\"alternate\"';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<td class=\"row-title\"><?php echo esc_html( $row->post_title ); ?></td>\n\t\t\t\t\t\t\t\t<td><code><?php echo esc_html( $row->post_name ); ?></code></td>\n\t\t\t\t\t\t\t\t<td><p class=\"description\"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>\n\t\t\t\t\t\t\t\t<td class=\"edit\"><a class=\"button\" href=\"<?php echo esc_url( get_edit_post_link( $row->ID ) ); ?>\"><?php esc_html_e( 'Edit', 'sportspress' ); ?></s></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\nendforeach; else :\n\t?>\n\t\t\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"4\"><?php esc_html_e( 'No results found.', 'sportspress' ); ?></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</table>\n\t\t\t\t\t<div class=\"tablenav bottom\">\n\t\t\t\t\t\t<a class=\"button alignleft\" href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_metric' ) ); ?>\"><?php esc_html_e( 'View All', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<a class=\"button button-primary alignright\" href=\"<?php echo esc_url( admin_url( 'post-new.php?post_type=sp_metric' ) ); ?>\"><?php esc_html_e( 'Add New', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_statistic',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$data = get_posts( $args );\n\n\t\t\t$colspan = 6;\n\n\t\t\tif ( 'auto' === $columns ) {\n\t\t\t\t$colspan ++;\n\t\t\t}\n\t\t\t?>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<?php esc_html_e( 'Player Statistics', 'sportspress' ); ?>\n\t\t\t\t\t<p class=\"description\"><?php esc_html_e( 'Used for player lists.', 'sportspress' ); ?></p>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"forminp\">\n\t\t\t\t\t<table class=\"widefat sp-admin-config-table\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Label', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th class=\"icon\" scope=\"col\"><?php esc_html_e( 'Icon', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Equation', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Decimal Places', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Category', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<?php if ( 'auto' === $columns ) { ?>\n\t\t\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Visible', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t\t\t<i class=\"dashicons dashicons-editor-help sp-desc-tip\" title=\"<?php esc_html_e( 'Display in player profile?', 'sportspress' ); ?>\"></i>\n\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_html_e( 'Description', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"edit\"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $data ) :\n\t\t\t\t\t\t\t$i = 0; foreach ( $data as $row ) :\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$visible = get_post_meta( $row->ID, 'sp_visible', true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( '' === $visible ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$visible = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' class=\"alternate\"';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<td class=\"row-title\"><?php echo esc_html( $row->post_title ); ?></td>\n\t\t\t\t\t\t\t\t<td class=\"icon\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tif ( has_post_thumbnail( $row->ID ) ) {\n\t\t\t\t\t\t\t\t\t\t\t$icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$icon = '&nbsp;';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\techo wp_kses_post( apply_filters( 'sportspress_performance_icon', $icon, $row->ID ) );\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td><?php echo wp_kses_post( sp_get_post_equation( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_precision( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t<td><?php echo esc_html( sp_get_post_section( $row->ID ) ); ?></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( 'auto' === $columns ) { ?>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $visible ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"dashicons dashicons-yes\"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t&nbsp;<?php } ?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<td><p class=\"description\"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>\n\t\t\t\t\t\t\t\t<td class=\"edit\"><a class=\"button\" href=\"<?php echo esc_url( get_edit_post_link( $row->ID ) ); ?>\"><?php esc_html_e( 'Edit', 'sportspress' ); ?></s></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\nendforeach; else :\n\t?>\n\t\t\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"<?php echo esc_attr( $colspan ); ?>\"><?php esc_html_e( 'No results found.', 'sportspress' ); ?></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</table>\n\t\t\t\t\t<div class=\"tablenav bottom\">\n\t\t\t\t\t\t<a class=\"button alignleft\" href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_statistic' ) ); ?>\"><?php esc_html_e( 'View All', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<a class=\"button button-primary alignright\" href=\"<?php echo esc_url( admin_url( 'post-new.php?post_type=sp_statistic' ) ); ?>\"><?php esc_html_e( 'Add New', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t<?php do_action( 'sportspress_config_page' ); ?>\n</div>\n"
  },
  {
    "path": "includes/admin/views/html-admin-page-status.php",
    "content": "<div class=\"wrap sportspress\">\n\t<h2><?php esc_attr_e( 'System Status', 'sportspress' ); ?></h2>\n</div>\n<div class=\"updated sportspress-message\">\n\t<p><?php esc_attr_e( 'Please include this information when requesting support:', 'sportspress' ); ?> </p>\n\t<p class=\"submit\"><a href=\"#\" class=\"button-primary debug-report\"><?php esc_attr_e( 'Get System Report', 'sportspress' ); ?></a></p>\n\t<div id=\"debug-report\"><textarea readonly=\"readonly\"></textarea></div>\n</div>\n<br/>\n<table class=\"sp-status-table widefat\" cellspacing=\"0\">\n\n\t<thead>\n\t\t<tr>\n\t\t\t<th colspan=\"2\"><?php esc_attr_e( 'Environment', 'sportspress' ); ?></th>\n\t\t</tr>\n\t</thead>\n\n\t<tbody>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Home URL', 'sportspress' ); ?>:</td>\n\t\t\t<td><?php echo esc_url( home_url() ); ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Site URL', 'sportspress' ); ?>:</td>\n\t\t\t<td><?php echo esc_url( site_url() ); ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'SP Version', 'sportspress' ); ?>:</td>\n\t\t\t<td><?php echo esc_html( SP()->version ); ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'WP Version', 'sportspress' ); ?>:</td>\n\t\t\t<td><?php bloginfo( 'version' ); ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'WP Multisite Enabled', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\tif ( is_multisite() ) {\n\t\t\t\tesc_attr_e( 'Yes', 'sportspress' );\n\t\t\t} else {\n\t\t\t\tesc_attr_e( 'No', 'sportspress' );\n\t\t\t}\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Web Server Info', 'sportspress' ); ?>:</td>\n\t\t\t<td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'PHP Version', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\tif ( function_exists( 'phpversion' ) ) {\n\t\t\t\techo esc_html( phpversion() );}\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'WP Memory Limit', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$memory = sp_let_to_num( WP_MEMORY_LIMIT );\n\n\t\t\tif ( $memory < 67108864 ) {\n        echo '<mark class=\"error\">' . wp_kses_post( sprintf( __( '%1$s - We recommend setting memory to at least 64MB. See: <a href=\"%2$s\">Increasing memory allocated to PHP</a>', 'sportspress' ), esc_html( size_format( $memory ) ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) ) . '</mark>';\n\t\t\t} else {\n\t\t\t\techo '<mark class=\"yes\">' . esc_html( size_format( $memory ) ) . '</mark>';\n\t\t\t}\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'WP Debug Mode', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\n\t\t\t\techo '<mark class=\"yes\">' . esc_html__( 'Yes', 'sportspress' ) . '</mark>';\n\t\t\t} else {\n\t\t\t\techo '<mark class=\"no\">' . esc_html__( 'No', 'sportspress' ) . '</mark>';\n\t\t\t}\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'WP Language', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\tif ( defined( 'WPLANG' ) && WPLANG ) {\n\t\t\t\techo esc_html( WPLANG );\n\t\t\t} else {\n\t\t\t\tesc_html_e( 'Default', 'sportspress' );\n\t\t\t}\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'WP Max Upload Size', 'sportspress' ); ?>:</td>\n\t\t\t<td><?php echo esc_html( size_format( wp_max_upload_size() ) ); ?></td>\n\t\t</tr>\n\t\t<?php if ( function_exists( 'ini_get' ) ) : ?>\n\t\t\t<tr>\n\t\t\t\t<td><?php esc_attr_e( 'PHP Post Max Size', 'sportspress' ); ?>:</td>\n\t\t\t\t<td><?php echo esc_html( size_format( sp_let_to_num( ini_get( 'post_max_size' ) ) ) ); ?></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><?php esc_attr_e( 'PHP Time Limit', 'sportspress' ); ?>:</td>\n\t\t\t\t<td><?php echo esc_html( ini_get( 'max_execution_time' ) ); ?></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><?php esc_attr_e( 'PHP Max Input Vars', 'sportspress' ); ?>:</td>\n\t\t\t\t<td><?php echo esc_html( ini_get( 'max_input_vars' ) ); ?></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><?php esc_attr_e( 'SUHOSIN Installed', 'sportspress' ); ?>:</td>\n\t\t\t\t<td><?php echo extension_loaded( 'suhosin' ) ? esc_html__( 'Yes', 'sportspress' ) : esc_html__( 'No', 'sportspress' ); ?></td>\n\t\t\t</tr>\n\t\t<?php endif; ?>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Default Timezone', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$default_timezone = date_default_timezone_get();\n\t\t\tif ( 'UTC' !== $default_timezone ) {\n\t\t\t\techo '<mark class=\"error\">' . sprintf( esc_html__( 'Default timezone is %s - it should be UTC', 'sportspress' ), esc_html( $default_timezone ) ) . '</mark>';\n\t\t\t} else {\n\t\t\t\techo '<mark class=\"yes\">' . sprintf( esc_html__( 'Default timezone is %s', 'sportspress' ), esc_html( $default_timezone ) ) . '</mark>';\n\t\t\t}\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php\n\t\t\t$posting = array();\n\n\t\t\t// fsockopen/cURL\n\t\t\t$posting['fsockopen_curl']['name'] = esc_attr__( 'fsockopen/cURL', 'sportspress' );\n\t\tif ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) {\n\t\t\tif ( function_exists( 'fsockopen' ) && function_exists( 'curl_init' ) ) {\n\t\t\t\t$posting['fsockopen_curl']['note'] = esc_attr__( 'Your server has fsockopen and cURL enabled.', 'sportspress' );\n\t\t\t} elseif ( function_exists( 'fsockopen' ) ) {\n\t\t\t\t$posting['fsockopen_curl']['note'] = esc_attr__( 'Your server has fsockopen enabled, cURL is disabled.', 'sportspress' );\n\t\t\t} else {\n\t\t\t\t$posting['fsockopen_curl']['note'] = esc_attr__( 'Your server has cURL enabled, fsockopen is disabled.', 'sportspress' );\n\t\t\t}\n\t\t\t$posting['fsockopen_curl']['success'] = true;\n\t\t} else {\n\t\t\t$posting['fsockopen_curl']['note']    = esc_attr__( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'sportspress' ) . '</mark>';\n\t\t\t$posting['fsockopen_curl']['success'] = false;\n\t\t}\n\n\t\t\t// SOAP\n\t\t\t$posting['soap_client']['name'] = esc_attr__( 'SOAP Client', 'sportspress' );\n\t\tif ( class_exists( 'SoapClient' ) ) {\n\t\t\t$posting['soap_client']['note']    = esc_attr__( 'Your server has the SOAP Client class enabled.', 'sportspress' );\n\t\t\t$posting['soap_client']['success'] = true;\n\t\t} else {\n\t\t\t$posting['soap_client']['note']    = sprintf( esc_attr__( 'Your server does not have the <a href=\"%s\">SOAP Client</a> class enabled - some gateway plugins which use SOAP may not work as expected.', 'sportspress' ), 'http://php.net/manual/en/class.soapclient.php' ) . '</mark>';\n\t\t\t$posting['soap_client']['success'] = false;\n\t\t}\n\n\t\t\t$posting = apply_filters( 'sportspress_debug_posting', $posting );\n\n\t\tforeach ( $posting as $post ) {\n\t\t\t$mark = ( isset( $post['success'] ) && $post['success'] == true ) ? 'yes' : 'error';\n\t\t\t?>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><?php echo esc_html( $post['name'] ); ?>:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<mark class=\"<?php echo esc_attr( $mark ); ?>\">\n\t\t\t\t\t\t<?php echo wp_kses_data( $post['note'] ); ?>\n\t\t\t\t\t\t</mark>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<?php\n\t\t}\n\t\t?>\n\t</tbody>\n\n\t<thead>\n\t\t<tr>\n\t\t\t<th colspan=\"2\"><?php esc_attr_e( 'Plugins', 'sportspress' ); ?></th>\n\t\t</tr>\n\t</thead>\n\n\t<tbody>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Installed Plugins', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\n\n\t\t\tif ( is_multisite() ) {\n\t\t\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\n\t\t\t}\n\n\t\t\t\t$sp_plugins = array();\n\n\t\t\tforeach ( $active_plugins as $plugin ) {\n\n\t\t\t\t$plugin_data    = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );\n\t\t\t\t$dirname        = dirname( $plugin );\n\t\t\t\t$version_string = '';\n\n\t\t\t\tif ( ! empty( $plugin_data['Name'] ) ) {\n\n\t\t\t\t\t// link the plugin name to the plugin url if available\n\t\t\t\t\t$plugin_name = $plugin_data['Name'];\n\t\t\t\t\tif ( ! empty( $plugin_data['PluginURI'] ) ) {\n\t\t\t\t\t\t$plugin_name = '<a href=\"' . esc_url( $plugin_data['PluginURI'] ) . '\" title=\"' . esc_attr__( 'Visit plugin homepage', 'sportspress' ) . '\">' . $plugin_name . '</a>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( strstr( $dirname, 'sportspress' ) ) {\n\n\t\t\t\t\t\tif ( false === ( $version_data = get_transient( md5( $plugin ) . '_version_data' ) ) ) {\n\t\t\t\t\t\t\t$changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' );\n\t\t\t\t\t\t\t$cl_lines  = explode( \"\\n\", wp_remote_retrieve_body( $changelog ) );\n\t\t\t\t\t\t\tif ( ! empty( $cl_lines ) ) {\n\t\t\t\t\t\t\t\tforeach ( $cl_lines as $line_num => $cl_line ) {\n\t\t\t\t\t\t\t\t\tif ( preg_match( '/^[0-9]/', $cl_line ) ) {\n\n\t\t\t\t\t\t\t\t\t\t$date         = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) );\n\t\t\t\t\t\t\t\t\t\t$version      = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) );\n\t\t\t\t\t\t\t\t\t\t$update       = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) );\n\t\t\t\t\t\t\t\t\t\t$version_data = array(\n\t\t\t\t\t\t\t\t\t\t\t'date'      => $date,\n\t\t\t\t\t\t\t\t\t\t\t'version'   => $version,\n\t\t\t\t\t\t\t\t\t\t\t'update'    => $update,\n\t\t\t\t\t\t\t\t\t\t\t'changelog' => $changelog,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tset_transient( md5( $plugin ) . '_version_data', $version_data, 60 * 60 * 12 );\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $version_data['version'] ) && version_compare( $version_data['version'], $plugin_data['Version'], '>' ) ) {\n\t\t\t\t\t\t\t$version_string = ' &ndash; <strong style=\"color:red;\">' . $version_data['version'] . ' ' . esc_attr__( 'is available', 'sportspress' ) . '</strong>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$sp_plugins[] = $plugin_name . ' ' . esc_attr__( 'by', 'sportspress' ) . ' ' . $plugin_data['Author'] . ' ' . esc_attr__( 'version', 'sportspress' ) . ' ' . $plugin_data['Version'] . $version_string;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( sizeof( $sp_plugins ) == 0 ) {\n\t\t\t\techo '-';\n\t\t\t} else {\n\t\t\t\techo wp_kses_post( implode( ', <br/>', $sp_plugins ) );\n\t\t\t}\n\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n\n\t<thead>\n\t\t<tr>\n\t\t\t<th colspan=\"2\"><?php esc_attr_e( 'SP Configuration', 'sportspress' ); ?></th>\n\t\t</tr>\n\t</thead>\n\n\t<tbody>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Sport', 'sportspress' ); ?>:</td>\n\t\t\t<td><?php echo esc_html( get_option( 'sportspress_sport', esc_attr__( 'None', 'sportspress' ) ) ); ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Event Outcomes', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_posts = array();\n\t\t\t\t$posts         = get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']';\n\t\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Event Results', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_posts = array();\n\t\t\t\t$posts         = get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'      => 'sp_result',\n\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']';\n\t\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Player Performance', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_posts = array();\n\t\t\t\t$posts         = get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'      => 'sp_performance',\n\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']';\n\t\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Table Columns', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_posts = array();\n\t\t\t\t$posts         = get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'      => 'sp_column',\n\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ' = ' . get_post_meta( $post->ID, 'sp_equation', true ) . ') [' . $post->menu_order . ']';\n\t\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Player Metrics', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_posts = array();\n\t\t\t\t$posts         = get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'      => 'sp_metric',\n\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']';\n\t\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Player Statistics', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_posts = array();\n\t\t\t\t$posts         = get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'      => 'sp_statistic',\n\t\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t'post_status'    => 'any',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t$display_posts[] = $post->post_title . ' (' . $post->post_name . ' = ' . get_post_meta( $post->ID, 'sp_equation', true ) . ') [' . $post->menu_order . ']';\n\t\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_posts ) );\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n\n\t<thead>\n\t\t<tr>\n\t\t\t<th colspan=\"2\"><?php esc_attr_e( 'SP Taxonomies', 'sportspress' ); ?></th>\n\t\t</tr>\n\t</thead>\n\n\t<tbody>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Leagues', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_terms = array();\n\t\t\t\t$terms         = get_terms( 'sp_league', array( 'hide_empty' => 0 ) );\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$display_terms[] = $term->name . ' (' . $term->slug . ')';\n\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_terms ) );\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Seasons', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_terms = array();\n\t\t\t\t$terms         = get_terms( 'sp_season', array( 'hide_empty' => 0 ) );\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$display_terms[] = $term->name . ' (' . $term->slug . ')';\n\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_terms ) );\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Venues', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_terms = array();\n\t\t\t\t$terms         = get_terms( 'sp_venue', array( 'hide_empty' => 0 ) );\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$display_terms[] = $term->name . ' (' . $term->slug . ')';\n\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_terms ) );\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td><?php esc_attr_e( 'Positions', 'sportspress' ); ?>:</td>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\t\t$display_terms = array();\n\t\t\t\t$terms         = get_terms( 'sp_position', array( 'hide_empty' => 0 ) );\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$display_terms[] = $term->name . ' (' . $term->slug . ')';\n\t\t\t}\n\t\t\t\techo implode( ', ', array_map( 'esc_html', $display_terms ) );\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n\n\t<thead>\n\t\t<tr>\n\t\t\t<th colspan=\"2\"><?php esc_attr_e( 'SP Post Types', 'sportspress' ); ?></th>\n\t\t</tr>\n\t</thead>\n\n\t<tbody>\n\t\t<?php\n\t\t$post_types = sp_post_types();\n\t\tforeach ( $post_types as $post_type ) :\n\t\t\t?>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t$object = get_post_type_object( $post_type );\n\t\t\t\techo esc_html( $object->labels->name );\n\t\t\t\t?>\n\t\t\t\t:\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<?php $count = wp_count_posts( $post_type ); ?>\n\t\t\t\t<?php echo esc_html( $count->publish ); ?> publish, <?php echo esc_html( $count->future ); ?> future, <?php echo esc_html( $count->draft ); ?> draft, <?php echo esc_html( $count->private ); ?> private, <?php echo esc_html( $count->trash ); ?> trash, <?php echo esc_html( $count->{'auto-draft'} ); ?> auto-draft, <?php echo esc_html( $count->inherit ); ?> inherit\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php endforeach; ?>\n\t</tbody>\n\n\t<thead>\n\t\t<tr>\n\t\t\t<th colspan=\"2\"><?php esc_attr_e( 'Theme', 'sportspress' ); ?></th>\n\t\t</tr>\n\t</thead>\n\n\t\t<?php\n\t\t$active_theme = wp_get_theme();\n\t\tif ( $active_theme->{'Author URI'} == 'http://themeboy.com' ) :\n\n\t\t\t$theme_dir = substr( strtolower( str_replace( ' ', '', $active_theme->Name ) ), 0, 45 );\n\n\t\t\tif ( false === ( $theme_version_data = get_transient( $theme_dir . '_version_data' ) ) ) :\n\n\t\t\t\t$theme_changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt' );\n\t\t\t\t$cl_lines        = explode( \"\\n\", wp_remote_retrieve_body( $theme_changelog ) );\n\t\t\t\tif ( ! empty( $cl_lines ) ) :\n\n\t\t\t\t\tforeach ( $cl_lines as $line_num => $cl_line ) {\n\t\t\t\t\t\tif ( preg_match( '/^[0-9]/', $cl_line ) ) :\n\n\t\t\t\t\t\t\t$theme_date         = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) );\n\t\t\t\t\t\t\t$theme_version      = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) );\n\t\t\t\t\t\t\t$theme_update       = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) );\n\t\t\t\t\t\t\t$theme_version_data = array(\n\t\t\t\t\t\t\t\t'date'      => $theme_date,\n\t\t\t\t\t\t\t\t'version'   => $theme_version,\n\t\t\t\t\t\t\t\t'update'    => $theme_update,\n\t\t\t\t\t\t\t\t'changelog' => $theme_changelog,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tset_transient( $theme_dir . '_version_data', $theme_version_data, 60 * 60 * 12 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tendif;\n\t\t\t\t\t}\n\n\t\t\t\tendif;\n\n\t\t\tendif;\n\n\t\tendif;\n\t\t?>\n\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td><?php esc_attr_e( 'Theme Name', 'sportspress' ); ?>:</td>\n\t\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t\techo esc_html( $active_theme->Name );\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><?php esc_attr_e( 'Theme Version', 'sportspress' ); ?>:</td>\n\t\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t\techo esc_html( $active_theme->Version );\n\n\t\t\t\tif ( ! empty( $theme_version_data['version'] ) && version_compare( $theme_version_data['version'], $active_theme->Version, '!=' ) ) {\n\t\t\t\t\techo ' &ndash; <strong style=\"color:red;\">' . esc_html( $theme_version_data['version'] ) . ' ' . esc_html__( 'is available', 'sportspress' ) . '</strong>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><?php esc_attr_e( 'Author URL', 'sportspress' ); ?>:</td>\n\t\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t\techo esc_url( $active_theme->{'Author URI'} );\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t</tbody>\n\n\t<thead>\n\t\t<tr>\n\t\t\t<th colspan=\"2\"><?php esc_attr_e( 'Templates', 'sportspress' ); ?></th>\n\t\t</tr>\n\t</thead>\n\n\t<tbody>\n\t\t<tr>\n\t\t\t<?php\n\n\t\t\t\t$template_paths = apply_filters( 'sportspress_template_overrides_scan_paths', array( 'SportsPress' => SP()->plugin_path() . '/templates/' ) );\n\t\t\t\t$found_files    = array();\n\n\t\t\tforeach ( $template_paths as $plugin_name => $template_path ) {\n\t\t\t\t$scanned_files[ $plugin_name ] = $this->scan_template_files( $template_path );\n\t\t\t}\n\n\t\t\tforeach ( $scanned_files as $plugin_name => $files ) {\n\t\t\t\tforeach ( $files as $file ) {\n\t\t\t\t\tif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {\n\t\t\t\t\t\t$theme_file = get_stylesheet_directory() . '/' . $file;\n\t\t\t\t\t} elseif ( file_exists( get_stylesheet_directory() . '/sportspress/' . $file ) ) {\n\t\t\t\t\t\t$theme_file = get_stylesheet_directory() . '/sportspress/' . $file;\n\t\t\t\t\t} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {\n\t\t\t\t\t\t$theme_file = get_template_directory() . '/' . $file;\n\t\t\t\t\t} elseif ( file_exists( get_template_directory() . '/sportspress/' . $file ) ) {\n\t\t\t\t\t\t$theme_file = get_template_directory() . '/sportspress/' . $file;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$theme_file = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $theme_file ) {\n\t\t\t\t\t\t$core_version  = $this->get_file_version( SP()->plugin_path() . '/templates/' . $file );\n\t\t\t\t\t\t$theme_version = $this->get_file_version( $theme_file );\n\n\t\t\t\t\t\tif ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) {\n\t\t\t\t\t\t\t$found_files[ $plugin_name ][] = wp_kses_post( sprintf( __( '<code>%1$s</code> version <strong style=\"color:red\">%2$s</strong> is out of date. The core version is %3$s', 'sportspress' ), basename( $theme_file ), $theme_version ? $theme_version : '-', $core_version ) );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$found_files[ $plugin_name ][] = sprintf( '<code>%s</code>', basename( $theme_file ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $found_files ) {\n\t\t\t\tforeach ( $found_files as $plugin_name => $found_plugin_files ) {\n\t\t\t\t\t?>\n\t\t\t\t\t\t<td><?php esc_attr_e( 'Template Overrides', 'sportspress' ); ?> (<?php echo esc_html( $plugin_name ); ?>):</td>\n\t\t\t\t\t\t<td><?php echo wp_kses_post( implode( ', <br/>', $found_plugin_files ) ); ?></td>\n\t\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t\t<td><?php esc_attr_e( 'Template Overrides', 'sportspress' ); ?>:</td>\n\t\t\t\t\t<td><?php esc_attr_e( 'No overrides present in theme.', 'sportspress' ); ?></td>\n\t\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</tr>\n\t</tbody>\n\n</table>\n\n<script type=\"text/javascript\">\n\t/*\n\t@var i string default\n\t@var l how many repeat s\n\t@var s string to repeat\n\t@var w where s should indent\n\t*/\n\tjQuery.sp_strPad = function(i,l,s,w) {\n\t\tvar o = i.toString();\n\t\tif (!s) { s = '0'; }\n\t\twhile (o.length < l) {\n\t\t\t// empty\n\t\t\tif(w == 'undefined'){\n\t\t\t\to = s + o;\n\t\t\t}else{\n\t\t\t\to = o + s;\n\t\t\t}\n\t\t}\n\t\treturn o;\n\t};\n\n\n\tjQuery('a.debug-report').click(function(){\n\n\t\tvar report = \"\";\n\n\t\tjQuery('.sp-status-table thead, .sp-status-table tbody').each(function(){\n\n\t\t\tif ( jQuery( this ).is('thead') ) {\n\n\t\t\t\treport = report + \"\\n### \" + jQuery.trim( jQuery( this ).text() ) + \" ###\\n\\n\";\n\n\t\t\t} else {\n\n\t\t\t\tjQuery('tr', jQuery( this )).each(function(){\n\n\t\t\t\t\tvar the_name    = jQuery.sp_strPad( jQuery.trim( jQuery( this ).find('td:eq(0)').text() ), 25, ' ' );\n\t\t\t\t\tvar the_value   = jQuery.trim( jQuery( this ).find('td:eq(1)').text() );\n\t\t\t\t\tvar value_array = the_value.split( ', ' );\n\n\t\t\t\t\tif ( value_array.length > 1 ){\n\n\t\t\t\t\t\t// if value have a list of plugins ','\n\t\t\t\t\t\t// split to add new line\n\t\t\t\t\t\tvar output = '';\n\t\t\t\t\t\tvar temp_line ='';\n\t\t\t\t\t\tjQuery.each( value_array, function(key, line){\n\t\t\t\t\t\t\tvar tab = ( key == 0 )?0:25;\n\t\t\t\t\t\t\ttemp_line = temp_line + jQuery.sp_strPad( '', tab, ' ', 'f' ) + line +'\\n';\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tthe_value = temp_line;\n\t\t\t\t\t}\n\n\t\t\t\t\treport = report +''+ the_name + the_value + \"\\n\";\n\t\t\t\t});\n\n\t\t\t}\n\t\t} );\n\n\t\ttry {\n\t\t\tjQuery(\"#debug-report\").slideDown();\n\t\t\tjQuery(\"#debug-report textarea\").val( report ).focus().select();\n\t\t\tjQuery(this).fadeOut();\n\t\t\treturn false;\n\t\t} catch(e){ console.log( e ); }\n\n\t\treturn false;\n\t});\n</script>\n"
  },
  {
    "path": "includes/admin/views/html-admin-settings.php",
    "content": "<div class=\"wrap sportspress\">\n\t<h2><?php echo wp_kses_post( apply_filters( 'sportspress_logo', '<img src=\"' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/modules/sportspress' . ( class_exists( 'SportsPress_Pro' ) ? '-pro' : '' ) . '.png\" alt=\"' . esc_attr__( 'SportsPress', 'sportspress' ) . '\" class=\"sp-settings-logo\">' ) ); ?></h2>\n\t<form method=\"post\" id=\"mainform\" action=\"\" enctype=\"multipart/form-data\">\n\t\t<h2 class=\"nav-tab-wrapper sp-nav-tab-wrapper\">\n\t\t\t<?php\n\t\t\tforeach ( $tabs as $name => $label ) :\n\t\t\t\t?>\n\t\t\t\t<a href=\"<?php echo esc_attr( admin_url( 'admin.php?page=sportspress&tab=' . $name ) ); ?>\" class=\"nav-tab <?php echo ( $current_tab == $name ? 'nav-tab-active' : '' ); ?>\"><?php echo esc_html( $label ); ?></a><?php endforeach; ?>\n\t\t\t<?php do_action( 'sportspress_settings_tabs' ); ?>\n\t\t</h2>\n\t\t<?php\n\t\t\tdo_action( 'sportspress_sections_' . $current_tab );\n\t\t\tdo_action( 'sportspress_settings_' . $current_tab );\n\t\t\tdo_action( 'sportspress_settings_tabs_' . $current_tab ); // @deprecated hook\n\t\t?>\n\t\t<p class=\"submit\">\n\t\t\t<?php if ( ! isset( $GLOBALS['hide_save_button'] ) ) : ?>\n\t\t\t\t<input name=\"save\" class=\"button-primary\" type=\"submit\" value=\"<?php esc_attr_e( 'Save Changes', 'sportspress' ); ?>\" />\n\t\t\t<?php endif; ?>\n\t\t\t<input type=\"hidden\" name=\"subtab\" id=\"last_tab\" />\n\t\t\t<?php wp_nonce_field( 'sportspress-settings' ); ?>\n\t\t</p>\n\t</form>\n\t<?php do_action( 'sportspress_settings_page' ); ?>\n</div>\n"
  },
  {
    "path": "includes/admin/views/html-notice-install.php",
    "content": "<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n?>\n<div id=\"message\" class=\"updated sportspress-message\">\n\t<p><strong><?php esc_attr_e( 'Welcome to SportsPress', 'sportspress' ); ?></strong> &#8211; <?php esc_attr_e( \"Let's get started with some basic settings.\", 'sportspress' ); ?></p>\n\t<p class=\"submit\">\n\t\t<a class=\"button-primary\" href=\"\n\t\t<?php\n\t\techo esc_url(\n\t\t\tadmin_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'page'                => 'sp-setup',\n\t\t\t\t\t\t'install_sportspress' => 'true',\n\t\t\t\t\t),\n\t\t\t\t\t'admin.php'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t?>\n\t\t\"><?php esc_attr_e( 'Run the Setup Wizard', 'sportspress' ); ?></a>\n\t\t<a class=\"button-secondary\" href=\"<?php echo esc_url( add_query_arg( 'skip_install_sportspress', 'true' ) ); ?>\"><?php esc_attr_e( 'Hide this notice', 'sportspress' ); ?></a>\n\t</p>\n</div>\n"
  },
  {
    "path": "includes/admin/views/html-notice-no-access.php",
    "content": "<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n?>\n<div id=\"message\" class=\"error\">\n\t<p><?php esc_attr_e( 'You are not allowed to edit this item.', 'sportspress' ); ?></p>\n</div>\n"
  },
  {
    "path": "includes/admin/views/html-notice-template-check.php",
    "content": "<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n?>\n<div id=\"message\" class=\"updated sportspress-message wc-connect\">\n\t<p><?php echo wp_kses_post( __( '<strong>Your theme has bundled outdated copies of SportsPress template files</strong> &#8211; if you encounter functionality issues on the frontend this could the reason. Ensure you update or remove them (in general we recommend only bundling the template files you actually need to customize). See the system report for full details.', 'sportspress' ) ); ?></p>\n\t<p class=\"submit\"><a class=\"button-primary\" href=\"\n\t<?php\n\techo esc_url(\n\t\tadd_query_arg(\n\t\t\tarray(\n\t\t\t\t'page' => 'sportspress',\n\t\t\t\t'tab'  => 'status',\n\t\t\t),\n\t\t\tadmin_url( 'admin.php' )\n\t\t)\n\t);\n\t?>\n\t\"><?php esc_html_e( 'System Status', 'sportspress' ); ?></a> <a class=\"skip button\" href=\"<?php echo wp_nonce_url( esc_url( add_query_arg( 'hide_template_files_notice', 'true' ) ) ); ?>\"><?php esc_html_e( 'Hide this notice', 'sportspress' ); ?></a></p>\n</div>\n"
  },
  {
    "path": "includes/admin/views/html-notice-theme-support.php",
    "content": "<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n?>\n<div id=\"message\" class=\"error sportspress-message\">\n\t<p><?php echo wp_kses_post( __( '<strong>Your theme does not declare SportsPress support</strong> &#8211; if you encounter layout issues please read our integration guide or choose a SportsPress theme :)', 'sportspress' ) ); ?></p>\n\t<p><?php esc_attr_e( 'Have you tried the free Rookie theme yet?', 'sportspress' ); ?></p>\n\t<p class=\"submit\">\n\t\t<a class=\"button-primary\" href=\"<?php echo esc_url( add_query_arg( array( 'theme' => 'rookie' ), network_admin_url( 'theme-install.php' ) ) ); ?>\"><?php esc_attr_e( 'Install Now', 'sportspress' ); ?></a>\n\t\t<a class=\"button-secondary\" href=\"http://tboy.co/integration\"><?php esc_attr_e( 'Theme Integration Guide', 'sportspress' ); ?></a>\n\t\t<a class=\"button\" href=\"<?php echo wp_nonce_url( esc_url( add_query_arg( 'hide_theme_support_notice', 'true' ) ) ); ?>\"><?php esc_attr_e( 'Hide this notice', 'sportspress' ); ?></a>\n\t</p>\n</div>\n"
  },
  {
    "path": "includes/api/class-sp-rest-api.php",
    "content": "<?php\n/**\n * REST API Class\n *\n * The SportsPress REST API class handles all API-related hooks.\n *\n * @class       SP_REST_API\n * @version     2.7.9\n * @package     SportsPress/Classes\n * @category    Class\n * @package     SportsPress/API\n * @author      ThemeBoy\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_REST_API' ) ) :\n\n\t/**\n\t * SP_REST_API Class\n\t */\n\tclass SP_REST_API {\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Create REST routes\n\t\t\tadd_action( 'rest_api_init', array( $this, 'create_routes' ) );\n\t\t\tadd_action( 'rest_api_init', array( $this, 'register_fields' ), 0 );\n\n\t\t\t// Add filter for post meta query\n\t\t\tadd_filter( 'rest_query_vars', array( $this, 'meta_query' ) );\n\n\t\t\t// Add filters to query scheduled events\n\t\t\tadd_filter( 'rest_sp_event_query', array( $this, 'event_query' ) );\n\t\t\tadd_filter( 'rest_query_vars', array( $this, 'query_vars' ) );\n\t\t}\n\n\t\t/**\n\t\t * Create REST routes.\n\t\t */\n\t\tpublic static function create_routes() {\n\n\t\t\tif ( ! class_exists( 'SP_REST_Posts_Controller' ) ) {\n\t\t\t\trequire_once dirname( __FILE__ ) . '/class-sp-rest-posts-controller.php';\n\t\t\t}\n\n\t\t\tif ( ! class_exists( 'SP_REST_Terms_Controller' ) ) {\n\t\t\t\trequire_once dirname( __FILE__ ) . '/class-sp-rest-terms-controller.php';\n\t\t\t}\n\n\t\t\tdo_action( 'sportspress_create_rest_routes' );\n\t\t}\n\n\t\t/**\n\t\t * Register REST fields.\n\t\t */\n\t\tpublic static function register_fields() {\n\t\t\tif ( ! function_exists( 'register_rest_field' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'teams',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'main_results',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback' => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'schema'       => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Main Results', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'outcome',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback' => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'schema'       => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Outcome', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'winner',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback' => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'schema'       => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Winner', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'format',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Format', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'mode',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Mode', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'day',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Match Day', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'minutes',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Full Time', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'players',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'offense',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'defense',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'staff',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'results',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_arrays',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Results', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_event',\n\t\t\t\t'performance',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_arrays_multi',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Box Score', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_team',\n\t\t\t\t'staff',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_team',\n\t\t\t\t'tables',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'League Tables', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_team',\n\t\t\t\t'lists',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Player Lists', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_team',\n\t\t\t\t'events',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback' => 'SP_REST_API::get_post_ids_with_meta',\n\t\t\t\t\t'schema'       => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_team',\n\t\t\t\t'abbreviation',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Abbreviation', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_team',\n\t\t\t\t'url',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Site URL', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_player',\n\t\t\t\t'number',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_player',\n\t\t\t\t'teams',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_player',\n\t\t\t\t'current_teams',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Current Teams', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_player',\n\t\t\t\t'past_teams',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Past Teams', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_player',\n\t\t\t\t'nationalities',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Nationalities', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_player',\n\t\t\t\t'metrics',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_array',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Metrics', 'sportspress' ),\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_player',\n\t\t\t\t'statistics',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_arrays_multi',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Statistics', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_staff',\n\t\t\t\t'teams',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_staff',\n\t\t\t\t'current_teams',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Current Teams', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_staff',\n\t\t\t\t'past_teams',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta_recursive',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Past Teams', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_staff',\n\t\t\t\t'nationalities',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_recursive',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Nationalities', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tdo_action( 'sportspress_register_rest_fields' );\n\t\t}\n\n\t\t/**\n\t\t * Get the value of a single SportsPress meta field.\n\t\t *\n\t\t * @param array           $object Details of current post.\n\t\t * @param string          $field_name Name of field.\n\t\t * @param WP_REST_Request $request Current request\n\t\t *\n\t\t * @return mixed\n\t\t */\n\t\tpublic static function get_post_meta( $object, $field_name, $request ) {\n\t\t\t$meta = get_post_meta( $object['id'], self::meta_key( $field_name ), true );\n\n\t\t\tif ( ctype_digit( $meta ) ) {\n\t\t\t\t$meta = intval( $meta );\n\t\t\t}\n\n\t\t\treturn $meta;\n\t\t}\n\n\t\t/**\n\t\t * Handler for updating custom field data.\n\t\t *\n\t\t * @param mixed  $value The value of the field\n\t\t * @param object $object The object from the response\n\t\t * @param string $field_name Name of field\n\t\t *\n\t\t * @return bool|int\n\t\t */\n\t\tpublic static function update_post_meta( $value, $object, $field_name ) {\n\t\t\treturn update_post_meta( $object->ID, self::meta_key( $field_name ), strip_tags( $value ) );\n\t\t}\n\n\t\t/**\n\t\t * Handler for updating array values by merging with the existing array.\n\t\t *\n\t\t * @param mixed  $value The value of the field\n\t\t * @param object $object The object from the response\n\t\t * @param string $field_name Name of field\n\t\t *\n\t\t * @return bool|int\n\t\t */\n\t\tpublic static function update_post_meta_array( $value, $object, $field_name ) {\n\t\t\t// Convert PHP object to array\n\t\t\tif ( is_object( $value ) ) {\n\t\t\t\t$value = (array) $value;\n\t\t\t}\n\n\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$type = $object->post_type;\n\n\t\t\t$meta = get_post_meta( $object->ID, self::meta_key( $field_name, $type ), true );\n\n\t\t\tif ( ! is_array( $meta ) ) {\n\t\t\t\t$meta = array();\n\t\t\t}\n\n\t\t\t$meta = array_merge( $meta, $value );\n\n\t\t\treturn update_post_meta( $object->ID, self::meta_key( $field_name, $type ), $meta );\n\t\t}\n\n\t\t/**\n\t\t * Handler for updating array values by merging with the existing multidimentional array.\n\t\t *\n\t\t * @param mixed  $value The value of the field\n\t\t * @param object $object The object from the response\n\t\t * @param string $field_name Name of field\n\t\t *\n\t\t * @return bool|int\n\t\t */\n\t\tpublic static function update_post_meta_arrays( $value, $object, $field_name ) {\n\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$type = $object->post_type;\n\n\t\t\t$meta = get_post_meta( $object->ID, self::meta_key( $field_name, $type ), true );\n\n\t\t\tif ( ! is_array( $meta ) ) {\n\t\t\t\t$meta = array();\n\t\t\t}\n\n\t\t\tforeach ( $value as $index => $array ) {\n\t\t\t\tif ( ! is_array( $array ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! isset( $meta[ $index ] ) || ! is_array( $meta[ $index ] ) ) {\n\t\t\t\t\t$meta[ $index ] = array();\n\t\t\t\t}\n\n\t\t\t\t$meta[ $index ] = array_merge( $meta[ $index ], $array );\n\t\t\t}\n\n\t\t\treturn update_post_meta( $object->ID, self::meta_key( $field_name, $type ), $meta );\n\t\t}\n\n\t\t/**\n\t\t * Handler for updating array values by merging with existing multidimensional arrays.\n\t\t *\n\t\t * @param mixed  $value The value of the field\n\t\t * @param object $object The object from the response\n\t\t * @param string $field_name Name of field\n\t\t *\n\t\t * @return bool|int\n\t\t */\n\t\tpublic static function update_post_meta_arrays_multi( $value, $object, $field_name ) {\n\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$type = $object->post_type;\n\n\t\t\t$meta = get_post_meta( $object->ID, self::meta_key( $field_name, $type ), true );\n\n\t\t\tif ( ! is_array( $meta ) ) {\n\t\t\t\t$meta = array();\n\t\t\t}\n\n\t\t\tforeach ( $value as $key => $arrays ) {\n\t\t\t\tif ( ! is_array( $arrays ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! isset( $meta[ $key ] ) || ! is_array( $meta[ $key ] ) ) {\n\t\t\t\t\t$meta[ $key ] = array();\n\t\t\t\t}\n\n\t\t\t\tforeach ( $arrays as $index => $array ) {\n\t\t\t\t\tif ( ! is_array( $array ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! isset( $meta[ $key ][ $index ] ) || ! is_array( $meta[ $key ][ $index ] ) ) {\n\t\t\t\t\t\t$meta[ $key ][ $index ] = array();\n\t\t\t\t\t}\n\n\t\t\t\t\t$meta[ $key ][ $index ] = array_merge( $meta[ $key ][ $index ], $array );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn update_post_meta( $object->ID, self::meta_key( $field_name, $type ), $meta );\n\t\t}\n\n\t\t/**\n\t\t * Get an array of SportsPress meta field values.\n\t\t *\n\t\t * @param array           $object Details of current post.\n\t\t * @param string          $field_name Name of field.\n\t\t * @param WP_REST_Request $request Current request\n\t\t *\n\t\t * @return mixed\n\t\t */\n\t\tpublic static function get_post_meta_recursive( $object, $field_name, $request ) {\n\t\t\t$meta = get_post_meta( $object['id'], self::meta_key( $field_name ), false );\n\n\t\t\treturn array_map( 'intval', $meta );\n\t\t}\n\n\t\t/**\n\t\t * Handler for updating multiple custom field values.\n\t\t *\n\t\t * @param array  $values The values of the field\n\t\t * @param object $object The object from the response\n\t\t * @param string $field_name Name of field\n\t\t *\n\t\t * @return bool|int\n\t\t */\n\t\tpublic static function update_post_meta_recursive( $values, $object, $field_name ) {\n\t\t\tdelete_post_meta( $object->ID, self::meta_key( $field_name ) );\n\n\t\t\t$response = true;\n\t\t\tforeach ( $values as $value ) {\n\t\t\t\t$response = add_post_meta( $object->ID, self::meta_key( $field_name ), $value );\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t/**\n\t\t * Get an array of SportsPress meta field values and split into separate arrays based on placeholder zeroes.\n\t\t *\n\t\t * @param array           $object Details of current post.\n\t\t * @param string          $field_name Name of field.\n\t\t * @param WP_REST_Request $request Current request\n\t\t *\n\t\t * @return mixed\n\t\t */\n\t\tpublic static function get_post_meta_recursive_split( $object, $field_name, $request ) {\n\t\t\t$array = self::get_post_meta_recursive( $object, $field_name, $request );\n\n\t\t\t$meta = array();\n\t\t\t$i    = 0;\n\t\t\tforeach ( $array as $value ) {\n\t\t\t\tif ( $value ) {\n\t\t\t\t\t$meta[ $i ][] = $value;\n\t\t\t\t} else {\n\t\t\t\t\t$i ++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $meta;\n\t\t}\n\n\t\t/**\n\t\t * Get a list of posts with a meta value of the given field name.\n\t\t *\n\t\t * @param array           $object Details of current post.\n\t\t * @param string          $field_name Name of field.\n\t\t * @param WP_REST_Request $request Current request\n\t\t *\n\t\t * @return mixed\n\t\t */\n\t\tpublic static function get_post_ids_with_meta( $object, $field_name, $request ) {\n\t\t\t$meta_key = self::meta_key( $field_name );\n\n\t\t\t$query_args = array(\n\t\t\t\t'post_type'      => $meta_key,\n\t\t\t\t'posts_per_page' => 2000,\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\t'key'     => $object['type'],\n\t\t\t\t\t'value'   => $object['id'],\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tif ( 'sp_event' === $meta_key ) {\n\t\t\t\t$query_args['orderby']     = 'date';\n\t\t\t\t$query_args['order']       = 'DESC';\n\t\t\t\t$query_args['post_status'] = array( 'publish', 'future' );\n\t\t\t} else {\n\t\t\t\t$query_args['orderby']     = 'title';\n\t\t\t\t$query_args['order']       = 'ASC';\n\t\t\t\t$query_args['post_status'] = 'publish';\n\t\t\t}\n\n\t\t\t$posts_query  = new WP_Query();\n\t\t\t$query_result = $posts_query->query( $query_args );\n\n\t\t\treturn wp_list_pluck( $query_result, 'ID' );\n\t\t}\n\n\t\t/**\n\t\t * Get custom SportsPress data based on post type and field name.\n\t\t *\n\t\t * @param array           $object Details of current post.\n\t\t * @param string          $field_name Name of field.\n\t\t * @param WP_REST_Request $request Current request\n\t\t *\n\t\t * @return mixed\n\t\t */\n\t\tpublic static function get_post_data( $object, $field_name, $request ) {\n\t\t\t//$type = $object['type'];\n\t\t\t$type = get_post_type( $object['id'] );\n\n\t\t\t$post = new $type( $object['id'] );\n\n\t\t\treturn $post->$field_name();\n\t\t}\n\n\t\t/**\n\t\t * Get meta key of a field\n\t\t */\n\t\tpublic static function meta_key( $field_name, $type = null ) {\n\t\t\t$names = array(\n\t\t\t\t'current_teams' => 'sp_current_team',\n\t\t\t\t'events'        => 'sp_event',\n\t\t\t\t'lists'         => 'sp_list',\n\t\t\t\t'nationalities' => 'sp_nationality',\n\t\t\t\t'past_teams'    => 'sp_past_team',\n\t\t\t\t'performance'   => 'sp_players',\n\t\t\t\t'players'       => 'sp_player',\n\t\t\t\t'offense'       => 'sp_offense',\n\t\t\t\t'defense'       => 'sp_defense',\n\t\t\t\t'table'         => 'sp_teams',\n\t\t\t\t'tables'        => 'sp_table',\n\t\t\t\t'teams'         => 'sp_team',\n\t\t\t);\n\n\t\t\tif ( isset( $type ) ) {\n\t\t\t\tswitch ( $type ) {\n\t\t\t\t\tcase 'sp_table':\n\t\t\t\t\t\t$names['data'] = 'sp_teams';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'sp_list':\n\t\t\t\t\t\t$names['data'] = 'sp_players';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$names = apply_filters( 'sportspress_rest_meta_keys', $names, $type );\n\n\t\t\tif ( array_key_exists( $field_name, $names ) ) {\n\t\t\t\t$field_name = $names[ $field_name ];\n\t\t\t} else {\n\t\t\t\t$field_name = 'sp_' . $field_name;\n\t\t\t}\n\n\t\t\treturn $field_name;\n\t\t}\n\n\t\t/**\n\t\t * Enable meta query vars\n\t\t */\n\t\tpublic static function meta_query( $valid_vars ) {\n\t\t\t$valid_vars = array_merge( $valid_vars, array( 'meta_key', 'meta_value', 'meta_query' ) );\n\t\t\treturn $valid_vars;\n\t\t}\n\n\t\t/**\n\t\t * Add scheduled events to query\n\t\t */\n\t\tpublic static function event_query( $args ) {\n\t\t\t$args['post_status'] = array( 'publish', 'future' );\n\t\t\treturn $args;\n\t\t}\n\n\t\t/**\n\t\t * Enable post status in events query\n\t\t */\n\t\tpublic static function query_vars( $vars ) {\n\t\t\tglobal $wp;\n\t\t\t$vars[] = 'post_status';\n\t\t\treturn $vars;\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_REST_API();\n"
  },
  {
    "path": "includes/api/class-sp-rest-posts-controller.php",
    "content": "<?php\n\nif ( class_exists( 'WP_REST_Posts_Controller' ) ) {\n\tclass SP_REST_Posts_Controller extends WP_REST_Posts_Controller {\n\t\tpublic function __construct( $post_type ) {\n\t\t\tparent::__construct( $post_type );\n\t\t\t$this->namespace = 'sportspress/v2';\n\t\t}\n\n\t\tpublic function check_read_permission( $post ) {\n\t\t\tif ( 'sp_event' === $post->post_type ) {\n\t\t\t\tif ( in_array( $post->post_status, array( 'publish', 'future' ) ) || current_user_can( 'read_post', $post->ID ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn WP_REST_Posts_Controller::check_read_permission( $post );\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/api/class-sp-rest-terms-controller.php",
    "content": "<?php\n\nif ( class_exists( 'WP_REST_Terms_Controller' ) ) {\n\tclass SP_REST_Terms_Controller extends WP_REST_Terms_Controller {\n\t\tpublic function __construct( $taxonomy ) {\n\t\t\tparent::__construct( $taxonomy );\n\t\t\t$this->namespace = 'sportspress/v2';\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-ajax.php",
    "content": "<?php\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * SportsPress SP_AJAX\n *\n * AJAX Event Handler\n *\n * @class       SP_AJAX\n * @version     2.7.9\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\n\nclass SP_AJAX {\n\n\t/**\n\t * Hook into ajax events\n\t */\n\tpublic function __construct() {\n\n\t\t// sportspress_EVENT => nopriv\n\t\t$ajax_events = array(\n\t\t\t'event_countdown_shortcode'   => false,\n\t\t\t'event_details_shortcode'     => false,\n\t\t\t'event_results_shortcode'     => false,\n\t\t\t'event_performance_shortcode' => false,\n\t\t\t'event_venue_shortcode'       => false,\n\t\t\t'event_officials_shortcode'   => false,\n\t\t\t'event_teams_shortcode'       => false,\n\t\t\t'event_full_shortcode'        => false,\n\t\t\t'event_calendar_shortcode'    => false,\n\t\t\t'event_list_shortcode'        => false,\n\t\t\t'event_blocks_shortcode'      => false,\n\t\t\t'team_standings_shortcode'    => false,\n\t\t\t'team_gallery_shortcode'      => false,\n\t\t\t'player_details_shortcode'    => false,\n\t\t\t'player_statistics_shortcode' => false,\n\t\t\t'player_list_shortcode'       => false,\n\t\t\t'player_gallery_shortcode'    => false,\n\t\t);\n\n\t\tforeach ( $ajax_events as $ajax_event => $nopriv ) {\n\t\t\tadd_action( 'wp_ajax_sportspress_' . $ajax_event, array( $this, $ajax_event ) );\n\n\t\t\tif ( $nopriv ) {\n\t\t\t\tadd_action( 'wp_ajax_nopriv_sportspress_' . $ajax_event, array( $this, $ajax_event ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * AJAX event_countdown shortcode\n\t */\n\tpublic function event_countdown_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_calendar\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'       => 'sp_event',\n\t\t\t\t\t\t'name'            => 'id',\n\t\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t\t\t'show_option_all' => esc_html__( '(Auto)', 'sportspress' ),\n\t\t\t\t\t\t'show_dates'      => true,\n\t\t\t\t\t\t'post_status'     => 'future',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"show_venue\">\n\t\t\t\t\t<?php esc_html_e( 'Display venue', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"show_league\">\n\t\t\t\t\t<?php esc_html_e( 'Display league', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'countdown' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('countdown');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_details shortcode\n\t */\n\tpublic function event_details_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_details\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_event',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-details' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_details');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_results shortcode\n\t */\n\tpublic function event_results_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_results\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_event',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-results' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_results');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_attr_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_performance shortcode\n\t */\n\tpublic function event_performance_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_performance\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_event',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-performance' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_performance');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_venue shortcode\n\t */\n\tpublic function event_venue_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_venue\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_event',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-venue' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_venue');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_officials shortcode\n\t */\n\tpublic function event_officials_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_officials\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_event',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-officials' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_officials');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_teams shortcode\n\t */\n\tpublic function event_teams_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_teams\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_event',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-teams' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_teams');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_full shortcode\n\t */\n\tpublic function event_full_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_full\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_event',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-full' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_full');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_calendar shortcode\n\t */\n\tpublic function event_calendar_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_calendar\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Calendar', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'       => 'sp_calendar',\n\t\t\t\t\t\t'name'            => 'id',\n\t\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'All', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Team:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'       => 'sp_team',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'team',\n\t\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'League:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'league',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Season:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'season',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Venue:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_venue',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'venue',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Status:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name'                => 'status',\n\t\t\t\t\t\t'show_option_default' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_statuses( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<div class=\"sp-date-selector\">\n\t\t\t\t<p><?php esc_html_e( 'Date:', 'sportspress' ); ?> \n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name' => 'date',\n\t\t\t\t\t\t'id'   => 'date',\n\t\t\t\t\t\t// 'selected' => $date,\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<div class=\"sp-date-range\">\n\t\t\t\t\t<p class=\"sp-date-range-absolute\">\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-from\" name=\"date_from\" value=\"default\" size=\"10\">\n\t\t\t\t\t\t:\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-to\" name=\"date_to\" value=\"default\" size=\"10\">\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-range-relative\">\n\t\t\t\t\t\t<?php esc_html_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"date_past\" value=\"default\">\n\t\t\t\t\t\t<?php esc_html_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t\t&rarr;\n\t\t\t\t\t\t<?php esc_html_e( 'Next', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"date_future\" value=\"default\">\n\t\t\t\t\t\t<?php esc_html_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"date_relative\" value=\"0\" id=\"date_relative\">\n\t\t\t\t\t\t\t<?php esc_html_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Match Day:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"day\" id=\"day\" placeholder=\"<?php esc_html_e( 'All', 'sportspress' ); ?>\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Display link to view all events', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_all_events_link\" id=\"show_all_events_link\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-calendar' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_html_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_calendar');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_html_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_list shortcode\n\t */\n\tpublic function event_list_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_list\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Title:', 'sportspress' ); ?>\n\t\t\t\t\t<input class=\"regular-text\" type=\"text\" name=\"title\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'       => 'sp_calendar',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'All', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'id',\n\t\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Team:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'       => 'sp_team',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'team',\n\t\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'League:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'league',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Season:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'season',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Venue:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_venue',\n\t\t\t\t\t\t'show_option_all' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'venue',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Status:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name'                => 'status',\n\t\t\t\t\t\t'show_option_default' => esc_html__( 'Default', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_statuses( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Format:', 'sportspress' ); ?>\n\t\t\t\t\t<select name=\"format\" class=\"postform\">\n\t\t\t\t\t\t<option value=\"default\">Default</option>\n\t\t\t\t\t\t<option value=\"all\">All</option>\n\t\t\t\t\t\t<?php foreach ( SP()->formats->event as $key => $format ) : ?>\n\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $format ); ?></option>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</select>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<div class=\"sp-date-selector\">\n\t\t\t\t<p><?php esc_html_e( 'Date:', 'sportspress' ); ?> \n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name' => 'date',\n\t\t\t\t\t\t'id'   => 'date',\n\t\t\t\t\t\t// 'selected' => $date,\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<div class=\"sp-date-range\">\n\t\t\t\t\t<p class=\"sp-date-range-absolute\">\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-from\" name=\"date_from\" value=\"default\" size=\"10\">\n\t\t\t\t\t\t:\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-to\" name=\"date_to\" value=\"default\" size=\"10\">\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-range-relative\">\n\t\t\t\t\t\t<?php esc_html_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"date_past\" value=\"default\">\n\t\t\t\t\t\t<?php esc_html_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t\t&rarr;\n\t\t\t\t\t\t<?php esc_html_e( 'Next', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"date_future\" value=\"default\">\n\t\t\t\t\t\t<?php esc_html_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"date_relative\" value=\"0\" id=\"date_relative\">\n\t\t\t\t\t\t\t<?php esc_html_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Match Day:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"day\" id=\"day\" placeholder=\"<?php esc_attr_e( 'All', 'sportspress' ); ?>\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Number of events to show:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"number\" id=\"number\" value=\"5\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Sort Order:', 'sportspress' ); ?>\n\t\t\t\t\t<select id=\"order\" name=\"order\">\n\t\t\t\t\t\t<option value=\"default\"><?php esc_html_e( 'Default', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"ASC\"><?php esc_html_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"DESC\"><?php esc_html_e( 'Descending', 'sportspress' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p class=\"sp-prefs\">\n\t\t\t\t<?php esc_html_e( 'Columns:', 'sportspress' ); ?><br>\n\t\t\t\t<?php\n\t\t\t\t$the_columns = array(\n\t\t\t\t\t'event'       => esc_attr__( 'Event', 'sportspress' ),\n\t\t\t\t\t'teams'       => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t'time'        => esc_attr__( 'Time', 'sportspress' ),\n\t\t\t\t\t'league'      => esc_attr__( 'League', 'sportspress' ),\n\t\t\t\t\t'season'      => esc_attr__( 'Season', 'sportspress' ),\n\t\t\t\t\t'venue'       => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t\t'article'     => esc_attr__( 'Article', 'sportspress' ),\n\t\t\t\t\t'event_specs' => esc_attr__( 'Specs', 'sportspress' ),\n\t\t\t\t);\n\t\t\t\t$field_name  = 'columns[]';\n\t\t\t\t$field_id    = 'columns';\n\t\t\t\t?>\n\t\t\t\t<?php foreach ( $the_columns as $key => $label ) : ?>\n\t\t\t\t\t<label class=\"button\"><input name=\"<?php echo esc_attr( $field_name ); ?>\" type=\"checkbox\" id=\"<?php echo esc_attr( $field_id ) . '-' . esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" checked=\"checked\"><?php echo esc_html( $label ); ?></label>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_all_events_link\" id=\"show_all_events_link\">\n\t\t\t\t\t<?php esc_html_e( 'Display link to view all events', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-list' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_list');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX event_blocks shortcode\n\t */\n\tpublic function event_blocks_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-event_blocks\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Title:', 'sportspress' ); ?>\n\t\t\t\t\t<input class=\"regular-text\" type=\"text\" name=\"title\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Event:', 'sportspress' ); ?>\n\t\t\t\t\t<input class=\"regular-text\" type=\"number\" name=\"event\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Calendar', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'       => 'sp_calendar',\n\t\t\t\t\t\t'show_option_all' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'id',\n\t\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Team:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'       => 'sp_team',\n\t\t\t\t\t\t'show_option_all' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'team',\n\t\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'League:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t\t\t'show_option_all' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'league',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Season:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t\t\t'show_option_all' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'season',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Venue:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_venue',\n\t\t\t\t\t\t'show_option_all' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'venue',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Status:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name'                => 'status',\n\t\t\t\t\t\t'show_option_default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_statuses( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Format:', 'sportspress' ); ?>\n\t\t\t\t\t<select name=\"format\" class=\"postform\">\n\t\t\t\t\t<option value=\"default\">Default</option>\n\t\t\t\t\t<option value=\"all\">All</option>\n\t\t\t\t\t<?php foreach ( SP()->formats->event as $key => $format ) : ?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $key ); ?>\"><?php echo esc_html( $format ); ?></option>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</select>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<div class=\"sp-date-selector\">\n\t\t\t\t<p><?php esc_html_e( 'Date:', 'sportspress' ); ?> \n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'name' => 'date',\n\t\t\t\t\t\t'id'   => 'date',\n\t\t\t\t\t\t// 'selected' => $date,\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<div class=\"sp-date-range\">\n\t\t\t\t\t<p class=\"sp-date-range-absolute\">\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-from\" name=\"date_from\" value=\"default\" size=\"10\">\n\t\t\t\t\t\t:\n\t\t\t\t\t\t<input type=\"text\" class=\"sp-datepicker-to\" name=\"date_to\" value=\"default\" size=\"10\">\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-range-relative\">\n\t\t\t\t\t\t<?php esc_html_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"date_past\" value=\"default\">\n\t\t\t\t\t\t<?php esc_html_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t\t&rarr;\n\t\t\t\t\t\t<?php esc_html_e( 'Next', 'sportspress' ); ?>\n\t\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"date_future\" value=\"default\">\n\t\t\t\t\t\t<?php esc_attr_e( 'days', 'sportspress' ); ?>\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"date_relative\" value=\"0\" id=\"date_relative\">\n\t\t\t\t\t\t\t<?php esc_html_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Match Day:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"day\" id=\"day\" placeholder=\"<?php esc_attr_e( 'All', 'sportspress' ); ?>\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Number of events to show:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"number\" id=\"number\" value=\"5\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Sort by:', 'sportspress' ); ?>\n\t\t\t\t\t<select id=\"orderby\" name=\"orderby\">\n\t\t\t\t\t\t<option value=\"default\"><?php esc_html_e( 'Default', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"date\"><?php esc_html_e( 'Date', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"day\"><?php esc_html_e( 'Match Day', 'sportspress' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Sort Order:', 'sportspress' ); ?>\n\t\t\t\t\t<select id=\"order\" name=\"order\">\n\t\t\t\t\t\t<option value=\"default\"><?php esc_html_e( 'Default', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"ASC\"><?php esc_html_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"DESC\"><?php esc_html_e( 'Descending', 'sportspress' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_all_events_link\" id=\"show_all_events_link\">\n\t\t\t\t\t<?php esc_html_e( 'Display link to view all events', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'event-blocks' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('event_blocks');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX team_standings shortcode\n\t */\n\tpublic function team_standings_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-team_standings\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Title:', 'sportspress' ); ?>\n\t\t\t\t\t<input class=\"regular-text\" type=\"text\" name=\"title\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'League Table', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_table',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Number of teams to show:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"number\" id=\"number\" value=\"5\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p class=\"sp-prefs\">\n\t\t\t\t<?php esc_html_e( 'Columns:', 'sportspress' ); ?><br>\n\t\t\t\t<?php\n\t\t\t\t$args        = array(\n\t\t\t\t\t'post_type'      => 'sp_column',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t);\n\t\t\t\t$the_columns = get_posts( $args );\n\n\t\t\t\t$field_name = 'columns[]';\n\t\t\t\t$field_id   = 'columns';\n\t\t\t\t?>\n\t\t\t\t<?php foreach ( $the_columns as $column ) : ?>\n\t\t\t\t\t<label class=\"button\"><input name=\"<?php echo esc_attr( $field_name ); ?>\" type=\"checkbox\" id=\"<?php echo esc_attr( $field_id ) . '-' . esc_attr( $column->post_name ); ?>\" value=\"<?php echo esc_attr( $column->post_name ); ?>\" checked=\"checked\"><?php echo esc_html( $column->post_title ); ?></label>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_team_logo\" id=\"show_team_logo\">\n\t\t\t\t\t<?php esc_html_e( 'Display logos', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_full_table_link\" id=\"show_full_table_link\">\n\t\t\t\t\t<?php esc_html_e( 'Display link to view full table', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<?php esc_html_e( 'Event Status:', 'sportspress' ); ?><br/>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_published_events\" id=\"show_published_events\" checked>\n\t\t\t\t\t<?php esc_html_e( 'Include Published/Played Events with results', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t\t<br/>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_future_events\" id=\"show_future_events\" checked>\n\t\t\t\t\t<?php esc_html_e( 'Include Scheduled/Future Events with results', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'league-table' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('team_standings');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX team_gallery shortcode\n\t */\n\tpublic function team_gallery_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-team_gallery\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Title:', 'sportspress' ); ?>\n\t\t\t\t\t<input class=\"regular-text\" type=\"text\" name=\"title\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'League Table', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_table',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Number of teams to show:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"number\" id=\"number\" value=\"5\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Columns:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"columns\" id=\"columns\" value=\"3\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Order by', 'sportspress' ); ?>:\n\t\t\t\t\t<select name=\"orderby\">\n\t\t\t\t\t\t<option value=\"default\"><?php esc_html_e( 'Rank', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"name\"><?php esc_html_e( 'Alphabetical', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"rand\"><?php esc_html_e( 'Random', 'sportspress' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_full_table_link\" id=\"show_full_table_link\">\n\t\t\t\t\t<?php esc_html_e( 'Display link to view full table', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'league-table' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('team_gallery');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX player_details shortcode\n\t */\n\tpublic function player_details_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-player_details\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Player', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_player',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'player-details' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('player_details');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX player_statistics shortcode\n\t */\n\tpublic function player_statistics_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-player_statistics\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Player', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_player',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'player-statistics' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('player_statistics');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX player_list shortcode\n\t */\n\tpublic function player_list_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-player_list\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Title:', 'sportspress' ); ?>\n\t\t\t\t\t<input class=\"regular-text\" type=\"text\" name=\"title\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Player List', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_list',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Team:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'       => 'sp_team',\n\t\t\t\t\t\t'show_option_all' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'team',\n\t\t\t\t\t\t'values'          => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'League:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_league',\n\t\t\t\t\t\t'show_option_all' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'league',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Season:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'taxonomy'        => 'sp_season',\n\t\t\t\t\t\t'show_option_all' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t'name'            => 'season',\n\t\t\t\t\t\t'values'          => 'term_id',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_taxonomies( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Number of players to show:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"number\" id=\"number\" value=\"5\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p class=\"sp-prefs\">\n\t\t\t\t<?php esc_html_e( 'Columns:', 'sportspress' ); ?><br>\n\t\t\t\t<?php\n\t\t\t\t$args        = array(\n\t\t\t\t\t'post_type'      => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t);\n\t\t\t\t$the_columns = get_posts( $args );\n\n\t\t\t\t$field_name = 'columns[]';\n\t\t\t\t$field_id   = 'columns';\n\t\t\t\t?>\n\t\t\t\t<label class=\"button\"><input name=\"columns[]\" type=\"checkbox\" id=\"columns-number\" value=\"number\" checked=\"checked\"><?php esc_html_e( '#', 'sportspress' ); ?></label>\n\t\t\t\t<label class=\"button\"><input name=\"columns[]\" type=\"checkbox\" id=\"columns-team\" value=\"team\" checked=\"checked\"><?php esc_html_e( 'Team', 'sportspress' ); ?></label>\n\t\t\t\t<label class=\"button\"><input name=\"columns[]\" type=\"checkbox\" id=\"columns-position\" value=\"position\" checked=\"checked\"><?php esc_html_e( 'Position', 'sportspress' ); ?></label>\n\t\t\t\t<?php foreach ( $the_columns as $column ) : ?>\n\t\t\t\t\t<label class=\"button\"><input name=\"<?php echo esc_attr( $field_name ); ?>\" type=\"checkbox\" id=\"<?php echo esc_attr( $field_id ) . '-' . esc_attr( $column->post_name ); ?>\" value=\"<?php echo esc_attr( $column->post_name ); ?>\" checked=\"checked\"><?php echo esc_html( $column->post_title ); ?></label>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Sort by:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'prepend_options' => array(\n\t\t\t\t\t\t\t'default'      => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t\t'number'       => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t\t\t\t'name'         => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t\t\t\t'eventsplayed' => esc_attr__( 'Played', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'post_type'       => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),\n\t\t\t\t\t\t'name'            => 'orderby',\n\t\t\t\t\t\t'id'              => 'orderby',\n\t\t\t\t\t\t'values'          => 'slug',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Sort Order:', 'sportspress' ); ?>\n\t\t\t\t\t<select id=\"order\" name=\"order\">\n\t\t\t\t\t\t<option value=\"\"><?php esc_html_e( 'Default', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"ASC\"><?php esc_html_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"DESC\"><?php esc_html_e( 'Descending', 'sportspress' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_all_players_link\" id=\"show_all_players_link\">\n\t\t\t\t\t<?php esc_html_e( 'Display link to view all players', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'player-list' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('player_list');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\t/**\n\t * AJAX player_gallery shortcode\n\t */\n\tpublic function player_gallery_shortcode() {\n\t\t?>\n\t\t<div class=\"wrap sp-thickbox-content\" id=\"sp-thickbox-player_gallery\">\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Title:', 'sportspress' ); ?>\n\t\t\t\t\t<input class=\"regular-text\" type=\"text\" name=\"title\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php printf( esc_html__( 'Select %s:', 'sportspress' ), esc_html__( 'Player List', 'sportspress' ) ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type' => 'sp_list',\n\t\t\t\t\t\t'name'      => 'id',\n\t\t\t\t\t\t'values'    => 'ID',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Number of players to show:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"number\" id=\"number\" value=\"5\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Columns:', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"text\" size=\"3\" name=\"columns\" id=\"columns\" value=\"3\">\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Sort by:', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'prepend_options' => array(\n\t\t\t\t\t\t\t'default'      => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t\t\t'number'       => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t\t\t\t'name'         => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t\t\t\t'eventsplayed' => esc_attr__( 'Played', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'post_type'       => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),\n\t\t\t\t\t\t'name'            => 'orderby',\n\t\t\t\t\t\t'id'              => 'orderby',\n\t\t\t\t\t\t'values'          => 'slug',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<?php esc_html_e( 'Sort Order:', 'sportspress' ); ?>\n\t\t\t\t\t<select id=\"order\" name=\"order\">\n\t\t\t\t\t\t<option value=\"\"><?php esc_html_e( 'Default', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"ASC\"><?php esc_html_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t\t\t\t<option value=\"DESC\"><?php esc_html_e( 'Descending', 'sportspress' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"show_all_players_link\" id=\"show_all_players_link\">\n\t\t\t\t\t<?php esc_html_e( 'Display link to view all players', 'sportspress' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<?php do_action( 'sportspress_ajax_shortcode_form', 'player-gallery' ); ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"button\" class=\"button-primary\" value=\"<?php esc_attr_e( 'Insert Shortcode', 'sportspress' ); ?>\" onclick=\"insertSportsPress('player_gallery');\" />\n\t\t\t\t<a class=\"button-secondary\" onclick=\"tb_remove();\" title=\"<?php esc_attr_e( 'Cancel', 'sportspress' ); ?>\"><?php esc_html_e( 'Cancel', 'sportspress' ); ?></a>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t\tself::scripts();\n\t\tdie();\n\t}\n\n\tpublic function scripts() {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tfunction insertSportsPress( type ) {\n\t\t\t\tvar $div = jQuery('.sp-thickbox-content');\n\n\t\t\t\t// Initialize shortcode arguments\n\t\t\t\tvar args = {};\n\n\t\t\t\t// Add ID if available and not 0\n\t\t\t\tid = $div.find('[name=id]').val();\n\t\t\t\tif ( id != 0 ) args.id = id;\n\n\t\t\t\t// Extract args based on type\n\t\t\t\tif ( 'countdown' == type ) {\n\t\t\t\t\targs.show_venue = $div.find('[name=show_venue]:checked').length;\n\t\t\t\t\targs.show_league = $div.find('[name=show_league]:checked').length;\n\t\t\t\t} else if ( 'event_calendar' == type ) {\n\t\t\t\t\targs.team = $div.find('[name=team]').val();\n\t\t\t\t\targs.league = $div.find('[name=league]').val();\n\t\t\t\t\targs.season = $div.find('[name=season]').val();\n\t\t\t\t\targs.venue = $div.find('[name=venue]').val();\n\t\t\t\t\targs.status = $div.find('[name=status]').val();\n\t\t\t\t\targs.date = $div.find('[name=date]').val();\n\t\t\t\t\targs.date_from = $div.find('[name=date_from]').val();\n\t\t\t\t\targs.date_to = $div.find('[name=date_to]').val();\n\t\t\t\t\targs.date_past = $div.find('[name=date_past]').val();\n\t\t\t\t\targs.date_future = $div.find('[name=date_future]').val();\n\t\t\t\t\targs.date_relative = $div.find('[name=date_relative]:checked').length;\n\t\t\t\t\targs.day = $div.find('[name=day]').val();\n\t\t\t\t\targs.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length;\n\t\t\t\t} else if ( 'event_list' == type ) {\n\t\t\t\t\targs.title = $div.find('[name=title]').val();\n\t\t\t\t\targs.team = $div.find('[name=team]').val();\n\t\t\t\t\targs.league = $div.find('[name=league]').val();\n\t\t\t\t\targs.season = $div.find('[name=season]').val();\n\t\t\t\t\targs.venue = $div.find('[name=venue]').val();\n\t\t\t\t\targs.status = $div.find('[name=status]').val();\n\t\t\t\t\targs.format = $div.find('[name=format]').val();\n\t\t\t\t\targs.date = $div.find('[name=date]').val();\n\t\t\t\t\targs.date_from = $div.find('[name=date_from]').val();\n\t\t\t\t\targs.date_to = $div.find('[name=date_to]').val();\n\t\t\t\t\targs.date_past = $div.find('[name=date_past]').val();\n\t\t\t\t\targs.date_future = $div.find('[name=date_future]').val();\n\t\t\t\t\targs.date_relative = $div.find('[name=date_relative]:checked').length;\n\t\t\t\t\targs.day = $div.find('[name=day]').val();\n\t\t\t\t\targs.number = $div.find('[name=number]').val();\n\t\t\t\t\targs.order = $div.find('[name=order]').val();\n\t\t\t\t\targs.columns = $div.find('[name=\"columns[]\"]:checked').map(function() { return this.value; }).get().join(',');\n\t\t\t\t\targs.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length;\n\t\t\t\t} else if ( 'event_blocks' == type ) {\n\t\t\t\t\targs.title = $div.find('[name=title]').val();\n\t\t\t\t\targs.event = $div.find('[name=event]').val();\n\t\t\t\t\targs.team = $div.find('[name=team]').val();\n\t\t\t\t\targs.league = $div.find('[name=league]').val();\n\t\t\t\t\targs.season = $div.find('[name=season]').val();\n\t\t\t\t\targs.venue = $div.find('[name=venue]').val();\n\t\t\t\t\targs.status = $div.find('[name=status]').val();\n\t\t\t\t\targs.format = $div.find('[name=format]').val();\n\t\t\t\t\targs.date = $div.find('[name=date]').val();\n\t\t\t\t\targs.date_from = $div.find('[name=date_from]').val();\n\t\t\t\t\targs.date_to = $div.find('[name=date_to]').val();\n\t\t\t\t\targs.date_past = $div.find('[name=date_past]').val();\n\t\t\t\t\targs.date_future = $div.find('[name=date_future]').val();\n\t\t\t\t\targs.date_relative = $div.find('[name=date_relative]:checked').length;\n\t\t\t\t\targs.day = $div.find('[name=day]').val();\n\t\t\t\t\targs.number = $div.find('[name=number]').val();\n\t\t\t\t\targs.orderby = $div.find('[name=orderby]').val();\n\t\t\t\t\targs.order = $div.find('[name=order]').val();\n\t\t\t\t\targs.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length;\n\t\t\t\t} else if ( 'team_standings' == type ) {\n\t\t\t\t\targs.title = $div.find('[name=title]').val();\n\t\t\t\t\targs.number = $div.find('[name=number]').val();\n\t\t\t\t\targs.columns = $div.find('[name=\"columns[]\"]:checked').map(function() { return this.value; }).get().join(',');\n\t\t\t\t\targs.show_team_logo = $div.find('[name=show_team_logo]:checked').length;\n\t\t\t\t\targs.show_published_events = $div.find('[name=show_published_events]:checked').length;\n\t\t\t\t\targs.show_future_events = $div.find('[name=show_future_events]:checked').length;\n\t\t\t\t\targs.show_full_table_link = $div.find('[name=show_full_table_link]:checked').length;\n\t\t\t\t} else if ( 'team_gallery' == type ) {\n\t\t\t\t\targs.title = $div.find('[name=title]').val();\n\t\t\t\t\targs.number = $div.find('[name=number]').val();\n\t\t\t\t\targs.columns = $div.find('[name=columns]').val();\n\t\t\t\t\targs.orderby = $div.find('[name=orderby]').val();\n\t\t\t\t\targs.show_full_table_link = $div.find('[name=show_full_table_link]:checked').length;\n\t\t\t\t} else if ( 'player_list' == type ) {\n\t\t\t\t\targs.title = $div.find('[name=title]').val();\n\t\t\t\t\targs.number = $div.find('[name=number]').val();\n\t\t\t\t\targs.team = $div.find('[name=team]').val();\n\t\t\t\t\targs.seasons = $div.find('[name=season]').val();\n\t\t\t\t\targs.leagues = $div.find('[name=league]').val();\n\t\t\t\t\targs.columns = $div.find('[name=\"columns[]\"]:checked').map(function() { return this.value; }).get().join(',');\n\t\t\t\t\targs.orderby = $div.find('[name=orderby]').val();\n\t\t\t\t\targs.order = $div.find('[name=order]').val();\n\t\t\t\t\targs.show_all_players_link = $div.find('[name=show_all_players_link]:checked').length;\n\t\t\t\t} else if ( 'player_gallery' == type ) {\n\t\t\t\t\targs.title = $div.find('[name=title]').val();\n\t\t\t\t\targs.number = $div.find('[name=number]').val();\n\t\t\t\t\targs.columns = $div.find('[name=columns]').val();\n\t\t\t\t\targs.orderby = $div.find('[name=orderby]').val();\n\t\t\t\t\targs.order = $div.find('[name=order]').val();\n\t\t\t\t\targs.show_all_players_link = $div.find('[name=show_all_players_link]:checked').length;\n\t\t\t\t}\n\n\t\t\t\t<?php do_action( 'sportspress_ajax_scripts_before_shortcode' ); ?>\n\n\t\t\t\t// Generate the shortcode\n\t\t\t\tvar shortcode = '[' + type;\n\t\t\t\tfor ( var key in args ) {\n\t\t\t\t\tif ( args.hasOwnProperty( key ) ) {\n\t\t\t\t\t\tshortcode += ' ' + key + '=\"' + args[key] + '\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshortcode += ']';\n\n\t\t\t\t// Send the shortcode to the editor\n\t\t\t\twindow.send_to_editor( shortcode );\n\t\t\t}\n\t\t</script>\n\t\t<script type=\"text/javascript\">\n\t\t\tjQuery(document).ready(function($){\n\t\t\t\t// Datepicker\n\t\t\t\t$(\".sp-datepicker\").datepicker({\n\t\t\t\t\tdateFormat : \"yy-mm-dd\"\n\t\t\t\t});\n\t\t\t\t$(\".sp-datepicker-from\").datepicker({\n\t\t\t\t\tdateFormat : \"yy-mm-dd\",\n\t\t\t\t\tonClose: function( selectedDate ) {\n\t\t\t\t\t\t$(this).closest(\".sp-date-selector\").find(\".sp-datepicker-to\").datepicker(\"option\", \"minDate\", selectedDate);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t$(\".sp-datepicker-to\").datepicker({\n\t\t\t\t\tdateFormat : \"yy-mm-dd\",\n\t\t\t\t\tonClose: function( selectedDate ) {\n\t\t\t\t\t\t$(this).closest(\".sp-date-selector\").find(\".sp-datepicker-from\").datepicker(\"option\", \"maxDate\", selectedDate);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Show or hide datepicker\n\t\t\t\t$(\".sp-date-selector select\").change(function() {\n\t\t\t\t\tif ( $(this).val() == \"range\" ) {\n\t\t\t\t\t\t$(this).closest(\".sp-date-selector\").find(\".sp-date-range\").show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(this).closest(\".sp-date-selector\").find(\".sp-date-range\").hide();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t$(\".sp-date-selector select\").trigger(\"change\");\n\n\t\t\t\t// Toggle date range selectors\n\t\t\t\t$(\".sp-date-relative input\").change(function() {\n\t\t\t\t\t$relative = $( this ).closest( \".sp-date-relative\" ).siblings( \".sp-date-range-relative\" ).toggle( 0, $( this ).attr( \"checked\" ) );\n\t\t\t\t\t$absolute = $( this ).closest( \".sp-date-relative\" ).siblings( \".sp-date-range-absolute\" ).toggle( 0, $( this ).attr( \"checked\" ) );\n\t\t\t\t\t\n\t\t\t\t\tif ( $( this ).is( \":checked\" ) ) {\n\t\t\t\t\t\t$relative.show();\n\t\t\t\t\t\t$absolute.hide();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$absolute.show();\n\t\t\t\t\t\t$relative.hide();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t$(\".sp-date-selector input\").trigger(\"change\");\n\t\t\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}\n}\n\nnew SP_AJAX();\n"
  },
  {
    "path": "includes/class-sp-calendar.php",
    "content": "<?php\n/**\n * Calendar Class\n *\n * The SportsPress calendar class handles individual calendar data.\n * Props @_drg_ for adjustments to range and timezone handling.\n * https://wordpress.org/support/topic/suggestion-for-schedule-list-range-option/\n * https://wordpress.org/support/topic/timezone-issues-with-schedule-calendar-list/\n *\n * @class       SP_Calendar\n * @version   2.6.20\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\n\nclass SP_Calendar extends SP_Secondary_Post {\n\n\t/** @var string The events status. */\n\tpublic $status;\n\n\t/** @var string The events order. */\n\tpublic $order;\n\n\t/** @var string The events orderby. */\n\tpublic $orderby;\n\n\t/** @var string The match day. */\n\tpublic $day;\n\n\t/** @var int The league ID. */\n\tpublic $league;\n\n\t/** @var int The season ID. */\n\tpublic $season;\n\n\t/** @var int The venue ID. */\n\tpublic $venue;\n\n\t/** @var int The team ID. */\n\tpublic $team;\n\n\t/** @var array The teams IDs. */\n\tpublic $teams_past;\n\n\t/** @var string The event date. */\n\tpublic $date_before;\n\n\t/** @var int The player ID. */\n\tpublic $player;\n\n\t/** @var int Number of events. */\n\tpublic $number;\n\n\t/** @var int The event ID. */\n\tpublic $event;\n\n\t/** @var integer The event format slug. */\n\tpublic $event_format;\n\n\t/**\n\t * __construct function.\n\t *\n\t * @access public\n\t * @param mixed $post\n\t */\n\tpublic function __construct( $post ) {\n\t\tif ( $post instanceof WP_Post || $post instanceof SP_Secondary_Post ) :\n\t\t\t$this->ID   = absint( $post->ID );\n\t\t\t$this->post = $post;\n\t\telse :\n\t\t\t$this->ID   = absint( $post );\n\t\t\t$this->post = get_post( $this->ID );\n\t\tendif;\n\n\t\t$this->status  = $this->__get( 'status' );\n\t\t$this->date    = $this->__get( 'date' );\n\t\t$this->orderby = $this->__get( 'orderby' );\n\t\t$this->order   = $this->__get( 'order' );\n\t\t$this->number  = $this->__get( 'number' );\n\n\t\tif ( ! $this->status ) {\n\t\t\t$this->status = 'any';\n\t\t}\n\n\t\tif ( ! $this->date ) {\n\t\t\t$this->date = 0;\n\t\t}\n\n\t\tif ( ! $this->order ) {\n\t\t\t$this->order = 'ASC';\n\t\t}\n\n\t\tif ( ! $this->orderby ) {\n\t\t\t$this->orderby = 'post_date';\n\t\t}\n\n\t\tif ( 'range' == $this->date ) {\n\n\t\t\t$this->relative = get_post_meta( $this->ID, 'sp_date_relative', true );\n\n\t\t\tif ( $this->relative ) {\n\n\t\t\t\t$this->past   = get_post_meta( $this->ID, 'sp_date_past', true );\n\t\t\t\t$this->future = get_post_meta( $this->ID, 'sp_date_future', true );\n\n\t\t\t} else {\n\n\t\t\t\t$this->from = get_post_meta( $this->ID, 'sp_date_from', true );\n\t\t\t\t$this->to   = get_post_meta( $this->ID, 'sp_date_to', true );\n\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $this->day ) {\n\t\t\t$this->day = get_post_meta( $this->ID, 'sp_day', true );\n\t\t}\n\n\t\tif ( ! $this->event_format ) {\n\t\t\t$this->event_format = get_post_meta( $this->ID, 'sp_event_format', true );\n\t\t}\n\n\t\tif ( ! $this->number ) {\n\t\t\t$this->number = -1;\n\t\t}\n\t}\n\n\t/**\n\t * Returns formatted data\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function data() {\n\t\tglobal $pagenow;\n\n\t\t$weekday = array(\n\t\t\t0 => 'Sunday',\n\t\t\t1 => 'Monday',\n\t\t\t2 => 'Tuesday',\n\t\t\t3 => 'Wednesday',\n\t\t\t4 => 'Thursday',\n\t\t\t5 => 'Friday',\n\t\t\t6 => 'Saturday',\n\t\t);\n\n\t\t$start_of_week = get_option( 'start_of_week' );\n\n\t\t$firstday = $weekday[ $start_of_week ];\n\t\tif ( $start_of_week != 0 ) {\n\t\t\t$lastday = $weekday[ ( $start_of_week - 1 ) ];\n\t\t} else {\n\t\t\t$lastday = $weekday[6];\n\t\t}\n\n\t\t$today = date( 'l' );\n\n\t\t$args = array(\n\t\t\t'post_type'      => 'sp_event',\n\t\t\t'posts_per_page' => $this->number,\n\t\t\t'orderby'        => $this->orderby,\n\t\t\t'order'          => $this->order,\n\t\t\t'meta_query'     => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t),\n\t\t\t'tax_query'      => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t),\n\t\t);\n\n\t\tif ( $this->date !== 0 ) :\n\t\t\tswitch ( $this->date ) :\n\t\t\t\tcase '-day':\n\t\t\t\t\t$date = new DateTime( date_i18n( 'Y-m-d' ) );\n\t\t\t\t\t$date->modify( '-1 day' );\n\t\t\t\t\t$args['year']     = $date->format( 'Y' );\n\t\t\t\t\t$args['day']      = $date->format( 'j' );\n\t\t\t\t\t$args['monthnum'] = $date->format( 'n' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'day':\n\t\t\t\t\t$args['year']     = date_i18n( 'Y' );\n\t\t\t\t\t$args['day']      = date_i18n( 'j' );\n\t\t\t\t\t$args['monthnum'] = date_i18n( 'n' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+day':\n\t\t\t\t\t$date = new DateTime( date_i18n( 'Y-m-d' ) );\n\t\t\t\t\t$date->modify( '+1 day' );\n\t\t\t\t\t$args['year']     = $date->format( 'Y' );\n\t\t\t\t\t$args['day']      = $date->format( 'j' );\n\t\t\t\t\t$args['monthnum'] = $date->format( 'n' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-w':\n\t\t\t\t\tif ( $start_of_week != '1' ) { // If start of week is not Monday\n\t\t\t\t\t\tif ( $today == $firstday ) { // If today is start of Week\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"last $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"last $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"-2 $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"last $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$args['date_query'] = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'after'     => $after,\n\t\t\t\t\t\t\t\t'before'    => $before,\n\t\t\t\t\t\t\t\t'inclusive' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$date = new DateTime( date_i18n( 'Y-m-d' ) );\n\t\t\t\t\t\t$date->modify( '-1 week' );\n\t\t\t\t\t\t$args['year'] = $date->format( 'Y' );\n\t\t\t\t\t\t$args['w']    = $date->format( 'W' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\tif ( $start_of_week != '1' ) { // If start of week is not Monday\n\t\t\t\t\t\tif ( $today == $firstday ) { // If today is start of Week\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d' );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"next $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t} elseif ( $today == $lastday ) { // If today is the end of Week\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"last $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d' ) . ' 23:59:59';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"last $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"next $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$args['date_query'] = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'after'     => $after,\n\t\t\t\t\t\t\t\t'before'    => $before,\n\t\t\t\t\t\t\t\t'inclusive' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$args['year'] = date_i18n( 'Y' );\n\t\t\t\t\t\t$args['w']    = date_i18n( 'W' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+w':\n\t\t\t\t\tif ( $start_of_week != '1' ) { // If start of week is not Monday\n\t\t\t\t\t\tif ( $today == $lastday ) { // If today is the end of Week\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"next $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"next $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"next $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"+2 $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$args['date_query'] = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'after'     => $after,\n\t\t\t\t\t\t\t\t'before'    => $before,\n\t\t\t\t\t\t\t\t'inclusive' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$date = new DateTime( date_i18n( 'Y-m-d' ) );\n\t\t\t\t\t\t$date->modify( '+1 week' );\n\t\t\t\t\t\t$args['year'] = $date->format( 'Y' );\n\t\t\t\t\t\t$args['w']    = $date->format( 'W' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'range':\n\t\t\t\t\tif ( $this->relative ) :\n\t\t\t\t\t\tadd_filter( 'posts_where', array( $this, 'relative' ) );\n\t\t\t\t\telse :\n\t\t\t\t\t\tadd_filter( 'posts_where', array( $this, 'range' ) );\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\tendif;\n\n\t\tif ( $this->league ) :\n\t\t\t$league_ids = array( $this->league );\n\t\tendif;\n\n\t\tif ( $this->season ) :\n\t\t\t$season_ids = array( $this->season );\n\t\tendif;\n\n\t\tif ( $this->venue ) :\n\t\t\t$venue_ids = array( $this->venue );\n\t\tendif;\n\n\t\tif ( $this->team ) :\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\t'key'     => 'sp_team',\n\t\t\t\t'value'   => array( $this->team ),\n\t\t\t\t'compare' => 'IN',\n\t\t\t);\n\t\tendif;\n\n\t\t// If we are showing past meetings filter by team's id and current event date\n\t\tif ( $this->teams_past ) :\n\t\t\tforeach ( $this->teams_past as $team_past ) :\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key'     => 'sp_team',\n\t\t\t\t\t'value'   => $team_past,\n\t\t\t\t\t'compare' => '=',\n\t\t\t\t);\n\t\t\tendforeach;\n\t\t\t$args['date_query'] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'before'    => $this->date_before,\n\t\t\t\t\t'inclusive' => false,\n\t\t\t\t),\n\n\t\t\t);\n\t\tendif;\n\n\t\tif ( $this->player ) :\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\t'key'     => 'sp_player',\n\t\t\t\t'value'   => array( $this->player ),\n\t\t\t\t'compare' => 'IN',\n\t\t\t);\n\t\tendif;\n\n\t\tif ( $this->event_format && 'all' != $this->event_format ) :\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\t'key'   => 'sp_format',\n\t\t\t\t'value' => $this->event_format,\n\t\t\t);\n\t\tendif;\n\n\t\tif ( $this->day ) :\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\t'key'   => 'sp_day',\n\t\t\t\t'value' => $this->day,\n\t\t\t);\n\t\tendif;\n\n\t\tif ( 'day' == $this->orderby ) :\n\t\t\t$args['orderby']  = 'meta_value_num';\n\t\t\t$args['meta_key'] = 'sp_day';\n\t\tendif;\n\n\t\tif ( $pagenow != 'post-new.php' ) :\n\t\t\tif ( $this->ID ) :\n\t\t\t\t$leagues = get_the_terms( $this->ID, 'sp_league' );\n\t\t\t\t$seasons = get_the_terms( $this->ID, 'sp_season' );\n\t\t\t\t$venues  = get_the_terms( $this->ID, 'sp_venue' );\n\t\t\t\t$teams   = array_filter( get_post_meta( $this->ID, 'sp_team', false ) );\n\t\t\t\t$players = array_filter( get_post_meta( $this->ID, 'sp_player', false ) );\n\t\t\t\t$table   = get_post_meta( $this->ID, 'sp_table', true );\n\n\t\t\t\tif ( ! isset( $league_ids ) ) {\n\t\t\t\t\t$league_ids = array();\n\t\t\t\t}\n\t\t\t\tif ( empty( $league_ids ) && $leagues ) :\n\t\t\t\t\tforeach ( $leagues as $league ) :\n\t\t\t\t\t\t$league_ids[] = $league->term_id;\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\t\t$league_ids = sp_add_auto_term( $league_ids, $this->ID, 'sp_league' );\n\t\t\t\tif ( empty( $league_ids ) ) {\n\t\t\t\t\tunset( $league_ids );\n\t\t\t\t}\n\n\t\t\t\tif ( ! isset( $season_ids ) ) {\n\t\t\t\t\t$season_ids = array();\n\t\t\t\t}\n\t\t\t\tif ( empty( $season_ids ) && $seasons ) :\n\t\t\t\t\tforeach ( $seasons as $season ) :\n\t\t\t\t\t\t$season_ids[] = $season->term_id;\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\t\t$season_ids = sp_add_auto_term( $season_ids, $this->ID, 'sp_season' );\n\t\t\t\tif ( empty( $season_ids ) ) {\n\t\t\t\t\tunset( $season_ids );\n\t\t\t\t}\n\n\t\t\t\tif ( ! isset( $venue_ids ) && $venues ) :\n\t\t\t\t\t$venue_ids = array();\n\t\t\t\t\tforeach ( $venues as $venue ) :\n\t\t\t\t\t\t$venue_ids[] = $venue->term_id;\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\t\tif ( isset( $league_ids ) ) {\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $league_ids,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isset( $season_ids ) ) {\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $season_ids,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isset( $venue_ids ) ) {\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_venue',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $venue_ids,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! empty( $teams ) ) {\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key'     => 'sp_team',\n\t\t\t\t\t'value'   => $teams,\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! empty( $players ) ) {\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key'     => 'sp_player',\n\t\t\t\t\t'value'   => $players,\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $this->event ) {\n\t\t\t\t$args['p']           = $this->event;\n\t\t\t\t$args['post_status'] = array( 'publish', 'future' );\n\t\t\t}\n\n\t\t\tif ( 'auto' === $this->date && 'any' === $this->status ) {\n\t\t\t\t$args['post_status']    = 'publish';\n\t\t\t\t$args['order']          = 'DESC';\n\t\t\t\t$args['posts_per_page'] = ceil( $this->number / 2 );\n\t\t\t\t$results                = get_posts( $args );\n\t\t\t\t$results                = array_reverse( $results, true );\n\n\t\t\t\t$args['post_status']    = 'future';\n\t\t\t\t$args['order']          = 'ASC';\n\t\t\t\t$args['posts_per_page'] = floor( $this->number / 2 );\n\t\t\t\t$fixtures               = get_posts( $args );\n\n\t\t\t\t$events = array_merge_recursive( $results, $fixtures );\n\t\t\t} else {\n\t\t\t\t$args['post_status'] = $this->status == 'any' ? array( 'publish', 'future' ) : explode( ',', $this->status );\n\t\t\t\t$events              = get_posts( $args );\n\t\t\t}\n\n\t\telse :\n\t\t\t$events = null;\n\t\tendif;\n\n\t\t// Remove any calendar selection filters\n\t\tremove_filter( 'posts_where', array( $this, 'range' ) );\n\t\tremove_filter( 'posts_where', array( $this, 'relative' ) );\n\n\t\treturn $events;\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-countries.php",
    "content": "<?php\n/**\n * SportsPress countries\n *\n * The SportsPress countries class stores continent/country data.\n *\n * @class       SP_Countries\n * @version   2.7.9\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Countries {\n\n\t/** @var array Array of continents */\n\tpublic $continents;\n\n\t/** @var array Array of countries */\n\tpublic $countries;\n\n\t/** @var array Array of legacy 2-letter codes converted to 3-letter codes */\n\tpublic $legacy;\n\n\t/**\n\t * Constructor for the countries class - defines all continents and countries.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function __construct() {\n\t\t$continents = array(\n\t\t\t__( 'Africa', 'sportspress' )        => array(\n\t\t\t\t'alg',\n\t\t\t\t'ang',\n\t\t\t\t'bdi',\n\t\t\t\t'ben',\n\t\t\t\t'bfa',\n\t\t\t\t'bot',\n\t\t\t\t'cgo',\n\t\t\t\t'cha',\n\t\t\t\t'civ',\n\t\t\t\t'cmr',\n\t\t\t\t'cod',\n\t\t\t\t'com',\n\t\t\t\t'cpv',\n\t\t\t\t'cta',\n\t\t\t\t'dji',\n\t\t\t\t'egy',\n\t\t\t\t'eqg',\n\t\t\t\t'eri',\n\t\t\t\t'esh',\n\t\t\t\t'eth',\n\t\t\t\t'gab',\n\t\t\t\t'gam',\n\t\t\t\t'gha',\n\t\t\t\t'gnb',\n\t\t\t\t'gui',\n\t\t\t\t'ken',\n\t\t\t\t'lbr',\n\t\t\t\t'lby',\n\t\t\t\t'les',\n\t\t\t\t'mad',\n\t\t\t\t'mar',\n\t\t\t\t'mli',\n\t\t\t\t'moz',\n\t\t\t\t'mri',\n\t\t\t\t'mtn',\n\t\t\t\t'nam',\n\t\t\t\t'nga',\n\t\t\t\t'nig',\n\t\t\t\t'reu',\n\t\t\t\t'rsa',\n\t\t\t\t'rwa',\n\t\t\t\t'sdn',\n\t\t\t\t'sen',\n\t\t\t\t'sey',\n\t\t\t\t'sle',\n\t\t\t\t'som',\n\t\t\t\t'ssd',\n\t\t\t\t'stp',\n\t\t\t\t'swz',\n\t\t\t\t'tan',\n\t\t\t\t'tog',\n\t\t\t\t'tun',\n\t\t\t\t'uga',\n\t\t\t\t'zam',\n\t\t\t\t'zim',\n\t\t\t),\n\t\t\t__( 'Asia', 'sportspress' )          => array(\n\t\t\t\t'afg',\n\t\t\t\t'arm',\n\t\t\t\t'aze',\n\t\t\t\t'ban',\n\t\t\t\t'bhr',\n\t\t\t\t'bhu',\n\t\t\t\t'bru',\n\t\t\t\t'cam',\n\t\t\t\t'chn',\n\t\t\t\t'cyp',\n\t\t\t\t'geo',\n\t\t\t\t'hkg',\n\t\t\t\t'ind',\n\t\t\t\t'irn',\n\t\t\t\t'irq',\n\t\t\t\t'isr',\n\t\t\t\t'jor',\n\t\t\t\t'jpn',\n\t\t\t\t'kaz',\n\t\t\t\t'kgz',\n\t\t\t\t'kor',\n\t\t\t\t'ksa',\n\t\t\t\t'kuw',\n\t\t\t\t'lao',\n\t\t\t\t'lib',\n\t\t\t\t'mac',\n\t\t\t\t'mas',\n\t\t\t\t'mdv',\n\t\t\t\t'mng',\n\t\t\t\t'mya',\n\t\t\t\t'nep',\n\t\t\t\t'oma',\n\t\t\t\t'pak',\n\t\t\t\t'phi',\n\t\t\t\t'ple',\n\t\t\t\t'prk',\n\t\t\t\t'qat',\n\t\t\t\t'sin',\n\t\t\t\t'sri',\n\t\t\t\t'syr',\n\t\t\t\t'tha',\n\t\t\t\t'tjk',\n\t\t\t\t'tkm',\n\t\t\t\t'tpe',\n\t\t\t\t'uae',\n\t\t\t\t'uzb',\n\t\t\t\t'vie',\n\t\t\t\t'yem',\n\t\t\t),\n\t\t\t__( 'Europe', 'sportspress' )        => array(\n\t\t\t\t'alb',\n\t\t\t\t'and',\n\t\t\t\t'aut',\n\t\t\t\t'bel',\n\t\t\t\t'bih',\n\t\t\t\t'blr',\n\t\t\t\t'bul',\n\t\t\t\t'cro',\n\t\t\t\t'cze',\n\t\t\t\t'den',\n\t\t\t\t'end',\n\t\t\t\t'eng',\n\t\t\t\t'esp',\n\t\t\t\t'est',\n\t\t\t\t'fin',\n\t\t\t\t'fra',\n\t\t\t\t'fro',\n\t\t\t\t'gbr',\n\t\t\t\t'ger',\n\t\t\t\t'gib',\n\t\t\t\t'gre',\n\t\t\t\t'hun',\n\t\t\t\t'irl',\n\t\t\t\t'isl',\n\t\t\t\t'ita',\n\t\t\t\t'kos',\n\t\t\t\t'lie',\n\t\t\t\t'ltu',\n\t\t\t\t'lux',\n\t\t\t\t'lva',\n\t\t\t\t'mco',\n\t\t\t\t'mda',\n\t\t\t\t'mkd',\n\t\t\t\t'mlt',\n\t\t\t\t'mne',\n\t\t\t\t'mwi',\n\t\t\t\t'ned',\n\t\t\t\t'nir',\n\t\t\t\t'nor',\n\t\t\t\t'pol',\n\t\t\t\t'por',\n\t\t\t\t'rou',\n\t\t\t\t'rus',\n\t\t\t\t'sco',\n\t\t\t\t'smr',\n\t\t\t\t'srb',\n\t\t\t\t'svk',\n\t\t\t\t'svn',\n\t\t\t\t'sui',\n\t\t\t\t'swe',\n\t\t\t\t'swz',\n\t\t\t\t'tur',\n\t\t\t\t'ukr',\n\t\t\t\t'vat',\n\t\t\t\t'wal',\n\t\t\t),\n\t\t\t__( 'North America', 'sportspress' ) => array(\n\t\t\t\t'atg',\n\t\t\t\t'aia',\n\t\t\t\t'aru',\n\t\t\t\t'bah',\n\t\t\t\t'ber',\n\t\t\t\t'blz',\n\t\t\t\t'brb',\n\t\t\t\t'can',\n\t\t\t\t'cay',\n\t\t\t\t'crc',\n\t\t\t\t'cub',\n\t\t\t\t'cuw',\n\t\t\t\t'dma',\n\t\t\t\t'dom',\n\t\t\t\t'glp',\n\t\t\t\t'grl',\n\t\t\t\t'grn',\n\t\t\t\t'gua',\n\t\t\t\t'hai',\n\t\t\t\t'hon',\n\t\t\t\t'jam',\n\t\t\t\t'lca',\n\t\t\t\t'mex',\n\t\t\t\t'mtq',\n\t\t\t\t'msr',\n\t\t\t\t'nca',\n\t\t\t\t'pan',\n\t\t\t\t'pur',\n\t\t\t\t'skn',\n\t\t\t\t'slv',\n\t\t\t\t'sxm',\n\t\t\t\t'tca',\n\t\t\t\t'usa',\n\t\t\t\t'vgb',\n\t\t\t\t'vin',\n\t\t\t\t'vir',\n\t\t\t\t'wif',\n\t\t\t),\n\t\t\t__( 'Oceania', 'sportspress' )       => array(\n\t\t\t\t'asa',\n\t\t\t\t'aus',\n\t\t\t\t'cok',\n\t\t\t\t'fij',\n\t\t\t\t'fsm',\n\t\t\t\t'gum',\n\t\t\t\t'idn',\n\t\t\t\t'kir',\n\t\t\t\t'mhl',\n\t\t\t\t'ncl',\n\t\t\t\t'nru',\n\t\t\t\t'nzl',\n\t\t\t\t'plw',\n\t\t\t\t'png',\n\t\t\t\t'pyf',\n\t\t\t\t'sam',\n\t\t\t\t'sol',\n\t\t\t\t'tah',\n\t\t\t\t'tga',\n\t\t\t\t'tls',\n\t\t\t\t'tuv',\n\t\t\t\t'van',\n\t\t\t),\n\t\t\t__( 'South America', 'sportspress' ) => array(\n\t\t\t\t'arg',\n\t\t\t\t'bol',\n\t\t\t\t'bra',\n\t\t\t\t'chi',\n\t\t\t\t'col',\n\t\t\t\t'ecu',\n\t\t\t\t'guf',\n\t\t\t\t'guy',\n\t\t\t\t'par',\n\t\t\t\t'per',\n\t\t\t\t'sur',\n\t\t\t\t'tri',\n\t\t\t\t'uru',\n\t\t\t\t'ven',\n\t\t\t),\n\t\t);\n\n\t\t$this->countries = apply_filters(\n\t\t\t'sportspress_countries',\n\t\t\tarray(\n\t\t\t\t'afg' => esc_attr__( 'Afghanistan', 'sportspress' ),\n\t\t\t\t'aia' => esc_attr__( 'Anguilla', 'sportspress' ),\n\t\t\t\t'alb' => esc_attr__( 'Albania', 'sportspress' ),\n\t\t\t\t'alg' => esc_attr__( 'Algeria', 'sportspress' ),\n\t\t\t\t'and' => esc_attr__( 'Andorra', 'sportspress' ),\n\t\t\t\t'ang' => esc_attr__( 'Angola', 'sportspress' ),\n\t\t\t\t'arg' => esc_attr__( 'Argentina', 'sportspress' ),\n\t\t\t\t'arm' => esc_attr__( 'Armenia', 'sportspress' ),\n\t\t\t\t'aru' => esc_attr__( 'Aruba', 'sportspress' ),\n\t\t\t\t'asa' => esc_attr__( 'American Samoa', 'sportspress' ),\n\t\t\t\t'atg' => esc_attr__( 'Antigua and Barbuda', 'sportspress' ),\n\t\t\t\t'aus' => esc_attr__( 'Australia', 'sportspress' ),\n\t\t\t\t'aut' => esc_attr__( 'Austria', 'sportspress' ),\n\t\t\t\t'aze' => esc_attr__( 'Azerbaijan', 'sportspress' ),\n\t\t\t\t'bah' => esc_attr__( 'Bahamas', 'sportspress' ),\n\t\t\t\t'ban' => esc_attr__( 'Bangladesh', 'sportspress' ),\n\t\t\t\t'bdi' => esc_attr__( 'Burundi', 'sportspress' ),\n\t\t\t\t'bel' => esc_attr__( 'Belgium', 'sportspress' ),\n\t\t\t\t'ben' => esc_attr__( 'Benin', 'sportspress' ),\n\t\t\t\t'ber' => esc_attr__( 'Bermuda', 'sportspress' ),\n\t\t\t\t'bfa' => esc_attr__( 'Burkina Faso', 'sportspress' ),\n\t\t\t\t'bhr' => esc_attr__( 'Bahrain', 'sportspress' ),\n\t\t\t\t'bhu' => esc_attr__( 'Bhutan', 'sportspress' ),\n\t\t\t\t'bih' => esc_attr__( 'Bosnia and Herzegovina', 'sportspress' ),\n\t\t\t\t'blr' => esc_attr__( 'Belarus', 'sportspress' ),\n\t\t\t\t'blz' => esc_attr__( 'Belize', 'sportspress' ),\n\t\t\t\t'bol' => esc_attr__( 'Bolivia', 'sportspress' ),\n\t\t\t\t'bot' => esc_attr__( 'Botswana', 'sportspress' ),\n\t\t\t\t'bra' => esc_attr__( 'Brazil', 'sportspress' ),\n\t\t\t\t'brb' => esc_attr__( 'Barbados', 'sportspress' ),\n\t\t\t\t'bru' => esc_attr__( 'Brunei', 'sportspress' ),\n\t\t\t\t'bul' => esc_attr__( 'Bulgaria', 'sportspress' ),\n\t\t\t\t'cam' => esc_attr__( 'Cambodia', 'sportspress' ),\n\t\t\t\t'can' => esc_attr__( 'Canada', 'sportspress' ),\n\t\t\t\t'cay' => esc_attr__( 'Cayman Islands', 'sportspress' ),\n\t\t\t\t'cgo' => esc_attr__( 'Republic of the Congo', 'sportspress' ),\n\t\t\t\t'cha' => esc_attr__( 'Chad', 'sportspress' ),\n\t\t\t\t'chi' => esc_attr__( 'Chile', 'sportspress' ),\n\t\t\t\t'chn' => esc_attr__( 'China', 'sportspress' ),\n\t\t\t\t'civ' => esc_attr__( 'Ivory Coast', 'sportspress' ),\n\t\t\t\t'cmr' => esc_attr__( 'Cameroon', 'sportspress' ),\n\t\t\t\t'cod' => esc_attr__( 'Democratic Republic of the Congo', 'sportspress' ),\n\t\t\t\t'cok' => esc_attr__( 'Cook Islands', 'sportspress' ),\n\t\t\t\t'col' => esc_attr__( 'Colombia', 'sportspress' ),\n\t\t\t\t'com' => esc_attr__( 'Comoros', 'sportspress' ),\n\t\t\t\t'cpv' => esc_attr__( 'Cape Verde', 'sportspress' ),\n\t\t\t\t'crc' => esc_attr__( 'Costa Rica', 'sportspress' ),\n\t\t\t\t'cro' => esc_attr__( 'Croatia', 'sportspress' ),\n\t\t\t\t'cta' => esc_attr__( 'Central African Republic', 'sportspress' ),\n\t\t\t\t'cub' => esc_attr__( 'Cuba', 'sportspress' ),\n\t\t\t\t'cuw' => esc_attr__( 'Curacao', 'sportspress' ),\n\t\t\t\t'cyp' => esc_attr__( 'Cyprus', 'sportspress' ),\n\t\t\t\t'cze' => esc_attr__( 'Czechia', 'sportspress' ),\n\t\t\t\t'den' => esc_attr__( 'Denmark', 'sportspress' ),\n\t\t\t\t'dji' => esc_attr__( 'Djibouti', 'sportspress' ),\n\t\t\t\t'dma' => esc_attr__( 'Dominica', 'sportspress' ),\n\t\t\t\t'dom' => esc_attr__( 'Dominican Republic', 'sportspress' ),\n\t\t\t\t'ecu' => esc_attr__( 'Ecuador', 'sportspress' ),\n\t\t\t\t'egy' => esc_attr__( 'Egypt', 'sportspress' ),\n\t\t\t\t'eng' => esc_attr__( 'England', 'sportspress' ),\n\t\t\t\t'eqg' => esc_attr__( 'Equatorial Guinea', 'sportspress' ),\n\t\t\t\t'eri' => esc_attr__( 'Eritrea', 'sportspress' ),\n\t\t\t\t'esh' => esc_attr__( 'Western Sahara', 'sportspress' ),\n\t\t\t\t'esp' => esc_attr__( 'Spain', 'sportspress' ),\n\t\t\t\t'est' => esc_attr__( 'Estonia', 'sportspress' ),\n\t\t\t\t'eth' => esc_attr__( 'Ethiopia', 'sportspress' ),\n\t\t\t\t'fij' => esc_attr__( 'Fiji', 'sportspress' ),\n\t\t\t\t'fin' => esc_attr__( 'Finland', 'sportspress' ),\n\t\t\t\t'fra' => esc_attr__( 'France', 'sportspress' ),\n\t\t\t\t'fro' => esc_attr__( 'Faroe Islands', 'sportspress' ),\n\t\t\t\t'guf' => esc_attr__( 'French Guiana', 'sportspress' ),\n\t\t\t\t'pyf' => esc_attr__( 'French Polynesia', 'sportspress' ),\n\t\t\t\t'fsm' => esc_attr__( 'Micronesia', 'sportspress' ),\n\t\t\t\t'gab' => esc_attr__( 'Gabon', 'sportspress' ),\n\t\t\t\t'gam' => esc_attr__( 'Gambia', 'sportspress' ),\n\t\t\t\t'gbr' => esc_attr__( 'United Kingdom', 'sportspress' ),\n\t\t\t\t'geo' => esc_attr__( 'Georgia', 'sportspress' ),\n\t\t\t\t'ger' => esc_attr__( 'Germany', 'sportspress' ),\n\t\t\t\t'gha' => esc_attr__( 'Ghana', 'sportspress' ),\n\t\t\t\t'gib' => esc_attr__( 'Gibraltar', 'sportspress' ),\n\t\t\t\t'glp' => esc_attr__( 'Guadeloupe', 'sportspress' ),\n\t\t\t\t'gnb' => esc_attr__( 'Guinea-Bissau', 'sportspress' ),\n\t\t\t\t'gre' => esc_attr__( 'Greece', 'sportspress' ),\n\t\t\t\t'grl' => esc_attr__( 'Greenland', 'sportspress' ),\n\t\t\t\t'grn' => esc_attr__( 'Grenada', 'sportspress' ),\n\t\t\t\t'gua' => esc_attr__( 'Guatemala', 'sportspress' ),\n\t\t\t\t'gui' => esc_attr__( 'Guinea', 'sportspress' ),\n\t\t\t\t'gum' => esc_attr__( 'Guam', 'sportspress' ),\n\t\t\t\t'guy' => esc_attr__( 'Guyana', 'sportspress' ),\n\t\t\t\t'hai' => esc_attr__( 'Haiti', 'sportspress' ),\n\t\t\t\t'hkg' => esc_attr__( 'Hong Kong', 'sportspress' ),\n\t\t\t\t'hon' => esc_attr__( 'Honduras', 'sportspress' ),\n\t\t\t\t'hun' => esc_attr__( 'Hungary', 'sportspress' ),\n\t\t\t\t'idn' => esc_attr__( 'Indonesia', 'sportspress' ),\n\t\t\t\t'ind' => esc_attr__( 'India', 'sportspress' ),\n\t\t\t\t'irl' => esc_attr__( 'Ireland', 'sportspress' ),\n\t\t\t\t'irn' => esc_attr__( 'Iran', 'sportspress' ),\n\t\t\t\t'irq' => esc_attr__( 'Iraq', 'sportspress' ),\n\t\t\t\t'isl' => esc_attr__( 'Iceland', 'sportspress' ),\n\t\t\t\t'isr' => esc_attr__( 'Israel', 'sportspress' ),\n\t\t\t\t'ita' => esc_attr__( 'Italy', 'sportspress' ),\n\t\t\t\t'jam' => esc_attr__( 'Jamaica', 'sportspress' ),\n\t\t\t\t'jor' => esc_attr__( 'Jordan', 'sportspress' ),\n\t\t\t\t'jpn' => esc_attr__( 'Japan', 'sportspress' ),\n\t\t\t\t'kaz' => esc_attr__( 'Kazakhstan', 'sportspress' ),\n\t\t\t\t'ken' => esc_attr__( 'Kenya', 'sportspress' ),\n\t\t\t\t'kos' => esc_attr__( 'Kosovo', 'sportspress' ),\n\t\t\t\t'kgz' => esc_attr__( 'Kyrgyzstan', 'sportspress' ),\n\t\t\t\t'kir' => esc_attr__( 'Kiribati', 'sportspress' ),\n\t\t\t\t'mtq' => esc_attr__( 'Martinique', 'sportspress' ),\n\t\t\t\t'kor' => esc_attr__( 'South Korea', 'sportspress' ),\n\t\t\t\t'ksa' => esc_attr__( 'Saudi Arabia', 'sportspress' ),\n\t\t\t\t'kuw' => esc_attr__( 'Kuwait', 'sportspress' ),\n\t\t\t\t'lao' => esc_attr__( 'Laos', 'sportspress' ),\n\t\t\t\t'lbr' => esc_attr__( 'Liberia', 'sportspress' ),\n\t\t\t\t'lby' => esc_attr__( 'Libya', 'sportspress' ),\n\t\t\t\t'lca' => esc_attr__( 'Saint Lucia', 'sportspress' ),\n\t\t\t\t'les' => esc_attr__( 'Lesotho', 'sportspress' ),\n\t\t\t\t'lib' => esc_attr__( 'Lebanon', 'sportspress' ),\n\t\t\t\t'lie' => esc_attr__( 'Liechtenstein', 'sportspress' ),\n\t\t\t\t'ltu' => esc_attr__( 'Lithuania', 'sportspress' ),\n\t\t\t\t'lux' => esc_attr__( 'Luxembourg', 'sportspress' ),\n\t\t\t\t'lva' => esc_attr__( 'Latvia', 'sportspress' ),\n\t\t\t\t'mac' => esc_attr__( 'Macau', 'sportspress' ),\n\t\t\t\t'mad' => esc_attr__( 'Madagascar', 'sportspress' ),\n\t\t\t\t'mar' => esc_attr__( 'Morocco', 'sportspress' ),\n\t\t\t\t'mas' => esc_attr__( 'Malaysia', 'sportspress' ),\n\t\t\t\t'mco' => esc_attr__( 'Monaco', 'sportspress' ),\n\t\t\t\t'mda' => esc_attr__( 'Moldova', 'sportspress' ),\n\t\t\t\t'mdv' => esc_attr__( 'Maldives', 'sportspress' ),\n\t\t\t\t'mex' => esc_attr__( 'Mexico', 'sportspress' ),\n\t\t\t\t'mhl' => esc_attr__( 'Marshall Islands', 'sportspress' ),\n\t\t\t\t'mkd' => esc_attr__( 'North Macedonia', 'sportspress' ),\n\t\t\t\t'mli' => esc_attr__( 'Mali', 'sportspress' ),\n\t\t\t\t'mlt' => esc_attr__( 'Malta', 'sportspress' ),\n\t\t\t\t'mne' => esc_attr__( 'Montenegro', 'sportspress' ),\n\t\t\t\t'mng' => esc_attr__( 'Mongolia', 'sportspress' ),\n\t\t\t\t'moz' => esc_attr__( 'Mozambique', 'sportspress' ),\n\t\t\t\t'mri' => esc_attr__( 'Mauritius', 'sportspress' ),\n\t\t\t\t'msr' => esc_attr__( 'Montserrat', 'sportspress' ),\n\t\t\t\t'mtn' => esc_attr__( 'Mauritania', 'sportspress' ),\n\t\t\t\t'mwi' => esc_attr__( 'Malawi', 'sportspress' ),\n\t\t\t\t'mya' => esc_attr__( 'Myanmar', 'sportspress' ),\n\t\t\t\t'nam' => esc_attr__( 'Namibia', 'sportspress' ),\n\t\t\t\t'nca' => esc_attr__( 'Nicaragua', 'sportspress' ),\n\t\t\t\t'ncl' => esc_attr__( 'New Caledonia', 'sportspress' ),\n\t\t\t\t'ned' => esc_attr__( 'Netherlands', 'sportspress' ),\n\t\t\t\t'nep' => esc_attr__( 'Nepal', 'sportspress' ),\n\t\t\t\t'nga' => esc_attr__( 'Nigeria', 'sportspress' ),\n\t\t\t\t'nig' => esc_attr__( 'Niger', 'sportspress' ),\n\t\t\t\t'nir' => esc_attr__( 'Northern Ireland', 'sportspress' ),\n\t\t\t\t'nor' => esc_attr__( 'Norway', 'sportspress' ),\n\t\t\t\t'nru' => esc_attr__( 'Nauru', 'sportspress' ),\n\t\t\t\t'nzl' => esc_attr__( 'New Zealand', 'sportspress' ),\n\t\t\t\t'oma' => esc_attr__( 'Oman', 'sportspress' ),\n\t\t\t\t'pak' => esc_attr__( 'Pakistan', 'sportspress' ),\n\t\t\t\t'pan' => esc_attr__( 'Panama', 'sportspress' ),\n\t\t\t\t'par' => esc_attr__( 'Paraguay', 'sportspress' ),\n\t\t\t\t'per' => esc_attr__( 'Peru', 'sportspress' ),\n\t\t\t\t'phi' => esc_attr__( 'Philippines', 'sportspress' ),\n\t\t\t\t'ple' => esc_attr__( 'Palestine', 'sportspress' ),\n\t\t\t\t'plw' => esc_attr__( 'Palau', 'sportspress' ),\n\t\t\t\t'png' => esc_attr__( 'Papua New Guinea', 'sportspress' ),\n\t\t\t\t'pol' => esc_attr__( 'Poland', 'sportspress' ),\n\t\t\t\t'por' => esc_attr__( 'Portugal', 'sportspress' ),\n\t\t\t\t'prk' => esc_attr__( 'North Korea', 'sportspress' ),\n\t\t\t\t'pur' => esc_attr__( 'Puerto Rico', 'sportspress' ),\n\t\t\t\t'qat' => esc_attr__( 'Qatar', 'sportspress' ),\n\t\t\t\t'rou' => esc_attr__( 'Romania', 'sportspress' ),\n\t\t\t\t'rsa' => esc_attr__( 'South Africa', 'sportspress' ),\n\t\t\t\t'reu' => esc_attr__( 'Reunion', 'sportspress' ),\n\t\t\t\t'rus' => esc_attr__( 'Russia', 'sportspress' ),\n\t\t\t\t'rwa' => esc_attr__( 'Rwanda', 'sportspress' ),\n\t\t\t\t'sam' => esc_attr__( 'Samoa', 'sportspress' ),\n\t\t\t\t'sco' => esc_attr__( 'Scotland', 'sportspress' ),\n\t\t\t\t'sdn' => esc_attr__( 'Sudan', 'sportspress' ),\n\t\t\t\t'sen' => esc_attr__( 'Senegal', 'sportspress' ),\n\t\t\t\t'sey' => esc_attr__( 'Seychelles', 'sportspress' ),\n\t\t\t\t'sin' => esc_attr__( 'Singapore', 'sportspress' ),\n\t\t\t\t'skn' => esc_attr__( 'Saint Kitts and Nevis', 'sportspress' ),\n\t\t\t\t'sle' => esc_attr__( 'Sierra Leone', 'sportspress' ),\n\t\t\t\t'slv' => esc_attr__( 'El Salvador', 'sportspress' ),\n\t\t\t\t'smr' => esc_attr__( 'San Marino', 'sportspress' ),\n\t\t\t\t'sol' => esc_attr__( 'Solomon Islands', 'sportspress' ),\n\t\t\t\t'som' => esc_attr__( 'Somalia', 'sportspress' ),\n\t\t\t\t'srb' => esc_attr__( 'Serbia', 'sportspress' ),\n\t\t\t\t'sri' => esc_attr__( 'Sri Lanka', 'sportspress' ),\n\t\t\t\t'ssd' => esc_attr__( 'South Sudan', 'sportspress' ),\n\t\t\t\t'stp' => esc_attr__( 'Sao Tome and Principe', 'sportspress' ),\n\t\t\t\t'sui' => esc_attr__( 'Switzerland', 'sportspress' ),\n\t\t\t\t'sur' => esc_attr__( 'Suriname', 'sportspress' ),\n\t\t\t\t'svk' => esc_attr__( 'Slovakia', 'sportspress' ),\n\t\t\t\t'svn' => esc_attr__( 'Slovenia', 'sportspress' ),\n\t\t\t\t'swe' => esc_attr__( 'Sweden', 'sportspress' ),\n\t\t\t\t'swz' => esc_attr__( 'Eswatini', 'sportspress' ),\n\t\t\t\t'sxm' => esc_attr__( 'Sint Maarten', 'sportspress' ),\n\t\t\t\t'syr' => esc_attr__( 'Syria', 'sportspress' ),\n\t\t\t\t'tah' => esc_attr__( 'Tahiti', 'sportspress' ),\n\t\t\t\t'tan' => esc_attr__( 'Tanzania', 'sportspress' ),\n\t\t\t\t'tca' => esc_attr__( 'Turks and Caicos Islands', 'sportspress' ),\n\t\t\t\t'tga' => esc_attr__( 'Tonga', 'sportspress' ),\n\t\t\t\t'tha' => esc_attr__( 'Thailand', 'sportspress' ),\n\t\t\t\t'tjk' => esc_attr__( 'Tajikistan', 'sportspress' ),\n\t\t\t\t'tkm' => esc_attr__( 'Turkmenistan', 'sportspress' ),\n\t\t\t\t'tls' => esc_attr__( 'East Timor', 'sportspress' ),\n\t\t\t\t'tog' => esc_attr__( 'Togo', 'sportspress' ),\n\t\t\t\t'tpe' => esc_attr__( 'Taiwan', 'sportspress' ),\n\t\t\t\t'tri' => esc_attr__( 'Trinidad and Tobago', 'sportspress' ),\n\t\t\t\t'tun' => esc_attr__( 'Tunisia', 'sportspress' ),\n\t\t\t\t'tur' => esc_attr__( 'Turkey', 'sportspress' ),\n\t\t\t\t'tuv' => esc_attr__( 'Tuvalu', 'sportspress' ),\n\t\t\t\t'uae' => esc_attr__( 'United Arab Emirates', 'sportspress' ),\n\t\t\t\t'uga' => esc_attr__( 'Uganda', 'sportspress' ),\n\t\t\t\t'ukr' => esc_attr__( 'Ukraine', 'sportspress' ),\n\t\t\t\t'uru' => esc_attr__( 'Uruguay', 'sportspress' ),\n\t\t\t\t'usa' => esc_attr__( 'United States', 'sportspress' ),\n\t\t\t\t'uzb' => esc_attr__( 'Uzbekistan', 'sportspress' ),\n\t\t\t\t'van' => esc_attr__( 'Vanuatu', 'sportspress' ),\n\t\t\t\t'vat' => esc_attr__( 'Vatican City', 'sportspress' ),\n\t\t\t\t'ven' => esc_attr__( 'Venezuela', 'sportspress' ),\n\t\t\t\t'vgb' => esc_attr__( 'British Virgin Islands', 'sportspress' ),\n\t\t\t\t'vie' => esc_attr__( 'Vietnam', 'sportspress' ),\n\t\t\t\t'vin' => esc_attr__( 'Saint Vincent and the Grenadines', 'sportspress' ),\n\t\t\t\t'vir' => esc_attr__( 'US Virgin Islands', 'sportspress' ),\n\t\t\t\t'wal' => esc_attr__( 'Wales', 'sportspress' ),\n\t\t\t\t'wif' => esc_attr__( 'West Indies', 'sportspress' ),\n\t\t\t\t'yem' => esc_attr__( 'Yemen', 'sportspress' ),\n\t\t\t\t'zam' => esc_attr__( 'Zambia', 'sportspress' ),\n\t\t\t\t'zim' => esc_attr__( 'Zimbabwe', 'sportspress' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->legacy = array(\n\t\t\t'ad' => 'and',\n\t\t\t'ae' => 'uae',\n\t\t\t'af' => 'afg',\n\t\t\t'ag' => 'atg',\n\t\t\t'al' => 'alb',\n\t\t\t'am' => 'arm',\n\t\t\t'ao' => 'ang',\n\t\t\t'ar' => 'arg',\n\t\t\t'at' => 'aut',\n\t\t\t'au' => 'aus',\n\t\t\t'az' => 'aze',\n\t\t\t'ba' => 'bih',\n\t\t\t'bb' => 'brb',\n\t\t\t'bd' => 'ban',\n\t\t\t'be' => 'bel',\n\t\t\t'bf' => 'bfa',\n\t\t\t'bg' => 'bul',\n\t\t\t'bh' => 'bhr',\n\t\t\t'bi' => 'bdi',\n\t\t\t'bj' => 'ben',\n\t\t\t'bn' => 'bru',\n\t\t\t'bo' => 'bol',\n\t\t\t'br' => 'bra',\n\t\t\t'bs' => 'bah',\n\t\t\t'bt' => 'bhu',\n\t\t\t'bw' => 'bot',\n\t\t\t'by' => 'blr',\n\t\t\t'bz' => 'blz',\n\t\t\t'ca' => 'can',\n\t\t\t'cd' => 'cod',\n\t\t\t'cf' => 'cta',\n\t\t\t'cg' => 'cgo',\n\t\t\t'ch' => 'swz',\n\t\t\t'ci' => 'civ',\n\t\t\t'cl' => 'chi',\n\t\t\t'cm' => 'cmr',\n\t\t\t'cn' => 'chn',\n\t\t\t'co' => 'col',\n\t\t\t'cr' => 'crc',\n\t\t\t'cu' => 'cub',\n\t\t\t'cv' => 'cpv',\n\t\t\t'cy' => 'cyp',\n\t\t\t'cz' => 'cze',\n\t\t\t'de' => 'ger',\n\t\t\t'dj' => 'dji',\n\t\t\t'dk' => 'den',\n\t\t\t'dm' => 'dma',\n\t\t\t'do' => 'dom',\n\t\t\t'dz' => 'alg',\n\t\t\t'ec' => 'ecu',\n\t\t\t'ee' => 'est',\n\t\t\t'eg' => 'egy',\n\t\t\t'eh' => 'esh',\n\t\t\t'el' => 'gre',\n\t\t\t'en' => 'end',\n\t\t\t'er' => 'eri',\n\t\t\t'es' => 'esp',\n\t\t\t'et' => 'eth',\n\t\t\t'fi' => 'fin',\n\t\t\t'fj' => 'fij',\n\t\t\t'fm' => 'fsm',\n\t\t\t'fr' => 'fra',\n\t\t\t'ga' => 'gab',\n\t\t\t'gb' => 'gbr',\n\t\t\t'gd' => 'grn',\n\t\t\t'ge' => 'geo',\n\t\t\t'gh' => 'gha',\n\t\t\t'gm' => 'gam',\n\t\t\t'gn' => 'gui',\n\t\t\t'gq' => 'eqg',\n\t\t\t'gr' => 'gre',\n\t\t\t'gt' => 'gua',\n\t\t\t'gw' => 'gnb',\n\t\t\t'gy' => 'guy',\n\t\t\t'hk' => 'hkg',\n\t\t\t'hn' => 'hon',\n\t\t\t'hr' => 'cro',\n\t\t\t'ht' => 'hai',\n\t\t\t'hu' => 'hun',\n\t\t\t'id' => 'idn',\n\t\t\t'ie' => 'irl',\n\t\t\t'il' => 'isr',\n\t\t\t'in' => 'ind',\n\t\t\t'iq' => 'irq',\n\t\t\t'ir' => 'irn',\n\t\t\t'is' => 'isl',\n\t\t\t'it' => 'ita',\n\t\t\t'jm' => 'jam',\n\t\t\t'jo' => 'jor',\n\t\t\t'jp' => 'jpn',\n\t\t\t'ke' => 'ken',\n\t\t\t'kg' => 'kgz',\n\t\t\t'kh' => 'cam',\n\t\t\t'ki' => 'kir',\n\t\t\t'km' => 'com',\n\t\t\t'kn' => 'skn',\n\t\t\t'kp' => 'prk',\n\t\t\t'kr' => 'kor',\n\t\t\t'kw' => 'kuw',\n\t\t\t'kz' => 'kaz',\n\t\t\t'la' => 'lao',\n\t\t\t'lb' => 'lib',\n\t\t\t'lc' => 'lca',\n\t\t\t'li' => 'lie',\n\t\t\t'lk' => 'sri',\n\t\t\t'lr' => 'lbr',\n\t\t\t'ls' => 'les',\n\t\t\t'lt' => 'ltu',\n\t\t\t'lu' => 'lux',\n\t\t\t'lv' => 'lva',\n\t\t\t'ly' => 'lby',\n\t\t\t'ma' => 'mar',\n\t\t\t'mc' => 'mco',\n\t\t\t'md' => 'mda',\n\t\t\t'me' => 'mne',\n\t\t\t'mg' => 'mad',\n\t\t\t'mh' => 'mhl',\n\t\t\t'mk' => 'mkd',\n\t\t\t'ml' => 'mli',\n\t\t\t'mm' => 'mya',\n\t\t\t'mn' => 'mng',\n\t\t\t'mo' => 'mac',\n\t\t\t'mr' => 'mtn',\n\t\t\t'mt' => 'mlt',\n\t\t\t'mu' => 'mri',\n\t\t\t'mv' => 'mdv',\n\t\t\t'mw' => 'mwi',\n\t\t\t'mx' => 'mex',\n\t\t\t'my' => 'mas',\n\t\t\t'mz' => 'moz',\n\t\t\t'na' => 'nam',\n\t\t\t'nb' => 'nir',\n\t\t\t'ne' => 'nig',\n\t\t\t'ng' => 'nga',\n\t\t\t'ni' => 'nca',\n\t\t\t'nl' => 'ned',\n\t\t\t'no' => 'nor',\n\t\t\t'np' => 'nep',\n\t\t\t'nr' => 'nru',\n\t\t\t'nz' => 'nzl',\n\t\t\t'om' => 'oma',\n\t\t\t'pa' => 'pan',\n\t\t\t'pe' => 'per',\n\t\t\t'pg' => 'png',\n\t\t\t'ph' => 'phi',\n\t\t\t'pk' => 'pak',\n\t\t\t'pl' => 'pol',\n\t\t\t'pr' => 'pur',\n\t\t\t'ps' => 'ple',\n\t\t\t'pt' => 'por',\n\t\t\t'pw' => 'plw',\n\t\t\t'py' => 'par',\n\t\t\t'qa' => 'qat',\n\t\t\t'ro' => 'rou',\n\t\t\t'rs' => 'srb',\n\t\t\t'ru' => 'rus',\n\t\t\t'rw' => 'rwa',\n\t\t\t'sa' => 'ksa',\n\t\t\t'sb' => 'sol',\n\t\t\t'sc' => 'sey',\n\t\t\t'sd' => 'sdn',\n\t\t\t'se' => 'swe',\n\t\t\t'sf' => 'sco',\n\t\t\t'sg' => 'sin',\n\t\t\t'si' => 'svn',\n\t\t\t'sk' => 'svk',\n\t\t\t'sl' => 'sle',\n\t\t\t'sm' => 'smr',\n\t\t\t'sn' => 'sen',\n\t\t\t'so' => 'som',\n\t\t\t'sr' => 'sur',\n\t\t\t'st' => 'stp',\n\t\t\t'sv' => 'slv',\n\t\t\t'sy' => 'syr',\n\t\t\t'sz' => 'swz',\n\t\t\t'td' => 'cha',\n\t\t\t'tg' => 'tog',\n\t\t\t'th' => 'tha',\n\t\t\t'tj' => 'tjk',\n\t\t\t'tl' => 'tls',\n\t\t\t'tm' => 'tkm',\n\t\t\t'tn' => 'tun',\n\t\t\t'to' => 'tga',\n\t\t\t'tr' => 'tur',\n\t\t\t'tt' => 'tri',\n\t\t\t'tv' => 'tuv',\n\t\t\t'tw' => 'tpw',\n\t\t\t'tz' => 'tan',\n\t\t\t'ua' => 'ukr',\n\t\t\t'uk' => 'gbr',\n\t\t\t'ug' => 'uga',\n\t\t\t'us' => 'usa',\n\t\t\t'uy' => 'uru',\n\t\t\t'uz' => 'uzb',\n\t\t\t'va' => 'vat',\n\t\t\t'vc' => 'vin',\n\t\t\t've' => 'ven',\n\t\t\t'vn' => 'vie',\n\t\t\t'vu' => 'van',\n\t\t\t'wl' => 'wal',\n\t\t\t'ws' => 'sam',\n\t\t\t'ye' => 'yem',\n\t\t\t'za' => 'rsa',\n\t\t\t'zm' => 'zam',\n\t\t\t'zw' => 'zim',\n\t\t);\n\n\t\tforeach ( $continents as $continent => $codes ) :\n\t\t\t$countries = array_intersect_key( $this->countries, array_flip( $codes ) );\n\t\t\tasort( $countries );\n\t\t\t$continents[ $continent ] = $countries;\n\t\tendforeach;\n\n\t\t$this->continents = apply_filters( 'sportspress_continents', $continents );\n\t}\n\n\t/**\n\t * Get the base country.\n\t *\n\t * @access public\n\t * @return string\n\t */\n\tpublic function get_base_country() {\n\t\t$default = get_option( 'sportspress_default_country' );\n\t\t$country = ( ( $pos = strrpos( $default, ':' ) ) === false ) ? $default : substr( $default, 0, $pos );\n\n\t\treturn apply_filters( 'sportspress_countries_base_country', $country );\n\t}\n\n\n\t/**\n\t * Outputs the list of continents and countries for use in dropdown boxes.\n\t *\n\t * @access public\n\t * @param string $selected_country (default: '')\n\t * @param bool   $escape (default: false)\n\t * @return void\n\t */\n\tpublic function country_dropdown_options( $selected_country = '', $escape = false ) {\n\t\tif ( $this->continents ) {\n\t\t\tforeach ( $this->continents as $continent => $countries ) :\n\t\t\t\t?>\n\t\t\t\t<optgroup label=\"<?php echo esc_attr( $continent ); ?>\">\n\t\t\t\t\t<?php foreach ( $countries as $code => $country ) : ?>\n\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $code ); ?>\" <?php selected( $selected_country, $code ); ?>><?php echo esc_html( $country ); ?></option>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</optgroup>\n\t\t\t\t<?php\n\t\tendforeach;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-event.php",
    "content": "<?php\n/**\n * Event Class\n *\n * The SportsPress event class handles individual event data.\n *\n * @class       SP_Event\n * @version     2.7.9\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Event extends SP_Custom_Post {\n\n\tpublic function status() {\n\t\t$post_status = $this->post->post_status;\n\t\t$results     = get_post_meta( $this->ID, 'sp_results', true );\n\t\tif ( is_array( $results ) ) {\n\t\t\tforeach ( $results as $result ) {\n\t\t\t\t$result = is_array( $result ) ? array_filter( $result ) : array();\n\t\t\t\tif ( count( $result ) > 0 ) {\n\t\t\t\t\treturn 'results';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $post_status;\n\t}\n\n\tpublic function format() {\n\t\t$format = get_post_meta( $this->ID, 'sp_format', true );\n\t\treturn $format;\n\t}\n\n\tpublic function day() {\n\t\t$day = get_post_meta( $this->ID, 'sp_day', true );\n\t\treturn $day;\n\t}\n\n\tpublic function mode() {\n\t\t$mode = get_post_meta( $this->ID, 'sp_mode', true );\n\t\treturn $mode;\n\t}\n\n\tpublic function minutes() {\n\t\t$minutes = get_post_meta( $this->ID, 'sp_minutes', true );\n\t\tif ( '' === $minutes ) {\n\t\t\t$minutes = get_option( 'sportspress_event_minutes', 90 );\n\t\t}\n\t\treturn $minutes;\n\t}\n\n\tpublic function results( $admin = false ) {\n\t\t$teams   = (array) get_post_meta( $this->ID, 'sp_team', false );\n\t\t$results = (array) get_post_meta( $this->ID, 'sp_results', true );\n\n\t\t// Get columns from result variables\n\t\t$columns = sp_get_var_labels( 'sp_result' );\n\n\t\t// Get result columns to display\n\t\t$usecolumns = get_post_meta( $this->ID, 'sp_result_columns', true );\n\n\t\t// Get results for all teams\n\t\t$data = sp_array_combine( $teams, $results, true );\n\n\t\tif ( $admin ) :\n\t\t\treturn array( $columns, $usecolumns, $data );\n\t\telse :\n\t\t\t// Add outcome to result columns\n\t\t\t$columns['outcome'] = esc_attr__( 'Outcome', 'sportspress' );\n\t\t\tif ( is_array( $usecolumns ) ) :\n\t\t\t\tif ( 'manual' == get_option( 'sportspress_event_result_columns', 'auto' ) ) :\n\t\t\t\t\tforeach ( $columns as $key => $label ) :\n\t\t\t\t\t\tif ( ! in_array( $key, $usecolumns ) ) :\n\t\t\t\t\t\t\tunset( $columns[ $key ] );\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendforeach;\n\t\t\t\telse :\n\t\t\t\t\t$active_columns = array();\n\t\t\t\t\tforeach ( $data as $team_results ) :\n\t\t\t\t\t\tforeach ( $team_results as $key => $result ) :\n\t\t\t\t\t\t\tif ( is_string( $result ) && strlen( $result ) ) :\n\t\t\t\t\t\t\t\t$active_columns[ $key ] = $key;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendforeach;\n\t\t\t\t\t$columns = array_intersect_key( $columns, $active_columns );\n\t\t\t\tendif;\n\n\t\t\t\tif ( 'yes' == get_option( 'sportspress_event_show_outcome', 'no' ) ) :\n\t\t\t\t\t$columns['outcome'] = esc_attr__( 'Outcome', 'sportspress' );\n\t\t\t\tendif;\n\t\t\tendif;\n\t\t\t$data[0] = $columns;\n\t\t\treturn $data;\n\t\tendif;\n\t}\n\n\tpublic function performance( $admin = false ) {\n\t\t$teams       = get_post_meta( $this->ID, 'sp_team', false );\n\t\t$performance = (array) get_post_meta( $this->ID, 'sp_players', true );\n\n\t\t$args = array(\n\t\t\t'post_type'      => 'sp_performance',\n\t\t\t'numberposts'    => 100,\n\t\t\t'posts_per_page' => 100,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\n\t\t$vars = get_posts( $args );\n\n\t\t$labels    = array();\n\t\t$formats   = array();\n\t\t$timed     = array();\n\t\t$stars     = array();\n\t\t$equations = array();\n\t\tforeach ( $vars as $var ) {\n\t\t\t$labels[ $var->post_name ] = $var->post_title;\n\n\t\t\t$format = get_post_meta( $var->ID, 'sp_format', true );\n\t\t\tif ( '' === $format ) {\n\t\t\t\t$format = 'number';\n\t\t\t}\n\t\t\t$formats[ $var->post_name ] = $format;\n\n\t\t\tif ( 'number' === $format ) {\n\t\t\t\t$is_timed = get_post_meta( $var->ID, 'sp_timed', true );\n\t\t\t\tif ( '' === $is_timed || $is_timed ) {\n\t\t\t\t\t$timed[] = $var->post_name;\n\t\t\t\t}\n\t\t\t} elseif ( 'equation' === $format ) {\n\t\t\t\t$equation  = get_post_meta( $var->ID, 'sp_equation', true );\n\t\t\t\t$precision = get_post_meta( $var->ID, 'sp_precision', true );\n\n\t\t\t\tif ( empty( $equation ) ) {\n\t\t\t\t\t$equation = 0;\n\t\t\t\t}\n\t\t\t\tif ( empty( $precision ) ) {\n\t\t\t\t\t$precision = 0;\n\t\t\t\t}\n\n\t\t\t\t$equations[ $var->post_name ] = array(\n\t\t\t\t\t'equation'  => $equation,\n\t\t\t\t\t'precision' => $precision,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$order = (array) get_post_meta( $this->ID, 'sp_order', true );\n\n\t\tif ( get_option( 'sportspress_event_performance_stars_type', 0 ) ) {\n\t\t\t$stars = (array) get_post_meta( $this->ID, 'sp_stars', true );\n\t\t}\n\n\t\t$labels  = apply_filters( 'sportspress_event_performance_labels', $labels, $this );\n\t\t$columns = get_post_meta( $this->ID, 'sp_columns', true );\n\t\tif ( is_array( $teams ) ) :\n\t\t\tforeach ( $teams as $i => $team_id ) :\n\t\t\t\t$players = sp_array_between( (array) get_post_meta( $this->ID, 'sp_player', false ), 0, $i );\n\t\t\t\t$data    = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );\n\n\t\t\t\tforeach ( $data as $player_id => $player_performance ) :\n\t\t\t\t\tif ( ! $player_id ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! array_key_exists( 'number', $player_performance ) ) :\n\t\t\t\t\t\t$performance[ $team_id ][ $player_id ]['number'] = apply_filters( 'sportspress_event_performance_default_squad_number', get_post_meta( $player_id, 'sp_number', true ) );\n\t\t\t\t\tendif;\n\t\t\t\t\tif ( ! array_key_exists( 'position', $player_performance ) || $player_performance['position'] == null ) :\n\t\t\t\t\t\t$performance[ $team_id ][ $player_id ]['position'] = sp_get_the_term_id( $player_id, 'sp_position', null );\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tif ( $admin ) :\n\t\t\treturn array( $labels, $columns, $performance, $teams, $formats, $order, $timed, $stars );\n\t\telse :\n\t\t\t// Add position to performance labels\n\t\t\tif ( taxonomy_exists( 'sp_position' ) ) :\n\t\t\t\t$labels = array_merge( array( 'position' => esc_attr__( 'Position', 'sportspress' ) ), $labels );\n\t\t\tendif;\n\t\t\tif ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) && is_array( $columns ) ) :\n\t\t\t\tforeach ( $labels as $key => $label ) :\n\t\t\t\t\tif ( ! in_array( $key, $columns ) ) :\n\t\t\t\t\t\tunset( $labels[ $key ] );\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\tif ( 'no' == get_option( 'sportspress_event_show_position', 'yes' ) ) :\n\t\t\t\tunset( $labels['position'] );\n\t\t\tendif;\n\t\t\tif ( 'no' == get_option( 'sportspress_event_show_player_numbers', 'yes' ) ) :\n\t\t\t\tunset( $labels['number'] );\n\t\t\tendif;\n\n\t\t\t// Calculate equation-based performance\n\t\t\tif ( sizeof( $equations ) ) :\n\t\t\t\tforeach ( $performance as $team => $players ) :\n\t\t\t\t\tif ( ! is_array( $players ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $players as $player => $player_performance ) :\n\t\t\t\t\t\tif ( ! is_array( $player_performance ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Prepare existing values for equation calculation\n\t\t\t\t\t\t$vars = $player_performance;\n\n\t\t\t\t\t\tforeach ( $vars as $key => $var ) :\n\t\t\t\t\t\t\tif ( empty( $var ) ) {\n\t\t\t\t\t\t\t\t$vars[ $key ] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t$vars = array_merge( $vars, array( 'eventsplayed' => 1 ) );\n\n\t\t\t\t\t\tforeach ( $equations as $key => $equation ) :\n\t\t\t\t\t\t\t$performance[ $team ][ $player ][ $key ] = sp_solve( $equation['equation'], $vars, $equation['precision'] );\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\t// Convert to time notation\n\t\t\tif ( in_array( 'time', $formats ) ) :\n\t\t\t\tforeach ( $performance as $team => $players ) :\n\t\t\t\t\tif ( ! is_array( $players ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $players as $player => $player_performance ) :\n\t\t\t\t\t\tif ( ! $player ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ( $player_performance as $performance_key => $performance_value ) :\n\n\t\t\t\t\t\t\t// Continue if not time format\n\t\t\t\t\t\t\tif ( 'time' !== sp_array_value( $formats, $performance_key ) ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$intval  = intval( $performance_value );\n\t\t\t\t\t\t\t$timeval = gmdate( 'i:s', $intval );\n\t\t\t\t\t\t\t$hours   = floor( $intval / 3600 );\n\n\t\t\t\t\t\t\tif ( '00' != $hours ) {\n\t\t\t\t\t\t\t\t$timeval = $hours . ':' . $timeval;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$timeval = preg_replace( '/^0/', '', $timeval );\n\n\t\t\t\t\t\t\t$performance[ $team ][ $player ][ $performance_key ] = $timeval;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\t// Add minutes to box score values\n\t\t\tif ( in_array( 'number', $formats ) && 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'no' ) ) :\n\t\t\t\t$timeline = $this->timeline();\n\t\t\t\tif ( ! empty( $timeline ) ) :\n\t\t\t\t\tforeach ( $performance as $team => $players ) :\n\n\t\t\t\t\t\t// Get team timeline\n\t\t\t\t\t\t$team_timeline = sp_array_value( $timeline, $team, array() );\n\t\t\t\t\t\tif ( empty( $team_timeline ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ( $players as $player => $player_performance ) :\n\t\t\t\t\t\t\tif ( ! $player ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Get player timeline\n\t\t\t\t\t\t\t$player_timeline = sp_array_value( $team_timeline, $player, array() );\n\t\t\t\t\t\t\tif ( empty( $player_timeline ) ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach ( $player_performance as $performance_key => $performance_value ) :\n\n\t\t\t\t\t\t\t\t// Continue if not timed\n\t\t\t\t\t\t\t\tif ( ! in_array( $performance_key, $timed ) ) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Get performance times\n\t\t\t\t\t\t\t\t$times = sp_array_value( $player_timeline, $performance_key, array() );\n\t\t\t\t\t\t\t\t$times = array_filter( $times );\n\t\t\t\t\t\t\t\tif ( empty( $times ) ) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$performance[ $team ][ $player ][ $performance_key ] .= ' (' . implode( '\\', ', $times ) . '\\')';\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\t\t// Add labels to box score\n\t\t\t$performance[0] = $labels;\n\n\t\t\treturn apply_filters( 'sportspress_get_event_performance', $performance );\n\t\tendif;\n\t}\n\n\tpublic function timeline( $admin = false, $linear = false ) {\n\t\t$timeline = (array) get_post_meta( $this->ID, 'sp_timeline', true );\n\n\t\tif ( ! $linear ) {\n\t\t\treturn $timeline;\n\t\t}\n\n\t\t$performance = (array) get_post_meta( $this->ID, 'sp_players', true );\n\t\tif ( empty( $timeline ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$stats            = array();\n\t\t$player_ids       = array();\n\t\t$performance_keys = array();\n\n\t\t// Clean up timeline\n\t\tforeach ( $timeline as $team => $players ) {\n\t\t\tif ( ! $team ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Set home team\n\t\t\tif ( ! isset( $home_team ) ) {\n\t\t\t\t$home_team = $team;\n\t\t\t}\n\n\t\t\t// Determine side\n\t\t\tif ( $home_team === $team ) {\n\t\t\t\t$side = 'home';\n\t\t\t} else {\n\t\t\t\t$side = 'away';\n\t\t\t}\n\n\t\t\t$stats[] = array(\n\t\t\t\t'time' => -1,\n\t\t\t\t'id'   => $team,\n\t\t\t\t'team' => $team,\n\t\t\t\t'side' => $side,\n\t\t\t\t'key'  => 'team',\n\t\t\t);\n\n\t\t\tif ( ! is_array( $players ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( $players as $player => $keys ) {\n\t\t\t\tif ( ! $player ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! is_array( $keys ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$player_ids[] = $player;\n\n\t\t\t\tforeach ( $keys as $key => $times ) {\n\t\t\t\t\tif ( ! is_array( $times ) || empty( $times ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $times as $time ) {\n\t\t\t\t\t\tif ( '' === $time ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$entry = array(\n\t\t\t\t\t\t\t'time' => $time,\n\t\t\t\t\t\t\t'id'   => $player,\n\t\t\t\t\t\t\t'team' => $team,\n\t\t\t\t\t\t\t'side' => $side,\n\t\t\t\t\t\t\t'key'  => $key,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( 'sub' === $key ) {\n\t\t\t\t\t\t\t$sub          = sp_array_value( sp_array_value( sp_array_value( $performance, $team ), $player ), 'sub', 0 );\n\t\t\t\t\t\t\t$entry['sub'] = $sub;\n\t\t\t\t\t\t\t$player_ids[] = $sub;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$stats[] = $entry;\n\t\t\t\t\t}\n\n\t\t\t\t\t$performance_keys[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Filter out duplicate player IDs and performance keys\n\t\t$player_ids       = array_unique( $player_ids );\n\t\t$performance_keys = array_unique( $performance_keys );\n\n\t\t// Get player names and numbers\n\t\t$posts = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type'      => 'sp_player',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'post__in'       => $player_ids,\n\t\t\t)\n\t\t);\n\n\t\t$player_names   = array();\n\t\t$player_numbers = array();\n\n\t\tif ( $posts ) {\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t$player_names[ $post->ID ]   = $post->post_title;\n\t\t\t\t$player_numbers[ $post->ID ] = get_post_meta( $post->ID, 'sp_number', true );\n\t\t\t}\n\t\t}\n\n\t\t// Get performance labels and icons\n\t\t$posts = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type'      => 'sp_performance',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'post_name__in'  => $performance_keys,\n\t\t\t)\n\t\t);\n\n\t\t$performance_labels = array();\n\t\t$performance_icons  = array();\n\n\t\tif ( $posts ) {\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t$performance_labels[ $post->post_name ] = $post->post_title;\n\n\t\t\t\t$icon = '';\n\t\t\t\tif ( has_post_thumbnail( $post->ID ) ) {\n\t\t\t\t\t$icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post->ID ) ) );\n\t\t\t\t}\n\t\t\t\t$performance_icons[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );\n\t\t\t}\n\t\t}\n\n\t\t// Add missing info to stats\n\t\tforeach ( $stats as $index => $details ) {\n\t\t\t$stats[ $index ]['name']   = sp_array_value( $player_names, $details['id'] );\n\t\t\t$stats[ $index ]['number'] = sp_array_value( $player_numbers, $details['id'] );\n\n\t\t\tif ( 'team' === $details['key'] ) {\n\t\t\t\t$name                     = sp_team_short_name( $details['team'] );\n\t\t\t\t$stats[ $index ]['name']  = $name;\n\t\t\t\t$stats[ $index ]['label'] = $name;\n\t\t\t\t$stats[ $index ]['icon']  = sp_get_logo( $details['team'] );\n\t\t\t} elseif ( 'sub' === $details['key'] ) {\n\t\t\t\t$sub_name   = sp_array_value( $player_names, $details['sub'], esc_attr__( 'Substitute', 'sportspress' ) );\n\t\t\t\t$sub_number = sp_array_value( $player_numbers, $details['sub'] );\n\n\t\t\t\tif ( '' !== $sub_number ) {\n\t\t\t\t\t$icon_title = $sub_number . '. ' . $sub_name;\n\t\t\t\t} else {\n\t\t\t\t\t$icon_title = $sub_name;\n\t\t\t\t}\n\n\t\t\t\t$stats[ $index ]['sub_name']   = $sub_name;\n\t\t\t\t$stats[ $index ]['sub_number'] = $sub_number;\n\t\t\t\t$stats[ $index ]['label']      = esc_attr__( 'Substitute', 'sportspress' );\n\t\t\t\t$stats[ $index ]['icon']       = '<i class=\"sp-icon-sub\" title=\"' . $icon_title . '\"></i>';\n\t\t\t} else {\n\t\t\t\t$stats[ $index ]['label'] = sp_array_value( $performance_labels, $details['key'] );\n\t\t\t\t$stats[ $index ]['icon']  = sp_array_value( $performance_icons, $details['key'] );\n\t\t\t}\n\t\t}\n\n\t\tusort( $stats, array( $this, 'sort_timeline' ) );\n\n\t\treturn $stats;\n\t}\n\n\tpublic function main_results() {\n\t\t// Get main result option\n\t\t$main_result = get_option( 'sportspress_primary_result', null );\n\n\t\t// Get teams from event\n\t\t$teams = get_post_meta( $this->ID, 'sp_team', false );\n\n\t\t// Initialize output\n\t\t$output = array();\n\n\t\t// Return empty array if there are no teams\n\t\tif ( ! $teams ) {\n\t\t\treturn $output;\n\t\t}\n\n\t\t// Get results from event\n\t\t$results = get_post_meta( $this->ID, 'sp_results', true );\n\n\t\t// Loop through teams\n\t\tforeach ( $teams as $team_id ) {\n\n\t\t\t// Skip if not a team\n\t\t\tif ( ! $team_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get team results from all results\n\t\t\t$team_results = sp_array_value( $results, $team_id, null );\n\n\t\t\t// Get main or last result\n\t\t\tif ( $main_result ) {\n\n\t\t\t\t// Get main result from team results\n\t\t\t\t$team_result = sp_array_value( $team_results, $main_result, null );\n\t\t\t} else {\n\n\t\t\t\t// If there are any team results available\n\t\t\t\tif ( is_array( $team_results ) ) {\n\n\t\t\t\t\t// Get last result that is not outcome\n\t\t\t\t\tunset( $team_results['outcome'] );\n\t\t\t\t\t$team_result = end( $team_results );\n\t\t\t\t} else {\n\n\t\t\t\t\t// Give team null result\n\t\t\t\t\t$team_result = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( null != $team_result ) {\n\t\t\t\t$output[] = $team_result;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\tpublic function outcome( $single = true ) {\n\t\t// Get teams from event\n\t\t$teams = get_post_meta( $this->ID, 'sp_team', false );\n\n\t\t// Initialize output\n\t\t$output = array();\n\n\t\t// Return empty array if there are no teams\n\t\tif ( ! $teams ) {\n\t\t\treturn $output;\n\t\t}\n\n\t\t// Get results from event\n\t\t$results = get_post_meta( $this->ID, 'sp_results', true );\n\n\t\t// Loop through teams\n\t\tforeach ( $teams as $team_id ) {\n\n\t\t\t// Skip if not a team\n\t\t\tif ( ! $team_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get team results from all results\n\t\t\t$team_results = sp_array_value( $results, $team_id, null );\n\n\t\t\t// Get outcome from team results\n\t\t\t$team_outcome = sp_array_value( $team_results, 'outcome', null );\n\n\t\t\tif ( null != $team_outcome ) {\n\n\t\t\t\t// Make sure that we have an array of outcomes\n\t\t\t\t$team_outcome = (array) $team_outcome;\n\n\t\t\t\t// Use only first outcome if single\n\t\t\t\tif ( $single ) {\n\t\t\t\t\t$team_outcome = reset( $team_outcome );\n\t\t\t\t}\n\n\t\t\t\t// Add outcome to output\n\t\t\t\t$output[ $team_id ] = $team_outcome;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\tpublic function winner() {\n\t\t// Get the first configured outcome\n\t\t$outcome = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t'post_status'    => 'publish',\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t)\n\t\t);\n\n\t\t// Return if no outcomes available\n\t\tif ( ! $outcome ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$outcome = reset( $outcome );\n\n\t\t// Get event outcomes\n\t\t$outcomes = self::outcome( false );\n\n\t\t// Look for a team that meets the criteria\n\t\tforeach ( $outcomes as $team_id => $team_outcomes ) {\n\t\t\tif ( in_array( $outcome->post_name, $team_outcomes ) ) {\n\t\t\t\treturn $team_id;\n\t\t\t}\n\t\t}\n\n\t\t// Return if no teams meet criteria\n\t\treturn null;\n\t}\n\n\tpublic function appointments( $include_empty = false, $placeholder = '-' ) {\n\t\t$officials = (array) get_post_meta( $this->ID, 'sp_officials', true );\n\t\t$officials = array_filter( $officials );\n\n\t\tif ( ! $include_empty && empty( $officials ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$duties = get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy'   => 'sp_duty',\n\t\t\t\t'hide_empty' => false,\n\t\t\t\t'orderby'    => 'meta_value_num',\n\t\t\t\t'meta_query' => array(\n\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t\tif ( ! is_array( $duties ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\tif ( ! $include_empty && empty( $duties ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$labels       = array();\n\t\t$appointments = array();\n\n\t\tforeach ( $duties as $duty ) {\n\t\t\t$duty_appointments = sp_array_value( $officials, $duty->term_id, array() );\n\n\t\t\tif ( ! $include_empty && empty( $duty_appointments ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$appointed_officials = array();\n\n\t\t\tforeach ( $duty_appointments as $duty_appointment ) {\n\t\t\t\t$appointed_officials[ $duty_appointment ] = get_the_title( $duty_appointment );\n\t\t\t}\n\n\t\t\tif ( $include_empty && empty( $appointed_officials ) ) {\n\t\t\t\t$appointed_officials[] = $placeholder;\n\t\t\t}\n\n\t\t\t$appointments[ $duty->slug ] = $appointed_officials;\n\t\t\t$labels[ $duty->slug ]       = $duty->name;\n\t\t}\n\n\t\t$appointments[0] = $labels;\n\n\t\treturn $appointments;\n\t}\n\n\tpublic function update_main_results( $results ) {\n\t\t$main_result = sp_get_main_result_option();\n\n\t\tif ( ! $this->ID || ! is_array( $results ) || null === $main_result ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get current results meta\n\t\t$meta = (array) get_post_meta( $this->ID, 'sp_results', true );\n\n\t\t$primary_results = array();\n\t\tforeach ( $results as $id => $result ) {\n\t\t\t$primary_results[ $id ] = $result;\n\n\t\t\tif ( ! $id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$meta[ $id ][ $main_result ] = $result;\n\t\t}\n\n\t\tarsort( $primary_results );\n\n\t\tif ( count( $primary_results ) && ! in_array( null, $primary_results ) ) {\n\t\t\tif ( count( array_unique( $primary_results ) ) === 1 ) {\n\t\t\t\t$args     = array(\n\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'meta_key'       => 'sp_condition',\n\t\t\t\t\t'meta_value'     => '=',\n\t\t\t\t);\n\t\t\t\t$outcomes = get_posts( $args );\n\t\t\t\tforeach ( $meta as $team => $team_results ) {\n\t\t\t\t\tif ( $outcomes ) {\n\t\t\t\t\t\tif ( empty( $meta[ $team ] ) ) {\n\t\t\t\t\t\t\t$meta[ $team ] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$meta[ $team ]['outcome'] = array();\n\t\t\t\t\t\tforeach ( $outcomes as $outcome ) {\n\t\t\t\t\t\t\t$meta[ $team ]['outcome'][] = $outcome->post_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Get default outcomes\n\t\t\t\t$args             = array(\n\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'meta_key'       => 'sp_condition',\n\t\t\t\t\t'meta_value'     => 'else',\n\t\t\t\t);\n\t\t\t\t$default_outcomes = get_posts( $args );\n\n\t\t\t\t// Get greater than outcomes\n\t\t\t\t$args        = array(\n\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_condition',\n\t\t\t\t\t\t\t'value'   => '&gt;',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_condition',\n\t\t\t\t\t\t\t'value'   => '>',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\t$gt_outcomes = get_posts( $args );\n\t\t\t\tif ( empty( $gt_outcomes ) ) {\n\t\t\t\t\t$gt_outcomes = $default_outcomes;\n\t\t\t\t}\n\n\t\t\t\t// Get less than outcomes\n\t\t\t\t$args        = array(\n\t\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_condition',\n\t\t\t\t\t\t\t'value'   => '&lt;',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_condition',\n\t\t\t\t\t\t\t'value'   => '<',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\t$lt_outcomes = get_posts( $args );\n\t\t\t\tif ( empty( $lt_outcomes ) ) {\n\t\t\t\t\t$lt_outcomes = $default_outcomes;\n\t\t\t\t}\n\n\t\t\t\t// Get min and max values\n\t\t\t\t$min = min( $primary_results );\n\t\t\t\t$max = max( $primary_results );\n\n\t\t\t\tforeach ( $primary_results as $key => $value ) {\n\t\t\t\t\tif ( $min == $value ) {\n\t\t\t\t\t\t$outcomes = $lt_outcomes;\n\t\t\t\t\t} elseif ( $max == $value ) {\n\t\t\t\t\t\t$outcomes = $gt_outcomes;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$outcomes = $default_outcomes;\n\t\t\t\t\t}\n\t\t\t\t\t$meta[ $key ]['outcome'] = array();\n\t\t\t\t\tforeach ( $outcomes as $outcome ) {\n\t\t\t\t\t\t$meta[ $key ]['outcome'][] = $outcome->post_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update results\n\t\tupdate_post_meta( $this->ID, 'sp_results', $meta );\n\t}\n\n\tpublic function stars() {\n\t\treturn get_post_meta( $this->ID, 'sp_stars', true );\n\t}\n\n\tpublic function lineup_filter( $v ) {\n\t\treturn sp_array_value( $v, 'status', 'lineup' ) == 'lineup';\n\t}\n\n\tpublic function sub_filter( $v ) {\n\t\treturn sp_array_value( $v, 'status', 'lineup' ) == 'sub';\n\t}\n\n\tpublic function sort_timeline( $a, $b ) {\n\t\treturn (float) $a['time'] - (float) $b['time'];\n\t}\n\n\t/**\n\t * Returns formatted event specs\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function specs( $neg = null ) {\n\t\t$specs       = (array) get_post_meta( $this->ID, 'sp_specs', true );\n\t\t$spec_labels = (array) sp_get_var_labels( 'sp_spec', $neg, false );\n\t\t$data        = array();\n\n\t\tforeach ( $spec_labels as $key => $value ) :\n\t\t\t$spec = sp_array_value( $specs, $key, null );\n\t\t\tif ( $spec == null ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$data[ $value ] = sp_array_value( $specs, $key, '&nbsp;' );\n\t\tendforeach;\n\t\treturn $data;\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-feeds.php",
    "content": "<?php\n/**\n * SportsPress Feeds Class\n *\n * @class       SP_Feeds\n * @version     2.6.5\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Feeds {\n\n\t/** @var array Array of feeds */\n\tprivate $data;\n\n\t/**\n\t * Constructor for the feeds class - defines all preset feeds.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function __construct() {\n\t\t$data = array(\n\t\t\t'calendar' => array(\n\t\t\t\t'ical' => array(\n\t\t\t\t\t'apple'   => array(\n\t\t\t\t\t\t'name'     => esc_attr__( 'Apple Calendar', 'sportspress' ),\n\t\t\t\t\t\t'protocol' => 'webcal',\n\t\t\t\t\t),\n\t\t\t\t\t'outlook' => array(\n\t\t\t\t\t\t'name'     => esc_attr__( 'Outlook', 'sportspress' ),\n\t\t\t\t\t\t'protocol' => 'webcal',\n\t\t\t\t\t),\n\t\t\t\t\t'google'  => array(\n\t\t\t\t\t\t'name'     => esc_attr__( 'Google', 'sportspress' ),\n\t\t\t\t\t\t'protocol' => 'webcal',\n\t\t\t\t\t\t'prefix'   => 'http://www.google.com/calendar/render?cid=',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->data = apply_filters( 'sportspress_feeds', $data );\n\n\t\tforeach ( $data as $post_type => $feeds ) {\n\t\t\tforeach ( $feeds as $slug => $formats ) {\n\t\t\t\tadd_feed( 'sp-' . $slug, array( $this, $slug . '_feed' ) );\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function __get( $key ) {\n\t\treturn ( array_key_exists( $key, $this->data ) ? $this->data[ $key ] : null );\n\t}\n\n\tpublic function __set( $key, $value ) {\n\t\t$this->data[ $key ] = $value;\n\t}\n\n\tpublic static function ical_feed() {\n\t\t$feed_template = SP()->plugin_path() . '/feeds/ical.php';\n\t\tload_template( $feed_template );\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-formats.php",
    "content": "<?php\n/**\n * SportsPress formats\n *\n * The SportsPress formats class stores preset sport data.\n *\n * @class       SP_Formats\n * @version   2.4\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Formats {\n\n\t/** @var array Array of formats */\n\tprivate $data;\n\n\t/**\n\t * Constructor for the formats class - defines all preset formats.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function __construct() {\n\t\t$this->data = apply_filters(\n\t\t\t'sportspress_formats',\n\t\t\tarray(\n\t\t\t\t'event'    => array(\n\t\t\t\t\t'league'   => esc_attr__( 'Competitive', 'sportspress' ),\n\t\t\t\t\t'friendly' => esc_attr__( 'Friendly', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t'calendar' => array(\n\t\t\t\t\t'calendar' => esc_attr__( 'Calendar', 'sportspress' ),\n\t\t\t\t\t'list'     => esc_attr__( 'List', 'sportspress' ),\n\t\t\t\t\t'blocks'   => esc_attr__( 'Blocks', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t'table'    => array(\n\t\t\t\t\t'standings' => esc_attr__( 'Standings', 'sportspress' ),\n\t\t\t\t\t'gallery'   => esc_attr__( 'Gallery', 'sportspress' ),\n\t\t\t\t),\n\t\t\t\t'list'     => array(\n\t\t\t\t\t'list'    => esc_attr__( 'List', 'sportspress' ),\n\t\t\t\t\t'gallery' => esc_attr__( 'Gallery', 'sportspress' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}\n\n\tpublic function __get( $key ) {\n\t\treturn ( array_key_exists( $key, $this->data ) ? $this->data[ $key ] : null );\n\t}\n\n\tpublic function __set( $key, $value ) {\n\t\t$this->data[ $key ] = $value;\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-frontend-scripts.php",
    "content": "<?php\n/**\n * Handle frontend forms\n *\n * @class       SP_Frontend_Scripts\n * @version   2.6.8\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Frontend_Scripts {\n\n\tpublic $theme;\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'load_scripts' ) );\n\t\tadd_action( 'wp_print_scripts', array( $this, 'check_jquery' ), 25 );\n\t}\n\n\t/**\n\t * Get styles for the frontend\n\t *\n\t * @return array\n\t */\n\tpublic static function get_styles() {\n\t\t$styles = array(\n\t\t\t'sportspress-general' => array(\n\t\t\t\t'src'     => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress.css',\n\t\t\t\t'deps'    => '',\n\t\t\t\t'version' => SP_VERSION,\n\t\t\t\t'media'   => 'all',\n\t\t\t),\n\t\t);\n\n\t\tif ( is_rtl() ) :\n\t\t\t$styles['sportspress-rtl'] = array(\n\t\t\t\t'src'     => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-rtl.css',\n\t\t\t\t'deps'    => '',\n\t\t\t\t'version' => SP_VERSION,\n\t\t\t\t'media'   => 'all',\n\t\t\t);\n\t\tendif;\n\n\t\treturn apply_filters( 'sportspress_enqueue_styles', $styles );\n\t}\n\n\t/**\n\t * Add theme-specific styles to the frontend\n\t *\n\t * @return array\n\t */\n\tpublic function add_theme_styles( $styles ) {\n\t\treturn array_merge(\n\t\t\t$styles,\n\t\t\tarray(\n\t\t\t\t'sportspress-' . $this->theme => array(\n\t\t\t\t\t'src'     => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/themes/' . $this->theme . '.css',\n\t\t\t\t\t'deps'    => '',\n\t\t\t\t\t'version' => SP_VERSION,\n\t\t\t\t\t'media'   => 'all',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Register/queue frontend scripts.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function load_scripts() {\n\t\tglobal $typenow;\n\t\t// Scripts\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'jquery-datatables', plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/js/jquery.dataTables.min.js', array( 'jquery' ), '1.10.4', true );\n\t\twp_enqueue_script( 'sportspress', plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/js/sportspress.js', array( 'jquery' ), SP()->version, true );\n\n\t\t// Localize scripts\n\t\twp_localize_script(\n\t\t\t'sportspress',\n\t\t\t'localized_strings',\n\t\t\tarray(\n\t\t\t\t'days'     => esc_attr__( 'days', 'sportspress' ),\n\t\t\t\t'hrs'      => esc_attr__( 'hrs', 'sportspress' ),\n\t\t\t\t'mins'     => esc_attr__( 'mins', 'sportspress' ),\n\t\t\t\t'secs'     => esc_attr__( 'secs', 'sportspress' ),\n\t\t\t\t'previous' => esc_attr__( 'Previous', 'sportspress' ),\n\t\t\t\t'next'     => esc_attr__(\n\t\t\t\t\t'Next',\n\t\t\t\t\t'sportspress'\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Theme styles\n\t\t$theme       = wp_get_theme();\n\t\t$this->theme = $theme->stylesheet;\n\t\t$dir         = scandir( SP()->plugin_path() . '/assets/css/themes' );\n\t\t$files       = array();\n\t\tif ( $dir ) {\n\t\t\tforeach ( $dir as $key => $value ) {\n\t\t\t\tif ( preg_replace( '/\\\\.[^.\\\\s]{3,4}$/', '', $value ) == $this->theme ) {\n\t\t\t\t\tadd_filter( 'sportspress_enqueue_styles', array( $this, 'add_theme_styles' ) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// CSS Styles\n\t\twp_enqueue_style( 'dashicons' );\n\t\t$enqueue_styles = $this->get_styles();\n\n\t\tif ( $enqueue_styles ) :\n\t\t\tadd_action( 'wp_print_scripts', array( $this, 'custom_css' ), 30 );\n\t\t\tforeach ( $enqueue_styles as $handle => $args ) {\n\t\t\t\twp_enqueue_style( $handle, $args['src'], $args['deps'], $args['version'], $args['media'] );\n\t\t\t}\n\t\tendif;\n\t}\n\n\t/**\n\t * SP requires jQuery 1.8 since it uses functions like .on() for events and .parseHTML.\n\t * If, by the time wp_print_scrips is called, jQuery is outdated (i.e not\n\t * using the version in core) we need to deregister it and register the\n\t * core version of the file.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function check_jquery() {\n\t\tglobal $wp_scripts;\n\n\t\t// Enforce minimum version of jQuery\n\t\tif ( ! empty( $wp_scripts->registered['jquery']->ver ) && ! empty( $wp_scripts->registered['jquery']->src ) && 0 >= version_compare( $wp_scripts->registered['jquery']->ver, '1.8' ) ) {\n\t\t\twp_deregister_script( 'jquery' );\n\t\t\twp_register_script( 'jquery', '/wp-includes/js/jquery/jquery.js', array(), '1.8' );\n\t\t\twp_enqueue_script( 'jquery' );\n\t\t}\n\t}\n\n\t/**\n\t * Output custom CSS.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function custom_css() {\n\t\t$colors = array_map( 'esc_attr', (array) get_option( 'themeboy', array() ) );\n\n\t\t$custom  = get_option( 'sportspress_custom_css', null );\n\t\t$align   = get_option( 'sportspress_table_text_align', 'default' );\n\t\t$padding = get_option( 'sportspress_table_padding', null );\n\n\t\t$offset = get_option( 'sportspress_header_offset', '' );\n\t\tif ( $offset === '' ) {\n\t\t\t$template = get_option( 'template' );\n\t\t\t$offset   = ( 'twentyfourteen' == $template ? 48 : 0 );\n\t\t}\n\n\t\tif ( empty( $colors ) ) {\n\t\t\t$colors = array_map( 'esc_attr', (array) get_option( 'sportspress_frontend_css_colors', array() ) );\n\t\t}\n\n\t\t// Fallback\n\t\tif ( ! isset( $colors['customize'] ) ) {\n\t\t\t$colors['customize'] = ( 'yes' == get_option( 'sportspress_enable_frontend_css', 'no' ) );\n\t\t}\n\n\t\t// Defaults\n\t\tif ( empty( $colors['primary'] ) ) {\n\t\t\t$colors['primary'] = '#2b353e';\n\t\t}\n\t\tif ( empty( $colors['background'] ) ) {\n\t\t\t$colors['background'] = '#f4f4f4';\n\t\t}\n\t\tif ( empty( $colors['text'] ) ) {\n\t\t\t$colors['text'] = '#222222';\n\t\t}\n\t\tif ( empty( $colors['heading'] ) ) {\n\t\t\t$colors['heading'] = '#ffffff';\n\t\t}\n\t\tif ( empty( $colors['link'] ) ) {\n\t\t\t$colors['link'] = '#00a69c';\n\t\t}\n\n\t\t// Calculate colors\n\t\t$colors['highlight'] = sp_hex_lighter( $colors['background'], 30, true );\n\n\t\techo '<style type=\"text/css\">';\n\n\t\tif ( $colors['customize'] && ! current_theme_supports( 'sportspress' ) && sizeof( $colors ) > 0 ) {\n\t\t\techo ' /* SportsPress Frontend CSS */ ';\n\n\t\t\techo '.sp-event-calendar tbody td a,.sp-event-calendar tbody td a:hover{background: none;}';\n\n\t\t\tif ( isset( $colors['primary'] ) ) {\n\t\t\t\techo '.sp-data-table th,.sp-calendar th,.sp-data-table tfoot,.sp-calendar tfoot,.sp-button,.sp-heading{background:' . esc_attr( $colors['primary'] ) . ' !important}.sp-calendar tbody a{color:' . esc_attr( $colors['primary'] ) . ' !important}';\n\t\t\t}\n\n\t\t\tif ( isset( $colors['background'] ) ) {\n\t\t\t\techo '.sp-data-table tbody,.sp-calendar tbody{background: ' . esc_attr( $colors['background'] ) . ' !important}';\n\t\t\t}\n\n\t\t\tif ( isset( $colors['text'] ) ) {\n\t\t\t\techo '.sp-data-table tbody,.sp-calendar tbody{color: ' . esc_attr( $colors['text'] ) . ' !important}';\n\t\t\t}\n\n\t\t\tif ( isset( $colors['heading'] ) ) {\n\t\t\t\techo '.sp-data-table th,.sp-data-table th a,.sp-data-table tfoot,.sp-data-table tfoot a,.sp-calendar th,.sp-calendar th a,.sp-calendar tfoot,.sp-calendar tfoot a,.sp-button,.sp-heading{color: ' . esc_attr( $colors['heading'] ) . ' !important}';\n\t\t\t}\n\n\t\t\tif ( isset( $colors['link'] ) ) {\n\t\t\t\techo '.sp-data-table tbody a,.sp-data-table tbody a:hover,.sp-calendar tbody a:focus{color: ' . esc_attr( $colors['link'] ) . ' !important}';\n\t\t\t}\n\n\t\t\tif ( isset( $colors['highlight'] ) ) {\n\t\t\t\techo '.sp-highlight,.sp-calendar td#today{background: ' . esc_attr( $colors['highlight'] ) . ' !important}';\n\t\t\t}\n\n\t\t\tdo_action( 'sportspress_frontend_css', $colors );\n\t\t}\n\n\t\tif ( $align != 'default' ) {\n\t\t\techo '.sp-data-table th,.sp-data-table td{text-align: ' . esc_attr( $align ) . ' !important}';\n\t\t}\n\n\t\tif ( $padding != null ) {\n\t\t\techo '.sp-data-table th,.sp-data-table td{padding: ' . esc_attr( $padding ) . 'px !important}';\n\t\t}\n\n\t\tif ( $offset != 0 ) {\n\t\t\techo ' @media only screen and (min-width: 40.063em) {.sp-header{top: ' . esc_attr( $offset ) . 'px}}';\n\t\t}\n\n\t\tif ( ! empty( $custom ) ) {\n\t\t\techo ' /* SportsPress Custom CSS */ ' . wp_kses_post( $custom );\n\t\t}\n\n\t\techo '</style>';\n\t}\n}\n\nnew SP_Frontend_Scripts();\n"
  },
  {
    "path": "includes/class-sp-install.php",
    "content": "<?php\n/**\n * Installation related functions and actions.\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Classes\n * @version     2.6.17\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_Install' ) ) :\n\n\t/**\n\t * SP_Install Class\n\t */\n\tclass SP_Install {\n\n\t\t/**\n\t\t * Hook in tabs.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\tif ( ! defined( 'SP_PLUGIN_FILE' ) ) {\n\t\t\t\tdefine( 'SP_PLUGIN_FILE', __FILE__ );\n\t\t\t}\n\t\t\tregister_activation_hook( SP_PLUGIN_FILE, array( $this, 'install' ) );\n\n\t\t\tif ( defined( 'SP_PRO_PLUGIN_FILE' ) ) {\n\t\t\t\tregister_activation_hook( SP_PRO_PLUGIN_FILE, array( $this, 'install' ) );\n\t\t\t}\n\n\t\t\tadd_action( 'admin_init', array( $this, 'install_actions' ) );\n\t\t\tadd_action( 'admin_init', array( $this, 'check_version' ), 5 );\n\t\t\tadd_action( 'in_plugin_update_message-sportspress/sportspress.php', array( $this, 'in_plugin_update_message' ) );\n\t\t}\n\n\t\t/**\n\t\t * check_version function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function check_version() {\n\t\t\tif ( ! defined( 'IFRAME_REQUEST' ) && get_option( 'sportspress_version' ) != SP()->version ) {\n\t\t\t\t$this->install();\n\n\t\t\t\tdo_action( 'sportspress_updated' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Basic setup when a button is clicked.\n\t\t */\n\t\tpublic function install_actions() {\n\t\t\tif ( ! empty( $_GET['skip_install_sportspress'] ) ) {\n\n\t\t\t\t// We no longer need to install configs\n\t\t\t\tdelete_option( '_sp_needs_welcome' );\n\t\t\t\tupdate_option( 'sportspress_installed', 1 );\n\t\t\t\tupdate_option( 'sportspress_completed_setup', 1 );\n\t\t\t\tdelete_transient( '_sp_activation_redirect' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Install SP\n\t\t */\n\t\tpublic function install() {\n\t\t\t$this->remove_roles();\n\t\t\t$this->create_roles();\n\n\t\t\t// Register post types\n\t\t\tinclude_once 'class-sp-post-types.php';\n\t\t\tSP_Post_types::register_post_types();\n\t\t\tSP_Post_types::register_taxonomies();\n\n\t\t\t$this->create_options();\n\n\t\t\t// Queue upgrades\n\t\t\t$current_version = get_option( 'sportspress_version', null );\n\n\t\t\t// Do upgrades\n\t\t\t$this->upgrades( $current_version );\n\n\t\t\t// Update version\n\t\t\tupdate_option( 'sportspress_version', SP()->version );\n\n\t\t\t// Flush rules after install\n\t\t\tflush_rewrite_rules();\n\n\t\t\t// Get current major version\n\t\t\t$version = explode( '.', $current_version, 3 );\n\t\t\tunset( $version[2] );\n\t\t\t$major_current_version = implode( '.', $version );\n\n\t\t\t// Get new major version\n\t\t\t$version = explode( '.', SP()->version, 3 );\n\t\t\tunset( $version[2] );\n\t\t\t$major_version = implode( '.', $version );\n\n\t\t\t// Redirect to welcome screen if major version has changed\n\t\t\tif ( $major_current_version !== $major_version ) {\n\t\t\t\tset_transient( '_sp_activation_redirect', 1, 60 * 60 );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Default options\n\t\t *\n\t\t * Sets up the default options used on the settings page\n\t\t *\n\t\t * @access public\n\t\t */\n\t\tfunction create_options() {\n\t\t\t// Include settings so that we can run through defaults\n\t\t\tinclude_once 'admin/class-sp-admin-settings.php';\n\n\t\t\t$settings = SP_Admin_Settings::get_settings_pages();\n\n\t\t\tforeach ( $settings as $section ) {\n\t\t\t\tif ( ! is_object( $section ) || ! method_exists( $section, 'get_settings' ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach ( $section->get_settings() as $value ) {\n\t\t\t\t\tif ( isset( $value['default'] ) && isset( $value['id'] ) ) {\n\t\t\t\t\t\t$autoload = isset( $value['autoload'] ) ? (bool) $value['autoload'] : true;\n\t\t\t\t\t\tadd_option( $value['id'], $value['default'], '', ( $autoload ? 'yes' : 'no' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Default color scheme\n\t\t\tadd_option( 'sportspress_frontend_css_primary', '#2b353e' );\n\t\t\tadd_option( 'sportspress_frontend_css_background', '#f4f4f4' );\n\t\t\tadd_option( 'sportspress_frontend_css_text', '#222222' );\n\t\t\tadd_option( 'sportspress_frontend_css_heading', '#ffffff' );\n\t\t\tadd_option( 'sportspress_frontend_css_link', '#00a69c' );\n\t\t}\n\n\t\t/**\n\t\t * Create roles and capabilities\n\t\t */\n\t\tpublic function create_roles() {\n\t\t\tglobal $wp_roles;\n\n\t\t\tif ( class_exists( 'WP_Roles' ) ) :\n\t\t\t\tif ( ! isset( $wp_roles ) ) :\n\t\t\t\t\t$wp_roles = new WP_Roles();\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\t\tif ( is_object( $wp_roles ) ) :\n\n\t\t\t\tadd_role(\n\t\t\t\t\t'sp_player',\n\t\t\t\t\t__( 'Player', 'sportspress' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'level_1'                   => true,\n\t\t\t\t\t\t'level_0'                   => true,\n\n\t\t\t\t\t\t'read'                      => true,\n\t\t\t\t\t\t'delete_posts'              => true,\n\t\t\t\t\t\t'edit_posts'                => true,\n\t\t\t\t\t\t'upload_files'              => true,\n\n\t\t\t\t\t\t'edit_sp_player'            => true,\n\t\t\t\t\t\t'read_sp_player'            => true,\n\t\t\t\t\t\t'edit_sp_players'           => true,\n\t\t\t\t\t\t'edit_published_sp_players' => true,\n\t\t\t\t\t\t'assign_sp_player_terms'    => true,\n\n\t\t\t\t\t\t'edit_sp_event'             => true,\n\t\t\t\t\t\t'read_sp_event'             => true,\n\t\t\t\t\t\t'edit_sp_events'            => true,\n\t\t\t\t\t\t'edit_published_sp_events'  => true,\n\t\t\t\t\t\t'assign_sp_event_terms'     => true,\n\n\t\t\t\t\t\t'edit_sp_team'              => true,\n\t\t\t\t\t\t'read_sp_team'              => true,\n\t\t\t\t\t\t'edit_sp_teams'             => true,\n\t\t\t\t\t\t'edit_published_sp_teams'   => true,\n\t\t\t\t\t\t'assign_sp_team_terms'      => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tadd_role(\n\t\t\t\t\t'sp_staff',\n\t\t\t\t\t__( 'Staff', 'sportspress' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'level_1'                   => true,\n\t\t\t\t\t\t'level_0'                   => true,\n\n\t\t\t\t\t\t'read'                      => true,\n\t\t\t\t\t\t'delete_posts'              => true,\n\t\t\t\t\t\t'edit_posts'                => true,\n\t\t\t\t\t\t'upload_files'              => true,\n\n\t\t\t\t\t\t'edit_sp_staff'             => true,\n\t\t\t\t\t\t'read_sp_staff'             => true,\n\t\t\t\t\t\t'edit_sp_staffs'            => true,\n\t\t\t\t\t\t'edit_published_sp_staffs'  => true,\n\t\t\t\t\t\t'assign_sp_staff_terms'     => true,\n\n\t\t\t\t\t\t'edit_sp_event'             => true,\n\t\t\t\t\t\t'read_sp_event'             => true,\n\t\t\t\t\t\t'edit_sp_events'            => true,\n\t\t\t\t\t\t'edit_published_sp_events'  => true,\n\t\t\t\t\t\t'assign_sp_event_terms'     => true,\n\n\t\t\t\t\t\t'edit_sp_team'              => true,\n\t\t\t\t\t\t'read_sp_team'              => true,\n\t\t\t\t\t\t'edit_sp_teams'             => true,\n\t\t\t\t\t\t'edit_published_sp_teams'   => true,\n\t\t\t\t\t\t'assign_sp_team_terms'      => true,\n\n\t\t\t\t\t\t'edit_sp_player'            => true,\n\t\t\t\t\t\t'read_sp_player'            => true,\n\t\t\t\t\t\t'edit_sp_players'           => true,\n\t\t\t\t\t\t'edit_published_sp_players' => true,\n\t\t\t\t\t\t'assign_sp_player_terms'    => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tadd_role(\n\t\t\t\t\t'sp_event_manager',\n\t\t\t\t\t__( 'Event Manager', 'sportspress' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'level_1'                    => true,\n\t\t\t\t\t\t'level_0'                    => true,\n\n\t\t\t\t\t\t'read'                       => true,\n\t\t\t\t\t\t'delete_posts'               => true,\n\t\t\t\t\t\t'edit_posts'                 => true,\n\t\t\t\t\t\t'upload_files'               => true,\n\t\t\t\t\t\t'manage_categories'          => true,\n\n\t\t\t\t\t\t'edit_sp_event'              => true,\n\t\t\t\t\t\t'read_sp_event'              => true,\n\t\t\t\t\t\t'delete_sp_event'            => true,\n\t\t\t\t\t\t'edit_sp_events'             => true,\n\t\t\t\t\t\t'edit_others_sp_events'      => true,\n\t\t\t\t\t\t'publish_sp_events'          => true,\n\t\t\t\t\t\t'delete_sp_events'           => true,\n\t\t\t\t\t\t'delete_published_sp_events' => true,\n\t\t\t\t\t\t'edit_published_sp_events'   => true,\n\t\t\t\t\t\t'manage_sp_event_terms'      => true,\n\t\t\t\t\t\t'edit_sp_event_terms'        => true,\n\t\t\t\t\t\t'delete_sp_event_terms'      => true,\n\t\t\t\t\t\t'assign_sp_event_terms'      => true,\n\n\t\t\t\t\t\t'edit_sp_team'               => true,\n\t\t\t\t\t\t'read_sp_team'               => true,\n\t\t\t\t\t\t'edit_sp_teams'              => true,\n\t\t\t\t\t\t'edit_published_sp_teams'    => true,\n\t\t\t\t\t\t'assign_sp_team_terms'       => true,\n\n\t\t\t\t\t\t'edit_sp_player'             => true,\n\t\t\t\t\t\t'read_sp_player'             => true,\n\t\t\t\t\t\t'edit_sp_players'            => true,\n\t\t\t\t\t\t'edit_published_sp_players'  => true,\n\t\t\t\t\t\t'assign_sp_player_terms'     => true,\n\n\t\t\t\t\t\t'edit_sp_staff'              => true,\n\t\t\t\t\t\t'read_sp_staff'              => true,\n\t\t\t\t\t\t'edit_sp_staffs'             => true,\n\t\t\t\t\t\t'edit_published_sp_staffs'   => true,\n\t\t\t\t\t\t'assign_sp_staff_terms'      => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tadd_role(\n\t\t\t\t\t'sp_team_manager',\n\t\t\t\t\t__( 'Team Manager', 'sportspress' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'level_2'                     => true,\n\t\t\t\t\t\t'level_1'                     => true,\n\t\t\t\t\t\t'level_0'                     => true,\n\n\t\t\t\t\t\t'read'                        => true,\n\t\t\t\t\t\t'delete_posts'                => true,\n\t\t\t\t\t\t'edit_posts'                  => true,\n\t\t\t\t\t\t'delete_published_posts'      => true,\n\t\t\t\t\t\t'publish_posts'               => true,\n\t\t\t\t\t\t'upload_files'                => true,\n\t\t\t\t\t\t'edit_published_posts'        => true,\n\n\t\t\t\t\t\t'edit_sp_player'              => true,\n\t\t\t\t\t\t'read_sp_player'              => true,\n\t\t\t\t\t\t'delete_sp_player'            => true,\n\t\t\t\t\t\t'edit_sp_players'             => true,\n\t\t\t\t\t\t'edit_others_sp_players'      => true,\n\t\t\t\t\t\t'publish_sp_players'          => true,\n\t\t\t\t\t\t'delete_sp_players'           => true,\n\t\t\t\t\t\t'delete_published_sp_players' => true,\n\t\t\t\t\t\t'edit_published_sp_players'   => true,\n\t\t\t\t\t\t'assign_sp_player_terms'      => true,\n\n\t\t\t\t\t\t'edit_sp_staff'               => true,\n\t\t\t\t\t\t'read_sp_staff'               => true,\n\t\t\t\t\t\t'delete_sp_staff'             => true,\n\t\t\t\t\t\t'edit_sp_staffs'              => true,\n\t\t\t\t\t\t'edit_others_sp_staffs'       => true,\n\t\t\t\t\t\t'publish_sp_staffs'           => true,\n\t\t\t\t\t\t'delete_sp_staffs'            => true,\n\t\t\t\t\t\t'delete_published_sp_staffs'  => true,\n\t\t\t\t\t\t'edit_published_sp_staffs'    => true,\n\t\t\t\t\t\t'assign_sp_staff_terms'       => true,\n\n\t\t\t\t\t\t'edit_sp_event'               => true,\n\t\t\t\t\t\t'read_sp_event'               => true,\n\t\t\t\t\t\t'delete_sp_event'             => true,\n\t\t\t\t\t\t'edit_sp_events'              => true,\n\t\t\t\t\t\t'edit_others_sp_events'       => true,\n\t\t\t\t\t\t'publish_sp_events'           => true,\n\t\t\t\t\t\t'delete_sp_events'            => true,\n\t\t\t\t\t\t'delete_published_sp_events'  => true,\n\t\t\t\t\t\t'edit_published_sp_events'    => true,\n\t\t\t\t\t\t'manage_sp_event_terms'       => true,\n\t\t\t\t\t\t'edit_sp_event_terms'         => true,\n\t\t\t\t\t\t'delete_sp_event_terms'       => true,\n\t\t\t\t\t\t'assign_sp_event_terms'       => true,\n\n\t\t\t\t\t\t'edit_sp_team'                => true,\n\t\t\t\t\t\t'read_sp_team'                => true,\n\t\t\t\t\t\t'edit_sp_teams'               => true,\n\t\t\t\t\t\t'edit_published_sp_teams'     => true,\n\t\t\t\t\t\t'assign_sp_team_terms'        => true,\n\n\t\t\t\t\t\t'edit_sp_list'                => true,\n\t\t\t\t\t\t'read_sp_list'                => true,\n\t\t\t\t\t\t'delete_sp_list'              => true,\n\t\t\t\t\t\t'edit_sp_lists'               => true,\n\t\t\t\t\t\t'publish_sp_lists'            => true,\n\t\t\t\t\t\t'delete_sp_lists'             => true,\n\t\t\t\t\t\t'delete_published_sp_lists'   => true,\n\t\t\t\t\t\t'edit_published_sp_lists'     => true,\n\t\t\t\t\t\t'assign_sp_list_terms'        => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tadd_role(\n\t\t\t\t\t'sp_league_manager',\n\t\t\t\t\t__( 'League Manager', 'sportspress' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'level_7'                => true,\n\t\t\t\t\t\t'level_6'                => true,\n\t\t\t\t\t\t'level_5'                => true,\n\t\t\t\t\t\t'level_4'                => true,\n\t\t\t\t\t\t'level_3'                => true,\n\t\t\t\t\t\t'level_2'                => true,\n\t\t\t\t\t\t'level_1'                => true,\n\t\t\t\t\t\t'level_0'                => true,\n\n\t\t\t\t\t\t'read'                   => true,\n\t\t\t\t\t\t'read_private_pages'     => true,\n\t\t\t\t\t\t'read_private_posts'     => true,\n\t\t\t\t\t\t'edit_users'             => true,\n\t\t\t\t\t\t'edit_posts'             => true,\n\t\t\t\t\t\t'edit_pages'             => true,\n\t\t\t\t\t\t'edit_published_posts'   => true,\n\t\t\t\t\t\t'edit_published_pages'   => true,\n\t\t\t\t\t\t'edit_private_pages'     => true,\n\t\t\t\t\t\t'edit_private_posts'     => true,\n\t\t\t\t\t\t'edit_others_posts'      => true,\n\t\t\t\t\t\t'edit_others_pages'      => true,\n\t\t\t\t\t\t'publish_posts'          => true,\n\t\t\t\t\t\t'publish_pages'          => true,\n\t\t\t\t\t\t'delete_posts'           => true,\n\t\t\t\t\t\t'delete_pages'           => true,\n\t\t\t\t\t\t'delete_private_pages'   => true,\n\t\t\t\t\t\t'delete_private_posts'   => true,\n\t\t\t\t\t\t'delete_published_pages' => true,\n\t\t\t\t\t\t'delete_published_posts' => true,\n\t\t\t\t\t\t'delete_others_posts'    => true,\n\t\t\t\t\t\t'delete_others_pages'    => true,\n\t\t\t\t\t\t'manage_categories'      => true,\n\t\t\t\t\t\t'manage_links'           => true,\n\t\t\t\t\t\t'moderate_comments'      => true,\n\t\t\t\t\t\t'unfiltered_html'        => true,\n\t\t\t\t\t\t'upload_files'           => true,\n\t\t\t\t\t\t'export'                 => true,\n\t\t\t\t\t\t'import'                 => true,\n\t\t\t\t\t\t'list_users'             => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$capabilities = $this->get_core_capabilities();\n\n\t\t\t\tforeach ( $capabilities as $cap_group ) :\n\t\t\t\t\tforeach ( $cap_group as $cap ) :\n\t\t\t\t\t\t$wp_roles->add_cap( 'sp_league_manager', $cap );\n\t\t\t\t\t\t$wp_roles->add_cap( 'administrator', $cap );\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\t}\n\n\t\t/**\n\t\t * Make adjustments based on current version of the plugin\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function upgrades( $version = null ) {\n\t\t\tif ( empty( $version ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( version_compare( $version, '2.0', '<' ) ) {\n\t\t\t\tupdate_option( 'sportspress_player_columns', 'manual' );\n\t\t\t}\n\n\t\t\tif ( version_compare( $version, '2.1', '<' ) ) {\n\t\t\t\tupdate_option( 'sportspress_player_show_selector', 'no' );\n\t\t\t\tupdate_option( 'sportspress_event_performance_show_minutes', 'no' );\n\t\t\t}\n\n\t\t\tif ( version_compare( $version, '2.1.3', '<' ) ) {\n\t\t\t\t$layout = get_option( 'sportspress_player_template_order' );\n\t\t\t\tif ( is_array( $layout ) ) {\n\t\t\t\t\tarray_unshift( $layout, 'selector' );\n\t\t\t\t\tupdate_option( 'sportspress_player_template_order', $layout );\n\t\t\t\t}\n\n\t\t\t\t$layout = get_option( 'sportspress_staff_template_order' );\n\t\t\t\tif ( is_array( $layout ) ) {\n\t\t\t\t\tarray_unshift( $layout, 'selector' );\n\t\t\t\t\tupdate_option( 'sportspress_staff_template_order', $layout );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( version_compare( $version, '2.2', '<' ) ) {\n\t\t\t\tupdate_option( 'sportspress_frontend_styles', 'no' );\n\t\t\t\tupdate_option( 'sportspress_event_show_timeline', 'no' );\n\t\t\t\tupdate_option( 'sportspress_event_logos_show_team_names', 'no' );\n\t\t\t}\n\n\t\t\tif ( version_compare( $version, '2.2.3', '<' ) ) {\n\t\t\t\t$option = get_option( 'sportspress_player_show_total', 'no' );\n\t\t\t\tupdate_option( 'sportspress_player_show_career_total', $option );\n\t\t\t}\n\n\t\t\tif ( version_compare( $version, '2.2.11', '<' ) ) {\n\t\t\t\tupdate_option( 'sportspress_completed_setup', 1 );\n\t\t\t\tupdate_option( 'sportspress_registration_name_inputs', 'no' );\n\t\t\t\tupdate_option( 'sportspress_registration_add_player', 'no' );\n\n\t\t\t\t$individual_mode = get_option( 'sportspress_load_individual_mode_module', 'no' );\n\t\t\t\tif ( 'yes' === $individual_mode ) {\n\t\t\t\t\tupdate_option( 'sportspress_mode', 'player' );\n\t\t\t\t} else {\n\t\t\t\t\tupdate_option( 'sportspress_mode', 'team' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( version_compare( $version, '2.5.5', '<' ) ) {\n\t\t\t\tupdate_option( 'sportspress_enable_responsive_tables', 'no' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Get capabilities for SportsPress - these are assigned during installation or reset\n\t\t *\n\t\t * @access public\n\t\t * @return array\n\t\t */\n\t\tpublic function get_core_capabilities() {\n\t\t\tinclude_once 'sp-conditional-functions.php';\n\t\t\t$capabilities = array();\n\n\t\t\t$capabilities['core'] = array(\n\t\t\t\t'manage_sportspress',\n\t\t\t\t'view_sportspress_reports',\n\t\t\t);\n\n\t\t\t$post_types = sp_post_types();\n\t\t\tarray_unshift( $post_types, 'sp_config' );\n\n\t\t\t$capability_types = apply_filters( 'sportspress_post_types', $post_types );\n\n\t\t\tforeach ( $capability_types as $capability_type ) {\n\n\t\t\t\t$capabilities[ $capability_type ] = array(\n\t\t\t\t\t// Post type\n\t\t\t\t\t\"edit_{$capability_type}\",\n\t\t\t\t\t\"read_{$capability_type}\",\n\t\t\t\t\t\"delete_{$capability_type}\",\n\t\t\t\t\t\"edit_{$capability_type}s\",\n\t\t\t\t\t\"edit_others_{$capability_type}s\",\n\t\t\t\t\t\"publish_{$capability_type}s\",\n\t\t\t\t\t\"read_private_{$capability_type}s\",\n\t\t\t\t\t\"delete_{$capability_type}s\",\n\t\t\t\t\t\"delete_private_{$capability_type}s\",\n\t\t\t\t\t\"delete_published_{$capability_type}s\",\n\t\t\t\t\t\"delete_others_{$capability_type}s\",\n\t\t\t\t\t\"edit_private_{$capability_type}s\",\n\t\t\t\t\t\"edit_published_{$capability_type}s\",\n\n\t\t\t\t\t// Terms\n\t\t\t\t\t\"manage_{$capability_type}_terms\",\n\t\t\t\t\t\"edit_{$capability_type}_terms\",\n\t\t\t\t\t\"delete_{$capability_type}_terms\",\n\t\t\t\t\t\"assign_{$capability_type}_terms\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $capabilities;\n\t\t}\n\n\t\t/**\n\t\t * sportspress_remove_roles function.\n\t\t *\n\t\t * @access public\n\t\t * @return void\n\t\t */\n\t\tpublic function remove_roles() {\n\t\t\tglobal $wp_roles;\n\n\t\t\tif ( class_exists( 'WP_Roles' ) ) {\n\t\t\t\tif ( ! isset( $wp_roles ) ) {\n\t\t\t\t\t$wp_roles = new WP_Roles();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( is_object( $wp_roles ) ) {\n\n\t\t\t\t$capabilities = $this->get_core_capabilities();\n\n\t\t\t\tforeach ( $capabilities as $cap_group ) {\n\t\t\t\t\tforeach ( $cap_group as $cap ) {\n\t\t\t\t\t\t$wp_roles->remove_cap( 'sp_player', $cap );\n\t\t\t\t\t\t$wp_roles->remove_cap( 'sp_staff', $cap );\n\t\t\t\t\t\t$wp_roles->remove_cap( 'sp_event_manager', $cap );\n\t\t\t\t\t\t$wp_roles->remove_cap( 'sp_team_manager', $cap );\n\t\t\t\t\t\t$wp_roles->remove_cap( 'sp_league_manager', $cap );\n\t\t\t\t\t\t$wp_roles->remove_cap( 'administrator', $cap );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tremove_role( 'sp_player' );\n\t\t\t\tremove_role( 'sp_staff' );\n\t\t\t\tremove_role( 'sp_event_manager' );\n\t\t\t\tremove_role( 'sp_team_manager' );\n\t\t\t\tremove_role( 'sp_league_manager' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Active plugins pre update option filter\n\t\t *\n\t\t * @param string $new_value\n\t\t * @return string\n\t\t */\n\t\tfunction pre_update_option_active_plugins( $new_value ) {\n\t\t\t$old_value = (array) get_option( 'active_plugins' );\n\n\t\t\tif ( $new_value !== $old_value && in_array( W3TC_FILE, (array) $new_value ) && in_array( W3TC_FILE, (array) $old_value ) ) {\n\t\t\t\t$this->_config->set( 'notes.plugins_updated', true );\n\t\t\t\ttry {\n\t\t\t\t\t$this->_config->save();\n\t\t\t\t} catch ( Exception $ex ) {\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $new_value;\n\t\t}\n\n\t\t/**\n\t\t * Show plugin changes. Code adapted from W3 Total Cache.\n\t\t *\n\t\t * @return void\n\t\t */\n\t\tfunction in_plugin_update_message() {\n\t\t\t$response = wp_remote_get( 'https://plugins.svn.wordpress.org/sportspress/trunk/readme.txt' );\n\n\t\t\tif ( ! is_wp_error( $response ) && ! empty( $response['body'] ) ) {\n\n\t\t\t\t// Output Upgrade Notice\n\t\t\t\t$matches = null;\n\t\t\t\t$regexp  = '~==\\s*Upgrade Notice\\s*==\\s*=\\s*(.*)\\s*=(.*)(=\\s*' . preg_quote( SP_VERSION ) . '\\s*=|$)~Uis';\n\n\t\t\t\tif ( preg_match( $regexp, $response['body'], $matches ) ) {\n\t\t\t\t\t$version = trim( $matches[1] );\n\t\t\t\t\t$notices = (array) preg_split( '~[\\r\\n]+~', trim( $matches[2] ) );\n\n\t\t\t\t\tif ( version_compare( SP_VERSION, $version, '<' ) ) {\n\n\t\t\t\t\t\techo '<div style=\"font-weight: normal; background: #cc99c2; color: #fff !important; border: 1px solid #b76ca9; padding: 9px; margin: 9px 0;\">';\n\n\t\t\t\t\t\tforeach ( $notices as $index => $line ) {\n\t\t\t\t\t\t\techo '<p style=\"margin: 0; font-size: 1.1em; color: #fff; text-shadow: 0 1px 1px #b574a8;\">' . wp_kses_post( preg_replace( '~\\[([^\\]]*)\\]\\(([^\\)]*)\\)~', '<a href=\"${2}\">${1}</a>', $line ) ) . '</p>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\techo '</div> ';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Output Changelog\n\t\t\t\t$matches = null;\n\t\t\t\t$regexp  = '~==\\s*Changelog\\s*==\\s*=\\s*[0-9.]+\\s*-(.*)=(.*)(=\\s*' . preg_quote( SP_VERSION ) . '\\s*-(.*)=|$)~Uis';\n\n\t\t\t\tif ( preg_match( $regexp, $response['body'], $matches ) ) {\n\t\t\t\t\t$changelog = (array) preg_split( '~[\\r\\n]+~', trim( $matches[2] ) );\n\n\t\t\t\t\tesc_attr_e( 'What\\'s new:', 'sportspress' ) . '<div style=\"font-weight: normal;\">';\n\n\t\t\t\t\t$ul = false;\n\n\t\t\t\t\tforeach ( $changelog as $index => $line ) {\n\t\t\t\t\t\tif ( preg_match( '~^\\s*\\*\\s*~', $line ) ) {\n\t\t\t\t\t\t\tif ( ! $ul ) {\n\t\t\t\t\t\t\t\techo '<ul style=\"list-style: disc inside; margin: 9px 0 9px 20px; overflow:hidden; zoom: 1;\">';\n\t\t\t\t\t\t\t\t$ul = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$line = preg_replace( '~^\\s*\\*\\s*~', '', htmlspecialchars( $line ) );\n\n\t\t\t\t\t\t\techo '<li style=\"width: 50%; margin: 0; float: left; ' . ( $index % 2 == 0 ? 'clear: left;' : '' ) . '\">' . esc_html( $line ) . '</li>';\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$version = trim( current( explode( '-', str_replace( '=', '', $line ) ) ) );\n\n\t\t\t\t\t\t\tif ( version_compare( SP_VERSION, $version, '>=' ) ) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( $ul ) {\n\t\t\t\t\t\t\t\techo '</ul>';\n\t\t\t\t\t\t\t\t$ul = false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\techo '<p style=\"margin: 9px 0;\">' . esc_html( htmlspecialchars( $line ) ) . '</p>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $ul ) {\n\t\t\t\t\t\techo '</ul>';\n\t\t\t\t\t}\n\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_Install();\n"
  },
  {
    "path": "includes/class-sp-league-table.php",
    "content": "<?php\n/**\n * League Table Class\n *\n * The SportsPress league table class handles individual league table data.\n *\n * @class       SP_League_Table\n * @version     2.7.26\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_League_Table extends SP_Secondary_Post {\n\n\t/** @var array The sort priorities array. */\n\tpublic $priorities;\n\n\t/** @var int Position of team in the table. */\n\tpublic $pos;\n\n\t/** @var int Incremental value for team position. */\n\tpublic $counter;\n\n\t/** @var array Teams to check for tiebreakers. */\n\tpublic $tiebreakers = array();\n\n\t// ** @var strings\n\tpublic $orderby;\n\tpublic $orderbyorder;\n\tpublic $compare;\n\n\t/** @var int Show Published events. */\n\tpublic $show_published_events;\n\n\t/** @var int Show Scheduled events. */\n\tpublic $show_future_events;\n\n\t/**\n\t * Returns formatted data\n\t *\n\t * @access public\n\t * @param bool $admin\n\t * @return array\n\t */\n\tpublic function data( $admin = false, $team_ids = null ) {\n\t\t$league_ids         = sp_get_the_term_ids( $this->ID, 'sp_league' );\n\t\t$season_ids         = sp_get_the_term_ids( $this->ID, 'sp_season' );\n\t\t$table_stats        = (array) get_post_meta( $this->ID, 'sp_teams', true );\n\t\t$usecolumns         = get_post_meta( $this->ID, 'sp_columns', true );\n\t\t$adjustments        = get_post_meta( $this->ID, 'sp_adjustments', true );\n\t\t$select             = get_post_meta( $this->ID, 'sp_select', true );\n\t\t$this->orderby      = get_post_meta( $this->ID, 'sp_orderby', true );\n\t\t$this->orderbyorder = get_post_meta( $this->ID, 'sp_order', true );\n\t\t$link_events        = get_option( 'sportspress_link_events', 'yes' ) === 'yes' ? true : false;\n\t\t$form_limit         = (int) get_option( 'sportspress_form_limit', 5 );\n\n\t\t$this->date = $this->__get( 'date' );\n\n\t\tif ( ! $this->date ) {\n\t\t\t$this->date = 0;\n\t\t}\n\n\t\t// Apply defaults\n\t\tif ( empty( $this->orderby ) ) {\n\t\t\t$this->orderby = 'default';\n\t\t}\n\t\tif ( empty( $this->orderbyorder ) ) {\n\t\t\t$this->orderbyorder = 'ASC';\n\t\t}\n\t\tif ( empty( $select ) ) {\n\t\t\t$select = 'auto';\n\t\t}\n\n\t\tif ( 'range' == $this->date ) {\n\n\t\t\t$this->relative = get_post_meta( $this->ID, 'sp_date_relative', true );\n\n\t\t\tif ( $this->relative ) {\n\n\t\t\t\t$this->past = get_post_meta( $this->ID, 'sp_date_past', true );\n\n\t\t\t} else {\n\n\t\t\t\t$this->from = get_post_meta( $this->ID, 'sp_date_from', true );\n\t\t\t\t$this->to   = get_post_meta( $this->ID, 'sp_date_to', true );\n\n\t\t\t}\n\t\t}\n\n\t\t// Get labels from result variables\n\t\t$result_labels = (array) sp_get_var_labels( 'sp_result' );\n\n\t\t// Get labels from outcome variables\n\t\t$outcome_labels = (array) sp_get_var_labels( 'sp_outcome' );\n\n\t\t// Get post type\n\t\t$post_type = sp_get_post_mode_type( $this->ID );\n\n\t\t// Determine if main loop\n\t\tif ( $team_ids ) {\n\n\t\t\t$is_main_loop = false;\n\n\t\t} else {\n\n\t\t\t// Get teams automatically if set to auto\n\t\t\tif ( 'auto' == $select ) {\n\t\t\t\t$team_ids = array();\n\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type'      => $post_type,\n\t\t\t\t\t'numberposts'    => -1,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t\t'tax_query'      => array(\n\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t),\n\t\t\t\t\t'fields'         => 'ids',\n\t\t\t\t);\n\n\t\t\t\tif ( $league_ids ) :\n\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t\t'terms'    => $league_ids,\n\t\t\t\t\t);\n\t\t\t\tendif;\n\n\t\t\t\tif ( $season_ids ) :\n\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t\t'terms'    => $season_ids,\n\t\t\t\t\t);\n\t\t\t\tendif;\n\n\t\t\t\t$team_ids = get_posts( $args );\n\t\t\t} else {\n\t\t\t\t$team_ids = (array) get_post_meta( $this->ID, 'sp_team', false );\n\t\t\t}\n\n\t\t\t$is_main_loop = true;\n\t\t}\n\n\t\t// Get all leagues populated with stats where available\n\t\t$tempdata = sp_array_combine( $team_ids, $table_stats );\n\n\t\t// Create entry for each team in totals\n\t\t$totals       = array();\n\t\t$placeholders = array();\n\n\t\t// Initialize incremental counter\n\t\t$this->pos     = 0;\n\t\t$this->counter = 0;\n\n\t\t// Initialize team compare\n\t\t$this->compare = null;\n\n\t\t// Initialize streaks counter\n\t\t$streaks = array();\n\n\t\t// Initialize form counter\n\t\t$forms = array();\n\n\t\t// Initialize last counters\n\t\t$last5s  = array();\n\t\t$last10s = array();\n\n\t\t// Initialize record counters\n\t\t$homerecords = array();\n\t\t$awayrecords = array();\n\n\t\tforeach ( $team_ids as $team_id ) :\n\t\t\tif ( ! $team_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Initialize team streaks counter\n\t\t\t$streaks[ $team_id ] = array(\n\t\t\t\t'name'  => '',\n\t\t\t\t'count' => 0,\n\t\t\t\t'fire'  => 1,\n\t\t\t);\n\n\t\t\t// Initialize team form counter\n\t\t\t$forms[ $team_id ] = array();\n\n\t\t\t// Initialize team last counters\n\t\t\t$last5s[ $team_id ]  = array();\n\t\t\t$last10s[ $team_id ] = array();\n\n\t\t\t// Initialize team record counters\n\t\t\t$homerecords[ $team_id ] = array();\n\t\t\t$awayrecords[ $team_id ] = array();\n\n\t\t\t// Add outcome types to team last and record counters\n\t\t\tforeach ( $outcome_labels as $key => $value ) :\n\t\t\t\t$last5s[ $team_id ][ $key ]      = 0;\n\t\t\t\t$last10s[ $team_id ][ $key ]     = 0;\n\t\t\t\t$homerecords[ $team_id ][ $key ] = 0;\n\t\t\t\t$awayrecords[ $team_id ][ $key ] = 0;\n\t\t\tendforeach;\n\n\t\t\t// Initialize team totals\n\t\t\t$totals[ $team_id ] = array(\n\t\t\t\t'eventsplayed'       => 0,\n\t\t\t\t'eventsplayed_home'  => 0,\n\t\t\t\t'eventsplayed_away'  => 0,\n\t\t\t\t'eventsplayed_venue' => 0,\n\t\t\t\t'eventminutes'       => 0,\n\t\t\t\t'eventminutes_home'  => 0,\n\t\t\t\t'eventminutes_away'  => 0,\n\t\t\t\t'eventminutes_venue' => 0,\n\t\t\t\t'streak'             => 0,\n\t\t\t\t'streak_home'        => 0,\n\t\t\t\t'streak_away'        => 0,\n\t\t\t\t'streak_venue'       => 0,\n\t\t\t);\n\n\t\t\tforeach ( $result_labels as $key => $value ) :\n\t\t\t\t$totals[ $team_id ][ $key . 'for' ]           = 0;\n\t\t\t\t$totals[ $team_id ][ $key . 'for_home' ]      = 0;\n\t\t\t\t$totals[ $team_id ][ $key . 'for_away' ]      = 0;\n\t\t\t\t$totals[ $team_id ][ $key . 'for_venue' ]     = 0;\n\t\t\t\t$totals[ $team_id ][ $key . 'against' ]       = 0;\n\t\t\t\t$totals[ $team_id ][ $key . 'against_home' ]  = 0;\n\t\t\t\t$totals[ $team_id ][ $key . 'against_away' ]  = 0;\n\t\t\t\t$totals[ $team_id ][ $key . 'against_venue' ] = 0;\n\t\t\tendforeach;\n\n\t\t\tforeach ( $outcome_labels as $key => $value ) :\n\t\t\t\t$totals[ $team_id ][ $key ]            = 0;\n\t\t\t\t$totals[ $team_id ][ $key . '_home' ]  = 0;\n\t\t\t\t$totals[ $team_id ][ $key . '_away' ]  = 0;\n\t\t\t\t$totals[ $team_id ][ $key . '_venue' ] = 0;\n\t\t\tendforeach;\n\n\t\t\t// Get static stats\n\t\t\t$static = get_post_meta( $team_id, 'sp_columns', true );\n\n\t\t\tif ( 'yes' == get_option( 'sportspress_team_column_editing', 'no' ) && $league_ids && $season_ids ) :\n\t\t\t\t// Add static stats to placeholders\n\t\t\t\tforeach ( $league_ids as $league_id ) :\n\t\t\t\t\tforeach ( $season_ids as $season_id ) :\n\t\t\t\t\t\t$placeholders[ $team_id ] = (array) sp_array_value( sp_array_value( $static, $league_id, array() ), $season_id, array() );\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\tendforeach;\n\n\t\t// Get which event status to include\n\t\t$event_status = get_post_meta( $this->ID, 'sp_event_status', true );\n\n\t\tif ( empty( $event_status ) ) {\n\t\t\t$event_status = array( 'publish', 'future' );\n\t\t}\n\n\t\tif ( isset( $this->show_published_events ) ) { // If an attribute was pass through shortcode\n\t\t\tif ( $this->show_published_events == '1' ) {\n\t\t\t\t$event_status[] = 'publish';\n\t\t\t} else {\n\t\t\t\tif ( ( $status_key = array_search( 'publish', $event_status ) ) !== false ) {\n\t\t\t\t\tunset( $event_status[ $status_key ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $this->show_future_events ) ) { // If an attribute was pass through shortcode\n\t\t\tif ( $this->show_future_events == '1' ) {\n\t\t\t\t$event_status[] = 'future';\n\t\t\t} else {\n\t\t\t\tif ( ( $status_key = array_search( 'future', $event_status ) ) !== false ) {\n\t\t\t\t\tunset( $event_status[ $status_key ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Make sure to have unique values in the array\n\t\t$event_status = array_unique( $event_status );\n\n\t\t$args = array(\n\t\t\t'post_type'      => 'sp_event',\n\t\t\t'post_status'    => $event_status,\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'post_date',\n\t\t\t'order'          => 'DESC',\n\t\t\t'meta_query'     => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t'value'   => apply_filters( 'sportspress_competitive_event_formats', array( 'league' ) ),\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'tax_query'      => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t),\n\t\t);\n\n\t\tif ( $league_ids ) :\n\t\t\t$args['tax_query'][] = array(\n\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t'field'    => 'term_id',\n\t\t\t\t'terms'    => $league_ids,\n\t\t\t);\n\t\tendif;\n\n\t\tif ( $season_ids ) :\n\t\t\t$args['tax_query'][] = array(\n\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t'field'    => 'term_id',\n\t\t\t\t'terms'    => $season_ids,\n\t\t\t);\n\t\tendif;\n\n\t\tif ( $this->date !== 0 ) :\n\t\t\tif ( $this->date == 'w' ) :\n\t\t\t\t$args['year'] = date_i18n( 'Y' );\n\t\t\t\t$args['w']    = date_i18n( 'W' );\n\t\t\telseif ( $this->date == 'day' ) :\n\t\t\t\t$args['year']     = date_i18n( 'Y' );\n\t\t\t\t$args['day']      = date_i18n( 'j' );\n\t\t\t\t$args['monthnum'] = date_i18n( 'n' );\n\t\t\telseif ( $this->date == 'range' ) :\n\t\t\t\tif ( $this->relative ) :\n\t\t\t\t\tadd_filter( 'posts_where', array( $this, 'relative' ) );\n\t\t\t\telse :\n\t\t\t\t\tadd_filter( 'posts_where', array( $this, 'range' ) );\n\t\t\t\tendif;\n\t\t\tendif;\n\t\tendif;\n\n\t\t$args = apply_filters( 'sportspress_table_data_event_args', $args );\n\n\t\tif ( ! $is_main_loop ) :\n\t\t\tif ( sizeof( $team_ids ) ) :\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key'     => 'sp_team',\n\t\t\t\t\t'value'   => $team_ids,\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t);\n\t\t\tendif;\n\t\tendif;\n\n\t\t$events = get_posts( $args );\n\n\t\t// Remove range filters\n\t\tremove_filter( 'posts_where', array( $this, 'range' ) );\n\t\tremove_filter( 'posts_where', array( $this, 'relative' ) );\n\n\t\t$e = 0;\n\n\t\t// Event loop\n\t\tforeach ( $events as $event ) :\n\n\t\t\t$teams = (array) get_post_meta( $event->ID, 'sp_team', false );\n\t\t\t$teams = array_filter( $teams );\n\t\t\tif ( ! $is_main_loop && sizeof( array_diff( $teams, $team_ids ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$results = (array) get_post_meta( $event->ID, 'sp_results', true );\n\n\t\t\t$minutes = (int) get_post_meta( $event->ID, 'sp_minutes', true );\n\t\t\t$minutes = $minutes ? $minutes : (int) get_option( 'sportspress_event_minutes', 90 );\n\n\t\t\t$i = 0;\n\n\t\t\tforeach ( $results as $team_id => $team_result ) :\n\n\t\t\t\tif ( ! in_array( $team_id, $teams ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! in_array( $team_id, $team_ids ) ) {\n\t\t\t\t\t$i++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $team_result ) :\n\t\t\t\t\tforeach ( $team_result as $key => $value ) :\n\n\t\t\t\t\t\tif ( $key == 'outcome' ) :\n\n\t\t\t\t\t\t\tif ( ! is_array( $value ) ) :\n\t\t\t\t\t\t\t\t$value = array( $value );\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\tforeach ( $value as $outcome ) :\n\n\t\t\t\t\t\t\t\t// Increment events played and outcome count\n\t\t\t\t\t\t\t\tif ( array_key_exists( $team_id, $totals ) && is_array( $totals[ $team_id ] ) && array_key_exists( $outcome, $totals[ $team_id ] ) ) :\n\t\t\t\t\t\t\t\t\t$totals[ $team_id ]['eventsplayed'] ++;\n\t\t\t\t\t\t\t\t\t$totals[ $team_id ]['eventminutes'] = (int) $totals[ $team_id ]['eventminutes'] + $minutes;\n\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $outcome ] ++;\n\n\t\t\t\t\t\t\t\t\t// Add to home or away stats\n\t\t\t\t\t\t\t\t\tif ( 0 === $i ) :\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ]['eventsplayed_home'] ++;\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ]['eventminutes_home'] = (int) $totals[ $team_id ]['eventminutes_home'] + $minutes;\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $outcome . '_home' ] ++;\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ]['eventsplayed_away'] ++;\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ]['eventminutes_away'] = (int) $totals[ $team_id ]['eventminutes_away'] + $minutes;\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $outcome . '_away' ] ++;\n\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t// Add to venue stats\n\t\t\t\t\t\t\t\t\tif ( sp_is_home_venue( $team_id, $event->ID ) ) :\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ]['eventsplayed_venue'] ++;\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ]['eventminutes_venue'] = (int) $totals[ $team_id ]['eventminutes_venue'] + $minutes;\n\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $outcome . '_venue' ] ++;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\tif ( $outcome && $outcome != '-1' ) :\n\n\t\t\t\t\t\t\t\t\t// Add to streak counter\n\t\t\t\t\t\t\t\t\tif ( $streaks[ $team_id ]['fire'] && ( $streaks[ $team_id ]['name'] == '' || $streaks[ $team_id ]['name'] == $outcome ) ) :\n\t\t\t\t\t\t\t\t\t\t$streaks[ $team_id ]['name'] = $outcome;\n\t\t\t\t\t\t\t\t\t\t$streaks[ $team_id ]['count'] ++;\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$streaks[ $team_id ]['fire'] = 0;\n\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t// Add to form counter\n\t\t\t\t\t\t\t\t\t$forms[ $team_id ][] = array(\n\t\t\t\t\t\t\t\t\t\t'id'      => $event->ID,\n\t\t\t\t\t\t\t\t\t\t'outcome' => $outcome,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t// Add to last 5 counter if sum is less than 5\n\t\t\t\t\t\t\t\t\tif ( array_key_exists( $team_id, $last5s ) && array_key_exists( $outcome, $last5s[ $team_id ] ) && array_sum( $last5s[ $team_id ] ) < 5 ) :\n\t\t\t\t\t\t\t\t\t\t$last5s[ $team_id ][ $outcome ] ++;\n\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t// Add to last 10 counter if sum is less than 10\n\t\t\t\t\t\t\t\t\tif ( array_key_exists( $team_id, $last10s ) && array_key_exists( $outcome, $last10s[ $team_id ] ) && array_sum( $last10s[ $team_id ] ) < 10 ) :\n\t\t\t\t\t\t\t\t\t\t$last10s[ $team_id ][ $outcome ] ++;\n\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t// Add to home or away record\n\t\t\t\t\t\t\t\t\tif ( 0 === $i ) {\n\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $team_id, $homerecords ) && array_key_exists( $outcome, $homerecords[ $team_id ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t$homerecords[ $team_id ][ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $team_id, $awayrecords ) && array_key_exists( $outcome, $awayrecords[ $team_id ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t$awayrecords[ $team_id ][ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $team_id, $totals ) && is_array( $totals[ $team_id ] ) && array_key_exists( $key . 'for', $totals[ $team_id ] ) ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Get numeric value\n\t\t\t\t\t\t\t\t\t\t\t\t$value = floatval( $value );\n\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'for' ]             += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'for' . ( $e + 1 ) ] = $value;\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Add to home or away stats\n\t\t\t\t\t\t\t\t\t\t\t\tif ( 0 === $i ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'for_home' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'for_away' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Add to venue stats\n\t\t\t\t\t\t\t\t\t\t\t\tif ( sp_is_home_venue( $team_id, $event->ID ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'for_venue' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $results as $other_team_id => $other_result ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $other_team_id != $team_id && array_key_exists( $key . 'against', $totals[ $team_id ] ) ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Get numeric value of other team's result\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$value = floatval( sp_array_value( $other_result, $key, 0 ) );\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'against' ]             += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'against' . ( $e + 1 ) ] = $value;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Add to home or away stats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( 0 === $i ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'against_home' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'against_away' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Add to venue stats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( sp_is_home_venue( $team_id, $event->ID ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $team_id ][ $key . 'against_venue' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\tendforeach;\nendif;\n\n\t\t\t\t$i++;\n\n\t\t\tendforeach;\n\n\t\t\t$e++;\n\n\t\tendforeach;\n\n\t\t// Get outcomes\n\t\t$outcomes = array();\n\n\t\t$args  = array(\n\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t'post_status'    => 'publish',\n\t\t\t'posts_per_page' => -1,\n\t\t);\n\t\t$posts = get_posts( $args );\n\n\t\tif ( $posts ) :\n\t\t\tforeach ( $posts as $post ) :\n\t\t\t\t// Get ID\n\t\t\t\t$id = $post->ID;\n\n\t\t\t\t// Get title\n\t\t\t\t$title = $post->post_title;\n\n\t\t\t\t// Get abbreviation\n\t\t\t\t$abbreviation = get_post_meta( $id, 'sp_abbreviation', true );\n\t\t\t\tif ( ! $abbreviation ) :\n\t\t\t\t\t$abbreviation = substr( $title, 0, 1 );\n\t\t\t\tendif;\n\n\t\t\t\t// Get color\n\t\t\t\t$color = get_post_meta( $id, 'sp_color', true );\n\t\t\t\tif ( '' === $color ) {\n\t\t\t\t\t$color = '#888888';\n\t\t\t\t}\n\n\t\t\t\t$outcomes[ $post->post_name ] = array(\n\t\t\t\t\t'id'           => $id,\n\t\t\t\t\t'title'        => $title,\n\t\t\t\t\t'abbreviation' => $abbreviation,\n\t\t\t\t\t'color'        => $color,\n\t\t\t\t);\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tforeach ( $streaks as $team_id => $streak ) :\n\t\t\t// Compile streaks counter and add to totals\n\t\t\tif ( $streak['name'] ) :\n\t\t\t\t$outcome = sp_array_value( $outcomes, $streak['name'], false );\n\t\t\t\tif ( $outcome ) :\n\t\t\t\t\t$color                        = $outcome['color'];\n\t\t\t\t\t$totals[ $team_id ]['streak'] = '<span style=\"color:' . $color . '\">' . $outcome['abbreviation'] . $streak['count'] . '</span>';\n\t\t\t\telse :\n\t\t\t\t\t$totals[ $team_id ]['streak'] = null;\n\t\t\t\tendif;\n\t\t\telse :\n\t\t\t\t$totals[ $team_id ]['streak'] = null;\n\t\t\tendif;\n\t\tendforeach;\n\n\t\tforeach ( $forms as $team_id => $form ) :\n\t\t\t// Apply form limit\n\t\t\tif ( $form_limit && sizeof( $form ) > $form_limit ) :\n\t\t\t\t$form = array_slice( $form, 0, $form_limit );\n\t\t\tendif;\n\n\t\t\t// Initialize team form array\n\t\t\t$team_form = array();\n\n\t\t\t// Reverse form array to display in chronological order\n\t\t\t$form = array_reverse( $form );\n\n\t\t\t// Loop through event form\n\t\t\tforeach ( $form as $form_event ) :\n\t\t\t\tif ( $form_event['id'] ) :\n\t\t\t\t\t$outcome = sp_array_value( $outcomes, $form_event['outcome'], false );\n\t\t\t\t\tif ( $outcome ) :\n\t\t\t\t\t\t$abbreviation = $outcome['abbreviation'];\n\t\t\t\t\t\t$color        = $outcome['color'];\n\t\t\t\t\t\tif ( $link_events ) :\n\t\t\t\t\t\t\t$abbreviation = '<a class=\"sp-form-event-link\" href=\"' . get_post_permalink( $form_event['id'], false, true ) . '\" style=\"background-color:' . $color . '\">' . $abbreviation . '</a>';\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t$abbreviation = '<span class=\"sp-form-event-link\" style=\"background-color:' . $color . '\">' . $abbreviation . '</span>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t// Add to team form\n\t\t\t\t\t\t$team_form[] = $abbreviation;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\n\t\t\t// Append to totals\n\t\t\tif ( sizeof( $team_form ) ) :\n\t\t\t\t$totals[ $team_id ]['form'] = '<div class=\"sp-form-events\">' . implode( ' ', $team_form ) . '</div>';\n\t\t\telse :\n\t\t\t\t$totals[ $team_id ]['form'] = null;\n\t\t\tendif;\n\t\tendforeach;\n\n\t\tforeach ( $last5s as $team_id => $last5 ) :\n\t\t\t// Add last 5 to totals\n\t\t\t$totals[ $team_id ]['last5'] = $last5;\n\t\tendforeach;\n\n\t\tforeach ( $last10s as $team_id => $last10 ) :\n\t\t\t// Add last 10 to totals\n\t\t\t$totals[ $team_id ]['last10'] = $last10;\n\t\tendforeach;\n\n\t\tforeach ( $homerecords as $team_id => $homerecord ) :\n\t\t\t// Add home record to totals\n\t\t\t$totals[ $team_id ]['homerecord'] = $homerecord;\n\t\tendforeach;\n\n\t\tforeach ( $awayrecords as $team_id => $awayrecord ) :\n\t\t\t// Add away record to totals\n\t\t\t$totals[ $team_id ]['awayrecord'] = $awayrecord;\n\t\tendforeach;\n\n\t\t$args  = array(\n\t\t\t'post_type'      => 'sp_column',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\t\t$stats = get_posts( $args );\n\n\t\t$columns          = array();\n\t\t$this->priorities = array();\n\n\t\tforeach ( $stats as $stat ) :\n\n\t\t\t// Get post meta\n\t\t\t$meta = get_post_meta( $stat->ID );\n\n\t\t\t// Add equation to object\n\t\t\t$stat->equation  = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, null );\n\t\t\t$stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 );\n\n\t\t\t// Add column name to columns\n\t\t\t$columns[ $stat->post_name ] = $stat->post_title;\n\n\t\t\t// Add order to priorities if priority is set and does not exist in array already\n\t\t\t$priority = sp_array_value( sp_array_value( $meta, 'sp_priority', array() ), 0, 0 );\n\t\t\tif ( $priority && ! array_key_exists( $priority, $this->priorities ) ) :\n\t\t\t\t$this->priorities[ $priority ] = array(\n\t\t\t\t\t'column' => $stat->post_name,\n\t\t\t\t\t'order'  => sp_array_value( sp_array_value( $meta, 'sp_order', array() ), 0, 'DESC' ),\n\t\t\t\t);\n\t\t\tendif;\n\n\t\tendforeach;\n\n\t\t// Sort priorities in descending order\n\t\tksort( $this->priorities );\n\n\t\t// Initialize games back column variable\n\t\t$gb_column = null;\n\n\t\t// Fill in empty placeholder values for each team\n\t\tforeach ( $team_ids as $team_id ) :\n\t\t\tif ( ! $team_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$placeholders[ $team_id ] = array();\n\n\t\t\tforeach ( $stats as $stat ) :\n\t\t\t\tif ( sp_array_value( sp_array_value( $placeholders, $team_id, array() ), $stat->post_name, '' ) == '' ) :\n\n\t\t\t\t\tif ( $stat->equation == null ) :\n\t\t\t\t\t\t$placeholder = sp_array_value( sp_array_value( $adjustments, $team_id, array() ), $stat->post_name, null );\n\t\t\t\t\t\tif ( $placeholder == null ) :\n\t\t\t\t\t\t\t$placeholder = '-';\n\t\t\t\t\t\tendif;\n\t\t\t\t\telse :\n\t\t\t\t\t\t// Solve\n\t\t\t\t\t\t$placeholder = sp_solve( $stat->equation, sp_array_value( $totals, $team_id, array() ), $stat->precision, 0, $team_id );\n\n\t\t\t\t\t\tif ( '$gamesback' == $stat->equation ) {\n\t\t\t\t\t\t\t$gb_column = $stat->post_name;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! in_array( $stat->equation, apply_filters( 'sportspress_equation_presets', array( '$gamesback', '$streak', '$form', '$last5', '$last10', '$homerecord', '$awayrecord' ) ) ) ) :\n\t\t\t\t\t\t\t// Adjustments\n\t\t\t\t\t\t\t$adjustment = sp_array_value( $adjustments, $team_id, array() );\n\n\t\t\t\t\t\t\tif ( $adjustment != 0 ) :\n\t\t\t\t\t\t\t\t$value        = floatval( sp_array_value( $adjustment, $stat->post_name, 0 ) );\n\t\t\t\t\t\t\t\t$placeholder += $value;\n\t\t\t\t\t\t\t\t$placeholder  = number_format( $placeholder, $stat->precision, '.', '' );\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$placeholders[ $team_id ][ $stat->post_name ] = $placeholder;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\tendforeach;\n\n\t\t// Find win and loss variables for games back\n\t\t$w = $l = null;\n\t\tif ( $gb_column ) {\n\t\t\t$args     = array(\n\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t'numberposts'    => 1,\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => 'sp_condition',\n\t\t\t\t\t\t'value' => '>',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t\t$outcomes = get_posts( $args );\n\n\t\t\tif ( $outcomes ) {\n\t\t\t\t$outcome = reset( $outcomes );\n\t\t\t\tif ( is_array( $stats ) ) {\n\t\t\t\t\tforeach ( $stats as $stat ) {\n\t\t\t\t\t\tif ( '$' . $outcome->post_name == $stat->equation ) {\n\t\t\t\t\t\t\t$w = $stat->post_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Calculate games back\n\t\t\t$args     = array(\n\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t'numberposts'    => 1,\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => 'sp_condition',\n\t\t\t\t\t\t'value' => '<',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t\t$outcomes = get_posts( $args );\n\n\t\t\tif ( $outcomes ) {\n\t\t\t\t$outcome = reset( $outcomes );\n\t\t\t\tif ( is_array( $stats ) ) {\n\t\t\t\t\tforeach ( $stats as $stat ) {\n\t\t\t\t\t\tif ( '$' . $outcome->post_name == $stat->equation ) {\n\t\t\t\t\t\t\t$l = $stat->post_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Merge the data and placeholders arrays\n\t\t$merged = array();\n\n\t\tforeach ( $placeholders as $team_id => $team_data ) :\n\n\t\t\t// Add team name to row\n\t\t\t$merged[ $team_id ] = array();\n\n\t\t\t$team_data['name'] = sp_team_short_name( $team_id );\n\n\t\t\tforeach ( $team_data as $key => $value ) :\n\n\t\t\t\t// Use static data if key exists and value is not empty, else use placeholder\n\t\t\t\tif ( array_key_exists( $team_id, $tempdata ) && array_key_exists( $key, $tempdata[ $team_id ] ) && $tempdata[ $team_id ][ $key ] != '' ) :\n\t\t\t\t\t$value = $tempdata[ $team_id ][ $key ];\n\t\t\t\tendif;\n\n\t\t\t\t$merged[ $team_id ][ $key ] = $value;\n\n\t\t\tendforeach;\n\n\t\tendforeach;\n\n\t\tuasort( $merged, array( $this, 'sort' ) );\n\n\t\t// Calculate position of teams for ties\n\t\tforeach ( $merged as $team_id => $team_columns ) {\n\t\t\t$merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns, $team_id );\n\t\t}\n\n\t\t// Head to head table sorting\n\t\tif ( $is_main_loop && 'h2h' == get_option( 'sportspress_table_tiebreaker', 'none' ) ) {\n\t\t\t$order = array();\n\n\t\t\tforeach ( $this->tiebreakers as $pos => $teams ) {\n\t\t\t\tif ( sizeof( $teams ) === 1 ) {\n\t\t\t\t\t$order[] = reset( $teams );\n\t\t\t\t} else {\n\t\t\t\t\t$standings = $this->data( false, $teams );\n\t\t\t\t\t$teams     = array_keys( $standings );\n\t\t\t\t\tforeach ( $teams as $team ) {\n\t\t\t\t\t\t$order[] = $team;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$head_to_head = array();\n\t\t\tforeach ( $order as $team ) {\n\t\t\t\t$head_to_head[ $team ] = sp_array_value( $merged, $team, array() );\n\t\t\t}\n\t\t\t$merged = $head_to_head;\n\n\t\t\t// Recalculate position of teams after head to head\n\t\t\t$this->pos     = 0;\n\t\t\t$this->counter = 0;\n\t\t\tforeach ( $merged as $team_id => $team_columns ) {\n\t\t\t\t$merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns, $team_id, false );\n\t\t\t}\n\t\t}\n\n\t\t// Rearrange the table if Default ordering is not selected\n\t\tif ( $this->orderby != 'default' ) {\n\t\t\tuasort( $merged, array( $this, 'simple_order' ) );\n\t\t\t// Recalculate position of teams\n\t\t\t$this->pos     = 0;\n\t\t\t$this->counter = 0;\n\t\t\tforeach ( $merged as $team_id => $team_columns ) {\n\t\t\t\t$merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns, $team_id, false );\n\t\t\t}\n\t\t}\n\n\t\t// Rearrange data array to reflect values\n\t\t$data = array();\n\t\tforeach ( $merged as $key => $value ) :\n\t\t\t$data[ $key ] = $tempdata[ $key ];\n\t\tendforeach;\n\n\t\tif ( ! $is_main_loop ) :\n\t\t\treturn $merged;\n\t\telseif ( $admin ) :\n\t\t\t$this->add_gb( $placeholders, $w, $l, $gb_column );\n\t\t\treturn array( $columns, $usecolumns, $data, $placeholders, $merged );\n\t\telse :\n\t\t\t$this->add_gb( $merged, $w, $l, $gb_column );\n\t\t\tif ( ! is_array( $usecolumns ) ) {\n\t\t\t\t$usecolumns = array();\n\t\t\t}\n\t\t\t$labels    = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'pos'  => esc_attr__( 'Pos', 'sportspress' ),\n\t\t\t\t\t'name' => esc_attr__(\n\t\t\t\t\t\t'Team',\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t$columns\n\t\t\t);\n\t\t\t$merged[0] = $labels;\n\t\t\treturn $merged;\n\t\tendif;\n\t}\n\n\t/**\n\t * Sort the table by priorities.\n\t *\n\t * @param array $a\n\t * @param array $b\n\t * @return int\n\t */\n\tpublic function sort( $a, $b ) {\n\n\t\t// Loop through priorities\n\t\tforeach ( $this->priorities as $priority ) :\n\n\t\t\t// Proceed if columns are not equal\n\t\t\tif ( sp_array_value( $a, $priority['column'], 0 ) != sp_array_value( $b, $priority['column'], 0 ) ) :\n\n\t\t\t\t// Compare column values\n\t\t\t\t$output = (float) sp_array_value( $a, $priority['column'], 0 ) - (float) sp_array_value( $b, $priority['column'], 0 );\n\n\t\t\t\t// Flip value if descending order\n\t\t\t\tif ( $priority['order'] == 'DESC' ) {\n\t\t\t\t\t$output = 0 - $output;\n\t\t\t\t}\n\n\t\t\t\treturn ( $output > 0 ? 1 : -1 );\n\n\t\t\tendif;\n\n\t\tendforeach;\n\n\t\t// Default sort by alphabetical\n\t\treturn strcmp( sp_array_value( $a, 'name', '' ), sp_array_value( $b, 'name', '' ) );\n\t}\n\n\t/**\n\t * Sort the table by ordering.\n\t *\n\t * @param array $a\n\t * @param array $b\n\t * @return int\n\t */\n\tpublic function simple_order( $a, $b ) {\n\n\t\tif ( $this->orderbyorder == 'DESC' ) {\n\t\t\tif ( $this->orderby == 'name' ) {\n\t\t\t\treturn strcmp( sp_array_value( $b, 'name', '' ), sp_array_value( $a, 'name', '' ) );\n\t\t\t} else {\n\t\t\t\treturn (float) $b[ $this->orderby ] - (float) $a[ $this->orderby ];\n\t\t\t}\n\t\t} else {\n\t\t\tif ( $this->orderby == 'name' ) {\n\t\t\t\treturn strcmp( sp_array_value( $a, 'name', '' ), sp_array_value( $b, 'name', '' ) );\n\t\t\t} else {\n\t\t\t\treturn (float) $a[ $this->orderby ] - (float) $b[ $this->orderby ];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Find accurate position of teams.\n\t *\n\t * @param array $columns\n\t * @param int   $id\n\t * @return int\n\t */\n\tpublic function calculate_pos( $columns, $id = 0, $add_tiebreakers = true ) {\n\t\t$this->counter++;\n\n\t\t$pos = $this->increment( $columns );\n\n\t\tif ( $add_tiebreakers ) {\n\t\t\t// Initialize tiebreaker position\n\t\t\tif ( ! array_key_exists( $this->pos, $this->tiebreakers ) ) {\n\t\t\t\t$this->tiebreakers[ $this->pos ] = array();\n\t\t\t}\n\n\t\t\t// Add to tiebreakers\n\t\t\tif ( ! in_array( $id, $this->tiebreakers[ $this->pos ] ) ) {\n\t\t\t\t$this->tiebreakers[ $this->pos ][] = $id;\n\t\t\t}\n\t\t}\n\n\t\treturn $pos;\n\t}\n\n\t/**\n\t * Increment position as needed.\n\t *\n\t * @param array $columns\n\t * @return int\n\t */\n\tpublic function increment( $columns ) {\n\t\t// Replace compare data and use last set\n\t\t$compare       = $this->compare;\n\t\t$this->compare = $columns;\n\n\t\t// Loop through priorities\n\t\tforeach ( $this->priorities as $priority ) :\n\n\t\t\t// Proceed if columns are not equal\n\t\t\tif ( sp_array_value( $columns, $priority['column'], 0 ) !== sp_array_value( $compare, $priority['column'], 0 ) ) :\n\n\t\t\t\t// Increment if not equal\n\t\t\t\t$this->pos = $this->counter;\n\t\t\t\treturn $this->counter;\n\n\t\t\tendif;\n\n\t\tendforeach;\n\n\t\tif ( 'yes' == get_option( 'sportspress_table_increment', 'no' ) ) {\n\t\t\treturn $this->counter;\n\t\t}\n\n\t\t// Repeat position if equal\n\t\treturn $this->pos;\n\t}\n\n\t/**\n\t * Calculate and add games back.\n\t *\n\t * @param array  $a\n\t * @param string $w\n\t * @param string $l\n\t * @param string $column\n\t * @return null\n\t */\n\tpublic function add_gb( &$a, $w = null, $l = null, $column = null ) {\n\t\tif ( ! is_array( $a ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! $w && ! $l ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $a as $team_id => $values ) {\n\t\t\tif ( isset( $leader ) ) {\n\t\t\t\t$gb = ( sp_array_value( $leader, $w, 0 ) - sp_array_value( $values, $w, 0 ) + sp_array_value( $values, $l, 0 ) - sp_array_value( $leader, $l, 0 ) ) / 2;\n\t\t\t\tif ( 0 == sp_array_value( $values, $column ) && 0 !== $gb ) {\n\t\t\t\t\t$a[ $team_id ][ $column ] = $gb;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$leader = $values;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-modules.php",
    "content": "<?php\n/**\n * SportsPress modules\n *\n * The SportsPress modules class stores available modules.\n *\n * @class       SP_Modules\n * @version     2.6.15\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Modules {\n\n\t/** @var array Array of modules */\n\tpublic $data;\n\n\t/**\n\t * Constructor for the modules class - defines all default modules.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function __construct() {\n\t\t$this->data = apply_filters(\n\t\t\t'sportspress_modules',\n\t\t\tarray(\n\t\t\t\t'event'        => array(\n\t\t\t\t\t'calendars'      => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Calendars', 'sportspress' ),\n\t\t\t\t\t\t'icon'  => 'sp-icon-calendar',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Organize and publish calendars using different layouts.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'results_matrix' => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Results Matrix', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Results_Matrix',\n\t\t\t\t\t\t'icon'  => 'sp-icon-matrix',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/results-matrix/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Display fixtures and results between teams in a grid layout.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'scoreboard'     => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Scoreboard', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Scoreboard',\n\t\t\t\t\t\t'icon'  => 'sp-icon-scoreboard',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/scoreboard/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Display multiple event results in a horizontal scoreboard.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'google_maps'    => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Google Maps', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Google_Maps',\n\t\t\t\t\t\t'icon'  => 'sp-icon-location',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/google-maps/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Use Google Maps instead of OpenStreetMap for venues.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'user_scores'    => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'User Scores', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_User_Scores',\n\t\t\t\t\t\t'icon'  => 'sp-icon-user-scores',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/user-scores/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Let players, staff, and visitors submit event scores for review.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'match_stats'    => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Match Stats', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Match_Stats',\n\t\t\t\t\t\t'icon'  => 'sp-icon-statistics',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/match-stats/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Display head-to-head team comparison charts in events.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'past_meetings'  => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Past Meetings', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Past_Meetings',\n\t\t\t\t\t\t'icon'  => 'sp-icon-history',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/past-meetings/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Display previous events between teams in list or blocks layout.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'timelines'      => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Timelines', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Timelines',\n\t\t\t\t\t\t'icon'  => 'sp-icon-timeline',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/timelines/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Display a visual timeline of player performance in events.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'tournaments'    => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Tournaments', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Tournaments',\n\t\t\t\t\t\t'icon'  => 'sp-icon-tournament',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/tournaments/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Schedule tournaments and create interactive playoff brackets.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'team'         => array(\n\t\t\t\t\t'league_tables' => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'League Tables', 'sportspress' ),\n\t\t\t\t\t\t'icon'  => 'sp-icon-chart',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Create automated league tables to keep track of team standings.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'league_menu'   => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'League Menu', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_League_Menu',\n\t\t\t\t\t\t'icon'  => 'sp-icon-menu',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/league-menu/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Add a global navigation bar to display logos that link to each team.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'team_colors'   => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Team Colors', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Team_Colors',\n\t\t\t\t\t\t'icon'  => 'sp-icon-color',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/team-colors/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Create a custom color palette for each team.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'team_access'   => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Team Access', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Team_Access',\n\t\t\t\t\t\t'icon'  => 'sp-icon-key',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/team-access/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Limit user access to data that is related to their team.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'player_staff' => array(\n\t\t\t\t\t'player_lists'        => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Player Lists', 'sportspress' ),\n\t\t\t\t\t\t'icon'  => 'sp-icon-list',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Create team rosters, player galleries, and ranking charts.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'midseason_transfers' => array(\n\t\t\t\t\t\t'label'   => esc_attr__( 'Midseason Transfers', 'sportspress' ),\n\t\t\t\t\t\t'class'   => 'SportsPress_Midseason_Transfers',\n\t\t\t\t\t\t'icon'    => 'sp-icon-sub',\n\t\t\t\t\t\t'link'    => 'https://www.themeboy.com/sportspress-extensions/midseason-transfers/',\n\t\t\t\t\t\t'desc'    => esc_attr__( 'Statistics for players who transferred between teams during a season.', 'sportspress' ),\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t\t'staff_directories'   => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Directories', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Staff_Directories',\n\t\t\t\t\t\t'icon'  => 'sp-icon-archive',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/directories/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Organize and display staff in list and gallery layouts.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'officials'           => array(\n\t\t\t\t\t\t'label'   => esc_attr__( 'Officials', 'sportspress' ),\n\t\t\t\t\t\t'icon'    => 'sp-icon-whistle',\n\t\t\t\t\t\t'desc'    => esc_attr__( 'Manage referees, umpires, judges, timekeepers, and other officials.', 'sportspress' ),\n\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'admin'        => array(\n\t\t\t\t\t'tutorials'  => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Tutorials', 'sportspress' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-video-alt3',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Display a dashboard page with SportsPress video tutorials.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'branding'   => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Branding', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Branding',\n\t\t\t\t\t\t'icon'  => 'sp-icon-sportspress',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/branding/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Instantly rebrand the dashboard with your own logo and colors.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'duplicator' => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Duplicator', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Duplicator',\n\t\t\t\t\t\t'icon'  => 'sp-icon-copy',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/duplicator/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Clone anything with just one click. Great for creating multiple events.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'other'        => array(\n\t\t\t\t\t'twitter'  => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Twitter', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Twitter',\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-twitter',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/twitter/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Add a Twitter feed to team, player, and staff pages.', 'sportspress' ),\n\t\t\t\t\t\t'tip'   => esc_attr__( 'Free', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'facebook' => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Facebook', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Facebook',\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-facebook',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/facebook/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Add a Facebook Page widget to embed and promote each team.', 'sportspress' ),\n\t\t\t\t\t\t'tip'   => esc_attr__( 'Free', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'sponsors' => array(\n\t\t\t\t\t\t'label' => esc_attr__( 'Sponsors', 'sportspress' ),\n\t\t\t\t\t\t'class' => 'SportsPress_Sponsors',\n\t\t\t\t\t\t'icon'  => 'sp-icon-megaphone',\n\t\t\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/sponsors/',\n\t\t\t\t\t\t'desc'  => esc_attr__( 'Attract sponsors by offering them advertising space on your website.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( class_exists( 'BuddyPress' ) ) {\n\t\t\t$this->data['other']['buddypress'] = array(\n\t\t\t\t'label' => esc_attr__( 'BuddyPress', 'sportspress' ),\n\t\t\t\t'class' => 'BP_SportsPress_Component',\n\t\t\t\t'icon'  => 'sp-icon-buddypress',\n\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/buddypress/',\n\t\t\t\t'desc'  => esc_attr__( 'Easily display SportsPress player information in BuddyPress profiles.', 'sportspress' ),\n\t\t\t\t'tip'   => esc_attr__( 'Premium', 'sportspress' ),\n\t\t\t);\n\t\t}\n\n\t\tif ( class_exists( 'WooCommerce' ) ) {\n\t\t\t$this->data['other']['woocommerce'] = array(\n\t\t\t\t'label' => esc_attr__( 'WooCommerce', 'sportspress' ),\n\t\t\t\t'class' => 'WooCommerce_SportsPress',\n\t\t\t\t'icon'  => 'sp-icon-woo',\n\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/woocommerce/',\n\t\t\t\t'desc'  => esc_attr__( 'Sell team merchandise by integrating WooCommerce with SportsPress.', 'sportspress' ),\n\t\t\t\t'tip'   => esc_attr__( 'Premium', 'sportspress' ),\n\t\t\t);\n\t\t}\n\n\t\tif ( defined( 'WPSEO_FILE' ) ) {\n\t\t\t$this->data['other']['yoast_seo'] = array(\n\t\t\t\t'label' => esc_attr__( 'Yoast SEO', 'sportspress' ),\n\t\t\t\t'class' => 'Yoast_SEO_SportsPress',\n\t\t\t\t'icon'  => 'sp-icon-yoast',\n\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/yoast-seo/',\n\t\t\t\t'desc'  => esc_attr__( 'Generate custom titles for SportsPress pages using Yoast SEO.', 'sportspress' ),\n\t\t\t\t'tip'   => esc_attr__( 'Free', 'sportspress' ),\n\t\t\t);\n\t\t}\n\n\t\tif ( is_multisite() ) {\n\t\t\t$this->data['other']['multisite'] = array(\n\t\t\t\t'label' => esc_attr__( 'Multisite', 'sportspress' ),\n\t\t\t\t'class' => 'SportsPress_Multisite',\n\t\t\t\t'icon'  => 'sp-icon-globe',\n\t\t\t\t'link'  => 'https://www.themeboy.com/sportspress-extensions/multisite/',\n\t\t\t\t'desc'  => esc_attr__( 'Manage multiple sports and display different widgets all on one site.', 'sportspress' ),\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic function __set( $key, $value ) {\n\t\t$this->data[ $key ] = $value;\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-player-list.php",
    "content": "<?php\n/**\n * Player List Class\n *\n * The SportsPress player list class handles individual player list data.\n *\n * @class       SP_Player_List\n * @version     2.7.26\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Player_List extends SP_Secondary_Post {\n\n\t/** @var array The columns array. */\n\tpublic $columns;\n\n\t/** @var array The sort priorities array. */\n\tpublic $priorities;\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct( $post ) {\n\t\tparent::__construct( $post );\n\t\t$this->columns = get_post_meta( $this->ID, 'sp_columns', true );\n\t\tif ( is_array( $this->columns ) ) {\n\t\t\t$this->columns = array_filter( $this->columns );\n\t\t} else {\n\t\t\t$this->columns = array( 'number', 'team', 'position' );\n\t\t}\n\t}\n\n\t/**\n\t * Returns formatted data\n\t *\n\t * @access public\n\t * @param bool $admin\n\t * @return array\n\t */\n\tpublic function data( $admin = false, $leagues = null, $seasons = null, $team_id = null ) {\n\t\tif ( ! is_null( $leagues ) && '0' != $leagues ) {\n\t\t\t$league_ids = explode( ',', $leagues );\n\t\t} else {\n\t\t\t$league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' );\n\t\t}\n\t\tif ( ! is_null( $seasons ) && '0' != $seasons ) {\n\t\t\t$season_ids = explode( ',', $seasons );\n\t\t} else {\n\t\t\t$season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );\n\t\t}\n\t\t$position_ids = sp_get_the_term_ids( $this->ID, 'sp_position' );\n\t\tif ( ! is_null( $team_id ) && '0' != $team_id ) {\n\t\t\t$team = $team_id;\n\t\t} else {\n\t\t\t$team = get_post_meta( $this->ID, 'sp_team', true );\n\t\t}\n\t\t$era           = get_post_meta( $this->ID, 'sp_era', true );\n\t\t$list_stats    = (array) get_post_meta( $this->ID, 'sp_players', true );\n\t\t$adjustments   = get_post_meta( $this->ID, 'sp_adjustments', true );\n\t\t$orderby       = get_post_meta( $this->ID, 'sp_orderby', true );\n\t\t$crop          = get_post_meta( $this->ID, 'sp_crop', true );\n\t\t$order         = get_post_meta( $this->ID, 'sp_order', true );\n\t\t$select        = get_post_meta( $this->ID, 'sp_select', true );\n\t\t$nationalities = get_post_meta( $this->ID, 'sp_nationality', false );\n\t\t$showdob          = get_option( 'sportspress_player_show_birthday', 'no' );\n\t\t$showage          = get_option( 'sportspress_player_show_age', 'no' );\n\n\t\t$this->date = $this->__get( 'date' );\n\n\t\tif ( ! $this->date ) {\n\t\t\t$this->date = 0;\n\t\t}\n\n\t\t// Apply defaults\n\t\tif ( empty( $orderby ) ) {\n\t\t\t$orderby = 'number';\n\t\t}\n\t\tif ( empty( $order ) ) {\n\t\t\t$order = 'ASC';\n\t\t}\n\t\tif ( empty( $select ) ) {\n\t\t\t$select = 'auto';\n\t\t}\n\n\t\tif ( 'range' == $this->date ) {\n\n\t\t\t$this->relative = get_post_meta( $this->ID, 'sp_date_relative', true );\n\n\t\t\tif ( $this->relative ) {\n\n\t\t\t\t$this->past = get_post_meta( $this->ID, 'sp_date_past', true );\n\n\t\t\t} else {\n\n\t\t\t\t$this->from = get_post_meta( $this->ID, 'sp_date_from', true );\n\t\t\t\t$this->to   = get_post_meta( $this->ID, 'sp_date_to', true );\n\n\t\t\t}\n\t\t}\n\n\t\t$weekday = array(\n\t\t\t0 => 'Sunday',\n\t\t\t1 => 'Monday',\n\t\t\t2 => 'Tuesday',\n\t\t\t3 => 'Wednesday',\n\t\t\t4 => 'Thursday',\n\t\t\t5 => 'Friday',\n\t\t\t6 => 'Saturday',\n\t\t);\n\n\t\t$start_of_week = get_option( 'start_of_week' );\n\n\t\t$firstday = $weekday[ $start_of_week ];\n\t\tif ( $start_of_week != 0 ) {\n\t\t\t$lastday = $weekday[ ( $start_of_week - 1 ) ];\n\t\t} else {\n\t\t\t$lastday = $weekday[6];\n\t\t}\n\n\t\t$today = date( 'l' );\n\n\t\t// Get labels from performance variables\n\t\t$performance_labels = (array) sp_get_var_labels( 'sp_performance' );\n\n\t\t// Get labels from outcome variables\n\t\t$outcome_labels = (array) sp_get_var_labels( 'sp_outcome' );\n\n\t\t// Get labels from result variables\n\t\t$result_labels = (array) sp_get_var_labels( 'sp_result' );\n\n\t\t// Get players automatically if set to auto\n\t\tif ( 'auto' == $select ) {\n\t\t\t$player_ids = array();\n\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_player',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'meta_key'       => 'sp_number',\n\t\t\t\t'orderby'        => 'meta_value_num',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t\t'tax_query'      => array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t),\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tif ( $league_ids ) :\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $league_ids,\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\tif ( $season_ids ) :\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $season_ids,\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\t$team_key = 'sp_team';\n\t\t\tif ( $team ) :\n\t\t\t\tswitch ( $era ) :\n\t\t\t\t\tcase 'current':\n\t\t\t\t\t\t$team_key = 'sp_current_team';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'past':\n\t\t\t\t\t\t$team_key = 'sp_past_team';\n\t\t\t\t\t\tbreak;\n\t\t\t\tendswitch;\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => $team_key,\n\t\t\t\t\t\t'value' => $team,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\tif ( $position_ids ) :\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_position',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $position_ids,\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\tif ( $nationalities ) :\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_nationality',\n\t\t\t\t\t\t'value'   => $nationalities,\n\t\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\t$args = apply_filters( 'sportspress_player_list_args', $args, $team );\n\n\t\t\t$players = (array) get_posts( $args );\n\n\t\t\t$players = apply_filters( 'sportspress_player_list_players', $players, $args, $team, $team_key );\n\n\t\t\tif ( $players && is_array( $players ) ) {\n\t\t\t\tforeach ( $players as $player ) {\n\t\t\t\t\t$player_ids[] = $player->ID;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$player_ids = (array) get_post_meta( $this->ID, 'sp_player', false );\n\t\t}\n\n\t\t// Get all leagues populated with stats where available\n\t\t$tempdata = sp_array_combine( $player_ids, $list_stats );\n\n\t\t// Create entry for each player in totals\n\t\t$totals       = array();\n\t\t$placeholders = array();\n\n\t\t// Initialize columns\n\t\t$columns = array();\n\n\t\t$args  = array(\n\t\t\t'post_type'      => array( 'sp_performance', 'sp_metric', 'sp_statistic' ),\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t\t'meta_query'     => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t'value'   => 'number',\n\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t'value'   => array( 'equation', 'text' ),\n\t\t\t\t\t'compare' => 'NOT IN',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$stats = get_posts( $args );\n\n\t\t$formats         = array();\n\t\t$sendoffs        = array();\n\t\t$data            = array();\n\t\t$merged          = array();\n\t\t$column_order    = array();\n\t\t$ordered_columns = array();\n\n\t\tif ( $stats ) :\n\n\t\t\tforeach ( $stats as $stat ) :\n\n\t\t\t\t// Get post meta\n\t\t\t\t$meta = get_post_meta( $stat->ID );\n\n\t\t\t\t// Add equation to object\n\t\t\t\tif ( $stat->post_type == 'sp_metric' ) :\n\t\t\t\t\t$stat->equation = null;\n\t\t\t\telse :\n\t\t\t\t\t$stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, 0 );\n\t\t\t\tendif;\n\n\t\t\t\t// Add precision to object\n\t\t\t\t$stat->precision = (int) sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ) + 0;\n\n\t\t\t\t// Add column icons to columns were is available\n\t\t\t\tif ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' && ( $stat->post_type == 'sp_performance' || $stat->post_type == 'sp_statistic' ) ) {\n\t\t\t\t\t$icon = apply_filters( 'sportspress_event_performance_icons', '', $stat->ID, 1 );\n\t\t\t\t\tif ( $icon != '' ) {\n\t\t\t\t\t\t$columns[ $stat->post_name ] = $icon;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( has_post_thumbnail( $stat ) ) {\n\t\t\t\t\t\t\t$icon                        = get_the_post_thumbnail( $stat, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $stat ) ) );\n\t\t\t\t\t\t\t$columns[ $stat->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $stat->ID, 1 );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$columns[ $stat->post_name ] = $stat->post_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$columns[ $stat->post_name ] = $stat->post_title;\n\t\t\t\t}\n\n\t\t\t\t// Add format\n\t\t\t\t$format = get_post_meta( $stat->ID, 'sp_format', true );\n\t\t\t\tif ( '' === $format ) {\n\t\t\t\t\t$format = 'number';\n\t\t\t\t}\n\t\t\t\t$formats[ $stat->post_name ] = $format;\n\n\t\t\t\t// Add sendoffs\n\t\t\t\t$sendoff = get_post_meta( $stat->ID, 'sp_sendoff', true );\n\t\t\t\tif ( $sendoff ) {\n\t\t\t\t\t$sendoffs[] = $stat->post_name;\n\t\t\t\t}\n\n\t\t\t\t$column_order[] = $stat->post_name;\n\n\t\t\tendforeach;\n\n\t\tendif;\n\n\t\tforeach ( $column_order as $slug ) :\n\n\t\t\tif ( ! in_array( $slug, $this->columns ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$ordered_columns[] = $slug;\n\n\t\tendforeach;\n\n\t\t$diff          = array_diff( $this->columns, $ordered_columns );\n\t\t$this->columns = array_merge( $diff, $ordered_columns );\n\n\t\tforeach ( $player_ids as $player_id ) :\n\t\t\tif ( ! $player_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Initialize player totals\n\t\t\t$totals[ $player_id ] = array(\n\t\t\t\t'eventsattended' => 0,\n\t\t\t\t'eventsplayed'   => 0,\n\t\t\t\t'eventsstarted'  => 0,\n\t\t\t\t'eventssubbed'   => 0,\n\t\t\t\t'eventminutes'   => 0,\n\t\t\t);\n\n\t\t\tforeach ( $performance_labels as $key => $value ) :\n\t\t\t\t$totals[ $player_id ][ $key ] = 0;\n\t\t\tendforeach;\n\n\t\t\tforeach ( $outcome_labels as $key => $value ) :\n\t\t\t\t$totals[ $player_id ][ $key ] = 0;\n\t\t\tendforeach;\n\n\t\t\tforeach ( $result_labels as $key => $value ) :\n\t\t\t\t$totals[ $player_id ][ $key . 'for' ] = $totals[ $player_id ][ $key . 'against' ] = 0;\n\t\t\tendforeach;\n\n\t\t\t// Get metrics\n\t\t\t$metrics = (array) get_post_meta( $player_id, 'sp_metrics', true );\n\t\t\tforeach ( $metrics as $key => $value ) :\n\t\t\t\t$adjustment = sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $key, null );\n\t\t\t\tif ( $adjustment != null ) {\n\t\t\t\t\t$metrics[ $key ] += $adjustment;\n\t\t\t\t}\n\t\t\tendforeach;\n\n\t\t\t// Get static stats\n\t\t\t$static = get_post_meta( $player_id, 'sp_statistics', true );\n\n\t\t\t// Get league and season arrays for static stats\n\t\t\t$static_league_ids = ( empty( $league_ids ) ? array( 0 ) : $league_ids );\n\t\t\t$static_season_ids = ( empty( $season_ids ) ? array( 0 ) : $season_ids );\n\n\t\t\t// Add static stats to placeholders\n\t\t\tif ( $static_league_ids && $static_season_ids ) :\n\t\t\t\tforeach ( $static_league_ids as $league_id ) :\n\t\t\t\t\tforeach ( $static_season_ids as $season_id ) :\n\t\t\t\t\t\t$player_league_season_stats = sp_array_value( sp_array_value( $static, $league_id, array() ), $season_id, array() );\n\t\t\t\t\t\tif ( is_array( $player_league_season_stats ) ) :\n\t\t\t\t\t\t\tforeach ( $player_league_season_stats as $key => $value ) :\n\t\t\t\t\t\t\t\t$current_value                      = sp_array_value( sp_array_value( $placeholders, $player_id, array() ), $key, 0 );\n\t\t\t\t\t\t\t\t$value                              = floatval( $value );\n\t\t\t\t\t\t\t\t$placeholders[ $player_id ][ $key ] = $current_value + $value;\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\telse :\n\t\t\t\t$placeholders[ $player_id ] = sp_array_value( sp_array_value( $static, 0, array() ), 0, array() );\n\t\t\tendif;\n\n\t\t\t// Add metrics to placeholders\n\t\t\t$placeholders[ $player_id ] = array_merge( $metrics, sp_array_value( $placeholders, $player_id, array() ) );\n\t\tendforeach;\n\n\t\t$args = array(\n\t\t\t'post_type'      => 'sp_event',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'order'          => 'DESC',\n\t\t\t'meta_query'     => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t'value'   => apply_filters( 'sportspress_competitive_event_formats', array( 'league' ) ),\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'tax_query'      => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t),\n\t\t);\n\n\t\tif ( $league_ids ) :\n\t\t\t$args['tax_query'][] = array(\n\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t'field'    => 'term_id',\n\t\t\t\t'terms'    => $league_ids,\n\t\t\t);\n\t\tendif;\n\n\t\tif ( $season_ids ) :\n\t\t\t$args['tax_query'][] = array(\n\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t'field'    => 'term_id',\n\t\t\t\t'terms'    => $season_ids,\n\t\t\t);\n\t\tendif;\n\n\t\t$team_key = 'sp_team';\n\t\tif ( $team ) :\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => $team_key,\n\t\t\t\t\t'value'   => $team,\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t),\n\t\t\t);\n\t\tendif;\n\n\t\tif ( $this->date !== 0 ) :\n\t\t\tswitch ( $this->date ) :\n\t\t\t\tcase '-day':\n\t\t\t\t\t$date = new DateTime( date_i18n( 'Y-m-d' ) );\n\t\t\t\t\t$date->modify( '-1 day' );\n\t\t\t\t\t$args['year']     = $date->format( 'Y' );\n\t\t\t\t\t$args['day']      = $date->format( 'j' );\n\t\t\t\t\t$args['monthnum'] = $date->format( 'n' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'day':\n\t\t\t\t\t$args['year']     = date_i18n( 'Y' );\n\t\t\t\t\t$args['day']      = date_i18n( 'j' );\n\t\t\t\t\t$args['monthnum'] = date_i18n( 'n' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+day':\n\t\t\t\t\t$date = new DateTime( date_i18n( 'Y-m-d' ) );\n\t\t\t\t\t$date->modify( '+1 day' );\n\t\t\t\t\t$args['year']     = $date->format( 'Y' );\n\t\t\t\t\t$args['day']      = $date->format( 'j' );\n\t\t\t\t\t$args['monthnum'] = $date->format( 'n' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-w':\n\t\t\t\t\tif ( $start_of_week != '1' ) { // If start of week is not Monday\n\t\t\t\t\t\tif ( $today == $firstday ) { // If today is start of Week\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"last $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"last $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"-2 $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"last $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$args['date_query'] = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'after'     => $after,\n\t\t\t\t\t\t\t\t'before'    => $before,\n\t\t\t\t\t\t\t\t'inclusive' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$date = new DateTime( date_i18n( 'Y-m-d' ) );\n\t\t\t\t\t\t$date->modify( '-1 week' );\n\t\t\t\t\t\t$args['year'] = $date->format( 'Y' );\n\t\t\t\t\t\t$args['w']    = $date->format( 'W' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\tif ( $start_of_week != '1' ) { // If start of week is not Monday\n\t\t\t\t\t\tif ( $today == $firstday ) { // If today is start of Week\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d' );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"next $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t} elseif ( $today == $lastday ) { // If today is the end of Week\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"last $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d' ) . ' 23:59:59';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"last $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"next $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$args['date_query'] = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'after'     => $after,\n\t\t\t\t\t\t\t\t'before'    => $before,\n\t\t\t\t\t\t\t\t'inclusive' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$args['year'] = date_i18n( 'Y' );\n\t\t\t\t\t\t$args['w']    = date_i18n( 'W' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+w':\n\t\t\t\t\tif ( $start_of_week != '1' ) { // If start of week is not Monday\n\t\t\t\t\t\tif ( $today == $lastday ) { // If today is the end of Week\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"next $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"next $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$after  = date_i18n( 'Y-m-d', strtotime( \"next $firstday\" ) );\n\t\t\t\t\t\t\t$before = date_i18n( 'Y-m-d', strtotime( \"+2 $lastday\" ) ) . ' 23:59:59';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$args['date_query'] = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'after'     => $after,\n\t\t\t\t\t\t\t\t'before'    => $before,\n\t\t\t\t\t\t\t\t'inclusive' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$date = new DateTime( date_i18n( 'Y-m-d' ) );\n\t\t\t\t\t\t$date->modify( '+1 week' );\n\t\t\t\t\t\t$args['year'] = $date->format( 'Y' );\n\t\t\t\t\t\t$args['w']    = $date->format( 'W' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'range':\n\t\t\t\t\tif ( $this->relative ) :\n\t\t\t\t\t\tadd_filter( 'posts_where', array( $this, 'relative' ) );\n\t\t\t\t\telse :\n\t\t\t\t\t\tadd_filter( 'posts_where', array( $this, 'range' ) );\n\t\t\t\t\tendif;\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\tendif;\n\n\t\t$args = apply_filters( 'sportspress_list_data_event_args', $args );\n\n\t\t$events = get_posts( $args );\n\n\t\t// Remove range filters\n\t\tremove_filter( 'posts_where', array( $this, 'range' ) );\n\t\tremove_filter( 'posts_where', array( $this, 'relative' ) );\n\n\t\t// Event loop\n\t\tforeach ( $events as $i => $event ) :\n\t\t\t$results          = (array) get_post_meta( $event->ID, 'sp_results', true );\n\t\t\t$team_performance = get_post_meta( $event->ID, 'sp_players', true );\n\t\t\t$timeline         = (array) get_post_meta( $event->ID, 'sp_timeline', true );\n\t\t\t$minutes          = get_post_meta( $event->ID, 'sp_minutes', true );\n\t\t\tif ( $minutes === '' ) {\n\t\t\t\t$minutes = get_option( 'sportspress_event_minutes', 90 );\n\t\t\t}\n\n\t\t\t// Add all team performance\n\t\t\tif ( is_array( $team_performance ) ) :\n\t\t\t\tforeach ( $team_performance as $team_id => $players ) :\n\t\t\t\t\tif ( $team && $team_id != $team ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ( is_array( $players ) ) :\n\t\t\t\t\t\tforeach ( $players as $player_id => $player_performance ) :\n\t\t\t\t\t\t\tif ( array_key_exists( $player_id, $totals ) && is_array( $totals[ $player_id ] ) ) :\n\n\t\t\t\t\t\t\t\t$player_performance = sp_array_value( $players, $player_id, array() );\n\n\t\t\t\t\t\t\t\tforeach ( $player_performance as $key => $value ) :\n\t\t\t\t\t\t\t\t\tif ( 'outcome' == $key ) :\n\t\t\t\t\t\t\t\t\t\t// Increment events attended, played, and started\n\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventsattended'] ++;\n\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventsplayed'] ++;\n\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventsstarted'] ++;\n\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventminutes'] += $minutes;\n\n\t\t\t\t\t\t\t\t\t\t// Convert to array\n\t\t\t\t\t\t\t\t\t\tif ( ! is_array( $value ) ) :\n\t\t\t\t\t\t\t\t\t\t\t$value = array( $value );\n\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\tforeach ( $value as $outcome ) :\n\n\t\t\t\t\t\t\t\t\t\t\tif ( $outcome && $outcome != '-1' ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Increment events attended and outcome count\n\t\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $totals[ $player_id ] ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ][ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\telseif ( array_key_exists( $key, $totals[ $player_id ] ) ) :\n\t\t\t\t\t\t\t\t\t\t$add                           = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key );\n\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ][ $key ] += $add;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\t\t$team_results = sp_array_value( $results, $team_id, array() );\n\n\t\t\t\t\t\t\t\t// Loop through home team\n\t\t\t\t\t\t\t\tforeach ( $team_results as $result_slug => $team_result ) :\n\t\t\t\t\t\t\t\t\tif ( 'outcome' == $result_slug ) :\n\n\t\t\t\t\t\t\t\t\t\t// Increment events attended\n\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventsattended'] ++;\n\n\t\t\t\t\t\t\t\t\t\t// Continue with incrementing values if active in event\n\t\t\t\t\t\t\t\t\t\tif ( sp_array_value( $player_performance, 'status' ) != 'sub' || sp_array_value( $player_performance, 'sub', 0 ) ) :\n\t\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventsplayed'] ++;\n\n\t\t\t\t\t\t\t\t\t\t\t// Initialize played minutes\n\t\t\t\t\t\t\t\t\t\t\t$played_minutes = $minutes;\n\n\t\t\t\t\t\t\t\t\t\t\t// Adjust for sendoffs and substitution time\n\t\t\t\t\t\t\t\t\t\t\tif ( sp_array_value( $player_performance, 'status' ) === 'sub' ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Substituted for another player\n\t\t\t\t\t\t\t\t\t\t\t\t$timeline_performance = sp_array_value( sp_array_value( $timeline, $team_id, array() ), $player_id, array() );\n\t\t\t\t\t\t\t\t\t\t\t\tif ( empty( $timeline_performance ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $sendoffs as $sendoff_key ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_times = (array) sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), $sendoff_key, array() );\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_times = array_filter( $sendoff_times );\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_time  = end( $sendoff_times );\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! $sendoff_time ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_time = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Count minutes until being sent off\n\t\t\t\t\t\t\t\t\t\t\t\t\t$played_minutes = $sendoff_time;\n\t\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Subtract minutes prior to substitution\n\t\t\t\t\t\t\t\t\t\t\t\t$substitution_time = (int) sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), 'sub' ), 0, 0 );\n\t\t\t\t\t\t\t\t\t\t\t\t$played_minutes    = is_numeric($played_minutes) ? (int) $played_minutes : 0;\n\t\t\t\t\t\t\t\t\t\t\t\t$played_minutes   -= $substitution_time;\n\t\t\t\t\t\t\t\t\t\t\telse :\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Starting lineup with possible substitution\n\t\t\t\t\t\t\t\t\t\t\t\t$subbed_out = false;\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $timeline as $timeline_team => $timeline_players ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! is_array( $timeline_players ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $timeline_players as $timeline_player => $timeline_performance ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $player_id === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $substitution_time ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Count minutes until substitution\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$played_minutes = $substitution_time;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$subbed_out     = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// No need to check for sendoffs if subbed out\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $subbed_out ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Check for sendoffs\n\t\t\t\t\t\t\t\t\t\t\t\t\t$timeline_performance = sp_array_value( $timeline_players, $player_id, array() );\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( empty( $timeline_performance ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $sendoffs as $sendoff_key ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! sp_array_value( $player_performance, $sendoff_key, 0 ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_times = sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), $sendoff_key );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_times = array_filter( $sendoff_times );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_time  = end( $sendoff_times );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( false === $sendoff_time ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Count minutes until being sent off\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$played_minutes = $sendoff_time;\n\t\t\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t// Make sure that is a number (i.e. convert 90+2' to 90')\n\t\t\t\t\t\t\t\t\t\t\t$played_minutes = (float) $played_minutes;\n\n\t\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventminutes'] += max( 0, $played_minutes );\n\n\t\t\t\t\t\t\t\t\t\t\tif ( sp_array_value( $player_performance, 'status' ) == 'lineup' ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventsstarted'] ++;\n\t\t\t\t\t\t\t\t\t\t\telseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ]['eventssubbed'] ++;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t$value = $team_result;\n\n\t\t\t\t\t\t\t\t\t\t\t// Convert to array\n\t\t\t\t\t\t\t\t\t\t\tif ( ! is_array( $value ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$value = array( $value );\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $value as $outcome ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\tif ( $outcome && $outcome != '-1' ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Increment events attended and outcome count\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $totals[ $player_id ] ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ][ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\telse :\n\n\t\t\t\t\t\t\t\t\t\t// Add to total\n\t\t\t\t\t\t\t\t\t\t$value                                        = sp_array_value( $totals[ $player_id ], $result_slug . 'for', 0 );\n\t\t\t\t\t\t\t\t\t\t$value                                       += floatval( $team_result );\n\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ][ $result_slug . 'for' ] = $value;\n\n\t\t\t\t\t\t\t\t\t\t// Add subset\n\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ][ $result_slug . 'for' . ( $i + 1 ) ] = $team_result;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\t\t// Loop through away teams\n\t\t\t\t\t\t\t\tif ( sizeof( $results ) ) :\n\t\t\t\t\t\t\t\t\tforeach ( $results as $id => $team_results ) :\n\t\t\t\t\t\t\t\t\t\tif ( $team_id == $id ) {\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( is_array( $team_results ) ) :\n\t\t\t\t\t\t\t\t\t\t\tunset( $team_results['outcome'] );\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $team_results as $result_slug => $team_result ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Add to total\n\t\t\t\t\t\t\t\t\t\t\t\t$value  = sp_array_value( $totals[ $player_id ], $result_slug . 'against', 0 );\n\t\t\t\t\t\t\t\t\t\t\t\t$value += floatval( $team_result );\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ][ $result_slug . 'against' ] = $value;\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Add subset\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $player_id ][ $result_slug . 'against' . ( $i + 1 ) ] = $team_result;\n\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\tendforeach;\nendif;\n\t\t\t$i++;\n\t\tendforeach;\n\n\t\t// Fill in empty placeholder values for each player\n\t\tforeach ( $player_ids as $player_id ) :\n\t\t\tif ( ! $player_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Sum manual stats with auto-calculated stats\n\t\t\t$auto_stats   = sp_array_value( $totals, $player_id, array() );\n\t\t\t$manual_stats = sp_array_value( $placeholders, $player_id, array() );\n\t\t\t$combined     = array();\n\t\t\t\n\t\t\t// Get all unique keys from both arrays\n\t\t\t$all_keys = array_unique( array_merge( array_keys( $auto_stats ), array_keys( $manual_stats ) ) );\n\t\t\t\t\n\t\t\tforeach ( $all_keys as $key ) {\n\n\t\t\t\t// Check if this key refers to an sp_metric.\n\t\t\t\t$post      = get_page_by_path( $key, OBJECT, 'sp_metric' );\n\t\t\t\t$is_metric = $post && $post->post_type === 'sp_metric';\n\t\t\t\tif ( $is_metric ) {\n\t\t\t\t\t$manual_value = $manual_stats[ $key ];\n\t\t\t\t\t\n\t\t\t\t\t$combined[ $key ] = $manual_value;\n\t\t\t\t} else {\n\t\t\t\t\t$auto_value   = isset( $auto_stats[ $key ] ) ? floatval( $auto_stats[ $key ] ) : 0;\n\t\t\t\t\t$manual_value = isset( $manual_stats[ $key ] ) ? floatval( $manual_stats[ $key ] ) : 0;\n\t\t\t\t\t\n\t\t\t\t\t// Sum both values\n\t\t\t\t\t$combined[ $key ] = $auto_value + $manual_value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$placeholders[ $player_id ] = $combined;\n\n\t\t\t// Player adjustments\n\t\t\t$player_adjustments = sp_array_value( $adjustments, $player_id, array() );\n\n\t\t\tforeach ( $stats as $stat ) :\n\t\t\t\tif ( $stat->equation === null ) :\n\t\t\t\t\t$placeholder = sp_array_value( $player_adjustments, $stat->post_name, null );\n\t\t\t\t\tif ( $placeholder == null ) :\n\t\t\t\t\t\t$placeholder = '-';\n\t\t\t\t\tendif;\n\t\t\t\telse :\n\t\t\t\t\t// Solve\n\t\t\t\t\t$placeholder = sp_solve( $stat->equation, $placeholders[ $player_id ], $stat->precision );\n\n\t\t\t\t\t// Adjustment\n\t\t\t\t\t$adjustment = (float) sp_array_value( $player_adjustments, $stat->post_name, 0 );\n\n\t\t\t\t\t// Apply adjustment\n\t\t\t\t\tif ( $adjustment != 0 ) :\n\t\t\t\t\t\t$placeholder += $adjustment;\n\t\t\t\t\t\t$placeholder  = number_format( $placeholder, $stat->precision ? $stat->precision : 0, '.', '' );\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\n\t\t\t\tif ( ! $stat->equation ) {\n\t\t\t\t\tif ( $placeholder !== '' && is_numeric( $placeholder ) ) :\n\t\t\t\t\t\t$placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder;\n\t\t\t\t\telse :\n\t\t\t\t\t\t$placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' );\n\t\t\t\t\tendif;\n\t\t\t\t}\n\n\t\t\t\tif ( is_numeric( $placeholder ) && $stat->precision ) :\n\t\t\t\t\t$placeholder = number_format( $placeholder, $stat->precision, '.', '' );\n\t\t\t\tendif;\n\n\t\t\t\t$placeholders[ $player_id ][ $stat->post_name ] = apply_filters( 'sportspress_player_performance_table_placeholder', $placeholder, $stat->post_name );\n\t\t\tendforeach;\n\n\t\tendforeach;\n\n\t\t// Merge the data and placeholders arrays\n\t\tforeach ( $placeholders as $player_id => $player_data ) :\n\n\t\t\tif ( in_array( 'dob', $this->columns ) ) :\n\t\t\t\t$player_data['dob'] = get_the_date( get_option( 'date_format' ), $player_id );\n\t\t\tendif;\n\n\t\t\tif ( in_array( 'age', $this->columns ) ) :\n\t\t\t\t$birthdayclass      = new SportsPress_Birthdays();\n\t\t\t\t$player_data['age'] = $birthdayclass->get_age( get_the_date( 'm-d-Y', $player_id ) );\n\t\t\tendif;\n\n\t\t\t$player_data                = array_merge( $column_order, $player_data );\n\t\t\t$placeholders[ $player_id ] = $player_data;\n\n\t\t\t// Add player number and name to row\n\t\t\t$merged[ $player_id ] = array();\n\t\t\tif ( in_array( 'number', $this->columns ) ) :\n\t\t\t\t$player_data['number'] = get_post_meta( $player_id, 'sp_number', true );\n\t\t\tendif;\n\n\t\t\t$player_data['name'] = get_the_title( $player_id );\n\n\t\t\tif ( in_array( 'team', $this->columns ) ) :\n\t\t\t\t$player_data['team'] = get_post_meta( $player_id, 'sp_team', true );\n\t\t\tendif;\n\n\t\t\tif ( in_array( 'position', $this->columns ) ) :\n\t\t\t\t$player_data['position'] = null;\n\t\t\tendif;\n\n\t\t\tforeach ( $player_data as $key => $value ) :\n\n\t\t\t\t// Use static data if key exists and value is not empty, else use placeholder\n\t\t\t\tif ( array_key_exists( $player_id, $tempdata ) && array_key_exists( $key, $tempdata[ $player_id ] ) && $tempdata[ $player_id ][ $key ] != '' ) :\n\t\t\t\t\t$value = $tempdata[ $player_id ][ $key ];\n\t\t\t\tendif;\n\n\t\t\t\t$merged[ $player_id ][ $key ] = $value;\n\n\t\t\tendforeach;\n\t\tendforeach;\n\n\t\tif ( $orderby != 'number' || $order != 'ASC' ) :\n\t\t\t$this->priorities = array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => $orderby,\n\t\t\t\t\t'order' => $order,\n\t\t\t\t),\n\t\t\t);\n\t\t\tuasort( $merged, array( $this, 'sort' ) );\n\t\tendif;\n\n\t\t// Rearrange data array to reflect values\n\t\tforeach ( $merged as $key => $value ) :\n\t\t\tif ( $crop && ! (float) sp_array_value( $value, $orderby, 0 ) ) {\n\t\t\t\t// Crop\n\t\t\t\tunset( $merged[ $key ] );\n\t\t\t} else {\n\t\t\t\t// Add to main data array\n\t\t\t\t$data[ $key ] = $tempdata[ $key ];\n\t\t\t}\n\t\tendforeach;\n\n\t\tif ( $admin ) :\n\n\t\t\t// Convert to time notation\n\t\t\tif ( in_array( 'time', $formats ) ) :\n\t\t\t\tforeach ( $placeholders as $player => $stats ) :\n\t\t\t\t\tif ( ! is_array( $stats ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $stats as $key => $value ) :\n\n\t\t\t\t\t\t// Continue if not time format\n\t\t\t\t\t\tif ( 'time' !== sp_array_value( $formats, $key ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$intval  = intval( $value );\n\t\t\t\t\t\t$timeval = gmdate( 'i:s', $intval );\n\t\t\t\t\t\t$hours   = floor( $intval / 3600 );\n\n\t\t\t\t\t\tif ( '00' != $hours ) {\n\t\t\t\t\t\t\t$timeval = $hours . ':' . $timeval;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$timeval = preg_replace( '/^0/', '', $timeval );\n\n\t\t\t\t\t\t$placeholders[ $player ][ $key ] = $timeval;\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\t$labels = array();\n\t\t\tforeach ( $this->columns as $key ) :\n\t\t\t\tif ( $key == 'number' ) :\n\t\t\t\t\t$labels[ $key ] = '#';\n\t\t\t\telseif ( $key == 'team' ) :\n\t\t\t\t\t$labels[ $key ] = esc_attr__( 'Team', 'sportspress' );\n\t\t\t\telseif ( $key == 'position' ) :\n\t\t\t\t\t$labels[ $key ] = esc_attr__( 'Position', 'sportspress' );\n\t\t\t\telseif ( $key == 'dob' && $showdob ) :\n\t\t\t\t\t$labels[ $key ] = esc_attr__( 'Date of Birth', 'sportspress' );\n\t\t\t\telseif ( $key == 'age' && $showage ) :\n\t\t\t\t\t$labels[ $key ] = esc_attr__( 'Age', 'sportspress' );\n\t\t\t\telseif ( array_key_exists( $key, $columns ) ) :\n\t\t\t\t\t$labels[ $key ] = $columns[ $key ];\n\t\t\t\tendif;\n\t\t\tendforeach;\n\n\t\t\treturn array( $labels, $data, $placeholders, $merged, $orderby );\n\t\telse :\n\n\t\t\t// Convert to time notation\n\t\t\tif ( in_array( 'time', $formats ) ) :\n\t\t\t\tforeach ( $merged as $player => $stats ) :\n\t\t\t\t\tif ( ! is_array( $stats ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $stats as $key => $value ) :\n\n\t\t\t\t\t\t// Continue if not time format\n\t\t\t\t\t\tif ( 'time' !== sp_array_value( $formats, $key ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$intval  = intval( $value );\n\t\t\t\t\t\t$timeval = gmdate( 'i:s', $intval );\n\t\t\t\t\t\t$hours   = floor( $intval / 3600 );\n\n\t\t\t\t\t\tif ( '00' != $hours ) {\n\t\t\t\t\t\t\t$timeval = $hours . ':' . $timeval;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$timeval = preg_replace( '/^0/', '', $timeval );\n\n\t\t\t\t\t\t$merged[ $player ][ $key ] = $timeval;\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\tif ( ! is_array( $this->columns ) ) {\n\t\t\t\t$this->columns = array();\n\t\t\t}\n\t\t\tforeach ( $columns as $key => $label ) :\n\t\t\t\tif ( ! in_array( $key, $this->columns ) ) :\n\t\t\t\t\tunset( $columns[ $key ] );\n\t\t\t\tendif;\n\t\t\tendforeach;\n\n\t\t\t$labels = array();\n\t\t\tif ( in_array( 'number', $this->columns ) ) {\n\t\t\t\t$labels['number'] = '#';\n\t\t\t}\n\t\t\t$labels['name'] = esc_attr__( 'Player', 'sportspress' );\n\t\t\tif ( in_array( 'team', $this->columns ) ) {\n\t\t\t\t$labels['team'] = esc_attr__( 'Team', 'sportspress' );\n\t\t\t}\n\t\t\tif ( in_array( 'position', $this->columns ) ) {\n\t\t\t\t$labels['position'] = esc_attr__( 'Position', 'sportspress' );\n\t\t\t}\n\t\t\tif ( in_array( 'dob', $this->columns ) && $showdob ) {\n\t\t\t\t$labels['dob'] = esc_attr__( 'Date of Birth', 'sportspress' );\n\t\t\t}\n\t\t\tif ( in_array( 'age', $this->columns ) && $showage ) {\n\t\t\t\t$labels['age'] = esc_attr__( 'Age', 'sportspress' );\n\t\t\t}\n\n\t\t\t$merged[0] = array_merge( $labels, $columns );\n\t\t\treturn $merged;\n\t\tendif;\n\t}\n\n\t/**\n\t * Sort the table by priorities.\n\t *\n\t * @param array $a\n\t * @param array $b\n\t * @return int\n\t */\n\tpublic function sort( $a, $b ) {\n\n\t\t// Loop through priorities\n\t\tif ( is_array( $this->priorities ) ) :\n\t\t\tforeach ( $this->priorities as $priority ) :\n\n\t\t\t\t// Proceed if columns are not equal\n\t\t\t\tif ( sp_array_value( $a, $priority['key'], 0 ) != sp_array_value( $b, $priority['key'], 0 ) ) :\n\n\t\t\t\t\tif ( $priority['key'] == 'name' ) :\n\n\t\t\t\t\t\t$output = strcmp( sp_array_value( $a, 'name', null ), sp_array_value( $b, 'name', null ) );\n\n\t\t\t\t\telse :\n\n\t\t\t\t\t\t// Compare performance values\n\t\t\t\t\t\t$output = floatval( sp_array_value( $a, $priority['key'], 0 ) ) - floatval( sp_array_value( $b, $priority['key'], 0 ) );\n\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Flip value if descending order\n\t\t\t\t\tif ( $priority['order'] == 'DESC' ) {\n\t\t\t\t\t\t$output = 0 - $output;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ( $output > 0 ? 1 : -1 );\n\n\t\t\t\t\t\tendif;\n\n\t\tendforeach;\nendif;\n\n\t\t// Default sort by number\n\t\treturn floatval( sp_array_value( $a, 'number', 0 ) ) - floatval( sp_array_value( $b, 'number', 0 ) );\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-player.php",
    "content": "<?php\n/**\n * Player Class\n *\n * The SportsPress player class handles individual player data.\n *\n * @class       SP_Player\n * @version     2.7.26\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Player extends SP_Custom_Post {\n\n\t/**\n\t * Returns positions sorted by `sp_order`.\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function positions() {\n\t\treturn $this->get_terms_sorted_by_sp_order( 'sp_position' );\n\t}\n\n\t/**\n\t * Returns leagues sorted by `sp_order`.\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function leagues() {\n\t\treturn $this->get_terms_sorted_by_sp_order( 'sp_league' );\n\t}\n\n\t/**\n\t * Returns seasons sorted by `sp_order`.\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function seasons() {\n\t\treturn $this->get_terms_sorted_by_sp_order( 'sp_season' );\n\t}\n\n\t/**\n\t * Returns current teams\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function current_teams() {\n\t\treturn get_post_meta( $this->ID, 'sp_current_team', false );\n\t}\n\n\t/**\n\t * Returns past teams\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function past_teams() {\n\t\treturn get_post_meta( $this->ID, 'sp_past_team', false );\n\t}\n\n\t/**\n\t * Returns nationalities\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function nationalities() {\n\t\t$nationalities = get_post_meta( $this->ID, 'sp_nationality', false );\n\t\tif ( empty( $nationalities ) ) {\n\t\t\treturn array();\n\t\t}\n\t\tforeach ( $nationalities as $nationality ) :\n\t\t\tif ( 2 == strlen( $nationality ) ) :\n\t\t\t\t$legacy      = SP()->countries->legacy;\n\t\t\t\t$nationality = strtolower( $nationality );\n\t\t\t\t$nationality = sp_array_value( $legacy, $nationality, null );\n\t\t\tendif;\n\t\tendforeach;\n\t\treturn $nationalities;\n\t}\n\n\t/**\n\t * Returns formatted player metrics\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function metrics( $neg = null ) {\n\t\t$metrics       = (array) get_post_meta( $this->ID, 'sp_metrics', true );\n\t\t$metric_labels = (array) sp_get_var_labels( 'sp_metric', $neg, false );\n\t\t$data          = array();\n\n\t\tforeach ( $metric_labels as $key => $value ) :\n\t\t\t$metric = sp_array_value( $metrics, $key, null );\n\t\t\tif ( $metric == null ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$data[ $value ] = sp_array_value( $metrics, $key, '&nbsp;' );\n\t\tendforeach;\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Returns formatted data\n\t *\n\t * @access public\n\t * @param int  $league_id\n\t * @param bool $admin\n\t * @return array\n\t */\n\tpublic function data( $league_id, $admin = false, $section = -1 ) {\n\t\t$seasons = (array) $this->get_terms_sorted_by_sp_order( 'sp_season' );\n\t\t$metrics = (array) get_post_meta( $this->ID, 'sp_metrics', true );\n\t\t$stats   = (array) get_post_meta( $this->ID, 'sp_statistics', true );\n\t\t$leagues = (array) sp_array_value( (array) get_post_meta( $this->ID, 'sp_leagues', true ), $league_id );\n\t\tuksort( $leagues, 'sp_sort_terms' );\n\t\t$manual_columns = 'manual' == get_option( 'sportspress_player_columns', 'auto' ) ? true : false;\n\n\t\t$season_ids   = array_filter( wp_list_pluck( $seasons, 'term_id' ) );\n\t\t$season_order = array_flip( $season_ids );\n\t\tforeach ( $season_order as $season_id => $val ) {\n\t\t\t$season_order[ $season_id ] = null;\n\t\t}\n\n\t\t$leagues = array_replace( $season_order, $leagues );\n\n\t\t// Get performance labels\n\t\t$args = array(\n\t\t\t'post_type'      => array( 'sp_performance' ),\n\t\t\t'numberposts'    => 100,\n\t\t\t'posts_per_page' => 100,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t\t'meta_query'     => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t'value'   => 'number',\n\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t'value'   => array( 'equation', 'text' ),\n\t\t\t\t\t'compare' => 'NOT IN',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$posts = get_posts( $args );\n\n\t\tif ( $manual_columns ) {\n\t\t\t$usecolumns     = (array) get_post_meta( $this->ID, 'sp_columns', true );\n\t\t\t$has_checkboxes = true;\n\t\t} else {\n\t\t\t$usecolumns = array();\n\t\t\tif ( is_array( $posts ) ) {\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t// Get visibility\n\t\t\t\t\t$visible = get_post_meta( $post->ID, 'sp_visible', true );\n\t\t\t\t\tif ( '' === $visible || $visible ) {\n\t\t\t\t\t\t$usecolumns[] = $post->post_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$has_checkboxes = false;\n\t\t}\n\n\t\t$performance_labels = array();\n\t\t$formats            = array();\n\t\t$sendoffs           = array();\n\n\t\tforeach ( $posts as $post ) :\n\t\t\tif ( -1 === $section ) {\n\t\t\t\tif ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {\n\t\t\t\t\t$icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );\n\t\t\t\t\tif ( $icon != '' ) {\n\t\t\t\t\t\t$performance_labels[ $post->post_name ] = $icon;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( has_post_thumbnail( $post ) ) {\n\t\t\t\t\t\t\t$icon                                   = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) );\n\t\t\t\t\t\t\t$performance_labels[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$performance_labels[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$performance_labels[ $post->post_name ] = $post->post_title;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post_section = get_post_meta( $post->ID, 'sp_section', true );\n\n\t\t\t\tif ( '' === $post_section ) {\n\t\t\t\t\t$post_section = -1;\n\t\t\t\t}\n\n\t\t\t\tif ( $section == $post_section || -1 == $post_section ) {\n\t\t\t\t\tif ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {\n\t\t\t\t\t\t$icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );\n\t\t\t\t\t\tif ( $icon != '' ) {\n\t\t\t\t\t\t\t$performance_labels[ $post->post_name ] = $icon;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ( has_post_thumbnail( $post ) ) {\n\t\t\t\t\t\t\t\t$icon                                   = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) );\n\t\t\t\t\t\t\t\t$performance_labels[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$performance_labels[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$performance_labels[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$format = get_post_meta( $post->ID, 'sp_format', true );\n\t\t\tif ( '' === $format ) {\n\t\t\t\t$format = 'number';\n\t\t\t}\n\t\t\t$formats[ $post->post_name ] = $format;\n\n\t\t\t$sendoff = get_post_meta( $post->ID, 'sp_sendoff', true );\n\t\t\tif ( $sendoff ) {\n\t\t\t\t$sendoffs[] = $post->post_name;\n\t\t\t}\n\t\tendforeach;\n\n\t\t// Get statistic labels\n\t\t$args = array(\n\t\t\t'post_type'      => array( 'sp_statistic' ),\n\t\t\t'numberposts'    => 100,\n\t\t\t'posts_per_page' => 100,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\n\t\t$posts = get_posts( $args );\n\n\t\tif ( $manual_columns ) {\n\t\t\t$usecolumns = array_merge( $usecolumns, (array) get_post_meta( $this->ID, 'sp_columns', true ) );\n\t\t\t$usecolumns = array_filter( $usecolumns );\n\t\t} else {\n\t\t\tif ( is_array( $posts ) ) {\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t// Get visibility\n\t\t\t\t\t$visible = get_post_meta( $post->ID, 'sp_visible', true );\n\t\t\t\t\tif ( '' === $visible || $visible ) {\n\t\t\t\t\t\t$usecolumns[] = $post->post_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get labels from outcome variables\n\t\t$outcome_labels = (array) sp_get_var_labels( 'sp_outcome' );\n\n\t\t// Get labels from result variables\n\t\t$result_labels = (array) sp_get_var_labels( 'sp_result' );\n\n\t\t// Generate array of all season ids and season names\n\t\t$div_ids      = array();\n\t\t$season_names = array();\n\t\tforeach ( $seasons as $season ) :\n\t\t\tif ( is_object( $season ) && property_exists( $season, 'term_id' ) && property_exists( $season, 'name' ) ) :\n\t\t\t\t$div_ids[]                        = $season->term_id;\n\t\t\t\t$season_names[ $season->term_id ] = $season->name;\n\t\t\tendif;\n\t\tendforeach;\n\n\t\t$div_ids[]       = 0;\n\t\t$season_names[0] = esc_attr__( 'Total', 'sportspress' );\n\n\t\t$data = array();\n\n\t\t$league_stats = sp_array_value( $stats, $league_id, array() );\n\t\t$div_ids      = apply_filters( 'sportspress_player_data_season_ids', $div_ids, $league_stats );\n\n\t\t// Get all seasons populated with data where available\n\t\t$data = sp_array_combine( $div_ids, $league_stats, true );\n\n\t\t// Get equations from statistic variables\n\t\t$equations = sp_get_var_equations( 'sp_statistic' );\n\n\t\t// Initialize placeholders array\n\t\t$placeholders = array();\n\n\t\tforeach ( $div_ids as $div_id ) :\n\n\t\t\t$totals = array(\n\t\t\t\t'eventsattended' => 0,\n\t\t\t\t'eventsplayed'   => 0,\n\t\t\t\t'eventsstarted'  => 0,\n\t\t\t\t'eventssubbed'   => 0,\n\t\t\t\t'eventminutes'   => 0,\n\t\t\t\t'streak'         => 0,\n\t\t\t\t'last5'          => null,\n\t\t\t\t'last10'         => null,\n\t\t\t);\n\n\t\t\tforeach ( $performance_labels as $key => $value ) :\n\t\t\t\t$totals[ $key ] = 0;\n\t\t\tendforeach;\n\n\t\t\tforeach ( $outcome_labels as $key => $value ) :\n\t\t\t\t$totals[ $key ] = 0;\n\t\t\tendforeach;\n\n\t\t\tforeach ( $result_labels as $key => $value ) :\n\t\t\t\t$totals[ $key . 'for' ] = $totals[ $key . 'against' ] = 0;\n\t\t\tendforeach;\n\n\t\t\t// Initialize streaks counter\n\t\t\t$streak = array(\n\t\t\t\t'name'  => '',\n\t\t\t\t'count' => 0,\n\t\t\t\t'fire'  => 1,\n\t\t\t);\n\n\t\t\t// Initialize last counters\n\t\t\t$last5  = array();\n\t\t\t$last10 = array();\n\n\t\t\t// Add outcome types to last counters\n\t\t\tforeach ( $outcome_labels as $key => $value ) :\n\t\t\t\t$last5[ $key ]  = 0;\n\t\t\t\t$last10[ $key ] = 0;\n\t\t\tendforeach;\n\n\t\t\t// Get all events involving the player in current season\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_event',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'order'          => 'DESC',\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => 'sp_player',\n\t\t\t\t\t\t'value' => $this->ID,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t\t'value'   => apply_filters( 'sportspress_competitive_event_formats', array( 'league' ) ),\n\t\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'tax_query'      => array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tif ( -1 !== $section ) :\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key'   => ( 1 === $section ? 'sp_defense' : 'sp_offense' ),\n\t\t\t\t\t'value' => $this->ID,\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\tif ( $league_id ) :\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $league_id,\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\tif ( $div_id ) :\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $div_id,\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\t// Check if there is a selected team and return the team id or return a -1 value.\n\t\t\t$selected_team = sp_array_value( $leagues, $div_id, '-1' );\n\n\t\t\t$args = apply_filters( 'sportspress_player_data_event_args', $args, $data, $div_id, $selected_team );\n\n\t\t\t$events = get_posts( $args );\n\n\t\t\t// Event loop\n\t\t\tforeach ( $events as $i => $event ) :\n\t\t\t\t$results          = (array) get_post_meta( $event->ID, 'sp_results', true );\n\t\t\t\t$team_performance = (array) get_post_meta( $event->ID, 'sp_players', true );\n\t\t\t\t$timeline         = (array) get_post_meta( $event->ID, 'sp_timeline', true );\n\t\t\t\t$minutes          = get_post_meta( $event->ID, 'sp_minutes', true );\n\t\t\t\tif ( $minutes === '' ) {\n\t\t\t\t\t$minutes = get_option( 'sportspress_event_minutes', 90 );\n\t\t\t\t}\n\n\t\t\t\t// Add all team performance\n\t\t\t\tforeach ( $team_performance as $team_id => $players ) :\n\t\t\t\t\tif ( is_array( $players ) && array_key_exists( $this->ID, $players ) ) :\n\n\t\t\t\t\t\t$player_performance = sp_array_value( $players, $this->ID, array() );\n\n\t\t\t\t\t\tforeach ( $player_performance as $key => $value ) :\n\t\t\t\t\t\t\tif ( array_key_exists( $key, $totals ) ) :\n\t\t\t\t\t\t\t\t$add             = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key );\n\t\t\t\t\t\t\t\t$totals[ $key ] += $add;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t$team_results = sp_array_value( $results, $team_id, array() );\n\t\t\t\t\t\tunset( $results[ $team_id ] );\n\n\t\t\t\t\t\t// Loop through home team\n\t\t\t\t\t\tforeach ( $team_results as $result_slug => $team_result ) :\n\t\t\t\t\t\t\tif ( 'outcome' == $result_slug ) :\n\n\t\t\t\t\t\t\t\t// Increment events attended\n\t\t\t\t\t\t\t\t$totals['eventsattended'] ++;\n\n\t\t\t\t\t\t\t\t// Continue with incrementing values if active in event\n\t\t\t\t\t\t\t\tif ( sp_array_value( $player_performance, 'status' ) != 'sub' || sp_array_value( $player_performance, 'sub', 0 ) ) :\n\t\t\t\t\t\t\t\t\t$totals['eventsplayed'] ++;\n\t\t\t\t\t\t\t\t\t$played_minutes = $minutes;\n\n\t\t\t\t\t\t\t\t\t// Adjust for substitution time\n\t\t\t\t\t\t\t\t\tif ( sp_array_value( $player_performance, 'status' ) === 'sub' ) :\n\n\t\t\t\t\t\t\t\t\t\t// Substituted for another player\n\t\t\t\t\t\t\t\t\t\t$timeline_performance = sp_array_value( sp_array_value( $timeline, $team_id, array() ), $this->ID, array() );\n\t\t\t\t\t\t\t\t\t\tif ( empty( $timeline_performance ) ) {\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tforeach ( $sendoffs as $sendoff_key ) :\n\t\t\t\t\t\t\t\t\t\t\tif ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$sendoff_times = sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), $sendoff_key );\n\t\t\t\t\t\t\t\t\t\t\t$sendoff_times = array_filter( $sendoff_times );\n\t\t\t\t\t\t\t\t\t\t\t$sendoff_time  = end( $sendoff_times );\n\t\t\t\t\t\t\t\t\t\t\tif ( ! $sendoff_time ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_time = 0;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Count minutes until being sent off\n\t\t\t\t\t\t\t\t\t\t\t$played_minutes = $sendoff_time;\n\t\t\t\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\t\t\t\t// Subtract minutes prior to substitution\n\t\t\t\t\t\t\t\t\t\t$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), 'sub' ), 0, 0 );\n\t\t\t\t\t\t\t\t\t\t$played_minutes   -= (int) $substitution_time;\n\t\t\t\t\t\t\t\t\telse :\n\n\t\t\t\t\t\t\t\t\t\t// Starting lineup with possible substitution\n\t\t\t\t\t\t\t\t\t\t$subbed_out = false;\n\t\t\t\t\t\t\t\t\t\tforeach ( $timeline as $timeline_team => $timeline_players ) :\n\t\t\t\t\t\t\t\t\t\t\tif ( ! is_array( $timeline_players ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $timeline_players as $timeline_player => $timeline_performance ) :\n\t\t\t\t\t\t\t\t\t\t\t\tif ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $this->ID === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $substitution_time ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Count minutes until substitution\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$played_minutes = $substitution_time;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$subbed_out     = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\t\t\t\t\t// No need to check for sendoffs if subbed out\n\t\t\t\t\t\t\t\t\t\t\tif ( $subbed_out ) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Check for sendoffs\n\t\t\t\t\t\t\t\t\t\t\t$timeline_performance = sp_array_value( $timeline_players, $this->ID, array() );\n\t\t\t\t\t\t\t\t\t\t\tif ( empty( $timeline_performance ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $sendoffs as $sendoff_key ) :\n\t\t\t\t\t\t\t\t\t\t\t\tif ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_times = (array) sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), $sendoff_key, array() );\n\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_times = array_filter( $sendoff_times );\n\t\t\t\t\t\t\t\t\t\t\t\t$sendoff_time  = end( $sendoff_times );\n\t\t\t\t\t\t\t\t\t\t\t\tif ( false === $sendoff_time ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Count minutes until being sent off\n\t\t\t\t\t\t\t\t\t\t\t\t$played_minutes = $sendoff_time;\n\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t// Make sure that is a number (i.e. convert 90+2' to 90')\n\t\t\t\t\t\t\t\t\t$played_minutes = (float) $played_minutes;\n\n\t\t\t\t\t\t\t\t\t$totals['eventminutes'] += max( 0, $played_minutes );\n\n\t\t\t\t\t\t\t\t\tif ( sp_array_value( $player_performance, 'status' ) == 'lineup' ) :\n\t\t\t\t\t\t\t\t\t\t$totals['eventsstarted'] ++;\n\t\t\t\t\t\t\t\t\telseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ) :\n\t\t\t\t\t\t\t\t\t\t$totals['eventssubbed'] ++;\n\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t$value = $team_result;\n\n\t\t\t\t\t\t\t\t\t// Convert to array\n\t\t\t\t\t\t\t\t\tif ( ! is_array( $value ) ) :\n\t\t\t\t\t\t\t\t\t\t$value = array( $value );\n\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\tforeach ( $value as $outcome ) :\n\t\t\t\t\t\t\t\t\t\tif ( $outcome && $outcome != '-1' ) :\n\n\t\t\t\t\t\t\t\t\t\t\t// Increment outcome count\n\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $totals ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to streak counter\n\t\t\t\t\t\t\t\t\t\t\tif ( $streak['fire'] && ( $streak['name'] == '' || $streak['name'] == $outcome ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$streak['name'] = $outcome;\n\t\t\t\t\t\t\t\t\t\t\t\t$streak['count'] ++;\n\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t$streak['fire'] = 0;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to last 5 counter if sum is less than 5\n\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $last5 ) && array_sum( $last5 ) < 5 ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$last5[ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to last 10 counter if sum is less than 10\n\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $last10 ) && array_sum( $last10 ) < 10 ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$last10[ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\telse :\n\n\t\t\t\t\t\t\t\t// Add to total\n\t\t\t\t\t\t\t\t$value                          = sp_array_value( $totals, $result_slug . 'for', 0 );\n\t\t\t\t\t\t\t\t$value                         += floatval( $team_result );\n\t\t\t\t\t\t\t\t$totals[ $result_slug . 'for' ] = $value;\n\n\t\t\t\t\t\t\t\t// Add subset\n\t\t\t\t\t\t\t\t$totals[ $result_slug . 'for' . ( $i + 1 ) ] = $team_result;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t// Loop through away teams\n\t\t\t\t\t\tif ( sizeof( $results ) ) :\n\t\t\t\t\t\t\tforeach ( $results as $team_results ) :\n\t\t\t\t\t\t\t\tif ( is_array( $team_results ) ) :\n\t\t\t\t\t\t\t\t\tunset( $team_results['outcome'] );\n\t\t\t\t\t\t\t\t\tforeach ( $team_results as $result_slug => $team_result ) :\n\n\t\t\t\t\t\t\t\t\t\t// Add to total\n\t\t\t\t\t\t\t\t\t\t$value                              = sp_array_value( $totals, $result_slug . 'against', 0 );\n\t\t\t\t\t\t\t\t\t\t$value                             += floatval( $team_result );\n\t\t\t\t\t\t\t\t\t\t$totals[ $result_slug . 'against' ] = $value;\n\n\t\t\t\t\t\t\t\t\t\t// Add subset\n\t\t\t\t\t\t\t\t\t\t$totals[ $result_slug . 'against' . ( $i + 1 ) ] = $team_result;\n\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\t\t$i++;\n\t\t\tendforeach;\n\n\t\t\t// Compile streaks counter and add to totals\n\t\t\t$args     = array(\n\t\t\t\t'name'           => $streak['name'],\n\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t'post_status'    => 'publish',\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t);\n\t\t\t$outcomes = get_posts( $args );\n\n\t\t\tif ( $outcomes ) :\n\t\t\t\t$outcome      = reset( $outcomes );\n\t\t\t\t$abbreviation = sp_get_abbreviation( $outcome->ID );\n\t\t\t\tif ( empty( $abbreviation ) ) {\n\t\t\t\t\t$abbreviation = sp_strtoupper( sp_substr( $outcome->post_title, 0, 1 ) );\n\t\t\t\t}\n\t\t\t\t$totals['streak'] = $abbreviation . $streak['count'];\n\t\t\tendif;\n\n\t\t\t// Add last counters to totals\n\t\t\t$totals['last5']  = $last5;\n\t\t\t$totals['last10'] = $last10;\n\n\t\t\t// Add metrics to totals\n\t\t\t$totals = array_merge( $metrics, $totals );\n\n\t\t\t// Generate array of placeholder values for each league\n\t\t\t$placeholders[ $div_id ] = array();\n\t\t\tforeach ( $equations as $key => $value ) :\n\t\t\t\t$placeholders[ $div_id ][ $key ] = sp_solve( $value['equation'], $totals, $value['precision'] );\n\t\t\tendforeach;\n\n\t\t\tforeach ( $performance_labels as $key => $label ) :\n\t\t\t\t$placeholders[ $div_id ][ $key ] = apply_filters( 'sportspress_player_performance_table_placeholder', sp_array_value( $totals, $key, 0 ), $key );\n\t\t\tendforeach;\n\n\t\tendforeach;\n\n\t\t// Get labels by section\n\t\t$args = array(\n\t\t\t'post_type'      => 'sp_statistic',\n\t\t\t'numberposts'    => 100,\n\t\t\t'posts_per_page' => 100,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\n\t\t$posts = get_posts( $args );\n\n\t\t$stats = array();\n\n\t\tforeach ( $posts as $post ) :\n\t\t\tif ( -1 === $section ) {\n\t\t\t\tif ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {\n\t\t\t\t\t$icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );\n\t\t\t\t\tif ( $icon != '' ) {\n\t\t\t\t\t\t$stats[ $post->post_name ] = $icon;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( has_post_thumbnail( $post ) ) {\n\t\t\t\t\t\t\t$icon                      = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) );\n\t\t\t\t\t\t\t$stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$stats[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$stats[ $post->post_name ] = $post->post_title;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post_section = get_post_meta( $post->ID, 'sp_section', true );\n\n\t\t\t\tif ( '' === $post_section ) {\n\t\t\t\t\t$post_section = -1;\n\t\t\t\t}\n\n\t\t\t\tif ( $admin ) {\n\t\t\t\t\tif ( 1 == $section ) {\n\t\t\t\t\t\tif ( 1 == $post_section ) {\n\t\t\t\t\t\t\tif ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {\n\t\t\t\t\t\t\t\t$icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );\n\t\t\t\t\t\t\t\tif ( $icon != '' ) {\n\t\t\t\t\t\t\t\t\t$stats[ $post->post_name ] = $icon;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif ( has_post_thumbnail( $post ) ) {\n\t\t\t\t\t\t\t\t\t\t$icon                      = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) );\n\t\t\t\t\t\t\t\t\t\t$stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$stats[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$stats[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( 1 != $post_section ) {\n\t\t\t\t\t\t\tif ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {\n\t\t\t\t\t\t\t\t$icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );\n\t\t\t\t\t\t\t\tif ( $icon != '' ) {\n\t\t\t\t\t\t\t\t\t$stats[ $post->post_name ] = $icon;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif ( has_post_thumbnail( $post ) ) {\n\t\t\t\t\t\t\t\t\t\t$icon                      = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) );\n\t\t\t\t\t\t\t\t\t\t$stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$stats[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$stats[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif ( $section == $post_section || -1 == $post_section ) {\n\t\t\t\t\tif ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {\n\t\t\t\t\t\t$icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );\n\t\t\t\t\t\tif ( $icon != '' ) {\n\t\t\t\t\t\t\t$stats[ $post->post_name ] = $icon;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$stats[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$stats[ $post->post_name ] = $post->post_title;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tendforeach;\n\n\t\t// Merge the data and placeholders arrays\n\t\t$merged = array();\n\n\t\tforeach ( $placeholders as $season_id => $season_data ) :\n\n\t\t\t$team_id = sp_array_value( $leagues, $season_id, -1 );\n\n\t\t\tif ( -1 == $team_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$season_name = sp_array_value( $season_names, (int) $season_id, '&nbsp;' );\n\n\t\t\tif ( $team_id ) :\n\t\t\t\t$team_name = sp_team_short_name( $team_id );\n\n\t\t\t\tif ( get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false ) :\n\t\t\t\t\t$team_permalink = get_permalink( $team_id );\n\t\t\t\t\t$team_name      = '<a href=\"' . $team_permalink . '\">' . $team_name . '</a>';\n\t\t\t\tendif;\n\t\t\telse :\n\t\t\t\t$team_name = esc_attr__( 'Total', 'sportspress' );\n\t\t\tendif;\n\n\t\t\t// Add season name to row\n\t\t\t$merged[ $season_id ] = array(\n\t\t\t\t'name' => $season_name,\n\t\t\t\t'team' => $team_name,\n\t\t\t);\n\n\t\t\tforeach ( $season_data as $key => $value ) :\n\n\t\t\t\t// Use static data if key exists and value is not empty, else use placeholder\n\t\t\t\tif ( array_key_exists( $season_id, $data ) && array_key_exists( $key, $data[ $season_id ] ) && $data[ $season_id ][ $key ] != '' ) :\n\t\t\t\t\t$value = $data[ $season_id ][ $key ];\n\t\t\t\tendif;\n\n\t\t\t\t$merged[ $season_id ][ $key ] = $value;\n\n\t\t\tendforeach;\n\n\t\tendforeach;\n\n\t\t$columns = array_merge( $performance_labels, $stats );\n\n\t\t$formats     = array();\n\t\t$total_types = array();\n\n\t\t$args = array(\n\t\t\t'post_type'      => array( 'sp_performance', 'sp_statistic' ),\n\t\t\t'numberposts'    => 100,\n\t\t\t'posts_per_page' => 100,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\n\t\t$posts = get_posts( $args );\n\n\t\tif ( $posts ) {\n\t\t\t$column_order    = array();\n\t\t\t$usecolumn_order = array();\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\tif ( array_key_exists( $post->post_name, $columns ) ) {\n\t\t\t\t\t$column_order[ $post->post_name ] = $columns[ $post->post_name ];\n\t\t\t\t}\n\t\t\t\tif ( in_array( $post->post_name, $usecolumns ) ) {\n\t\t\t\t\t$usecolumn_order[] = $post->post_name;\n\t\t\t\t}\n\n\t\t\t\t$format = get_post_meta( $post->ID, 'sp_format', true );\n\t\t\t\tif ( '' === $format ) {\n\t\t\t\t\t$format = 'number';\n\t\t\t\t}\n\t\t\t\t$formats[ $post->post_name ] = $format;\n\n\t\t\t\t$total_type = get_post_meta( $post->ID, 'sp_type', true );\n\t\t\t\tif ( '' === $total_type ) {\n\t\t\t\t\t$total_type = 'total';\n\t\t\t\t}\n\t\t\t\t$total_types[ $post->post_name ] = $total_type;\n\t\t\t}\n\t\t\t$columns    = array_merge( $column_order, $columns );\n\t\t\t$usecolumns = array_merge( $usecolumn_order, $usecolumns );\n\t\t}\n\n\t\t// Calculate total statistics\n\t\t$career = array(\n\t\t\t'name' => esc_attr__( 'Total', 'sportspress' ),\n\t\t\t'team' => '-',\n\t\t);\n\n\t\t// Add values from all seasons for total-based statistics\n\t\tforeach ( $merged as $season => $stats ) :\n\t\t\tif ( ! is_array( $stats ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tforeach ( $stats as $key => $value ) :\n\t\t\t\tif ( in_array( $key, array( 'name', 'team' ) ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$value          = floatval( $value );\n\t\t\t\t$add            = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key );\n\t\t\t\t$career[ $key ] = sp_array_value( $career, $key, 0 ) + $add;\n\t\t\tendforeach;\n\t\tendforeach;\n\n\t\t// Calculate average-based statistics from performance\n\t\tforeach ( $posts as $post ) {\n\t\t\t$type = get_post_meta( $post->ID, 'sp_type', 'total' );\n\t\t\tif ( 'average' !== $type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$value = sp_array_value( $equations, $post->post_name, null );\n\t\t\tif ( null === $value || ! isset( $value['equation'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$precision                  = sp_array_value( $value, 'precision', 0 );\n\t\t\t$career[ $post->post_name ] = sp_solve( $value['equation'], $totals, $precision );\n\t\t}\n\n\t\t// Filter career total placeholders\n\t\t$career = apply_filters( 'sportspress_player_performance_table_placeholders', $career );\n\n\t\t// Get manually entered career totals\n\t\t$manual_career = sp_array_value( $data, 0, array() );\n\t\t$manual_career = array_filter( $manual_career, 'sp_filter_non_empty' );\n\n\t\t// Add career totals to merged array\n\t\t$merged[-1] = array_merge( $career, $manual_career );\n\n\t\tif ( $admin ) :\n\t\t\t$labels = array();\n\t\t\tif ( is_array( $usecolumns ) ) :\n\t\t\t\tforeach ( $usecolumns as $key ) :\n\t\t\t\t\tif ( $key == 'team' ) :\n\t\t\t\t\t\t$labels[ $key ] = esc_attr__( 'Team', 'sportspress' );\n\t\t\t\t\t\t\t\telseif ( array_key_exists( $key, $columns ) ) :\n\t\t\t\t\t\t\t\t\t$labels[ $key ] = $columns[ $key ];\n\t\t\t\t\t\t\t\tendif;\n\t\t\tendforeach;\nendif;\n\t\t\t$placeholders[0] = $merged[-1];\n\t\t\treturn array( $labels, $data, $placeholders, $merged, $leagues, $has_checkboxes, $formats, $total_types );\n\t\telse :\n\t\t\tif ( is_array( $usecolumns ) ) :\n\t\t\t\tforeach ( $columns as $key => $label ) :\n\t\t\t\t\tif ( ! in_array( $key, $usecolumns ) ) :\n\t\t\t\t\t\tunset( $columns[ $key ] );\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\t$labels = array();\n\n\t\t\t$labels['name'] = esc_attr__( 'Season', 'sportspress' );\n\t\t\t$labels['team'] = esc_attr__( 'Team', 'sportspress' );\n\n\t\t\tif ( 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) {\n\t\t\t\tunset( $merged[-1] );\n\t\t\t}\n\n\t\t\t// Convert to time notation\n\t\t\tif ( in_array( 'time', $formats ) ) :\n\t\t\t\tforeach ( $merged as $season => $season_performance ) :\n\t\t\t\t\tforeach ( $season_performance as $performance_key => $performance_value ) :\n\n\t\t\t\t\t\t// Continue if not time format\n\t\t\t\t\t\tif ( 'time' !== sp_array_value( $formats, $performance_key ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$merged[ $season ][ $performance_key ] = sp_time_value( $performance_value );\n\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\t$merged[0] = array_merge( $labels, $columns );\n\n\t\t\treturn $merged;\n\t\tendif;\n\t}\n\n\t/**\n\t * Returns formatted data for all leagues\n\t *\n\t * @access public\n\t * @param int  $league_id\n\t * @param bool $admin\n\t * @return array\n\t */\n\tpublic function statistics() {\n\t\t$terms = get_the_terms( $this->ID, 'sp_league' );\n\n\t\t$statistics = array();\n\n\t\tif ( is_array( $terms ) ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$statistics[ $term->term_id ] = $this->data( $term->term_id );\n\t\t\t}\n\t\t}\n\n\t\treturn $statistics;\n\t}\n\n}\n"
  },
  {
    "path": "includes/class-sp-post-types.php",
    "content": "<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * Post types\n *\n * Registers post types and taxonomies\n *\n * @class       SP_Post_types\n * @version     2.7.1\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Post_types {\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'init', array( __CLASS__, 'register_post_types' ), 5 );\n\t\tadd_action( 'init', array( __CLASS__, 'register_taxonomies' ), 10 );\n\t\tadd_action( 'trashed_post', array( $this, 'delete_config_post' ) );\n\t\tadd_filter( 'get_post_status', array( $this, 'display_scheduled_events' ), 10, 2 );\n\t}\n\n\t/**\n\t * Register SportsPress taxonomies.\n\t */\n\tpublic static function register_taxonomies() {\n\t\tdo_action( 'sportspress_register_taxonomy' );\n\n\t\t$show = current_user_can( 'edit_sp_events' );\n\n\t\tif ( apply_filters( 'sportspress_has_leagues', true ) ) :\n\t\t\t$labels       = array(\n\t\t\t\t'name'              => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t'singular_name'     => esc_attr__( 'League', 'sportspress' ),\n\t\t\t\t'all_items'         => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t'edit_item'         => esc_attr__( 'Edit League', 'sportspress' ),\n\t\t\t\t'view_item'         => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t'update_item'       => esc_attr__( 'Update', 'sportspress' ),\n\t\t\t\t'add_new_item'      => esc_attr__( 'Add New', 'sportspress' ),\n\t\t\t\t'new_item_name'     => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'parent_item'       => esc_attr__( 'Parent', 'sportspress' ),\n\t\t\t\t'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ),\n\t\t\t\t'search_items'      => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t'not_found'         => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t);\n\t\t\t$args         = apply_filters(\n\t\t\t\t'sportspress_register_taxonomy_league',\n\t\t\t\tarray(\n\t\t\t\t\t'label'                 => esc_attr__( 'Leagues', 'sportspress' ),\n\t\t\t\t\t'labels'                => $labels,\n\t\t\t\t\t'public'                => true,\n\t\t\t\t\t'show_ui'               => $show,\n\t\t\t\t\t'show_in_menu'          => $show,\n\t\t\t\t\t'show_in_nav_menus'     => false,\n\t\t\t\t\t'show_tagcloud'         => false,\n\t\t\t\t\t'hierarchical'          => true,\n\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_league_slug', 'league' ) ),\n\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t'rest_controller_class' => 'SP_REST_Terms_Controller',\n\t\t\t\t\t'rest_base'             => 'leagues',\n\t\t\t\t)\n\t\t\t);\n\t\t\t$object_types = apply_filters( 'sportspress_league_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );\n\t\t\tregister_taxonomy( 'sp_league', $object_types, $args );\n\t\t\tforeach ( $object_types as $object_type ) :\n\t\t\t\tregister_taxonomy_for_object_type( 'sp_league', $object_type );\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tif ( apply_filters( 'sportspress_has_seasons', true ) ) :\n\t\t\t$labels       = array(\n\t\t\t\t'name'              => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t'singular_name'     => esc_attr__( 'Season', 'sportspress' ),\n\t\t\t\t'all_items'         => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t'edit_item'         => esc_attr__( 'Edit Season', 'sportspress' ),\n\t\t\t\t'view_item'         => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t'update_item'       => esc_attr__( 'Update', 'sportspress' ),\n\t\t\t\t'add_new_item'      => esc_attr__( 'Add New', 'sportspress' ),\n\t\t\t\t'new_item_name'     => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'parent_item'       => esc_attr__( 'Parent', 'sportspress' ),\n\t\t\t\t'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ),\n\t\t\t\t'search_items'      => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t'not_found'         => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t);\n\t\t\t$args         = apply_filters(\n\t\t\t\t'sportspress_register_taxonomy_season',\n\t\t\t\tarray(\n\t\t\t\t\t'label'                 => esc_attr__( 'Seasons', 'sportspress' ),\n\t\t\t\t\t'labels'                => $labels,\n\t\t\t\t\t'public'                => true,\n\t\t\t\t\t'show_ui'               => $show,\n\t\t\t\t\t'show_in_menu'          => $show,\n\t\t\t\t\t'show_in_nav_menus'     => false,\n\t\t\t\t\t'show_tagcloud'         => false,\n\t\t\t\t\t'hierarchical'          => true,\n\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_season_slug', 'season' ) ),\n\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t'rest_controller_class' => 'SP_REST_Terms_Controller',\n\t\t\t\t\t'rest_base'             => 'seasons',\n\t\t\t\t)\n\t\t\t);\n\t\t\t$object_types = apply_filters( 'sportspress_season_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );\n\t\t\tregister_taxonomy( 'sp_season', $object_types, $args );\n\t\t\tforeach ( $object_types as $object_type ) :\n\t\t\t\tregister_taxonomy_for_object_type( 'sp_season', $object_type );\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tif ( apply_filters( 'sportspress_has_venues', true ) ) :\n\t\t\t$labels       = array(\n\t\t\t\t'name'              => esc_attr__( 'Venues', 'sportspress' ),\n\t\t\t\t'singular_name'     => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t'all_items'         => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t'edit_item'         => esc_attr__( 'Edit Venue', 'sportspress' ),\n\t\t\t\t'view_item'         => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t'update_item'       => esc_attr__( 'Update', 'sportspress' ),\n\t\t\t\t'add_new_item'      => esc_attr__( 'Add New', 'sportspress' ),\n\t\t\t\t'new_item_name'     => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'parent_item'       => esc_attr__( 'Parent', 'sportspress' ),\n\t\t\t\t'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ),\n\t\t\t\t'search_items'      => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t'not_found'         => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t);\n\t\t\t$args         = apply_filters(\n\t\t\t\t'sportspress_register_taxonomy_venue',\n\t\t\t\tarray(\n\t\t\t\t\t'label'                 => esc_attr__( 'Venues', 'sportspress' ),\n\t\t\t\t\t'labels'                => $labels,\n\t\t\t\t\t'public'                => true,\n\t\t\t\t\t'show_ui'               => $show,\n\t\t\t\t\t'show_in_menu'          => $show,\n\t\t\t\t\t'show_in_nav_menus'     => false,\n\t\t\t\t\t'show_tagcloud'         => false,\n\t\t\t\t\t'hierarchical'          => true,\n\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_venue_slug', 'venue' ) ),\n\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t'rest_controller_class' => 'SP_REST_Terms_Controller',\n\t\t\t\t\t'rest_base'             => 'venues',\n\t\t\t\t)\n\t\t\t);\n\t\t\t$object_types = apply_filters( 'sportspress_event_object_types', array( 'sp_event', 'sp_calendar', 'sp_team' ) );\n\t\t\tregister_taxonomy( 'sp_venue', $object_types, $args );\n\t\t\tforeach ( $object_types as $object_type ) :\n\t\t\t\tregister_taxonomy_for_object_type( 'sp_venue', $object_type );\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tif ( apply_filters( 'sportspress_has_positions', true ) ) :\n\t\t\t$labels       = array(\n\t\t\t\t'name'              => esc_attr__( 'Positions', 'sportspress' ),\n\t\t\t\t'singular_name'     => esc_attr__( 'Position', 'sportspress' ),\n\t\t\t\t'all_items'         => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t'edit_item'         => esc_attr__( 'Edit Position', 'sportspress' ),\n\t\t\t\t'view_item'         => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t'update_item'       => esc_attr__( 'Update', 'sportspress' ),\n\t\t\t\t'add_new_item'      => esc_attr__( 'Add New', 'sportspress' ),\n\t\t\t\t'new_item_name'     => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'parent_item'       => esc_attr__( 'Parent', 'sportspress' ),\n\t\t\t\t'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ),\n\t\t\t\t'search_items'      => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t'not_found'         => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t);\n\t\t\t$args         = apply_filters(\n\t\t\t\t'sportspress_register_taxonomy_position',\n\t\t\t\tarray(\n\t\t\t\t\t'label'                 => esc_attr__( 'Positions', 'sportspress' ),\n\t\t\t\t\t'labels'                => $labels,\n\t\t\t\t\t'public'                => true,\n\t\t\t\t\t'show_ui'               => $show,\n\t\t\t\t\t'show_in_menu'          => $show,\n\t\t\t\t\t'show_in_nav_menus'     => false,\n\t\t\t\t\t'show_tagcloud'         => false,\n\t\t\t\t\t'hierarchical'          => true,\n\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ),\n\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t'rest_controller_class' => 'SP_REST_Terms_Controller',\n\t\t\t\t\t'rest_base'             => 'positions',\n\t\t\t\t)\n\t\t\t);\n\t\t\t$object_types = apply_filters( 'sportspress_position_object_types', array( 'sp_player', 'sp_list' ) );\n\t\t\tregister_taxonomy( 'sp_position', $object_types, $args );\n\t\t\tforeach ( $object_types as $object_type ) :\n\t\t\t\tregister_taxonomy_for_object_type( 'sp_position', $object_type );\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tif ( apply_filters( 'sportspress_has_roles', true ) ) :\n\t\t\t$labels       = array(\n\t\t\t\t'name'              => esc_attr__( 'Jobs', 'sportspress' ),\n\t\t\t\t'singular_name'     => esc_attr__( 'Job', 'sportspress' ),\n\t\t\t\t'all_items'         => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t'edit_item'         => esc_attr__( 'Edit Job', 'sportspress' ),\n\t\t\t\t'view_item'         => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t'update_item'       => esc_attr__( 'Update', 'sportspress' ),\n\t\t\t\t'add_new_item'      => esc_attr__( 'Add New', 'sportspress' ),\n\t\t\t\t'new_item_name'     => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'parent_item'       => esc_attr__( 'Parent', 'sportspress' ),\n\t\t\t\t'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ),\n\t\t\t\t'search_items'      => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t'not_found'         => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t);\n\t\t\t$args         = apply_filters(\n\t\t\t\t'sportspress_register_taxonomy_role',\n\t\t\t\tarray(\n\t\t\t\t\t'label'                 => esc_attr__( 'Jobs', 'sportspress' ),\n\t\t\t\t\t'labels'                => $labels,\n\t\t\t\t\t'public'                => true,\n\t\t\t\t\t'show_ui'               => $show,\n\t\t\t\t\t'show_in_menu'          => $show,\n\t\t\t\t\t'show_in_nav_menus'     => false,\n\t\t\t\t\t'show_tagcloud'         => false,\n\t\t\t\t\t'hierarchical'          => true,\n\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_role_slug', 'role' ) ),\n\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t'rest_controller_class' => 'SP_REST_Terms_Controller',\n\t\t\t\t\t'rest_base'             => 'roles',\n\t\t\t\t)\n\t\t\t);\n\t\t\t$object_types = apply_filters( 'sportspress_role_object_types', array( 'sp_staff' ) );\n\t\t\tregister_taxonomy( 'sp_role', $object_types, $args );\n\t\t\tforeach ( $object_types as $object_type ) :\n\t\t\t\tregister_taxonomy_for_object_type( 'sp_role', $object_type );\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tdo_action( 'sportspress_after_register_taxonomy' );\n\t}\n\n\t/**\n\t * Register core post types\n\t */\n\tpublic static function register_post_types() {\n\t\tdo_action( 'sportspress_register_post_type' );\n\n\t\tregister_post_type(\n\t\t\t'sp_result',\n\t\t\tapply_filters(\n\t\t\t\t'sportspress_register_post_type_result',\n\t\t\t\tarray(\n\t\t\t\t\t'labels'              => array(\n\t\t\t\t\t\t'name'               => esc_attr__( 'Event Results', 'sportspress' ),\n\t\t\t\t\t\t'singular_name'      => esc_attr__( 'Result', 'sportspress' ),\n\t\t\t\t\t\t'add_new_item'       => esc_attr__( 'Add New Result', 'sportspress' ),\n\t\t\t\t\t\t'edit_item'          => esc_attr__( 'Edit Result', 'sportspress' ),\n\t\t\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t'view_item'          => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'public'              => false,\n\t\t\t\t\t'show_ui'             => true,\n\t\t\t\t\t'capability_type'     => 'sp_config',\n\t\t\t\t\t'map_meta_cap'        => true,\n\t\t\t\t\t'publicly_queryable'  => false,\n\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t'hierarchical'        => false,\n\t\t\t\t\t'supports'            => array( 'title', 'page-attributes', 'excerpt' ),\n\t\t\t\t\t'has_archive'         => false,\n\t\t\t\t\t'show_in_nav_menus'   => false,\n\t\t\t\t\t'can_export'          => false,\n\t\t\t\t\t'show_in_menu'        => false,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tregister_post_type(\n\t\t\t'sp_outcome',\n\t\t\tapply_filters(\n\t\t\t\t'sportspress_register_post_type_outcome',\n\t\t\t\tarray(\n\t\t\t\t\t'labels'              => array(\n\t\t\t\t\t\t'name'               => esc_attr__( 'Event Outcomes', 'sportspress' ),\n\t\t\t\t\t\t'singular_name'      => esc_attr__( 'Outcome', 'sportspress' ),\n\t\t\t\t\t\t'add_new_item'       => esc_attr__( 'Add New Outcome', 'sportspress' ),\n\t\t\t\t\t\t'edit_item'          => esc_attr__( 'Edit Outcome', 'sportspress' ),\n\t\t\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t'view_item'          => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'public'              => false,\n\t\t\t\t\t'show_ui'             => true,\n\t\t\t\t\t'capability_type'     => 'sp_config',\n\t\t\t\t\t'map_meta_cap'        => true,\n\t\t\t\t\t'publicly_queryable'  => false,\n\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t'hierarchical'        => false,\n\t\t\t\t\t'supports'            => array( 'title', 'page-attributes', 'excerpt' ),\n\t\t\t\t\t'has_archive'         => false,\n\t\t\t\t\t'show_in_nav_menus'   => false,\n\t\t\t\t\t'can_export'          => false,\n\t\t\t\t\t'show_in_menu'        => false,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tregister_post_type(\n\t\t\t'sp_column',\n\t\t\tapply_filters(\n\t\t\t\t'sportspress_register_post_type_column',\n\t\t\t\tarray(\n\t\t\t\t\t'labels'              => array(\n\t\t\t\t\t\t'name'               => esc_attr__( 'Table Columns', 'sportspress' ),\n\t\t\t\t\t\t'singular_name'      => esc_attr__( 'Column', 'sportspress' ),\n\t\t\t\t\t\t'add_new_item'       => esc_attr__( 'Add New Column', 'sportspress' ),\n\t\t\t\t\t\t'edit_item'          => esc_attr__( 'Edit Column', 'sportspress' ),\n\t\t\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t'view_item'          => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'public'              => false,\n\t\t\t\t\t'show_ui'             => true,\n\t\t\t\t\t'capability_type'     => 'sp_config',\n\t\t\t\t\t'map_meta_cap'        => true,\n\t\t\t\t\t'publicly_queryable'  => false,\n\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t'hierarchical'        => false,\n\t\t\t\t\t'supports'            => array( 'title', 'page-attributes', 'excerpt' ),\n\t\t\t\t\t'has_archive'         => false,\n\t\t\t\t\t'show_in_nav_menus'   => false,\n\t\t\t\t\t'can_export'          => false,\n\t\t\t\t\t'show_in_menu'        => false,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tregister_post_type(\n\t\t\t'sp_metric',\n\t\t\tapply_filters(\n\t\t\t\t'sportspress_register_post_type_metric',\n\t\t\t\tarray(\n\t\t\t\t\t'labels'              => array(\n\t\t\t\t\t\t'name'               => esc_attr__( 'Player Metrics', 'sportspress' ),\n\t\t\t\t\t\t'singular_name'      => esc_attr__( 'Metric', 'sportspress' ),\n\t\t\t\t\t\t'add_new_item'       => esc_attr__( 'Add New Metric', 'sportspress' ),\n\t\t\t\t\t\t'edit_item'          => esc_attr__( 'Edit Metric', 'sportspress' ),\n\t\t\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t'view_item'          => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'public'              => false,\n\t\t\t\t\t'show_ui'             => true,\n\t\t\t\t\t'capability_type'     => 'sp_config',\n\t\t\t\t\t'map_meta_cap'        => true,\n\t\t\t\t\t'publicly_queryable'  => false,\n\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t'hierarchical'        => false,\n\t\t\t\t\t'supports'            => array( 'title', 'page-attributes', 'excerpt' ),\n\t\t\t\t\t'has_archive'         => false,\n\t\t\t\t\t'show_in_nav_menus'   => false,\n\t\t\t\t\t'can_export'          => false,\n\t\t\t\t\t'show_in_menu'        => false,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tregister_post_type(\n\t\t\t'sp_performance',\n\t\t\tapply_filters(\n\t\t\t\t'sportspress_register_post_type_performance',\n\t\t\t\tarray(\n\t\t\t\t\t'labels'              => array(\n\t\t\t\t\t\t'name'                  => esc_attr__( 'Player Performance', 'sportspress' ),\n\t\t\t\t\t\t'menu_name'             => esc_attr__( 'Performance', 'sportspress' ),\n\t\t\t\t\t\t'singular_name'         => esc_attr__( 'Player Performance', 'sportspress' ),\n\t\t\t\t\t\t'add_new_item'          => esc_attr__( 'Add New Performance', 'sportspress' ),\n\t\t\t\t\t\t'edit_item'             => esc_attr__( 'Edit Performance', 'sportspress' ),\n\t\t\t\t\t\t'new_item'              => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t'view_item'             => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t\t\t'search_items'          => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t'not_found'             => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'not_found_in_trash'    => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'featured_image'        => esc_attr__( 'Icon', 'sportspress' ),\n\t\t\t\t\t\t'set_featured_image'    => esc_attr__( 'Select Icon', 'sportspress' ),\n\t\t\t\t\t\t'remove_featured_image' => esc_attr__( 'Remove icon', 'sportspress' ),\n\t\t\t\t\t\t'use_featured_image'    => esc_attr__( 'Add icon', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'public'              => false,\n\t\t\t\t\t'show_ui'             => true,\n\t\t\t\t\t'capability_type'     => 'sp_config',\n\t\t\t\t\t'map_meta_cap'        => true,\n\t\t\t\t\t'publicly_queryable'  => false,\n\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t'hierarchical'        => false,\n\t\t\t\t\t'supports'            => array( 'title', 'thumbnail', 'page-attributes', 'excerpt' ),\n\t\t\t\t\t'has_archive'         => false,\n\t\t\t\t\t'show_in_nav_menus'   => false,\n\t\t\t\t\t'can_export'          => false,\n\t\t\t\t\t'show_in_menu'        => false,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tregister_post_type(\n\t\t\t'sp_statistic',\n\t\t\tapply_filters(\n\t\t\t\t'sportspress_register_post_type_statistic',\n\t\t\t\tarray(\n\t\t\t\t\t'labels'              => array(\n\t\t\t\t\t\t'name'                  => esc_attr__( 'Player Statistics', 'sportspress' ),\n\t\t\t\t\t\t'menu_name'             => esc_attr__( 'Statistics', 'sportspress' ),\n\t\t\t\t\t\t'singular_name'         => esc_attr__( 'Statistic', 'sportspress' ),\n\t\t\t\t\t\t'add_new_item'          => esc_attr__( 'Add New Statistic', 'sportspress' ),\n\t\t\t\t\t\t'edit_item'             => esc_attr__( 'Edit Statistic', 'sportspress' ),\n\t\t\t\t\t\t'new_item'              => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t'view_item'             => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t\t\t'search_items'          => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t'not_found'             => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'not_found_in_trash'    => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'featured_image'        => esc_attr__( 'Icon', 'sportspress' ),\n\t\t\t\t\t\t'set_featured_image'    => esc_attr__( 'Select Icon', 'sportspress' ),\n\t\t\t\t\t\t'remove_featured_image' => esc_attr__( 'Remove icon', 'sportspress' ),\n\t\t\t\t\t\t'use_featured_image'    => esc_attr__( 'Add icon', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'public'              => false,\n\t\t\t\t\t'show_ui'             => true,\n\t\t\t\t\t'capability_type'     => 'sp_config',\n\t\t\t\t\t'map_meta_cap'        => true,\n\t\t\t\t\t'publicly_queryable'  => false,\n\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t'hierarchical'        => false,\n\t\t\t\t\t'supports'            => array( 'title', 'thumbnail', 'page-attributes', 'excerpt' ),\n\t\t\t\t\t'has_archive'         => false,\n\t\t\t\t\t'show_in_nav_menus'   => false,\n\t\t\t\t\t'can_export'          => false,\n\t\t\t\t\t'show_in_menu'        => false,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels'                => array(\n\t\t\t\t'name'               => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t'singular_name'      => esc_attr__( 'Event', 'sportspress' ),\n\t\t\t\t'add_new'      \t     => esc_attr__( 'Add New Event', 'sportspress' ),\n\t\t\t\t'add_new_item'       => esc_attr__( 'Add New Event', 'sportspress' ),\n\t\t\t\t'edit_item'          => esc_attr__( 'Edit Event', 'sportspress' ),\n\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t'view_item'          => esc_attr__( 'View Event', 'sportspress' ),\n\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t),\n\t\t\t'public'                => true,\n\t\t\t'show_ui'               => true,\n\t\t\t'capability_type'       => 'sp_event',\n\t\t\t'map_meta_cap'          => true,\n\t\t\t'publicly_queryable'    => true,\n\t\t\t'exclude_from_search'   => false,\n\t\t\t'hierarchical'          => false,\n\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_event_slug', 'event' ) ),\n\t\t\t'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' ),\n\t\t\t'has_archive'           => false,\n\t\t\t'show_in_nav_menus'     => true,\n\t\t\t'menu_icon'             => 'dashicons-calendar',\n\t\t\t'show_in_rest'          => true,\n\t\t\t'rest_controller_class' => 'SP_REST_Posts_Controller',\n\t\t\t'rest_base'             => 'events',\n\t\t);\n\n\t\tif ( get_option( 'sportspress_event_comment_status', 'no' ) == 'yes' ) :\n\t\t\t$args['supports'][] = 'comments';\n\t\tendif;\n\n\t\tregister_post_type( 'sp_event', apply_filters( 'sportspress_register_post_type_event', $args ) );\n\n\t\t$args = array(\n\t\t\t'labels'                => array(\n\t\t\t\t'name'                  => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t'singular_name'         => esc_attr__( 'Team', 'sportspress' ),\n\t\t\t\t'add_new'          \t\t=> esc_attr__( 'Add New Team', 'sportspress' ),\n\t\t\t\t'add_new_item'          => esc_attr__( 'Add New Team', 'sportspress' ),\n\t\t\t\t'edit_item'             => esc_attr__( 'Edit Team', 'sportspress' ),\n\t\t\t\t'new_item'              => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t'view_item'             => esc_attr__( 'View Team', 'sportspress' ),\n\t\t\t\t'search_items'          => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t'not_found'             => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t'not_found_in_trash'    => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t'featured_image'        => esc_attr__( 'Logo', 'sportspress' ),\n\t\t\t\t'set_featured_image'    => esc_attr__( 'Select Logo', 'sportspress' ),\n\t\t\t\t'remove_featured_image' => esc_attr__( 'Remove Logo', 'sportspress' ),\n\t\t\t\t'use_featured_image'    => esc_attr__( 'Select Logo', 'sportspress' ),\n\t\t\t),\n\t\t\t'public'                => true,\n\t\t\t'show_ui'               => true,\n\t\t\t'capability_type'       => 'sp_team',\n\t\t\t'map_meta_cap'          => true,\n\t\t\t'publicly_queryable'    => true,\n\t\t\t'exclude_from_search'   => false,\n\t\t\t'hierarchical'          => true,\n\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_team_slug', 'team' ) ),\n\t\t\t'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'excerpt' ),\n\t\t\t'has_archive'           => false,\n\t\t\t'show_in_nav_menus'     => true,\n\t\t\t'menu_icon'             => 'dashicons-shield-alt',\n\t\t\t'show_in_rest'          => true,\n\t\t\t'rest_controller_class' => 'SP_REST_Posts_Controller',\n\t\t\t'rest_base'             => 'teams',\n\t\t);\n\n\t\tif ( get_option( 'sportspress_team_comment_status', 'no' ) == 'yes' ) :\n\t\t\t$args['supports'][] = 'comments';\n\t\tendif;\n\n\t\tregister_post_type( 'sp_team', apply_filters( 'sportspress_register_post_type_team', $args ) );\n\n\t\tregister_post_type(\n\t\t\t'sp_player',\n\t\t\tapply_filters(\n\t\t\t\t'sportspress_register_post_type_player',\n\t\t\t\tarray(\n\t\t\t\t\t'labels'                => array(\n\t\t\t\t\t\t'name'                  => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t\t'singular_name'         => esc_attr__( 'Player', 'sportspress' ),\n\t\t\t\t\t\t'add_new'\t            => esc_attr__( 'Add New Player', 'sportspress' ),\n\t\t\t\t\t\t'add_new_item'          => esc_attr__( 'Add New Player', 'sportspress' ),\n\t\t\t\t\t\t'edit_item'             => esc_attr__( 'Edit Player', 'sportspress' ),\n\t\t\t\t\t\t'new_item'              => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t'view_item'             => esc_attr__( 'View Player', 'sportspress' ),\n\t\t\t\t\t\t'search_items'          => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t'not_found'             => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'not_found_in_trash'    => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'featured_image'        => esc_attr__( 'Photo', 'sportspress' ),\n\t\t\t\t\t\t'set_featured_image'    => esc_attr__( 'Select Photo', 'sportspress' ),\n\t\t\t\t\t\t'remove_featured_image' => esc_attr__( 'Remove Photo', 'sportspress' ),\n\t\t\t\t\t\t'use_featured_image'    => esc_attr__( 'Select Photo', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'public'                => true,\n\t\t\t\t\t'show_ui'               => true,\n\t\t\t\t\t'capability_type'       => 'sp_player',\n\t\t\t\t\t'map_meta_cap'          => true,\n\t\t\t\t\t'publicly_queryable'    => true,\n\t\t\t\t\t'exclude_from_search'   => false,\n\t\t\t\t\t'hierarchical'          => false,\n\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_player_slug', 'player' ) ),\n\t\t\t\t\t'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'page-attributes' ),\n\t\t\t\t\t'has_archive'           => false,\n\t\t\t\t\t'show_in_nav_menus'     => true,\n\t\t\t\t\t'menu_icon'             => 'dashicons-groups',\n\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t'rest_controller_class' => 'SP_REST_Posts_Controller',\n\t\t\t\t\t'rest_base'             => 'players',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tregister_post_type(\n\t\t\t'sp_staff',\n\t\t\tapply_filters(\n\t\t\t\t'sportspress_register_post_type_staff',\n\t\t\t\tarray(\n\t\t\t\t\t'labels'                => array(\n\t\t\t\t\t\t'name'                  => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t'singular_name'         => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t'add_new'\t            => esc_attr__( 'Add New Staff', 'sportspress' ),\n\t\t\t\t\t\t'add_new_item'          => esc_attr__( 'Add New Staff', 'sportspress' ),\n\t\t\t\t\t\t'edit_item'             => esc_attr__( 'Edit Staff', 'sportspress' ),\n\t\t\t\t\t\t'new_item'              => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t'view_item'             => esc_attr__( 'View Staff', 'sportspress' ),\n\t\t\t\t\t\t'search_items'          => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t'not_found'             => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'not_found_in_trash'    => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t'featured_image'        => esc_attr__( 'Photo', 'sportspress' ),\n\t\t\t\t\t\t'set_featured_image'    => esc_attr__( 'Select Photo', 'sportspress' ),\n\t\t\t\t\t\t'remove_featured_image' => esc_attr__( 'Remove Photo', 'sportspress' ),\n\t\t\t\t\t\t'use_featured_image'    => esc_attr__( 'Select Photo', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t\t'public'                => true,\n\t\t\t\t\t'show_ui'               => true,\n\t\t\t\t\t'capability_type'       => 'sp_staff',\n\t\t\t\t\t'map_meta_cap'          => true,\n\t\t\t\t\t'publicly_queryable'    => true,\n\t\t\t\t\t'exclude_from_search'   => false,\n\t\t\t\t\t'hierarchical'          => false,\n\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_staff_slug', 'staff' ) ),\n\t\t\t\t\t'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' ),\n\t\t\t\t\t'has_archive'           => false,\n\t\t\t\t\t'show_in_nav_menus'     => true,\n\t\t\t\t\t'menu_icon'             => 'dashicons-businessman',\n\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t'rest_controller_class' => 'SP_REST_Posts_Controller',\n\t\t\t\t\t'rest_base'             => 'staff',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tdo_action( 'sportspress_after_register_post_type' );\n\t}\n\n\tpublic function delete_config_post( $post_id ) {\n\t\t$post_type = get_post_type( $post_id );\n\t\tif ( is_sp_config_type( $post_type ) ) {\n\t\t\twp_delete_post( $post_id, true );\n\t\t}\n\t}\n\n\tpublic function display_scheduled_events( $post_status, $post ) {\n\t\tif ($post->post_type == 'sp_event' && $post_status == 'future') {\n\t\t\treturn \"publish\";\n\t\t}\n\t\treturn $post_status;\n\t}\n\t\n}\n\nnew SP_Post_types();\n"
  },
  {
    "path": "includes/class-sp-shortcodes.php",
    "content": "<?php\n/**\n * SP_Shortcodes class.\n *\n * @class       SP_Shortcodes\n * @version     2.7.9\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Shortcodes {\n\n\t/**\n\t * Init shortcodes\n\t */\n\tpublic static function init() {\n\t\t// Define shortcodes\n\t\t$shortcodes = array(\n\t\t\t'event_results'     => __CLASS__ . '::event_results',\n\t\t\t'event_details'     => __CLASS__ . '::event_details',\n\t\t\t'event_performance' => __CLASS__ . '::event_performance',\n\t\t\t'event_venue'       => __CLASS__ . '::event_venue',\n\t\t\t'event_officials'   => __CLASS__ . '::event_officials',\n\t\t\t'event_teams'       => __CLASS__ . '::event_teams',\n\t\t\t'event_full'        => __CLASS__ . '::event_full',\n\t\t\t'countdown'         => __CLASS__ . '::countdown',\n\t\t\t'player_details'    => __CLASS__ . '::player_details',\n\t\t\t'player_statistics' => __CLASS__ . '::player_statistics',\n\t\t\t'staff'             => __CLASS__ . '::staff',\n\t\t\t'staff_profile'     => __CLASS__ . '::staff_profile',\n\t\t\t'event_calendar'    => __CLASS__ . '::event_calendar',\n\t\t\t'event_list'        => __CLASS__ . '::event_list',\n\t\t\t'event_blocks'      => __CLASS__ . '::event_blocks',\n\t\t\t'league_table'      => __CLASS__ . '::league_table',\n\t\t\t'team_standings'    => __CLASS__ . '::league_table',\n\t\t\t'team_gallery'      => __CLASS__ . '::team_gallery',\n\t\t\t'player_list'       => __CLASS__ . '::player_list',\n\t\t\t'player_gallery'    => __CLASS__ . '::player_gallery',\n\t\t);\n\n\t\tforeach ( $shortcodes as $shortcode => $function ) {\n\t\t\tadd_shortcode( $shortcode, $function );\n\t\t}\n\t}\n\n\t/**\n\t * Shortcode Wrapper\n\t *\n\t * @param mixed $function\n\t * @param array $atts (default: array())\n\t * @return string\n\t */\n\tpublic static function shortcode_wrapper(\n\t\t$function,\n\t\t$atts = array(),\n\t\t$wrapper = array(\n\t\t\t'class'  => 'sportspress',\n\t\t\t'before' => null,\n\t\t\t'after'  => null,\n\t\t)\n\t) {\n\t\t$wrapper = apply_filters( 'sportspress_shortcode_wrapper', $wrapper, $function, $atts );\n\n\t\tob_start();\n\n\t\t$before = empty( $wrapper['before'] ) ? '<div class=\"' . esc_attr( $wrapper['class'] ) . '\">' : $wrapper['before'];\n\t\t$after  = empty( $wrapper['after'] ) ? '</div>' : $wrapper['after'];\n\n\t\techo wp_kses_post( $before );\n\t\tcall_user_func( $function, $atts );\n\t\techo wp_kses_post( $after );\n\n\t\treturn ob_get_clean();\n\t}\n\n\t/**\n\t * Event results shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_results( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Results', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event details shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_details( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Details', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event performance shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_performance( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Performance', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event venue shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_venue( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Venue', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event officials shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_officials( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Officials', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event teams shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_teams( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Teams', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event full info shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_full( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Full', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Countdown shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function countdown( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Countdown', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event calendar shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_calendar( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Calendar', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event list shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_list( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_List', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Event blocks shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function event_blocks( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Event_Blocks', 'output' ), $atts );\n\t}\n\n\t/**\n\t * League table (team standings) shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function league_table( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_League_Table', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Team gallery shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function team_gallery( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Team_Gallery', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Player details shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function player_details( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Player_Details', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Player statistics shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function player_statistics( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Player_Statistics', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Player performance shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function player_performance( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Player_Performance', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Player list shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function player_list( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Player_List', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Player gallery shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function player_gallery( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Player_Gallery', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Staff shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function staff( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Staff', 'output' ), $atts );\n\t}\n\n\t/**\n\t * Staff profile shortcode.\n\t *\n\t * @access public\n\t * @param mixed $atts\n\t * @return string\n\t */\n\tpublic static function staff_profile( $atts ) {\n\t\treturn self::shortcode_wrapper( array( 'SP_Shortcode_Staff_Profile', 'output' ), $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-staff.php",
    "content": "<?php\n/**\n * Staff Class\n *\n * The SportsPress staff class handles individual staff data.\n *\n * @class       SP_Staff\n * @version     2.5.1\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Staff extends SP_Custom_Post {\n\n\t/**\n\t * Returns current teams\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function current_teams() {\n\t\treturn get_post_meta( $this->ID, 'sp_current_team', false );\n\t}\n\n\t/**\n\t * Returns past teams\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function past_teams() {\n\t\treturn get_post_meta( $this->ID, 'sp_past_team', false );\n\t}\n\n\t/**\n\t * Returns nationalities\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function nationalities() {\n\t\treturn get_post_meta( $this->ID, 'sp_nationality', false );\n\t}\n\n\t/**\n\t * Returns role\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function role() {\n\t\t$roles = $this->get_roles();\n\t\tif ( $roles && ! is_wp_error( $roles ) ) :\n\t\t\treturn array_shift( $roles );\n\t\telse :\n\t\t\treturn false;\n\t\tendif;\n\t}\n\n\t/**\n\t * Returns roles\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function roles() {\n\t\t$roles = $this->get_roles();\n\t\tif ( $roles && ! is_wp_error( $roles ) ) :\n\t\t\treturn (array) $roles;\n\t\telse :\n\t\t\treturn array();\n\t\tendif;\n\t}\n\n\tpublic function get_roles() {\n\t\t$roles = get_the_terms( $this->ID, 'sp_role' );\n\n\t\tif ( ! is_array( $roles ) || ! sizeof( $roles ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$include = wp_list_pluck( $roles, 'term_id' );\n\n\t\treturn get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy'   => 'sp_role',\n\t\t\t\t'hide_empty' => false,\n\t\t\t\t'orderby'    => 'meta_value_num',\n\t\t\t\t'include'    => $include,\n\t\t\t\t'meta_query' => array(\n\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-team.php",
    "content": "<?php\n/**\n * Team Class\n *\n * The SportsPress team class handles individual team data.\n *\n * @class       SP_Team\n * @version     2.7.1\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Team extends SP_Custom_Post {\n\n\tpublic function next_event() {\n\t\t$args   = array(\n\t\t\t'post_type'      => 'sp_event',\n\t\t\t'numberposts'    => 1,\n\t\t\t'posts_per_page' => 1,\n\t\t\t'order'          => 'DESC',\n\t\t\t'post_status'    => 'future',\n\t\t\t'meta_query'     => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => 'sp_team',\n\t\t\t\t\t'value' => $this->ID,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$events = get_posts( $args );\n\n\t\tif ( count( $events ) ) {\n\t\t\treturn array_shift( $events );\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns formatted data\n\t *\n\t * @access public\n\t * @param bool $admin\n\t * @return array\n\t */\n\tpublic function columns( $league_id ) {\n\t\t$seasons = (array) get_the_terms( $this->ID, 'sp_season' );\n\t\t$columns = (array) get_post_meta( $this->ID, 'sp_columns', true );\n\n\t\t// Get labels from result variables\n\t\t$result_labels = (array) sp_get_var_labels( 'sp_result' );\n\n\t\t// Get labels from outcome variables\n\t\t$outcome_labels = (array) sp_get_var_labels( 'sp_outcome' );\n\n\t\t// Generate array of all season ids and season names\n\t\t$div_ids      = array();\n\t\t$season_names = array();\n\t\tforeach ( $seasons as $season ) :\n\t\t\tif ( is_object( $season ) && property_exists( $season, 'term_id' ) && property_exists( $season, 'name' ) ) :\n\t\t\t\t$div_ids[]                        = $season->term_id;\n\t\t\t\t$season_names[ $season->term_id ] = $season->name;\n\t\t\tendif;\n\t\tendforeach;\n\n\t\t$div_ids[]       = 0;\n\t\t$season_names[0] = esc_attr__( 'Total', 'sportspress' );\n\n\t\t$data = array();\n\n\t\t// Get all seasons populated with data where available\n\t\t$data = sp_array_combine( $div_ids, sp_array_value( $columns, $league_id, array() ) );\n\n\t\t// Get equations from column variables\n\t\t$equations = sp_get_var_equations( 'sp_column' );\n\n\t\t// Initialize placeholders array\n\t\t$placeholders = array();\n\n\t\tforeach ( $div_ids as $div_id ) :\n\n\t\t\t$totals = array(\n\t\t\t\t'eventsplayed'       => 0,\n\t\t\t\t'eventsplayed_home'  => 0,\n\t\t\t\t'eventsplayed_away'  => 0,\n\t\t\t\t'eventsplayed_venue' => 0,\n\t\t\t\t'eventminutes'       => 0,\n\t\t\t\t'eventminutes_home'  => 0,\n\t\t\t\t'eventminutes_away'  => 0,\n\t\t\t\t'eventminutes_venue' => 0,\n\t\t\t\t'streak'             => 0,\n\t\t\t\t'streak_home'        => 0,\n\t\t\t\t'streak_away'        => 0,\n\t\t\t\t'streak_venue'       => 0,\n\t\t\t\t'last5'              => null,\n\t\t\t\t'last10'             => null,\n\t\t\t\t'homerecord'         => null,\n\t\t\t\t'awayrecord'         => null,\n\t\t\t);\n\n\t\t\tforeach ( $result_labels as $key => $value ) :\n\t\t\t\t$totals[ $key . 'for' ]           = 0;\n\t\t\t\t$totals[ $key . 'for_home' ]      = 0;\n\t\t\t\t$totals[ $key . 'for_away' ]      = 0;\n\t\t\t\t$totals[ $key . 'for_venue' ]     = 0;\n\t\t\t\t$totals[ $key . 'against' ]       = 0;\n\t\t\t\t$totals[ $key . 'against_home' ]  = 0;\n\t\t\t\t$totals[ $key . 'against_away' ]  = 0;\n\t\t\t\t$totals[ $key . 'against_venue' ] = 0;\n\t\t\tendforeach;\n\n\t\t\tforeach ( $outcome_labels as $key => $value ) :\n\t\t\t\t$totals[ $key ]            = 0;\n\t\t\t\t$totals[ $key . '_home' ]  = 0;\n\t\t\t\t$totals[ $key . '_away' ]  = 0;\n\t\t\t\t$totals[ $key . '_venue' ] = 0;\n\t\t\tendforeach;\n\n\t\t\t// Initialize streaks counter\n\t\t\t$streak = array(\n\t\t\t\t'name'  => '',\n\t\t\t\t'count' => 0,\n\t\t\t\t'fire'  => 1,\n\t\t\t);\n\n\t\t\t// Initialize last counters\n\t\t\t$last5  = array();\n\t\t\t$last10 = array();\n\n\t\t\t// Initialize record counters\n\t\t\t$homerecord = array();\n\t\t\t$awayrecord = array();\n\n\t\t\t// Add outcome types to last and record counters\n\t\t\tforeach ( $outcome_labels as $key => $value ) :\n\t\t\t\t$last5[ $key ]      = 0;\n\t\t\t\t$last10[ $key ]     = 0;\n\t\t\t\t$homerecord[ $key ] = 0;\n\t\t\t\t$awayrecord[ $key ] = 0;\n\t\t\tendforeach;\n\n\t\t\t// Get all events involving the team in current season\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_event',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'post_date',\n\t\t\t\t'order'          => 'DESC',\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => 'sp_team',\n\t\t\t\t\t\t'value' => $this->ID,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t\t'value'   => apply_filters( 'sportspress_competitive_event_formats', array( 'league' ) ),\n\t\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'tax_query'      => array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tif ( $league_id ) :\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $league_id,\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\tif ( $div_id ) :\n\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $div_id,\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\t$args = apply_filters( 'sportspress_team_data_event_args', $args );\n\n\t\t\t$events = get_posts( $args );\n\n\t\t\t$e = 0;\n\n\t\t\tforeach ( $events as $event ) :\n\t\t\t\t$results = (array) get_post_meta( $event->ID, 'sp_results', true );\n\t\t\t\t$minutes = get_post_meta( $event->ID, 'sp_minutes', true );\n\t\t\t\tif ( $minutes === '' ) {\n\t\t\t\t\t$minutes = get_option( 'sportspress_event_minutes', 90 );\n\t\t\t\t}\n\n\t\t\t\t$i = 0;\n\n\t\t\t\tforeach ( $results as $team_id => $team_result ) :\n\t\t\t\t\tif ( is_array( $team_result ) ) :\n\t\t\t\t\t\tforeach ( $team_result as $key => $value ) :\n\t\t\t\t\t\t\tif ( $team_id == $this->ID ) :\n\t\t\t\t\t\t\t\tif ( $key == 'outcome' ) :\n\n\t\t\t\t\t\t\t\t\t// Convert to array\n\t\t\t\t\t\t\t\t\tif ( ! is_array( $value ) ) :\n\t\t\t\t\t\t\t\t\t\t$value = array( $value );\n\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\tforeach ( $value as $outcome ) :\n\n\t\t\t\t\t\t\t\t\t\t// Increment events played and outcome count\n\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $totals ) ) :\n\t\t\t\t\t\t\t\t\t\t\t$totals['eventsplayed'] ++;\n\t\t\t\t\t\t\t\t\t\t\t$totals['eventminutes'] += $minutes;\n\t\t\t\t\t\t\t\t\t\t\t$totals[ $outcome ] ++;\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to home or away stats\n\t\t\t\t\t\t\t\t\t\t\tif ( 0 === $i ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$totals['eventsplayed_home'] ++;\n\t\t\t\t\t\t\t\t\t\t\t\t$totals['eventminutes_home'] += $minutes;\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $outcome . '_home' ] ++;\n\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t$totals['eventsplayed_away'] ++;\n\t\t\t\t\t\t\t\t\t\t\t\t$totals['eventminutes_away'] += $minutes;\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $outcome . '_away' ] ++;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to venue stats\n\t\t\t\t\t\t\t\t\t\t\tif ( sp_is_home_venue( $team_id, $event->ID ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$totals['eventsplayed_venue'] ++;\n\t\t\t\t\t\t\t\t\t\t\t\t$totals['eventminutes_venue'] += $minutes;\n\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $outcome . '_venue' ] ++;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\tif ( $outcome && $outcome != '-1' ) :\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to streak counter\n\t\t\t\t\t\t\t\t\t\t\tif ( $streak['fire'] && ( $streak['name'] == '' || $streak['name'] == $outcome ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$streak['name'] = $outcome;\n\t\t\t\t\t\t\t\t\t\t\t\t$streak['count'] ++;\n\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t$streak['fire'] = 0;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to last 5 counter if sum is less than 5\n\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $last5 ) && array_sum( $last5 ) < 5 ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$last5[ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to last 10 counter if sum is less than 10\n\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $last10 ) && array_sum( $last10 ) < 10 ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$last10[ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t// Add to home or away record\n\t\t\t\t\t\t\t\t\t\t\tif ( 0 === $i ) {\n\t\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $homerecord ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$homerecord[ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $outcome, $awayrecord ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$awayrecord[ $outcome ] ++;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\t\telse :\n\n\t\t\t\t\t\t\t\t\t$value = floatval( $value );\n\n\t\t\t\t\t\t\t\t\tif ( array_key_exists( $key . 'for', $totals ) ) :\n\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'for' ]             += $value;\n\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'for' . ( $e + 1 ) ] = $value;\n\n\t\t\t\t\t\t\t\t\t\t// Add to home or away stats\n\t\t\t\t\t\t\t\t\t\tif ( 0 === $i ) :\n\t\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'for_home' ] += $value;\n\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'for_away' ] += $value;\n\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t// Add to venue stats\n\t\t\t\t\t\t\t\t\t\tif ( sp_is_home_venue( $team_id, $event->ID ) ) :\n\t\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'for_venue' ] += $value;\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $key != 'outcome' ) :\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$value = floatval( $value );\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( $key . 'against', $totals ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'against' ]             += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'against' . ( $e + 1 ) ] = $value;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Add to home or away stats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( 0 === $i ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'against_home' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'against_away' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Add to venue stats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( sp_is_home_venue( $team_id, $event->ID ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$totals[ $key . 'against_venue' ] += $value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\tendforeach;\nendif;\n\t\t\t\t\t$i++;\n\t\t\t\tendforeach;\n\t\t\t\t$e++;\n\t\t\tendforeach;\n\n\t\t\t// Compile streaks counter and add to totals\n\t\t\t$args     = array(\n\t\t\t\t'name'           => $streak['name'],\n\t\t\t\t'post_type'      => 'sp_outcome',\n\t\t\t\t'post_status'    => 'publish',\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$outcomes = get_posts( $args );\n\n\t\t\tif ( $outcomes ) :\n\t\t\t\t$outcome      = reset( $outcomes );\n\t\t\t\t$abbreviation = get_post_meta( $outcome->ID, 'sp_abbreviation', true );\n\t\t\t\tif ( ! $abbreviation ) {\n\t\t\t\t\t$abbreviation = sp_substr( $outcome->post_title, 0, 1 );\n\t\t\t\t}\n\t\t\t\t$totals['streak'] = $abbreviation . $streak['count'];\n\t\t\tendif;\n\n\t\t\t// Add last and record counters to totals\n\t\t\t$totals['last5']      = $last5;\n\t\t\t$totals['last10']     = $last10;\n\t\t\t$totals['homerecord'] = $homerecord;\n\t\t\t$totals['awayrecord'] = $awayrecord;\n\n\t\t\t// Generate array of placeholder values for each league\n\t\t\t$placeholders[ $div_id ] = array();\n\t\t\tforeach ( $equations as $key => $value ) :\n\t\t\t\tif ( '$gamesback' == $value['equation'] ) {\n\t\t\t\t\t$placeholders[ $div_id ][ $key ] = esc_attr__( '(Auto)', 'sportspress' );\n\t\t\t\t} else {\n\t\t\t\t\t$placeholders[ $div_id ][ $key ] = sp_solve( $value['equation'], $totals, $value['precision'] );\n\t\t\t\t}\n\t\t\tendforeach;\n\n\t\tendforeach;\n\n\t\t// Get columns from column variables\n\t\t$columns = sp_get_var_labels( 'sp_column' );\n\n\t\treturn array( $columns, $data, $placeholders );\n\t}\n\n\t/**\n\t * Returns staff members\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function staff( $admin = false ) {\n\t\tif ( ! $this->ID ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$args    = array(\n\t\t\t'post_type'      => 'sp_staff',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t\t'meta_key'       => 'sp_team',\n\t\t\t'meta_value'     => $this->ID,\n\t\t);\n\t\t$members = get_posts( $args );\n\n\t\t$checked = (array) get_post_meta( $this->ID, 'sp_staff' );\n\n\t\tif ( $admin ) :\n\t\t\treturn array( $members, $checked );\n\t\telse :\n\t\t\tforeach ( $members as $key => $member ) :\n\t\t\t\tif ( ! in_array( $member->ID, $checked ) ) :\n\t\t\t\t\tunset( $members[ $key ] );\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn $members;\n\t\tendif;\n\t}\n\n\t/**\n\t * Returns player lists\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function lists( $admin = false ) {\n\t\tif ( ! $this->ID ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$args  = array(\n\t\t\t'post_type'      => 'sp_list',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t\t'meta_query'     => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => 'sp_team',\n\t\t\t\t\t'value' => $this->ID,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => 'sp_team',\n\t\t\t\t\t'value' => '0',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$lists = get_posts( $args );\n\n\t\t$checked = (array) get_post_meta( $this->ID, 'sp_list' );\n\n\t\tif ( $admin ) :\n\t\t\treturn array( $lists, $checked );\n\t\telse :\n\t\t\tforeach ( $lists as $key => $list ) :\n\t\t\t\tif ( ! in_array( $list->ID, $checked ) ) :\n\t\t\t\t\tunset( $lists[ $key ] );\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn $lists;\n\t\tendif;\n\t}\n\n\t/**\n\t * Returns league tables\n\t *\n\t * @access public\n\t * @return array\n\t */\n\tpublic function tables( $admin = false ) {\n\t\tif ( ! $this->ID ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' );\n\t\t$season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );\n\n\t\t$args         = array(\n\t\t\t'post_type'      => 'sp_table',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t\t'meta_query'     => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => 'sp_select',\n\t\t\t\t\t'value' => 'manual',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => 'sp_team',\n\t\t\t\t\t'value' => $this->ID,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$tables_by_id = get_posts( $args );\n\n\t\t$args            = array(\n\t\t\t'post_type'      => 'sp_table',\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t\t'meta_query'     => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => 'sp_select',\n\t\t\t\t\t'value' => 'auto',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'tax_query'      => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $league_ids,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t'terms'    => $season_ids,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$tables_by_terms = get_posts( $args );\n\n\t\t$tables = array_merge( $tables_by_terms, $tables_by_id );\n\n\t\t$checked = (array) get_post_meta( $this->ID, 'sp_table' );\n\n\t\tif ( $admin ) :\n\t\t\treturn array( $tables, $checked );\n\t\telse :\n\t\t\tforeach ( $tables as $key => $table ) :\n\t\t\t\tif ( ! in_array( $table->ID, $checked ) ) :\n\t\t\t\t\tunset( $tables[ $key ] );\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn $tables;\n\t\tendif;\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-template-loader.php",
    "content": "<?php\n/**\n * Template Loader\n *\n * @class       SP_Template_Loader\n * @version     2.7.10\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Template_Loader {\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\tadd_filter( 'template_include', array( $this, 'template_loader' ) );\n\t\tadd_filter( 'the_content', array( $this, 'event_content' ) );\n\t\tadd_filter( 'the_content', array( $this, 'calendar_content' ) );\n\t\tadd_filter( 'the_content', array( $this, 'team_content' ) );\n\t\tadd_filter( 'the_content', array( $this, 'table_content' ) );\n\t\tadd_filter( 'the_content', array( $this, 'player_content' ) );\n\t\tadd_filter( 'the_content', array( $this, 'list_content' ) );\n\t\tadd_filter( 'the_content', array( $this, 'staff_content' ) );\n\t}\n\n\tpublic function add_content( $content, $type, $position = 10, $caption = null ) {\n\t\tif ( ! defined( 'ABSPATH' ) ) {\n\t\t\texit; // Exit if accessed directly\n\t\t}\n\t\tif ( ! in_the_loop() ) {\n\t\t\treturn; // Return if not in main loop\n\t\t}\n\n\t\t// Return password form if required\n\t\tif ( post_password_required() ) {\n\t\t\techo get_the_password_form(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepend caption to content if given\n\t\tif ( $content ) {\n\t\t\tif ( $caption ) {\n\t\t\t\t$content = '<h3 class=\"sp-post-caption\">' . $caption . '</h3>' . $content;\n\t\t\t}\n\n\t\t\t$content = '<div class=\"sp-post-content\">' . $content . '</div>';\n\t\t}\n\n\t\t// Get layout setting\n\t\t$layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );\n\n\t\t// Get templates\n\t\t$templates = SP()->templates->$type;\n\n\t\t// Combine layout setting with available templates\n\t\t$templates = array_merge( array_flip( $layout ), $templates );\n\n\t\t$templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );\n\n\t\t// Split templates into sections and tabs\n\t\t$slice = array_search( 'tabs', array_keys( $templates ) );\n\t\tif ( $slice ) {\n\t\t\t$section_templates = array_slice( $templates, 0, $slice );\n\t\t\t$tab_templates     = array_slice( $templates, $slice );\n\t\t} else {\n\t\t\t$section_templates = $templates;\n\t\t\t$tab_templates     = array();\n\t\t}\n\n\t\tob_start();\n\n\t\t// Before template hook\n\t\tdo_action( 'sportspress_before_single_' . $type );\n\n\t\t// Loop through sections\n\t\tif ( ! empty( $section_templates ) ) {\n\t\t\tforeach ( $section_templates as $key => $template ) {\n\t\t\t\t// Ignore templates that are unavailable or that have been turned off\n\t\t\t\tif ( ! is_array( $template ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $template['option'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Render the template\n\t\t\t\techo '<div class=\"sp-section-content sp-section-content-' . esc_attr( $key ) . '\">';\n\t\t\t\tif ( 'content' === $key ) {\n\t\t\t\t\techo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\t\t// Template content hook\n\t\t\t\t\tdo_action( 'sportspress_single_' . $type . '_content' );\n\t\t\t\t} else {\n\t\t\t\t\tcall_user_func( $template['action'] );\n\t\t\t\t}\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t}\n\n\t\t// After template hook\n\t\tdo_action( 'sportspress_after_single_' . $type );\n\n\t\t$ob = ob_get_clean();\n\n\t\t$tabs = '';\n\n\t\tif ( ! empty( $tab_templates ) ) {\n\t\t\t$i           = 0;\n\t\t\t$tab_content = '';\n\n\t\t\tforeach ( $tab_templates as $key => $template ) {\n\t\t\t\t// Ignore templates that are unavailable or that have been turned off\n\t\t\t\tif ( ! is_array( $template ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $template['option'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Put tab content into buffer\n\t\t\t\tob_start();\n\t\t\t\tif ( 'content' === $key ) {\n\t\t\t\t\techo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\t} else {\n\t\t\t\t\tcall_user_func( $template['action'] );\n\t\t\t\t}\n\t\t\t\t$buffer = ob_get_clean();\n\n\t\t\t\t// Trim whitespace from buffer\n\t\t\t\t$buffer = trim( $buffer );\n\n\t\t\t\t// Continue if tab content is empty\n\t\t\t\tif ( empty( $buffer ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Get template label\n\t\t\t\t$label = sp_array_value( $template, 'label', $template['title'] );\n\n\t\t\t\t// Add to tabs\n\t\t\t\t$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>';\n\n\t\t\t\t// Render the template\n\t\t\t\t$tab_content .= '<div class=\"sp-tab-content sp-tab-content-' . $key . '\" id=\"sp-tab-content-' . $key . '\"' . ( 0 === $i ? ' style=\"display: block;\"' : '' ) . '>' . $buffer . '</div>';\n\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$ob .= '<div class=\"sp-tab-group\">';\n\n\t\t\tif ( ! empty( $tabs ) ) {\n\t\t\t\t$ob .= '<ul class=\"sp-tab-menu\">' . $tabs . '</ul>';\n\t\t\t}\n\n\t\t\t$ob .= $tab_content;\n\n\t\t\t$ob .= '</div>';\n\t\t}\n\n\t\treturn $ob;\n\t}\n\n\tpublic function event_content( $content ) {\n\t\tif ( is_singular( 'sp_event' ) ) {\n\t\t\t$status = sp_get_status( get_the_ID() );\n\t\t\tif ( 'results' == $status ) {\n\t\t\t\t$caption = esc_attr__( 'Recap', 'sportspress' );\n\t\t\t} else {\n\t\t\t\t$caption = esc_attr__( 'Preview', 'sportspress' );\n\t\t\t}\n\t\t\t$content = self::add_content( $content, 'event', apply_filters( 'sportspress_event_content_priority', 10 ), $caption );\n\t\t}\n\t\treturn $content;\n\t}\n\n\tpublic function calendar_content( $content ) {\n\t\tif ( is_singular( 'sp_calendar' ) ) {\n\t\t\t$content = self::add_content( $content, 'calendar', apply_filters( 'sportspress_calendar_content_priority', 10 ) );\n\t\t}\n\t\treturn $content;\n\t}\n\n\tpublic function team_content( $content ) {\n\t\tif ( is_singular( 'sp_team' ) ) {\n\t\t\t$content = self::add_content( $content, 'team', apply_filters( 'sportspress_team_content_priority', 10 ) );\n\t\t}\n\t\treturn $content;\n\t}\n\n\tpublic function table_content( $content ) {\n\t\tif ( is_singular( 'sp_table' ) ) {\n\t\t\t$content = self::add_content( $content, 'table', apply_filters( 'sportspress_table_content_priority', 10 ) );\n\t\t}\n\t\treturn $content;\n\t}\n\n\tpublic function player_content( $content ) {\n\t\tif ( is_singular( 'sp_player' ) ) {\n\t\t\t$content = self::add_content( $content, 'player', apply_filters( 'sportspress_player_content_priority', 10 ) );\n\t\t}\n\t\treturn $content;\n\t}\n\n\tpublic function list_content( $content ) {\n\t\tif ( is_singular( 'sp_list' ) ) {\n\t\t\t$content = self::add_content( $content, 'list', apply_filters( 'sportspress_list_content_priority', 10 ) );\n\t\t}\n\t\treturn $content;\n\t}\n\n\tpublic function staff_content( $content ) {\n\t\tif ( is_singular( 'sp_staff' ) ) {\n\t\t\t$content = self::add_content( $content, 'staff', apply_filters( 'sportspress_staff_content_priority', 10 ) );\n\t\t}\n\t\treturn $content;\n\t}\n\n\t/**\n\t * Load a template.\n\t *\n\t * Handles template usage so that we can use our own templates instead of the themes.\n\t *\n\t * Templates are in the 'templates' folder. sportspress looks for theme\n\t * overrides in /theme/sportspress/ by default\n\t *\n\t * For beginners, it also looks for a sportspress.php template last. If the user adds\n\t * this to the theme (containing a sportspress() inside) this will be used as a\n\t * fallback for all sportspress templates.\n\t *\n\t * @param mixed $template\n\t * @return string\n\t */\n\tpublic function template_loader( $template ) {\n\t\t$find = array();\n\t\t$file = '';\n\n\t\tif ( is_single() ) :\n\n\t\t\t$post_type = get_post_type();\n\n\t\t\tif ( is_sp_post_type( $post_type ) ) :\n\t\t\t\t$file   = 'single-' . str_replace( 'sp_', '', $post_type ) . '.php';\n\t\t\t\t$find[] = $file;\n\t\t\t\t$find[] = SP_TEMPLATE_PATH . $file;\n\t\t\tendif;\n\n\t\telseif ( is_tax() ) :\n\n\t\t\t$term = get_queried_object();\n\n\t\t\tswitch ( $term->taxonomy ) :\n\t\t\t\tcase 'sp_venue':\n\t\t\t\t\t$file   = 'taxonomy-venue.php';\n\t\t\t\t\t$find[] = 'taxonomy-venue-' . $term->slug . '.php';\n\t\t\t\t\t$find[] = SP_TEMPLATE_PATH . 'taxonomy-venue-' . $term->slug . '.php';\n\t\t\t\t\t$find[] = $file;\n\t\t\t\t\t$find[] = SP_TEMPLATE_PATH . $file;\n\t\t\tendswitch;\n\n\t\tendif;\n\n\t\t$find[] = 'sportspress.php';\n\n\t\tif ( $file ) :\n\t\t\t$located = locate_template( $find );\n\t\t\tif ( $located ) :\n\t\t\t\t$template = $located;\n\t\t\tendif;\n\t\tendif;\n\n\t\treturn $template;\n\t}\n}\n\nnew SP_Template_Loader();\n\n"
  },
  {
    "path": "includes/class-sp-templates.php",
    "content": "<?php\n/**\n * SportsPress templates\n *\n * The SportsPress templates class stores template layout data.\n *\n * @class       SP_Templates\n * @version     2.2\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\nclass SP_Templates {\n\n\t/** @var array Array of templates */\n\tprivate $data = array();\n\n\t/**\n\t * Constructor for the templates class - defines all templates.\n\t *\n\t * @access public\n\t * @return void\n\t */\n\tpublic function __construct() {\n\t\t$this->data = array(\n\t\t\t'event'    => array_merge(\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_before_event_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'logos'   => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_event_show_logos',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_event_logos',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'excerpt' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Excerpt', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_event_show_excerpt',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_post_excerpt',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Article', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_event_show_content',\n\t\t\t\t\t\t'action'  => 'sportspress_output_event_content',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_after_event_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'video'       => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Video', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_event_show_video',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_event_video',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'details'     => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_event_show_details',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_event_details',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'venue'       => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Venue', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_event_show_venue',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_event_venue',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'results'     => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Results', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_event_show_results',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_event_results',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'performance' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Box Score', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_event_show_performance',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_event_performance',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'calendar' => array_merge(\n\t\t\t\tapply_filters( 'sportspress_before_calendar_template', array() ),\n\t\t\t\tarray(\n\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_calendar_show_content',\n\t\t\t\t\t\t'action'  => 'sportspress_output_calendar_content',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_after_calendar_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Calendar', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_calendar_show_data',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_calendar',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'team'     => array_merge(\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_before_team_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'logo'    => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Logo', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_team_show_logo',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_team_logo',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'excerpt' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Excerpt', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_team_show_excerpt',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_post_excerpt',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Profile', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_team_show_content',\n\t\t\t\t\t\t'action'  => 'sportspress_output_team_content',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_after_team_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'link'    => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Visit Site', 'sportspress' ),\n\t\t\t\t\t\t\t'label'   => esc_attr__( 'Link', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_team_show_link',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_team_link',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'details' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_team_show_details',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_team_details',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'staff'   => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_team_show_staff',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_team_staff',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'table'    => array_merge(\n\t\t\t\tapply_filters( 'sportspress_before_table_template', array() ),\n\t\t\t\tarray(\n\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_table_show_content',\n\t\t\t\t\t\t'action'  => 'sportspress_output_table_content',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_after_table_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'League Table', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_table_show_data',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_league_table',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'player'   => array_merge(\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_before_player_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'selector' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Dropdown', 'sportspress' ),\n\t\t\t\t\t\t\t'label'   => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_player_show_selector',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_player_selector',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'photo'    => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Photo', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_player_show_photo',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_player_photo',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'details'  => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_player_show_details',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_player_details',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'excerpt'  => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Excerpt', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_player_show_excerpt',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_post_excerpt',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Profile', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_player_show_content',\n\t\t\t\t\t\t'action'  => 'sportspress_output_player_content',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_after_player_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'statistics' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Statistics', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_player_show_statistics',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_player_statistics',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'list'     => array_merge(\n\t\t\t\tapply_filters( 'sportspress_before_list_template', array() ),\n\t\t\t\tarray(\n\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Description', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_list_show_content',\n\t\t\t\t\t\t'action'  => 'sportspress_output_list_content',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_after_list_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Player List', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_list_show_data',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_player_list',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'staff'    => array_merge(\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_before_staff_template',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'selector' => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Dropdown', 'sportspress' ),\n\t\t\t\t\t\t\t'label'   => esc_attr__( 'Staff', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_staff_show_selector',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_staff_selector',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'photo'    => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Photo', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_staff_show_photo',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_staff_photo',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'details'  => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_staff_show_details',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_staff_details',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'excerpt'  => array(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Excerpt', 'sportspress' ),\n\t\t\t\t\t\t\t'option'  => 'sportspress_staff_show_excerpt',\n\t\t\t\t\t\t\t'action'  => 'sportspress_output_post_excerpt',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Profile', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_staff_show_content',\n\t\t\t\t\t\t'action'  => 'sportspress_output_staff_content',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters( 'sportspress_after_staff_template', array() )\n\t\t\t),\n\t\t);\n\t}\n\n\tpublic function __get( $key ) {\n\t\treturn ( array_key_exists( $key, $this->data ) ? $this->data[ $key ] : array() );\n\t}\n\n\tpublic function __set( $key, $value ) {\n\t\t$this->data[ $key ] = $value;\n\t}\n}\n"
  },
  {
    "path": "includes/class-sp-wpml.php",
    "content": "<?php\n/**\n * WPML Class\n *\n * The SportsPress WPML class handles all WPML-related localization hooks.\n *\n * @class       SP_WPML\n * @version     1.8.2\n * @package     SportsPress/Classes\n * @category    Class\n * @author      ThemeBoy\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SP_WPML' ) ) :\n\n\t/**\n\t * SP_WPML Class\n\t */\n\tclass SP_WPML {\n\n\t\tvar $languages = array();\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t$this->init();\n\t\t\tadd_filter( 'the_title', array( $this, 'the_title' ), 5, 2 );\n\t\t\tadd_filter( 'post_type_link', array( $this, 'post_type_link' ), 5, 3 );\n\t\t\tadd_filter( 'icl_ls_languages', array( $this, 'ls' ) );\n\t\t}\n\n\t\tpublic function init() {\n\t\t\tif ( function_exists( 'icl_get_languages' ) ) {\n\t\t\t\t$this->languages = icl_get_languages();\n\t\t\t}\n\t\t}\n\n\t\tpublic static function the_title( $title, $id = null ) {\n\t\t\tif ( self::can_localize( $id, $id ) ) :\n\t\t\t\t// Get translated post ID\n\t\t\t\t$translated_id = icl_object_id( $id, 'any', false, ICL_LANGUAGE_CODE );\n\n\t\t\t\tif ( $translated_id ) :\n\t\t\t\t\t$post = get_post( $translated_id );\n\t\t\t\t\tif ( $post ) {\n\t\t\t\t\t\t$title = $post->post_title;\n\t\t\t\t\t}\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\t\treturn $title;\n\t\t}\n\n\t\tpublic static function post_type_link( $url, $post = null, $leavename = false, $sample = false ) {\n\t\t\tif ( self::can_localize( $post ) ) :\n\t\t\t\tif ( ! $post ) {\n\t\t\t\t\tglobal $post;\n\t\t\t\t}\n\n\t\t\t\t// Get post ID\n\t\t\t\t$id = $post->ID;\n\n\t\t\t\t// Get translated post ID\n\t\t\t\t$translated_id = icl_object_id( $id, 'any', false, ICL_LANGUAGE_CODE );\n\n\t\t\t\tif ( $translated_id && $translated_id != $id && get_the_ID() != $translated_id ) :\n\t\t\t\t\treturn get_post_permalink( $translated_id, $leavename, $sample );\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\t\treturn $url;\n\t\t}\n\n\t\tpublic function ls( $languages ) {\n\t\t\tif ( ! function_exists( 'icl_object_id' ) || ! is_singular( 'sp_event' ) ) {\n\t\t\t\treturn $languages;\n\t\t\t}\n\n\t\t\t// Get post ID\n\t\t\t$id = get_the_ID();\n\n\t\t\tif ( get_post_status( $id ) != 'future' ) {\n\t\t\t\treturn $languages;\n\t\t\t}\n\n\t\t\t$active_languages = array();\n\n\t\t\tforeach ( $this->languages as $k => $v ) :\n\t\t\t\tglobal $wpdb;\n\n\t\t\t\t// Get language code\n\t\t\t\t$code = sp_array_value( $v, 'code' );\n\n\t\t\t\t// Get URL\n\t\t\t\t$translated_id = icl_object_id( $id, 'any', false, $code );\n\t\t\t\tif ( ! $translated_id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$url = get_post_permalink( $translated_id, false, true );\n\n\t\t\t\t// Get native name;\n\t\t\t\t$native_name = sp_array_value( $v, 'native_name' );\n\n\t\t\t\t// Get encode URL\n\t\t\t\t$encode_url = $wpdb->get_var( $wpdb->prepare( \"SELECT encode_url FROM {$wpdb->prefix}icl_languages WHERE code=%s\", $code ) );\n\n\t\t\t\t// Get flag\n\t\t\t\t$flag = $wpdb->get_row( \"SELECT flag, from_template FROM {$wpdb->prefix}icl_flags WHERE lang_code='{$code}'\" );\n\t\t\t\tif ( $flag->from_template ) {\n\t\t\t\t\t$wp_upload_dir = wp_upload_dir();\n\t\t\t\t\t$flag_url      = $wp_upload_dir['baseurl'] . '/flags/' . $flag->flag;\n\t\t\t\t} else {\n\t\t\t\t\t$flag_url = ICL_PLUGIN_URL . '/res/flags/' . $flag->flag;\n\t\t\t\t}\n\n\t\t\t\t// Add language\n\t\t\t\t$active_languages[ $k ] = array_merge(\n\t\t\t\t\t$v,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'language_code'    => $code,\n\t\t\t\t\t\t'active'           => ICL_LANGUAGE_CODE == $code ? '1' : 0,\n\t\t\t\t\t\t'translated_name'  => $native_name,\n\t\t\t\t\t\t'encode_url'       => $encode_url,\n\t\t\t\t\t\t'country_flag_url' => $flag_url,\n\t\t\t\t\t\t'url'              => $url,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tendforeach;\n\n\t\t\t// Add if translations exist\n\t\t\tif ( sizeof( $active_languages ) > 1 ) {\n\t\t\t\t$languages = array_merge( $languages, $active_languages );\n\t\t\t}\n\n\t\t\treturn $languages;\n\t\t}\n\n\t\tpublic static function can_localize( $post, $id = null ) {\n\t\t\treturn function_exists( 'icl_object_id' ) && is_sp_post_type( get_post_type( $post ) );\n\t\t}\n\t}\n\nendif;\n\nreturn new SP_WPML();\n"
  },
  {
    "path": "includes/libraries/class-eqeos.php",
    "content": "<?php\n/**\n * EOS v2.0\n * https://github.com/jlawrence11/Classes\n *\n * Equation Operating System Classes\n *\n * Copyright 2005-2013, Jon Lawrence <jlawrence11@gmail.com>\n * Licensed under LGPL 2.1 License\n */\n\n/**\n * Equation Operating System Classes.\n *\n * This class was created for the safe parsing of mathematical equations\n * in PHP.  There is a need for a way to successfully parse equations\n * in PHP that do NOT require the use of `eval`.  `eval` at its core\n * opens the system using it to so many security vulnerabilities it is oft\n * suggested /never/ to use it, and for good reason.  This class set will\n * successfully take an equation, parse it, and provide solutions to the\n * developer.  It is a safe way to evaluate expressions without putting\n * the system at risk.\n *\n * Modified as per https://github.com/jlawrence11/eos/issues/2\n *\n * 2013/04 UPDATE:\n * - Moved to native class functions for PHP5\n * - Removed deprecated `eregi` calls to `preg_match`\n * - Updated to PHPDoc comment syntax\n * - Added Exception throwing instead of silent exits\n * - Added additional variable prefix of '$', '&' is still allowed as well\n * - Fixed small implied multiplication problem\n *\n * TODO:\n * - Add factorial support. (ie 5! = 120)\n *\n * @author Jon Lawrence <jlawrence11@gmail.com>\n * @copyright Copyright ©2005-2013, Jon Lawrence\n * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License\n * @package EOS\n * @version 2.0\n */\n\n// The following are defines for thrown exceptions\n\n/**\n * No matching Open/Close pair\n */\ndefine( 'EQEOS_E_NO_SET', 5500 );\n/**\n * Division by 0\n */\ndefine( 'EQEOS_E_DIV_ZERO', 5501 );\n/**\n * No Equation\n */\ndefine( 'EQEOS_E_NO_EQ', 5502 );\n/**\n * No variable replacement available\n */\ndefine( 'EQEOS_E_NO_VAR', 5503 );\n\nif ( ! defined( 'DEBUG' ) ) {\n\tdefine( 'DEBUG', false );\n}\n\n/**\n * Equation Operating System (EOS) Parser\n *\n * An EOS that can safely parse equations from unknown sources returning\n * the calculated value of it.  Can also handle solving equations with\n * variables, if the variables are defined (useful for the Graph creation\n * that the second and extended class in this file provides. {@see eqGraph})\n * This class was created for PHP4 in 2005, updated to fully PHP5 in 2013.\n *\n * @author Jon Lawrence <jlawrence11@gmail.com>\n * @copyright Copyright ©2005-2013, Jon Lawrence\n * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License\n * @package Math\n * @subpackage EOS\n * @version 2.0\n */\nclass eqEOS {\n\t/**#@+\n\t * Private variables\n\t */\n\tprivate $postFix;\n\tprivate $inFix;\n\t/**#@-*/\n\t/**#@+\n\t * Protected variables\n\t */\n\t// What are opening and closing selectors\n\tprotected $SEP = array(\n\t\t'open'  => array( '(', '[' ),\n\t\t'close' => array( ')', ']' ),\n\t);\n\t// Top presedence following operator - not in use\n\tprotected $SGL = array( '!' );\n\t// Order of operations arrays follow\n\tprotected $ST  = array( '^' );\n\tprotected $ST1 = array( '/', '*', '%' );\n\tprotected $ST2 = array( '+', '-' );\n\t// Allowed functions\n\tprotected $FNC = array( 'sin', 'cos', 'tan', 'csc', 'sec', 'cot' );\n\t/**#@-*/\n\t/**\n\t * Construct method\n\t *\n\t * Will initiate the class.  If variable given, will assign to\n\t * internal variable to solve with this::solveIF() without needing\n\t * additional input.  Initializing with a variable is not suggested.\n\t *\n\t * @see eqEOS::solveIF()\n\t * @param String $inFix Standard format equation\n\t */\n\tpublic function __construct( $inFix = null ) {\n\t\t$this->inFix   = ( isset( $inFix ) ) ? $inFix : null;\n\t\t$this->postFix = array();\n\t}\n\n\t/**\n\t * Check Infix for opening closing pair matches.\n\t *\n\t * This function is meant to solely check to make sure every opening\n\t * statement has a matching closing one, and throws an exception if\n\t * it doesn't.\n\t *\n\t * @param String $infix Equation to check\n\t * @throws Exception if malformed.\n\t * @return Bool true if passes - throws an exception if not.\n\t */\n\tprivate function checkInfix( $infix ) {\n\t\tif ( trim( $infix ) == '' ) {\n\t\t\treturn 0;\n\t\t}\n\t\t// Make sure we have the same number of '(' as we do ')'\n\t\t// and the same # of '[' as we do ']'\n\t\tif ( substr_count( $infix, '(' ) != substr_count( $infix, ')' ) ) {\n\t\t\tthrow new Exception( \"Mismatched parenthesis in '{$infix}'\", EQEOS_E_NO_SET );\n\t\t\treturn false;\n\t\t} elseif ( substr_count( $infix, '[' ) != substr_count( $infix, ']' ) ) {\n\t\t\tthrow new Exception( \"Mismatched brackets in '{$infix}'\", EQEOS_E_NO_SET );\n\t\t\treturn false;\n\t\t}\n\t\t$this->inFix = $infix;\n\t\treturn true;\n\t}\n\n\t/**\n\t * Infix to Postfix\n\t *\n\t * Converts an infix (standard) equation to postfix (RPN) notation.\n\t * Sets the internal variable $this->postFix for the eqEOS::solvePF()\n\t * function to use.\n\t *\n\t * @link http://en.wikipedia.org/wiki/Infix_notation Infix Notation\n\t * @link http://en.wikipedia.org/wiki/Reverse_Polish_notation Reverse Polish Notation\n\t * @param String $infix A standard notation equation\n\t * @return Array Fully formed RPN Stack\n\t */\n\tpublic function in2post( $infix = null ) {\n\t\t// if an equation was not passed, use the one that was passed in the constructor\n\t\t$infix = ( isset( $infix ) ) ? $infix : $this->inFix;\n\n\t\t// check to make sure 'valid' equation\n\t\t$this->checkInfix( $infix );\n\t\t$pf   = array();\n\t\t$ops  = new phpStack();\n\t\t$vars = new phpStack();\n\n\t\t// remove all white-space\n\t\tpreg_replace( '/\\s/', '', $infix );\n\n\t\t// Create postfix array index\n\t\t$pfIndex = 0;\n\n\t\t// what was the last character? (useful for decerning between a sign for negation and subtraction)\n\t\t$lChar = '';\n\n\t\t// loop through all the characters and start doing stuff ^^\n\t\tfor ( $i = 0;$i < strlen( $infix );$i++ ) {\n\t\t\t// pull out 1 character from the string\n\t\t\t$chr = substr( $infix, $i, 1 );\n\n\t\t\t// if the character is numerical\n\t\t\tif ( preg_match( '/[0-9.]/i', $chr ) ) {\n\t\t\t\t// if the previous character was not a '-' or a number\n\t\t\t\tif ( ( ! preg_match( '/[0-9.]/i', $lChar ) && ( $lChar != '' ) ) && ( array_key_exists( $pfIndex, @$pf ) && @$pf[ $pfIndex ] != '-' ) ) {\n\t\t\t\t\t$pfIndex++; // increase the index so as not to overlap anything\n\t\t\t\t}\n\t\t\t\t// if the array key doesn't exist\n\t\t\t\tif ( ! array_key_exists( $pfIndex, @$pf ) ) {\n\t\t\t\t\t@$pf[ $pfIndex ] = null; // add index to the array\n\t\t\t\t}\n\t\t\t\t// Add the number character to the array\n\t\t\t\t@$pf[ $pfIndex ] .= $chr;\n\t\t\t}\n\t\t\t// If the character opens a set e.g. '(' or '['\n\t\t\telseif ( in_array( $chr, $this->SEP['open'] ) ) {\n\t\t\t\t// if the last character was a number, place an assumed '*' on the stack\n\t\t\t\tif ( preg_match( '/[0-9.]/i', $lChar ) ) {\n\t\t\t\t\t$ops->push( '*' );\n\t\t\t\t}\n\n\t\t\t\t$ops->push( $chr );\n\t\t\t}\n\t\t\t// if the character closes a set e.g. ')' or ']'\n\t\t\telseif ( in_array( $chr, $this->SEP['close'] ) ) {\n\t\t\t\t// find what set it was i.e. matches ')' with '(' or ']' with '['\n\t\t\t\t$key = array_search( $chr, $this->SEP['close'] );\n\t\t\t\t// while the operator on the stack isn't the matching pair...pop it off\n\t\t\t\twhile ( $ops->peek() != $this->SEP['open'][ $key ] ) {\n\t\t\t\t\t$nchr = $ops->pop();\n\t\t\t\t\tif ( $nchr ) {\n\t\t\t\t\t\t$pf[ ++$pfIndex ] = $nchr;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception( \"Error while searching for '\" . $this->SEP['open'][ $key ] . \"' in '{$infix}'.\", EQEOS_E_NO_SET );\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$ops->pop();\n\t\t\t}\n\t\t\t// If a special operator that has precedence over everything else\n\t\t\telseif ( in_array( $chr, $this->ST ) ) {\n\t\t\t\t$ops->push( $chr );\n\t\t\t\t$pfIndex++;\n\t\t\t}\n\t\t\t// Any other operator other than '+' and '-'\n\t\t\telseif ( in_array( $chr, $this->ST1 ) ) {\n\t\t\t\twhile ( in_array( $ops->peek(), $this->ST1 ) || in_array( $ops->peek(), $this->ST ) ) {\n\t\t\t\t\t$pf[ ++$pfIndex ] = $ops->pop();\n\t\t\t\t}\n\n\t\t\t\t$ops->push( $chr );\n\t\t\t\t$pfIndex++;\n\t\t\t}\n\t\t\t// if a '+' or '-'\n\t\t\telseif ( in_array( $chr, $this->ST2 ) ) {\n\t\t\t\t// if it is a '-' and the character before it was an operator or nothingness (e.g. it negates a number)\n\t\t\t\tif ( ( in_array( $lChar, array_merge( $this->ST1, $this->ST2, $this->ST, $this->SEP['open'] ) ) || $lChar == '' ) && $chr == '-' ) {\n\t\t\t\t\t// increase the index because there is no reason that it shouldn't..\n\t\t\t\t\t$pfIndex++;\n\t\t\t\t\t$pf[ $pfIndex ] = $chr;\n\t\t\t\t}\n\t\t\t\t// Otherwise it will function like a normal operator\n\t\t\t\telse {\n\t\t\t\t\twhile ( in_array( $ops->peek(), array_merge( $this->ST1, $this->ST2, $this->ST ) ) ) {\n\t\t\t\t\t\t$pf[ ++$pfIndex ] = $ops->pop();\n\t\t\t\t\t}\n\t\t\t\t\t$ops->push( $chr );\n\t\t\t\t\t$pfIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// make sure we record this character to be refered to by the next one\n\t\t\t$lChar = $chr;\n\t\t}\n\t\t// if there is anything on the stack after we are done...add it to the back of the RPN array\n\t\twhile ( ( $tmp = $ops->pop() ) !== false ) {\n\t\t\t$pf[ ++$pfIndex ] = $tmp;\n\t\t}\n\n\t\t// re-index the array at 0\n\t\t$pf = array_values( $pf );\n\n\t\t// set the private variable for later use if needed\n\t\t$this->postFix = $pf;\n\n\t\t// return the RPN array in case developer wants to use it fro some insane reason (bug testing ;]\n\t\treturn $pf;\n\t} //end function in2post\n\n\t/**\n\t * Solve Postfix (RPN)\n\t *\n\t * This function will solve a RPN array. Default action is to solve\n\t * the RPN array stored in the class from eqEOS::in2post(), can take\n\t * an array input to solve as well, though default action is prefered.\n\t *\n\t * @link http://en.wikipedia.org/wiki/Reverse_Polish_notation Postix Notation\n\t * @param Array $pfArray RPN formatted array. Optional.\n\t * @return Float Result of the operation.\n\t */\n\tpublic function solvePF( $pfArray = null ) {\n\t\t// if no RPN array is passed - use the one stored in the private var\n\t\t$pf = ( ! is_array( $pfArray ) ) ? $this->postFix : $pfArray;\n\n\t\t// create our temporary function variables\n\t\t$temp = array();\n\t\t$tot  = 0;\n\t\t$hold = 0;\n\n\t\t// Loop through each number/operator\n\t\tfor ( $i = 0;$i < count( $pf ); $i++ ) {\n\t\t\t// If the string isn't an operator, add it to the temp var as a holding place\n\t\t\tif ( ! in_array( $pf[ $i ], array_merge( $this->ST, $this->ST1, $this->ST2 ) ) ) {\n\t\t\t\t$temp[ $hold++ ] = $pf[ $i ];\n\t\t\t}\n\t\t\t// ...Otherwise perform the operator on the last two numbers\n\t\t\telse {\n\t\t\t\tswitch ( $pf[ $i ] ) {\n\t\t\t\t\tcase '+':\n\t\t\t\t\t\tif ( isset( $temp[ $hold - 2 ] ) && isset( $temp[ $hold - 1 ] ) ) {\n\t\t\t\t\t\t\t$temp[ $hold - 2 ] = $temp[ $hold - 2 ] + $temp[ $hold - 1 ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '-':\n\t\t\t\t\t\tif ( isset( $temp[ $hold - 2 ] ) && isset( $temp[ $hold - 1 ] ) ) {\n\t\t\t\t\t\t\t$temp[ $hold - 2 ] = $temp[ $hold - 2 ] - $temp[ $hold - 1 ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\tif ( isset( $temp[ $hold - 2 ] ) && isset( $temp[ $hold - 1 ] ) ) {\n\t\t\t\t\t\t\t$temp[ $hold - 2 ] = $temp[ $hold - 2 ] * $temp[ $hold - 1 ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '/':\n\t\t\t\t\t\tif ( $temp[ $hold - 1 ] == 0 ) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$temp[ $hold - 2 ] = $temp[ $hold - 2 ] / $temp[ $hold - 1 ];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '^':\n\t\t\t\t\t\t$temp[ $hold - 2 ] = pow( $temp[ $hold - 2 ], $temp[ $hold - 1 ] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '%':\n\t\t\t\t\t\tif ( $temp[ $hold - 1 ] == 0 ) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$temp[ $hold - 2 ] = bcmod( $temp[ $hold - 2 ], $temp[ $hold - 1 ] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Decrease the hold var to one above where the last number is\n\t\t\t\t$hold = $hold - 1;\n\t\t\t}\n\t\t}\n\t\t// return the last number in the array\n\t\treturn $temp[ $hold - 1 ];\n\n\t} //end function solvePF\n\n\n\t/**\n\t * Solve Infix (Standard) Notation Equation\n\t *\n\t * Will take a standard equation with optional variables and solve it. Variables\n\t * must begin with '&' will expand to allow variables to begin with '$' (TODO)\n\t * The variable array must be in the format of 'variable' => value. If\n\t * variable array is scalar (ie 5), all variables will be replaced with it.\n\t *\n\t * @param String       $infix Standard Equation to solve\n\t * @param String|Array $vArray Variable replacement\n\t * @return Float Solved equation\n\t */\n\tfunction solveIF( $infix, $vArray = null ) {\n\t\t$infix = ( $infix != '' ) ? $infix : $this->inFix;\n\n\t\t// Check to make sure a 'valid' expression\n\t\t$this->checkInfix( $infix );\n\n\t\t$ops  = new phpStack();\n\t\t$vars = new phpStack();\n\n\t\t// remove all white-space\n\t\tpreg_replace( '/\\s/', '', $infix );\n\n\t\t// Find all the variables that were passed and replaces them\n\t\twhile ( ( preg_match( '/(.){0,1}[&$]([a-zA-Z0-9_]+)(.){0,1}/', $infix, $match ) ) != 0 ) {\n\n\t\t\t// remove notices by defining if undefined.\n\t\t\tif ( ! isset( $match[3] ) ) {\n\t\t\t\t$match[3] = '';\n\t\t\t}\n\n\t\t\t// Ensure that the variable has an operator or something of that sort in front and back - if it doesn't, add an implied '*'\n\t\t\tif ( ( ! in_array( $match[1], array_merge( $this->ST, $this->ST1, $this->ST2, $this->SEP['open'] ) ) && $match[1] != '' ) || is_numeric( $match[1] ) ) { // $this->SEP['close'] removed\n\t\t\t\t$front = '*';\n\t\t\t} else {\n\t\t\t\t$front = '';\n\t\t\t}\n\n\t\t\tif ( ( ! in_array( $match[3], array_merge( $this->ST, $this->ST1, $this->ST2, $this->SEP['close'] ) ) && $match[3] != '' ) || is_numeric( $match[3] ) ) { // $this->SEP['open'] removed\n\t\t\t\t$back = '*';\n\t\t\t} else {\n\t\t\t\t$back = '';\n\t\t\t}\n\n\t\t\t// Make sure that the variable does have a replacement\n\t\t\tif ( ! isset( $vArray[ $match[2] ] ) && ( ! is_array( $vArray != '' ) && ! is_numeric( $vArray ) ) ) {\n\t\t\t\tthrow new Exception( \"Variable replacement does not exist for '\" . substr( $match[0], 1, -1 ) . \"' in {$this->inFix}\", EQEOS_E_NO_VAR );\n\t\t\t\treturn false;\n\t\t\t} elseif ( ! isset( $vArray[ $match[2] ] ) && ( ! is_array( $vArray != '' ) && is_numeric( $vArray ) ) ) {\n\t\t\t\t$infix = str_replace( $match[0], $match[1] . $front . $vArray . $back . $match[3], $infix );\n\t\t\t} elseif ( isset( $vArray[ $match[2] ] ) ) {\n\t\t\t\t$infix = str_replace( $match[0], $match[1] . $front . $vArray[ $match[2] ] . $back . $match[3], $infix );\n\t\t\t}\n\t\t}\n\n\t\t// Finds all the 'functions' within the equation and calculates them\n\t\t// NOTE - when using function, only 1 set of paranthesis will be found, instead use brackets for sets within functions!!\n\t\twhile ( ( preg_match( '/(' . implode( '|', $this->FNC ) . ')\\(([^\\)\\(]*(\\([^\\)]*\\)[^\\(\\)]*)*[^\\)\\(]*)\\)/', $infix, $match ) ) != 0 ) {\n\t\t\t$func = $this->solveIF( $match[2] );\n\t\t\tswitch ( $match[1] ) {\n\t\t\t\tcase 'cos':\n\t\t\t\t\t$ans = cos( $func );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sin':\n\t\t\t\t\t$ans = sin( $func );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'tan':\n\t\t\t\t\t$ans = tan( $func );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sec':\n\t\t\t\t\t$tmp = cos( $func );\n\t\t\t\t\tif ( $tmp == 0 ) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\t$ans = 1 / $tmp;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'csc':\n\t\t\t\t\t$tmp = sin( $func );\n\t\t\t\t\tif ( $tmp == 0 ) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\t$ans = 1 / $tmp;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cot':\n\t\t\t\t\t$tmp = tan( $func );\n\t\t\t\t\tif ( $tmp == 0 ) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\t$ans = 1 / $tmp;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$infix = str_replace( $match[0], $ans, $infix );\n\t\t}\n\t\treturn $this->solvePF( $this->in2post( $infix ) );\n\n\t} //end function solveIF\n} //end class 'eqEOS'\n"
  },
  {
    "path": "includes/libraries/class-phpstack.php",
    "content": "<?php\n\n/**\n * Basic Stack Class\n *\n * Created for use with eqEOS. May eventually be replaced with native\n * PHP functions `array_pop()`, `array_push()`, and `end()`\n *\n * @author Jon Lawrence <jlawrence11@gmail.com>\n * @copyright Copyright ©2005-2013 Jon Lawrence\n * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License\n * @package eos.class.php\n * @version 2.0\n */\nclass phpStack {\n\tprivate $index;\n\tprivate $locArray;\n\n\t/**\n\t * Constructor\n\t *\n\t * Initializes the stack\n\t */\n\tpublic function __construct() {\n\t\t// define the private vars\n\t\t$this->locArray = array();\n\t\t$this->index    = -1;\n\t}\n\n\t/**\n\t * Peek\n\t *\n\t * Will view the last element of the stack without removing it\n\t *\n\t * @return Mixed An element of the array or false if none exist\n\t */\n\tpublic function peek() {\n\t\tif ( $this->index > -1 ) {\n\t\t\treturn $this->locArray[ $this->index ];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Poke\n\t *\n\t * Will add an element to the end of the stack\n\t *\n\t * @param Mixed Element to add\n\t */\n\tpublic function poke( $data ) {\n\t\t$this->locArray[ ++$this->index ] = $data;\n\t}\n\n\t/**\n\t * Push\n\t *\n\t * Alias of {@see phpStack::poke()}\n\t * Adds element to the stack\n\t *\n\t * @param Mixed Element to add\n\t */\n\tpublic function push( $data ) {\n\t\t// allias for 'poke'\n\t\t$this->poke( $data );\n\t}\n\n\t/**\n\t * Pop\n\t *\n\t * Retrives an element from the end of the stack, and removes it from\n\t * the stack at the same time. If no elements, returns boolean false\n\t *\n\t * @return Mixed Element at end of stack or false if none exist\n\t */\n\tpublic function pop() {\n\t\tif ( $this->index > -1 ) {\n\t\t\t$this->index--;\n\t\t\treturn $this->locArray[ $this->index + 1 ];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Clear\n\t *\n\t * Clears the stack to be reused.\n\t */\n\tpublic function clear() {\n\t\t$this->index    = -1;\n\t\t$this->locArray = array();\n\t}\n\n\t/**\n\t * Get Stack\n\t *\n\t * Returns the array of stack elements, keeping all, indexed at 0\n\t *\n\t * @return Mixed Array of stack elements or false if none exist.\n\t */\n\tpublic function getStack() {\n\t\tif ( $this->index > -1 ) {\n\t\t\treturn array_values( $this->locArray );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\n\n"
  },
  {
    "path": "includes/libraries/class-tgm-plugin-activation.php",
    "content": "<?php\n/**\n * Plugin installation and activation for WordPress themes.\n *\n * Please note that this is a drop-in library for a theme or plugin.\n * The authors of this library (Thomas, Gary and Juliette) are NOT responsible\n * for the support of your plugin or theme. Please contact the plugin\n * or theme author for support.\n *\n * @package   TGM-Plugin-Activation\n * @version   2.6.1\n * @link      http://tgmpluginactivation.com/\n * @author    Thomas Griffin, Gary Jones, Juliette Reinders Folmer\n * @copyright Copyright (c) 2011, Thomas Griffin\n * @license   GPL-2.0+\n */\n\n/*\n  Copyright 2011 Thomas Griffin (thomasgriffinmedia.com)\n\n  This program is free software; you can redistribute it and/or modify\n  it under the terms of the GNU General Public License, version 2, as\n  published by the Free Software Foundation.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\nif ( ! class_exists( 'TGM_Plugin_Activation' ) ) {\n\n  /**\n   * Automatic plugin installation and activation library.\n   *\n   * Creates a way to automatically install and activate plugins from within themes.\n   * The plugins can be either bundled, downloaded from the WordPress\n   * Plugin Repository or downloaded from another external source.\n   *\n   * @since 1.0.0\n   *\n   * @package TGM-Plugin-Activation\n   * @author  Thomas Griffin\n   * @author  Gary Jones\n   */\n  class TGM_Plugin_Activation {\n    /**\n     * TGMPA version number.\n     *\n     * @since 2.5.0\n     *\n     * @const string Version number.\n     */\n    const TGMPA_VERSION = '2.6.1';\n\n    /**\n     * Regular expression to test if a URL is a WP plugin repo URL.\n     *\n     * @const string Regex.\n     *\n     * @since 2.5.0\n     */\n    const WP_REPO_REGEX = '|^http[s]?://wordpress\\.org/(?:extend/)?plugins/|';\n\n    /**\n     * Arbitrary regular expression to test if a string starts with a URL.\n     *\n     * @const string Regex.\n     *\n     * @since 2.5.0\n     */\n    const IS_URL_REGEX = '|^http[s]?://|';\n\n    /**\n     * Holds a copy of itself, so it can be referenced by the class name.\n     *\n     * @since 1.0.0\n     *\n     * @var TGM_Plugin_Activation\n     */\n    public static $instance;\n\n    /**\n     * Holds arrays of plugin details.\n     *\n     * @since 1.0.0\n     * @since 2.5.0 the array has the plugin slug as an associative key.\n     *\n     * @var array\n     */\n    public $plugins = array();\n\n    /**\n     * Holds arrays of plugin names to use to sort the plugins array.\n     *\n     * @since 2.5.0\n     *\n     * @var array\n     */\n    protected $sort_order = array();\n\n    /**\n     * Whether any plugins have the 'force_activation' setting set to true.\n     *\n     * @since 2.5.0\n     *\n     * @var bool\n     */\n    protected $has_forced_activation = false;\n\n    /**\n     * Whether any plugins have the 'force_deactivation' setting set to true.\n     *\n     * @since 2.5.0\n     *\n     * @var bool\n     */\n    protected $has_forced_deactivation = false;\n\n    /**\n     * Name of the unique ID to hash notices.\n     *\n     * @since 2.4.0\n     *\n     * @var string\n     */\n    public $id = 'tgmpa';\n\n    /**\n     * Name of the query-string argument for the admin page.\n     *\n     * @since 1.0.0\n     *\n     * @var string\n     */\n    protected $menu = 'tgmpa-install-plugins';\n\n    /**\n     * Parent menu file slug.\n     *\n     * @since 2.5.0\n     *\n     * @var string\n     */\n    public $parent_slug = 'themes.php';\n\n    /**\n     * Capability needed to view the plugin installation menu item.\n     *\n     * @since 2.5.0\n     *\n     * @var string\n     */\n    public $capability = 'edit_theme_options';\n\n    /**\n     * Default absolute path to folder containing bundled plugin zip files.\n     *\n     * @since 2.0.0\n     *\n     * @var string Absolute path prefix to zip file location for bundled plugins. Default is empty string.\n     */\n    public $default_path = '';\n\n    /**\n     * Flag to show admin notices or not.\n     *\n     * @since 2.1.0\n     *\n     * @var boolean\n     */\n    public $has_notices = true;\n\n    /**\n     * Flag to determine if the user can dismiss the notice nag.\n     *\n     * @since 2.4.0\n     *\n     * @var boolean\n     */\n    public $dismissable = true;\n\n    /**\n     * Message to be output above nag notice if dismissable is false.\n     *\n     * @since 2.4.0\n     *\n     * @var string\n     */\n    public $dismiss_msg = '';\n\n    /**\n     * Flag to set automatic activation of plugins. Off by default.\n     *\n     * @since 2.2.0\n     *\n     * @var boolean\n     */\n    public $is_automatic = false;\n\n    /**\n     * Optional message to display before the plugins table.\n     *\n     * @since 2.2.0\n     *\n     * @var string Message filtered by wp_kses_post(). Default is empty string.\n     */\n    public $message = '';\n\n    /**\n     * Holds configurable array of strings.\n     *\n     * Default values are added in the constructor.\n     *\n     * @since 2.0.0\n     *\n     * @var array\n     */\n    public $strings = array();\n\n    /**\n     * Holds the version of WordPress.\n     *\n     * @since 2.4.0\n     *\n     * @var int\n     */\n    public $wp_version;\n\n    /**\n     * Holds the hook name for the admin page.\n     *\n     * @since 2.5.0\n     *\n     * @var string\n     */\n    public $page_hook;\n\n    /**\n     * Adds a reference of this object to $instance, populates default strings,\n     * does the tgmpa_init action hook, and hooks in the interactions to init.\n     *\n     * {@internal This method should be `protected`, but as too many TGMPA implementations\n     * haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues.\n     * Reverted back to public for the time being.}}\n     *\n     * @since 1.0.0\n     *\n     * @see TGM_Plugin_Activation::init()\n     */\n    public function __construct() {\n      // Set the current WordPress version.\n      $this->wp_version = $GLOBALS['wp_version'];\n\n      // Announce that the class is ready, and pass the object (for advanced use).\n      do_action_ref_array( 'tgmpa_init', array( $this ) );\n\n      /*\n       * Load our text domain and allow for overloading the fall-back file.\n       *\n       * {@internal IMPORTANT! If this code changes, review the regex in the custom TGMPA\n       * generator on the website.}}\n       */\n      add_action( 'init', array( $this, 'load_textdomain' ), 5 );\n      add_filter( 'load_textdomain_mofile', array( $this, 'overload_textdomain_mofile' ), 10, 2 );\n\n      // When the rest of WP has loaded, kick-start the rest of the class.\n      add_action( 'init', array( $this, 'init' ) );\n    }\n\n    /**\n     * Magic method to (not) set protected properties from outside of this class.\n     *\n     * {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6  where the `menu` property\n     * is being assigned rather than tested in a conditional, effectively rendering it useless.\n     * This 'hack' prevents this from happening.}}\n     *\n     * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593\n     *\n     * @since 2.5.2\n     *\n     * @param string $name  Name of an inaccessible property.\n     * @param mixed  $value Value to assign to the property.\n     * @return void  Silently fail to set the property when this is tried from outside of this class context.\n     *               (Inside this class context, the __set() method if not used as there is direct access.)\n     */\n    public function __set( $name, $value ) {\n      return;\n    }\n\n    /**\n     * Magic method to get the value of a protected property outside of this class context.\n     *\n     * @since 2.5.2\n     *\n     * @param string $name Name of an inaccessible property.\n     * @return mixed The property value.\n     */\n    public function __get( $name ) {\n      return $this->{$name};\n    }\n\n    /**\n     * Initialise the interactions between this class and WordPress.\n     *\n     * Hooks in three new methods for the class: admin_menu, notices and styles.\n     *\n     * @since 2.0.0\n     *\n     * @see TGM_Plugin_Activation::admin_menu()\n     * @see TGM_Plugin_Activation::notices()\n     * @see TGM_Plugin_Activation::styles()\n     */\n    public function init() {\n      /**\n       * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter\n       * you can overrule that behaviour.\n       *\n       * @since 2.5.0\n       *\n       * @param bool $load Whether or not TGMPA should load.\n       *                   Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`.\n       */\n      if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) {\n        return;\n      }\n\n      // Load class strings.\n      $this->strings = array(\n        'page_title'                      => __( 'Install Required Plugins', 'tgmpa' ),\n        'menu_title'                      => __( 'Install Plugins', 'tgmpa' ),\n        /* translators: %s: plugin name. */\n        'installing'                      => __( 'Installing Plugin: %s', 'tgmpa' ),\n        /* translators: %s: plugin name. */\n        'updating'                        => __( 'Updating Plugin: %s', 'tgmpa' ),\n        'oops'                            => __( 'Something went wrong with the plugin API.', 'tgmpa' ),\n        'notice_can_install_required'     => _n_noop(\n          /* translators: 1: plugin name(s). */\n          'This theme requires the following plugin: %1$s.',\n          'This theme requires the following plugins: %1$s.',\n          'tgmpa'\n        ),\n        'notice_can_install_recommended'  => _n_noop(\n          /* translators: 1: plugin name(s). */\n          'This theme recommends the following plugin: %1$s.',\n          'This theme recommends the following plugins: %1$s.',\n          'tgmpa'\n        ),\n        'notice_ask_to_update'            => _n_noop(\n          /* translators: 1: plugin name(s). */\n          'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',\n          'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',\n          'tgmpa'\n        ),\n        'notice_ask_to_update_maybe'      => _n_noop(\n          /* translators: 1: plugin name(s). */\n          'There is an update available for: %1$s.',\n          'There are updates available for the following plugins: %1$s.',\n          'tgmpa'\n        ),\n        'notice_can_activate_required'    => _n_noop(\n          /* translators: 1: plugin name(s). */\n          'The following required plugin is currently inactive: %1$s.',\n          'The following required plugins are currently inactive: %1$s.',\n          'tgmpa'\n        ),\n        'notice_can_activate_recommended' => _n_noop(\n          /* translators: 1: plugin name(s). */\n          'The following recommended plugin is currently inactive: %1$s.',\n          'The following recommended plugins are currently inactive: %1$s.',\n          'tgmpa'\n        ),\n        'install_link'                    => _n_noop(\n          'Begin installing plugin',\n          'Begin installing plugins',\n          'tgmpa'\n        ),\n        'update_link'                     => _n_noop(\n          'Begin updating plugin',\n          'Begin updating plugins',\n          'tgmpa'\n        ),\n        'activate_link'                   => _n_noop(\n          'Begin activating plugin',\n          'Begin activating plugins',\n          'tgmpa'\n        ),\n        'return'                          => __( 'Return to Required Plugins Installer', 'tgmpa' ),\n        'dashboard'                       => __( 'Return to the Dashboard', 'tgmpa' ),\n        'plugin_activated'                => __( 'Plugin activated successfully.', 'tgmpa' ),\n        'activated_successfully'          => __( 'The following plugin was activated successfully:', 'tgmpa' ),\n        /* translators: 1: plugin name. */\n        'plugin_already_active'           => __( 'No action taken. Plugin %1$s was already active.', 'tgmpa' ),\n        /* translators: 1: plugin name. */\n        'plugin_needs_higher_version'     => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'tgmpa' ),\n        /* translators: 1: dashboard link. */\n        'complete'                        => __( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ),\n        'dismiss'                         => __( 'Dismiss this notice', 'tgmpa' ),\n        'notice_cannot_install_activate'  => __( 'There are one or more required or recommended plugins to install, update or activate.', 'tgmpa' ),\n        'contact_admin'                   => __( 'Please contact the administrator of this site for help.', 'tgmpa' ),\n      );\n\n      do_action( 'tgmpa_register' );\n\n      /* After this point, the plugins should be registered and the configuration set. */\n\n      // Proceed only if we have plugins to handle.\n      if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) {\n        return;\n      }\n\n      // Set up the menu and notices if we still have outstanding actions.\n      if ( true !== $this->is_tgmpa_complete() ) {\n        // Sort the plugins.\n        array_multisort( $this->sort_order, SORT_ASC, $this->plugins );\n\n        add_action( 'admin_menu', array( $this, 'admin_menu' ) );\n        add_action( 'admin_head', array( $this, 'dismiss' ) );\n\n        // Prevent the normal links from showing underneath a single install/update page.\n        add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) );\n        add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) );\n\n        if ( $this->has_notices ) {\n          add_action( 'admin_notices', array( $this, 'notices' ) );\n          add_action( 'admin_init', array( $this, 'admin_init' ), 1 );\n          add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) );\n        }\n      }\n\n      // If needed, filter plugin action links.\n      add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 );\n\n      // Make sure things get reset on switch theme.\n      add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) );\n\n      if ( $this->has_notices ) {\n        add_action( 'switch_theme', array( $this, 'update_dismiss' ) );\n      }\n\n      // Setup the force activation hook.\n      if ( true === $this->has_forced_activation ) {\n        add_action( 'admin_init', array( $this, 'force_activation' ) );\n      }\n\n      // Setup the force deactivation hook.\n      if ( true === $this->has_forced_deactivation ) {\n        add_action( 'switch_theme', array( $this, 'force_deactivation' ) );\n      }\n    }\n\n    /**\n     * Load translations.\n     *\n     * @since 2.6.0\n     *\n     * (@internal Uses `load_theme_textdomain()` rather than `load_plugin_textdomain()` to\n     * get round the different ways of handling the path and deprecated notices being thrown\n     * and such. For plugins, the actual file name will be corrected by a filter.}}\n     *\n     * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA\n     * generator on the website.}}\n     */\n    public function load_textdomain() {\n      if ( is_textdomain_loaded( 'tgmpa' ) ) {\n        return;\n      }\n\n      if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) ) {\n        // Plugin, we'll need to adjust the file name.\n        add_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10, 2 );\n        load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );\n        remove_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10 );\n      } else {\n        load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );\n      }\n    }\n\n    /**\n     * Correct the .mo file name for (must-use) plugins.\n     *\n     * Themese use `/path/{locale}.mo` while plugins use `/path/{text-domain}-{locale}.mo`.\n     *\n     * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA\n     * generator on the website.}}\n     *\n     * @since 2.6.0\n     *\n     * @param string $mofile Full path to the target mofile.\n     * @param string $domain The domain for which a language file is being loaded.\n     * @return string $mofile\n     */\n    public function correct_plugin_mofile( $mofile, $domain ) {\n      // Exit early if not our domain (just in case).\n      if ( 'tgmpa' !== $domain ) {\n        return $mofile;\n      }\n      return preg_replace( '`/([a-z]{2}_[A-Z]{2}.mo)$`', '/tgmpa-$1', $mofile );\n    }\n\n    /**\n     * Potentially overload the fall-back translation file for the current language.\n     *\n     * WP, by default since WP 3.7, will load a local translation first and if none\n     * can be found, will try and find a translation in the /wp-content/languages/ directory.\n     * As this library is theme/plugin agnostic, translation files for TGMPA can exist both\n     * in the WP_LANG_DIR /plugins/ subdirectory as well as in the /themes/ subdirectory.\n     *\n     * This method makes sure both directories are checked.\n     *\n     * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA\n     * generator on the website.}}\n     *\n     * @since 2.6.0\n     *\n     * @param string $mofile Full path to the target mofile.\n     * @param string $domain The domain for which a language file is being loaded.\n     * @return string $mofile\n     */\n    public function overload_textdomain_mofile( $mofile, $domain ) {\n      // Exit early if not our domain, not a WP_LANG_DIR load or if the file exists and is readable.\n      if ( 'tgmpa' !== $domain || false === strpos( $mofile, WP_LANG_DIR ) || @is_readable( $mofile ) ) {\n        return $mofile;\n      }\n\n      // Current fallback file is not valid, let's try the alternative option.\n      if ( false !== strpos( $mofile, '/themes/' ) ) {\n        return str_replace( '/themes/', '/plugins/', $mofile );\n      } elseif ( false !== strpos( $mofile, '/plugins/' ) ) {\n        return str_replace( '/plugins/', '/themes/', $mofile );\n      } else {\n        return $mofile;\n      }\n    }\n\n    /**\n     * Hook in plugin action link filters for the WP native plugins page.\n     *\n     * - Prevent activation of plugins which don't meet the minimum version requirements.\n     * - Prevent deactivation of force-activated plugins.\n     * - Add update notice if update available.\n     *\n     * @since 2.5.0\n     */\n    public function add_plugin_action_link_filters() {\n      foreach ( $this->plugins as $slug => $plugin ) {\n        if ( false === $this->can_plugin_activate( $slug ) ) {\n          add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 );\n        }\n\n        if ( true === $plugin['force_activation'] ) {\n          add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );\n        }\n\n        if ( false !== $this->does_plugin_require_update( $slug ) ) {\n          add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 );\n        }\n      }\n    }\n\n    /**\n     * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the\n     * minimum version requirements.\n     *\n     * @since 2.5.0\n     *\n     * @param array $actions Action links.\n     * @return array\n     */\n    public function filter_plugin_action_links_activate( $actions ) {\n      unset( $actions['activate'] );\n\n      return $actions;\n    }\n\n    /**\n     * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate.\n     *\n     * @since 2.5.0\n     *\n     * @param array $actions Action links.\n     * @return array\n     */\n    public function filter_plugin_action_links_deactivate( $actions ) {\n      unset( $actions['deactivate'] );\n\n      return $actions;\n    }\n\n    /**\n     * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the\n     * minimum version requirements.\n     *\n     * @since 2.5.0\n     *\n     * @param array $actions Action links.\n     * @return array\n     */\n    public function filter_plugin_action_links_update( $actions ) {\n      $actions['update'] = sprintf(\n        '<a href=\"%1$s\" title=\"%2$s\" class=\"edit\">%3$s</a>',\n        esc_url( $this->get_tgmpa_status_url( 'update' ) ),\n        esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'tgmpa' ),\n        esc_html__( 'Update Required', 'tgmpa' )\n      );\n\n      return $actions;\n    }\n\n    /**\n     * Handles calls to show plugin information via links in the notices.\n     *\n     * We get the links in the admin notices to point to the TGMPA page, rather\n     * than the typical plugin-install.php file, so we can prepare everything\n     * beforehand.\n     *\n     * WP does not make it easy to show the plugin information in the thickbox -\n     * here we have to require a file that includes a function that does the\n     * main work of displaying it, enqueue some styles, set up some globals and\n     * finally call that function before exiting.\n     *\n     * Down right easy once you know how...\n     *\n     * Returns early if not the TGMPA page.\n     *\n     * @since 2.1.0\n     *\n     * @global string $tab Used as iframe div class names, helps with styling\n     * @global string $body_id Used as the iframe body ID, helps with styling\n     *\n     * @return null Returns early if not the TGMPA page.\n     */\n    public function admin_init() {\n      if ( ! $this->is_tgmpa_page() ) {\n        return;\n      }\n\n      if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {\n        // Needed for install_plugin_information().\n        require_once ABSPATH . 'wp-admin/includes/plugin-install.php';\n\n        wp_enqueue_style( 'plugin-install' );\n\n        global $tab, $body_id;\n        $body_id = 'plugin-information';\n        // @codingStandardsIgnoreStart\n        $tab     = 'plugin-information';\n        // @codingStandardsIgnoreEnd\n\n        install_plugin_information();\n\n        exit;\n      }\n    }\n\n    /**\n     * Enqueue thickbox scripts/styles for plugin info.\n     *\n     * Thickbox is not automatically included on all admin pages, so we must\n     * manually enqueue it for those pages.\n     *\n     * Thickbox is only loaded if the user has not dismissed the admin\n     * notice or if there are any plugins left to install and activate.\n     *\n     * @since 2.1.0\n     */\n    public function thickbox() {\n      if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {\n        add_thickbox();\n      }\n    }\n\n    /**\n     * Adds submenu page if there are plugin actions to take.\n     *\n     * This method adds the submenu page letting users know that a required\n     * plugin needs to be installed.\n     *\n     * This page disappears once the plugin has been installed and activated.\n     *\n     * @since 1.0.0\n     *\n     * @see TGM_Plugin_Activation::init()\n     * @see TGM_Plugin_Activation::install_plugins_page()\n     *\n     * @return null Return early if user lacks capability to install a plugin.\n     */\n    public function admin_menu() {\n      // Make sure privileges are correct to see the page.\n      if ( ! current_user_can( 'install_plugins' ) ) {\n        return;\n      }\n\n      $args = apply_filters(\n        'tgmpa_admin_menu_args',\n        array(\n          'parent_slug' => $this->parent_slug,                     // Parent Menu slug.\n          'page_title'  => $this->strings['page_title'],           // Page title.\n          'menu_title'  => $this->strings['menu_title'],           // Menu title.\n          'capability'  => $this->capability,                      // Capability.\n          'menu_slug'   => $this->menu,                            // Menu slug.\n          'function'    => array( $this, 'install_plugins_page' ), // Callback.\n        )\n      );\n\n      $this->add_admin_menu( $args );\n    }\n\n    /**\n     * Add the menu item.\n     *\n     * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA\n     * generator on the website.}}\n     *\n     * @since 2.5.0\n     *\n     * @param array $args Menu item configuration.\n     */\n    protected function add_admin_menu( array $args ) {\n      if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) {\n        _deprecated_function( 'The \"tgmpa_admin_menu_use_add_theme_page\" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'tgmpa' ) );\n      }\n\n      if ( 'themes.php' === $this->parent_slug ) {\n        $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );\n      } else {\n        $this->page_hook = call_user_func( 'add_submenu_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );\n      }\n    }\n\n    /**\n     * Echoes plugin installation form.\n     *\n     * This method is the callback for the admin_menu method function.\n     * This displays the admin page and form area where the user can select to install and activate the plugin.\n     * Aborts early if we're processing a plugin installation action.\n     *\n     * @since 1.0.0\n     *\n     * @return null Aborts early if we're processing a plugin installation action.\n     */\n    public function install_plugins_page() {\n      // Store new instance of plugin table in object.\n      $plugin_table = new TGMPA_List_Table;\n\n      // Return early if processing a plugin installation action.\n      if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) {\n        return;\n      }\n\n      // Force refresh of available plugin information so we'll know about manual updates/deletes.\n      wp_clean_plugins_cache( false );\n\n      ?>\n      <div class=\"tgmpa wrap\">\n        <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n        <?php $plugin_table->prepare_items(); ?>\n\n        <?php\n        if ( ! empty( $this->message ) && is_string( $this->message ) ) {\n          echo wp_kses_post( $this->message );\n        }\n        ?>\n        <?php $plugin_table->views(); ?>\n\n        <form id=\"tgmpa-plugins\" action=\"\" method=\"post\">\n          <input type=\"hidden\" name=\"tgmpa-page\" value=\"<?php echo esc_attr( $this->menu ); ?>\" />\n          <input type=\"hidden\" name=\"plugin_status\" value=\"<?php echo esc_attr( $plugin_table->view_context ); ?>\" />\n          <?php $plugin_table->display(); ?>\n        </form>\n      </div>\n      <?php\n    }\n\n    /**\n     * Installs, updates or activates a plugin depending on the action link clicked by the user.\n     *\n     * Checks the $_GET variable to see which actions have been\n     * passed and responds with the appropriate method.\n     *\n     * Uses WP_Filesystem to process and handle the plugin installation\n     * method.\n     *\n     * @since 1.0.0\n     *\n     * @uses WP_Filesystem\n     * @uses WP_Error\n     * @uses WP_Upgrader\n     * @uses Plugin_Upgrader\n     * @uses Plugin_Installer_Skin\n     * @uses Plugin_Upgrader_Skin\n     *\n     * @return boolean True on success, false on failure.\n     */\n    protected function do_plugin_install() {\n      if ( empty( $_GET['plugin'] ) ) {\n        return false;\n      }\n\n      // All plugin information will be stored in an array for processing.\n      $slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );\n\n      if ( ! isset( $this->plugins[ $slug ] ) ) {\n        return false;\n      }\n\n      // Was an install or upgrade action link clicked?\n      if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) {\n\n        $install_type = 'install';\n        if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) {\n          $install_type = 'update';\n        }\n\n        check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' );\n\n        // Pass necessary information via URL if WP_Filesystem is needed.\n        $url = wp_nonce_url(\n          add_query_arg(\n            array(\n              'plugin'                 => urlencode( $slug ),\n              'tgmpa-' . $install_type => $install_type . '-plugin',\n            ),\n            $this->get_tgmpa_url()\n          ),\n          'tgmpa-' . $install_type,\n          'tgmpa-nonce'\n        );\n\n        $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.\n\n        if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) {\n          return true;\n        }\n\n        if ( ! WP_Filesystem( $creds ) ) {\n          request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.\n          return true;\n        }\n\n        /* If we arrive here, we have the filesystem. */\n\n        // Prep variables for Plugin_Installer_Skin class.\n        $extra         = array();\n        $extra['slug'] = $slug; // Needed for potentially renaming of directory name.\n        $source        = $this->get_download_url( $slug );\n        $api           = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;\n        $api           = ( false !== $api ) ? $api : null;\n\n        $url = add_query_arg(\n          array(\n            'action' => $install_type . '-plugin',\n            'plugin' => urlencode( $slug ),\n          ),\n          'update.php'\n        );\n\n        if ( ! class_exists( 'Plugin_Upgrader', false ) ) {\n          require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n        }\n\n        $title     = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing'];\n        $skin_args = array(\n          'type'   => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',\n          'title'  => sprintf( $title, $this->plugins[ $slug ]['name'] ),\n          'url'    => esc_url_raw( $url ),\n          'nonce'  => $install_type . '-plugin_' . $slug,\n          'plugin' => '',\n          'api'    => $api,\n          'extra'  => $extra,\n        );\n        unset( $title );\n\n        if ( 'update' === $install_type ) {\n          $skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];\n          $skin                = new Plugin_Upgrader_Skin( $skin_args );\n        } else {\n          $skin = new Plugin_Installer_Skin( $skin_args );\n        }\n\n        // Create a new instance of Plugin_Upgrader.\n        $upgrader = new Plugin_Upgrader( $skin );\n\n        // Perform the action and install the plugin from the $source urldecode().\n        add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );\n\n        if ( 'update' === $install_type ) {\n          // Inject our info into the update transient.\n          $to_inject                    = array( $slug => $this->plugins[ $slug ] );\n          $to_inject[ $slug ]['source'] = $source;\n          $this->inject_update_info( $to_inject );\n\n          $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );\n        } else {\n          $upgrader->install( $source );\n        }\n\n        remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 );\n\n        // Make sure we have the correct file path now the plugin is installed/updated.\n        $this->populate_file_path( $slug );\n\n        // Only activate plugins if the config option is set to true and the plugin isn't\n        // already active (upgrade).\n        if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) {\n          $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method.\n          if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) {\n            return true; // Finish execution of the function early as we encountered an error.\n          }\n        }\n\n        $this->show_tgmpa_version();\n\n        // Display message based on if all plugins are now active or not.\n        if ( $this->is_tgmpa_complete() ) {\n          echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href=\"' . esc_url( self_admin_url() ) . '\">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>' ), '</p>';\n          echo '<style type=\"text/css\">#adminmenu .wp-submenu li.current { display: none !important; }</style>';\n        } else {\n          echo '<p><a href=\"', esc_url( $this->get_tgmpa_url() ), '\" target=\"_parent\">', esc_html( $this->strings['return'] ), '</a></p>';\n        }\n\n        return true;\n      } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {\n        // Activate action link was clicked.\n        check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' );\n\n        if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {\n          return true; // Finish execution of the function early as we encountered an error.\n        }\n      }\n\n      return false;\n    }\n\n    /**\n     * Inject information into the 'update_plugins' site transient as WP checks that before running an update.\n     *\n     * @since 2.5.0\n     *\n     * @param array $plugins The plugin information for the plugins which are to be updated.\n     */\n    public function inject_update_info( $plugins ) {\n      $repo_updates = get_site_transient( 'update_plugins' );\n\n      if ( ! is_object( $repo_updates ) ) {\n        $repo_updates = new stdClass;\n      }\n\n      foreach ( $plugins as $slug => $plugin ) {\n        $file_path = $plugin['file_path'];\n\n        if ( empty( $repo_updates->response[ $file_path ] ) ) {\n          $repo_updates->response[ $file_path ] = new stdClass;\n        }\n\n        // We only really need to set package, but let's do all we can in case WP changes something.\n        $repo_updates->response[ $file_path ]->slug        = $slug;\n        $repo_updates->response[ $file_path ]->plugin      = $file_path;\n        $repo_updates->response[ $file_path ]->new_version = $plugin['version'];\n        $repo_updates->response[ $file_path ]->package     = $plugin['source'];\n        if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {\n          $repo_updates->response[ $file_path ]->url = $plugin['external_url'];\n        }\n      }\n\n      set_site_transient( 'update_plugins', $repo_updates );\n    }\n\n    /**\n     * Adjust the plugin directory name if necessary.\n     *\n     * The final destination directory of a plugin is based on the subdirectory name found in the\n     * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this\n     * subdirectory name is not the same as the expected slug and the plugin will not be recognized\n     * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to\n     * the expected plugin slug.\n     *\n     * @since 2.5.0\n     *\n     * @param string       $source        Path to upgrade/zip-file-name.tmp/subdirectory/.\n     * @param string       $remote_source Path to upgrade/zip-file-name.tmp.\n     * @param \\WP_Upgrader $upgrader      Instance of the upgrader which installs the plugin.\n     * @return string $source\n     */\n    public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {\n      if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {\n        return $source;\n      }\n\n      // Check for single file plugins.\n      $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );\n      if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {\n        return $source;\n      }\n\n      // Multi-file plugin, let's see if the directory is correctly named.\n      $desired_slug = '';\n\n      // Figure out what the slug is supposed to be.\n      if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {\n        $desired_slug = $upgrader->skin->options['extra']['slug'];\n      } else {\n        // Bulk installer contains less info, so fall back on the info registered here.\n        foreach ( $this->plugins as $slug => $plugin ) {\n          if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {\n            $desired_slug = $slug;\n            break;\n          }\n        }\n        unset( $slug, $plugin );\n      }\n\n      if ( ! empty( $desired_slug ) ) {\n        $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );\n\n        if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {\n          $from_path = untrailingslashit( $source );\n          $to_path   = trailingslashit( $remote_source ) . $desired_slug;\n\n          if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {\n            return trailingslashit( $to_path );\n          } else {\n            return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );\n          }\n        } elseif ( empty( $subdir_name ) ) {\n          return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );\n        }\n      }\n\n      return $source;\n    }\n\n    /**\n     * Activate a single plugin and send feedback about the result to the screen.\n     *\n     * @since 2.5.0\n     *\n     * @param string $file_path Path within wp-plugins/ to main plugin file.\n     * @param string $slug      Plugin slug.\n     * @param bool   $automatic Whether this is an automatic activation after an install. Defaults to false.\n     *                          This determines the styling of the output messages.\n     * @return bool False if an error was encountered, true otherwise.\n     */\n    protected function activate_single_plugin( $file_path, $slug, $automatic = false ) {\n      if ( $this->can_plugin_activate( $slug ) ) {\n        $activate = activate_plugin( $file_path );\n\n        if ( is_wp_error( $activate ) ) {\n          echo '<div id=\"message\" class=\"error\"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',\n            '<p><a href=\"', esc_url( $this->get_tgmpa_url() ), '\" target=\"_parent\">', esc_html( $this->strings['return'] ), '</a></p>';\n\n          return false; // End it here if there is an error with activation.\n        } else {\n          if ( ! $automatic ) {\n            // Make sure message doesn't display again if bulk activation is performed\n            // immediately after a single activation.\n            if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.\n              echo '<div id=\"message\" class=\"updated\"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';\n            }\n          } else {\n            // Simpler message layout for use on the plugin install page.\n            echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';\n          }\n        }\n      } elseif ( $this->is_plugin_active( $slug ) ) {\n        // No simpler message format provided as this message should never be encountered\n        // on the plugin install page.\n        echo '<div id=\"message\" class=\"error\"><p>',\n          sprintf(\n            esc_html( $this->strings['plugin_already_active'] ),\n            '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'\n          ),\n          '</p></div>';\n      } elseif ( $this->does_plugin_require_update( $slug ) ) {\n        if ( ! $automatic ) {\n          // Make sure message doesn't display again if bulk activation is performed\n          // immediately after a single activation.\n          if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.\n            echo '<div id=\"message\" class=\"error\"><p>',\n              sprintf(\n                esc_html( $this->strings['plugin_needs_higher_version'] ),\n                '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'\n              ),\n              '</p></div>';\n          }\n        } else {\n          // Simpler message layout for use on the plugin install page.\n          echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';\n        }\n      }\n\n      return true;\n    }\n\n    /**\n     * Echoes required plugin notice.\n     *\n     * Outputs a message telling users that a specific plugin is required for\n     * their theme. If appropriate, it includes a link to the form page where\n     * users can install and activate the plugin.\n     *\n     * Returns early if we're on the Install page.\n     *\n     * @since 1.0.0\n     *\n     * @global object $current_screen\n     *\n     * @return null Returns early if we're on the Install page.\n     */\n    public function notices() {\n      // Remove nag on the install page / Return early if the nag message has been dismissed or user < author.\n      if ( ( $this->is_tgmpa_page() || $this->is_core_update_page() ) || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability', 'publish_posts' ) ) ) {\n        return;\n      }\n\n      // Store for the plugin slugs by message type.\n      $message = array();\n\n      // Initialize counters used to determine plurality of action link texts.\n      $install_link_count          = 0;\n      $update_link_count           = 0;\n      $activate_link_count         = 0;\n      $total_required_action_count = 0;\n\n      foreach ( $this->plugins as $slug => $plugin ) {\n        if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) {\n          continue;\n        }\n\n        if ( ! $this->is_plugin_installed( $slug ) ) {\n          if ( current_user_can( 'install_plugins' ) ) {\n            $install_link_count++;\n\n            if ( true === $plugin['required'] ) {\n              $message['notice_can_install_required'][] = $slug;\n            } else {\n              $message['notice_can_install_recommended'][] = $slug;\n            }\n          }\n          if ( true === $plugin['required'] ) {\n            $total_required_action_count++;\n          }\n        } else {\n          if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) {\n            if ( current_user_can( 'activate_plugins' ) ) {\n              $activate_link_count++;\n\n              if ( true === $plugin['required'] ) {\n                $message['notice_can_activate_required'][] = $slug;\n              } else {\n                $message['notice_can_activate_recommended'][] = $slug;\n              }\n            }\n            if ( true === $plugin['required'] ) {\n              $total_required_action_count++;\n            }\n          }\n\n          if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {\n\n            if ( current_user_can( 'update_plugins' ) ) {\n              $update_link_count++;\n\n              if ( $this->does_plugin_require_update( $slug ) ) {\n                $message['notice_ask_to_update'][] = $slug;\n              } elseif ( false !== $this->does_plugin_have_update( $slug ) ) {\n                $message['notice_ask_to_update_maybe'][] = $slug;\n              }\n            }\n            if ( true === $plugin['required'] ) {\n              $total_required_action_count++;\n            }\n          }\n        }\n      }\n      unset( $slug, $plugin );\n\n      // If we have notices to display, we move forward.\n      if ( ! empty( $message ) || $total_required_action_count > 0 ) {\n        krsort( $message ); // Sort messages.\n        $rendered = '';\n\n        // As add_settings_error() wraps the final message in a <p> and as the final message can't be\n        // filtered, using <p>'s in our html would render invalid html output.\n        $line_template = '<span style=\"display: block; margin: 0.5em 0.5em 0 0; clear: both;\">%s</span>' . \"\\n\";\n\n        if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) {\n          $rendered  = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] );\n          $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template );\n        } else {\n\n          // If dismissable is false and a message is set, output it now.\n          if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) {\n            $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) );\n          }\n\n          // Render the individual message lines for the notice.\n          foreach ( $message as $type => $plugin_group ) {\n            $linked_plugins = array();\n\n            // Get the external info link for a plugin if one is available.\n            foreach ( $plugin_group as $plugin_slug ) {\n              $linked_plugins[] = $this->get_info_link( $plugin_slug );\n            }\n            unset( $plugin_slug );\n\n            $count          = count( $plugin_group );\n            $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );\n            $last_plugin    = array_pop( $linked_plugins ); // Pop off last name to prep for readability.\n            $imploded       = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );\n\n            $rendered .= sprintf(\n              $line_template,\n              sprintf(\n                translate_nooped_plural( $this->strings[ $type ], $count, 'tgmpa' ),\n                $imploded,\n                $count\n              )\n            );\n\n          }\n          unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded );\n\n          $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template );\n        }\n\n        // Register the nag messages and prepare them to be processed.\n        add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() );\n      }\n\n      // Admin options pages already output settings_errors, so this is to avoid duplication.\n      if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {\n        $this->display_settings_errors();\n      }\n    }\n\n    /**\n     * Generate the user action links for the admin notice.\n     *\n     * @since 2.6.0\n     *\n     * @param int $install_count  Number of plugins to install.\n     * @param int $update_count   Number of plugins to update.\n     * @param int $activate_count Number of plugins to activate.\n     * @param int $line_template  Template for the HTML tag to output a line.\n     * @return string Action links.\n     */\n    protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) {\n      // Setup action links.\n      $action_links = array(\n        'install'  => '',\n        'update'   => '',\n        'activate' => '',\n        'dismiss'  => $this->dismissable ? '<a href=\"' . esc_url( wp_nonce_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ), 'tgmpa-dismiss-' . get_current_user_id() ) ) . '\" class=\"dismiss-notice\" target=\"_parent\">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '',\n      );\n\n      $link_template = '<a href=\"%2$s\">%1$s</a>';\n\n      if ( current_user_can( 'install_plugins' ) ) {\n        if ( $install_count > 0 ) {\n          $action_links['install'] = sprintf(\n            $link_template,\n            translate_nooped_plural( $this->strings['install_link'], $install_count, 'tgmpa' ),\n            esc_url( $this->get_tgmpa_status_url( 'install' ) )\n          );\n        }\n        if ( $update_count > 0 ) {\n          $action_links['update'] = sprintf(\n            $link_template,\n            translate_nooped_plural( $this->strings['update_link'], $update_count, 'tgmpa' ),\n            esc_url( $this->get_tgmpa_status_url( 'update' ) )\n          );\n        }\n      }\n\n      if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) {\n        $action_links['activate'] = sprintf(\n          $link_template,\n          translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'tgmpa' ),\n          esc_url( $this->get_tgmpa_status_url( 'activate' ) )\n        );\n      }\n\n      $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links );\n\n      $action_links = array_filter( (array) $action_links ); // Remove any empty array items.\n\n      if ( ! empty( $action_links ) ) {\n        $action_links = sprintf( $line_template, implode( ' | ', $action_links ) );\n        return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links );\n      } else {\n        return '';\n      }\n    }\n\n    /**\n     * Get admin notice class.\n     *\n     * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7\n     * (lowest supported version by TGMPA).\n     *\n     * @since 2.6.0\n     *\n     * @return string\n     */\n    protected function get_admin_notice_class() {\n      if ( ! empty( $this->strings['nag_type'] ) ) {\n        return sanitize_html_class( strtolower( $this->strings['nag_type'] ) );\n      } else {\n        if ( version_compare( $this->wp_version, '4.2', '>=' ) ) {\n          return 'notice-warning';\n        } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) {\n          return 'notice';\n        } else {\n          return 'updated';\n        }\n      }\n    }\n\n    /**\n     * Display settings errors and remove those which have been displayed to avoid duplicate messages showing\n     *\n     * @since 2.5.0\n     */\n    protected function display_settings_errors() {\n      global $wp_settings_errors;\n\n      settings_errors( 'tgmpa' );\n\n      foreach ( (array) $wp_settings_errors as $key => $details ) {\n        if ( 'tgmpa' === $details['setting'] ) {\n          unset( $wp_settings_errors[ $key ] );\n          break;\n        }\n      }\n    }\n\n    /**\n     * Register dismissal of admin notices.\n     *\n     * Acts on the dismiss link in the admin nag messages.\n     * If clicked, the admin notice disappears and will no longer be visible to this user.\n     *\n     * @since 2.1.0\n     */\n    public function dismiss() {\n      if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) {\n        update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 );\n      }\n    }\n\n    /**\n     * Add individual plugin to our collection of plugins.\n     *\n     * If the required keys are not set or the plugin has already\n     * been registered, the plugin is not added.\n     *\n     * @since 2.0.0\n     *\n     * @param array|null $plugin Array of plugin arguments or null if invalid argument.\n     * @return null Return early if incorrect argument.\n     */\n    public function register( $plugin ) {\n      if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {\n        return;\n      }\n\n      if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {\n        return;\n      }\n\n      $defaults = array(\n        'name'               => '',      // String\n        'slug'               => '',      // String\n        'source'             => 'repo',  // String\n        'required'           => false,   // Boolean\n        'version'            => '',      // String\n        'force_activation'   => false,   // Boolean\n        'force_deactivation' => false,   // Boolean\n        'external_url'       => '',      // String\n        'is_callable'        => '',      // String|Array.\n      );\n\n      // Prepare the received data.\n      $plugin = wp_parse_args( $plugin, $defaults );\n\n      // Standardize the received slug.\n      $plugin['slug'] = $this->sanitize_key( $plugin['slug'] );\n\n      // Forgive users for using string versions of booleans or floats for version number.\n      $plugin['version']            = (string) $plugin['version'];\n      $plugin['source']             = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];\n      $plugin['required']           = TGMPA_Utils::validate_bool( $plugin['required'] );\n      $plugin['force_activation']   = TGMPA_Utils::validate_bool( $plugin['force_activation'] );\n      $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );\n\n      // Enrich the received data.\n      $plugin['file_path']   = $this->_get_plugin_basename_from_slug( $plugin['slug'] );\n      $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );\n\n      // Set the class properties.\n      $this->plugins[ $plugin['slug'] ]    = $plugin;\n      $this->sort_order[ $plugin['slug'] ] = $plugin['name'];\n\n      // Should we add the force activation hook ?\n      if ( true === $plugin['force_activation'] ) {\n        $this->has_forced_activation = true;\n      }\n\n      // Should we add the force deactivation hook ?\n      if ( true === $plugin['force_deactivation'] ) {\n        $this->has_forced_deactivation = true;\n      }\n    }\n\n    /**\n     * Determine what type of source the plugin comes from.\n     *\n     * @since 2.5.0\n     *\n     * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path\n     *                       (= bundled) or an external URL.\n     * @return string 'repo', 'external', or 'bundled'\n     */\n    protected function get_plugin_source_type( $source ) {\n      if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) {\n        return 'repo';\n      } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) {\n        return 'external';\n      } else {\n        return 'bundled';\n      }\n    }\n\n    /**\n     * Sanitizes a string key.\n     *\n     * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are*\n     * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase\n     * characters in the plugin directory path/slug. Silly them.\n     *\n     * @see https://developer.wordpress.org/reference/hooks/sanitize_key/\n     *\n     * @since 2.5.0\n     *\n     * @param string $key String key.\n     * @return string Sanitized key\n     */\n    public function sanitize_key( $key ) {\n      $raw_key = $key;\n      $key     = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );\n\n      /**\n       * Filter a sanitized key string.\n       *\n       * @since 2.5.0\n       *\n       * @param string $key     Sanitized key.\n       * @param string $raw_key The key prior to sanitization.\n       */\n      return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key );\n    }\n\n    /**\n     * Amend default configuration settings.\n     *\n     * @since 2.0.0\n     *\n     * @param array $config Array of config options to pass as class properties.\n     */\n    public function config( $config ) {\n      $keys = array(\n        'id',\n        'default_path',\n        'has_notices',\n        'dismissable',\n        'dismiss_msg',\n        'menu',\n        'parent_slug',\n        'capability',\n        'is_automatic',\n        'message',\n        'strings',\n      );\n\n      foreach ( $keys as $key ) {\n        if ( isset( $config[ $key ] ) ) {\n          if ( is_array( $config[ $key ] ) ) {\n            $this->$key = array_merge( $this->$key, $config[ $key ] );\n          } else {\n            $this->$key = $config[ $key ];\n          }\n        }\n      }\n    }\n\n    /**\n     * Amend action link after plugin installation.\n     *\n     * @since 2.0.0\n     *\n     * @param array $install_actions Existing array of actions.\n     * @return false|array Amended array of actions.\n     */\n    public function actions( $install_actions ) {\n      // Remove action links on the TGMPA install page.\n      if ( $this->is_tgmpa_page() ) {\n        return false;\n      }\n\n      return $install_actions;\n    }\n\n    /**\n     * Flushes the plugins cache on theme switch to prevent stale entries\n     * from remaining in the plugin table.\n     *\n     * @since 2.4.0\n     *\n     * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache.\n     *                                 Parameter added in v2.5.0.\n     */\n    public function flush_plugins_cache( $clear_update_cache = true ) {\n      wp_clean_plugins_cache( $clear_update_cache );\n    }\n\n    /**\n     * Set file_path key for each installed plugin.\n     *\n     * @since 2.1.0\n     *\n     * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin.\n     *                            Parameter added in v2.5.0.\n     */\n    public function populate_file_path( $plugin_slug = '' ) {\n      if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {\n        $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );\n      } else {\n        // Add file_path key for all plugins.\n        foreach ( $this->plugins as $slug => $values ) {\n          $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );\n        }\n      }\n    }\n\n    /**\n     * Helper function to extract the file path of the plugin file from the\n     * plugin slug, if the plugin is installed.\n     *\n     * @since 2.0.0\n     *\n     * @param string $slug Plugin slug (typically folder name) as provided by the developer.\n     * @return string Either file path for plugin if installed, or just the plugin slug.\n     */\n    protected function _get_plugin_basename_from_slug( $slug ) {\n      $keys = array_keys( $this->get_plugins() );\n\n      foreach ( $keys as $key ) {\n        if ( preg_match( '|^' . $slug . '/|', $key ) ) {\n          return $key;\n        }\n      }\n\n      return $slug;\n    }\n\n    /**\n     * Retrieve plugin data, given the plugin name.\n     *\n     * Loops through the registered plugins looking for $name. If it finds it,\n     * it returns the $data from that plugin. Otherwise, returns false.\n     *\n     * @since 2.1.0\n     *\n     * @param string $name Name of the plugin, as it was registered.\n     * @param string $data Optional. Array key of plugin data to return. Default is slug.\n     * @return string|boolean Plugin slug if found, false otherwise.\n     */\n    public function _get_plugin_data_from_name( $name, $data = 'slug' ) {\n      foreach ( $this->plugins as $values ) {\n        if ( $name === $values['name'] && isset( $values[ $data ] ) ) {\n          return $values[ $data ];\n        }\n      }\n\n      return false;\n    }\n\n    /**\n     * Retrieve the download URL for a package.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return string Plugin download URL or path to local file or empty string if undetermined.\n     */\n    public function get_download_url( $slug ) {\n      $dl_source = '';\n\n      switch ( $this->plugins[ $slug ]['source_type'] ) {\n        case 'repo':\n          return $this->get_wp_repo_download_url( $slug );\n        case 'external':\n          return $this->plugins[ $slug ]['source'];\n        case 'bundled':\n          return $this->default_path . $this->plugins[ $slug ]['source'];\n      }\n\n      return $dl_source; // Should never happen.\n    }\n\n    /**\n     * Retrieve the download URL for a WP repo package.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return string Plugin download URL.\n     */\n    protected function get_wp_repo_download_url( $slug ) {\n      $source = '';\n      $api    = $this->get_plugins_api( $slug );\n\n      if ( false !== $api && isset( $api->download_link ) ) {\n        $source = $api->download_link;\n      }\n\n      return $source;\n    }\n\n    /**\n     * Try to grab information from WordPress API.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return object Plugins_api response object on success, WP_Error on failure.\n     */\n    protected function get_plugins_api( $slug ) {\n      static $api = array(); // Cache received responses.\n\n      if ( ! isset( $api[ $slug ] ) ) {\n        if ( ! function_exists( 'plugins_api' ) ) {\n          require_once ABSPATH . 'wp-admin/includes/plugin-install.php';\n        }\n\n        $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );\n\n        $api[ $slug ] = false;\n\n        if ( is_wp_error( $response ) ) {\n          wp_die( esc_html( $this->strings['oops'] ) );\n        } else {\n          $api[ $slug ] = $response;\n        }\n      }\n\n      return $api[ $slug ];\n    }\n\n    /**\n     * Retrieve a link to a plugin information page.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return string Fully formed html link to a plugin information page if available\n     *                or the plugin name if not.\n     */\n    public function get_info_link( $slug ) {\n      if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) {\n        $link = sprintf(\n          '<a href=\"%1$s\" target=\"_blank\">%2$s</a>',\n          esc_url( $this->plugins[ $slug ]['external_url'] ),\n          esc_html( $this->plugins[ $slug ]['name'] )\n        );\n      } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {\n        $url = add_query_arg(\n          array(\n            'tab'       => 'plugin-information',\n            'plugin'    => urlencode( $slug ),\n            'TB_iframe' => 'true',\n            'width'     => '640',\n            'height'    => '500',\n          ),\n          self_admin_url( 'plugin-install.php' )\n        );\n\n        $link = sprintf(\n          '<a href=\"%1$s\" class=\"thickbox\">%2$s</a>',\n          esc_url( $url ),\n          esc_html( $this->plugins[ $slug ]['name'] )\n        );\n      } else {\n        $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.\n      }\n\n      return $link;\n    }\n\n    /**\n     * Determine if we're on the TGMPA Install page.\n     *\n     * @since 2.1.0\n     *\n     * @return boolean True when on the TGMPA page, false otherwise.\n     */\n    protected function is_tgmpa_page() {\n      return isset( $_GET['page'] ) && $this->menu === $_GET['page'];\n    }\n\n    /**\n     * Determine if we're on a WP Core installation/upgrade page.\n     *\n     * @since 2.6.0\n     *\n     * @return boolean True when on a WP Core installation/upgrade page, false otherwise.\n     */\n    protected function is_core_update_page() {\n      // Current screen is not always available, most notably on the customizer screen.\n      if ( ! function_exists( 'get_current_screen' ) ) {\n        return false;\n      }\n\n      $screen = get_current_screen();\n\n      if ( 'update-core' === $screen->base ) {\n        // Core update screen.\n        return true;\n      } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.\n        // Plugins bulk update screen.\n        return true;\n      } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.\n        // Individual updates (ajax call).\n        return true;\n      }\n\n      return false;\n    }\n\n    /**\n     * Retrieve the URL to the TGMPA Install page.\n     *\n     * I.e. depending on the config settings passed something along the lines of:\n     * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins\n     *\n     * @since 2.5.0\n     *\n     * @return string Properly encoded URL (not escaped).\n     */\n    public function get_tgmpa_url() {\n      static $url;\n\n      if ( ! isset( $url ) ) {\n        $parent = $this->parent_slug;\n        if ( false === strpos( $parent, '.php' ) ) {\n          $parent = 'admin.php';\n        }\n        $url = add_query_arg(\n          array(\n            'page' => urlencode( $this->menu ),\n          ),\n          self_admin_url( $parent )\n        );\n      }\n\n      return $url;\n    }\n\n    /**\n     * Retrieve the URL to the TGMPA Install page for a specific plugin status (view).\n     *\n     * I.e. depending on the config settings passed something along the lines of:\n     * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install\n     *\n     * @since 2.5.0\n     *\n     * @param string $status Plugin status - either 'install', 'update' or 'activate'.\n     * @return string Properly encoded URL (not escaped).\n     */\n    public function get_tgmpa_status_url( $status ) {\n      return add_query_arg(\n        array(\n          'plugin_status' => urlencode( $status ),\n        ),\n        $this->get_tgmpa_url()\n      );\n    }\n\n    /**\n     * Determine whether there are open actions for plugins registered with TGMPA.\n     *\n     * @since 2.5.0\n     *\n     * @return bool True if complete, i.e. no outstanding actions. False otherwise.\n     */\n    public function is_tgmpa_complete() {\n      $complete = true;\n      foreach ( $this->plugins as $slug => $plugin ) {\n        if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {\n          $complete = false;\n          break;\n        }\n      }\n\n      return $complete;\n    }\n\n    /**\n     * Check if a plugin is installed. Does not take must-use plugins into account.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return bool True if installed, false otherwise.\n     */\n    public function is_plugin_installed( $slug ) {\n      $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).\n\n      return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );\n    }\n\n    /**\n     * Check if a plugin is active.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return bool True if active, false otherwise.\n     */\n    public function is_plugin_active( $slug ) {\n      return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );\n    }\n\n    /**\n     * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required\n     * available, check whether the current install meets them.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return bool True if OK to update, false otherwise.\n     */\n    public function can_plugin_update( $slug ) {\n      // We currently can't get reliable info on non-WP-repo plugins - issue #380.\n      if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {\n        return true;\n      }\n\n      $api = $this->get_plugins_api( $slug );\n\n      if ( false !== $api && isset( $api->requires ) ) {\n        return version_compare( $this->wp_version, $api->requires, '>=' );\n      }\n\n      // No usable info received from the plugins API, presume we can update.\n      return true;\n    }\n\n    /**\n     * Check to see if the plugin is 'updatetable', i.e. installed, with an update available\n     * and no WP version requirements blocking it.\n     *\n     * @since 2.6.0\n     *\n     * @param string $slug Plugin slug.\n     * @return bool True if OK to proceed with update, false otherwise.\n     */\n    public function is_plugin_updatetable( $slug ) {\n      if ( ! $this->is_plugin_installed( $slug ) ) {\n        return false;\n      } else {\n        return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) );\n      }\n    }\n\n    /**\n     * Check if a plugin can be activated, i.e. is not currently active and meets the minimum\n     * plugin version requirements set in TGMPA (if any).\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return bool True if OK to activate, false otherwise.\n     */\n    public function can_plugin_activate( $slug ) {\n      return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) );\n    }\n\n    /**\n     * Retrieve the version number of an installed plugin.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return string Version number as string or an empty string if the plugin is not installed\n     *                or version unknown (plugins which don't comply with the plugin header standard).\n     */\n    public function get_installed_version( $slug ) {\n      $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).\n\n      if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {\n        return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];\n      }\n\n      return '';\n    }\n\n    /**\n     * Check whether a plugin complies with the minimum version requirements.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return bool True when a plugin needs to be updated, otherwise false.\n     */\n    public function does_plugin_require_update( $slug ) {\n      $installed_version = $this->get_installed_version( $slug );\n      $minimum_version   = $this->plugins[ $slug ]['version'];\n\n      return version_compare( $minimum_version, $installed_version, '>' );\n    }\n\n    /**\n     * Check whether there is an update available for a plugin.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return false|string Version number string of the available update or false if no update available.\n     */\n    public function does_plugin_have_update( $slug ) {\n      // Presume bundled and external plugins will point to a package which meets the minimum required version.\n      if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {\n        if ( $this->does_plugin_require_update( $slug ) ) {\n          return $this->plugins[ $slug ]['version'];\n        }\n\n        return false;\n      }\n\n      $repo_updates = get_site_transient( 'update_plugins' );\n\n      if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) {\n        return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version;\n      }\n\n      return false;\n    }\n\n    /**\n     * Retrieve potential upgrade notice for a plugin.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return string The upgrade notice or an empty string if no message was available or provided.\n     */\n    public function get_upgrade_notice( $slug ) {\n      // We currently can't get reliable info on non-WP-repo plugins - issue #380.\n      if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {\n        return '';\n      }\n\n      $repo_updates = get_site_transient( 'update_plugins' );\n\n      if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) {\n        return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice;\n      }\n\n      return '';\n    }\n\n    /**\n     * Wrapper around the core WP get_plugins function, making sure it's actually available.\n     *\n     * @since 2.5.0\n     *\n     * @param string $plugin_folder Optional. Relative path to single plugin folder.\n     * @return array Array of installed plugins with plugin information.\n     */\n    public function get_plugins( $plugin_folder = '' ) {\n      if ( ! function_exists( 'get_plugins' ) ) {\n        require_once ABSPATH . 'wp-admin/includes/plugin.php';\n      }\n\n      return get_plugins( $plugin_folder );\n    }\n\n    /**\n     * Delete dismissable nag option when theme is switched.\n     *\n     * This ensures that the user(s) is/are again reminded via nag of required\n     * and/or recommended plugins if they re-activate the theme.\n     *\n     * @since 2.1.1\n     */\n    public function update_dismiss() {\n      delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true );\n    }\n\n    /**\n     * Forces plugin activation if the parameter 'force_activation' is\n     * set to true.\n     *\n     * This allows theme authors to specify certain plugins that must be\n     * active at all times while using the current theme.\n     *\n     * Please take special care when using this parameter as it has the\n     * potential to be harmful if not used correctly. Setting this parameter\n     * to true will not allow the specified plugin to be deactivated unless\n     * the user switches themes.\n     *\n     * @since 2.2.0\n     */\n    public function force_activation() {\n      foreach ( $this->plugins as $slug => $plugin ) {\n        if ( true === $plugin['force_activation'] ) {\n          if ( ! $this->is_plugin_installed( $slug ) ) {\n            // Oops, plugin isn't there so iterate to next condition.\n            continue;\n          } elseif ( $this->can_plugin_activate( $slug ) ) {\n            // There we go, activate the plugin.\n            activate_plugin( $plugin['file_path'] );\n          }\n        }\n      }\n    }\n\n    /**\n     * Forces plugin deactivation if the parameter 'force_deactivation'\n     * is set to true and adds the plugin to the 'recently active' plugins list.\n     *\n     * This allows theme authors to specify certain plugins that must be\n     * deactivated upon switching from the current theme to another.\n     *\n     * Please take special care when using this parameter as it has the\n     * potential to be harmful if not used correctly.\n     *\n     * @since 2.2.0\n     */\n    public function force_deactivation() {\n      $deactivated = array();\n\n      foreach ( $this->plugins as $slug => $plugin ) {\n        /*\n         * Only proceed forward if the parameter is set to true and plugin is active\n         * as a 'normal' (not must-use) plugin.\n         */\n        if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) {\n          deactivate_plugins( $plugin['file_path'] );\n          $deactivated[ $plugin['file_path'] ] = time();\n        }\n      }\n\n      if ( ! empty( $deactivated ) ) {\n        update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );\n      }\n    }\n\n    /**\n     * Echo the current TGMPA version number to the page.\n     *\n     * @since 2.5.0\n     */\n    public function show_tgmpa_version() {\n      echo '<p style=\"float: right; padding: 0em 1.5em 0.5em 0;\"><strong><small>',\n        esc_html(\n          sprintf(\n            /* translators: %s: version number */\n            __( 'TGMPA v%s', 'tgmpa' ),\n            self::TGMPA_VERSION\n          )\n        ),\n        '</small></strong></p>';\n    }\n\n    /**\n     * Returns the singleton instance of the class.\n     *\n     * @since 2.4.0\n     *\n     * @return \\TGM_Plugin_Activation The TGM_Plugin_Activation object.\n     */\n    public static function get_instance() {\n      if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {\n        self::$instance = new self();\n      }\n\n      return self::$instance;\n    }\n  }\n\n  if ( ! function_exists( 'load_tgm_plugin_activation' ) ) {\n    /**\n     * Ensure only one instance of the class is ever invoked.\n     *\n     * @since 2.5.0\n     */\n    function load_tgm_plugin_activation() {\n      $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance();\n    }\n  }\n\n  if ( did_action( 'plugins_loaded' ) ) {\n    load_tgm_plugin_activation();\n  } else {\n    add_action( 'plugins_loaded', 'load_tgm_plugin_activation' );\n  }\n}\n\nif ( ! function_exists( 'tgmpa' ) ) {\n  /**\n   * Helper function to register a collection of required plugins.\n   *\n   * @since 2.0.0\n   * @api\n   *\n   * @param array $plugins An array of plugin arrays.\n   * @param array $config  Optional. An array of configuration values.\n   */\n  function tgmpa( $plugins, $config = array() ) {\n    $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );\n\n    foreach ( $plugins as $plugin ) {\n      call_user_func( array( $instance, 'register' ), $plugin );\n    }\n\n    if ( ! empty( $config ) && is_array( $config ) ) {\n      // Send out notices for deprecated arguments passed.\n      if ( isset( $config['notices'] ) ) {\n        _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' );\n        if ( ! isset( $config['has_notices'] ) ) {\n          $config['has_notices'] = $config['notices'];\n        }\n      }\n\n      if ( isset( $config['parent_menu_slug'] ) ) {\n        _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );\n      }\n      if ( isset( $config['parent_url_slug'] ) ) {\n        _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );\n      }\n\n      call_user_func( array( $instance, 'config' ), $config );\n    }\n  }\n}\n\n/**\n * WP_List_Table isn't always available. If it isn't available,\n * we load it here.\n *\n * @since 2.2.0\n */\nif ( ! class_exists( 'WP_List_Table' ) ) {\n  require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';\n}\n\nif ( ! class_exists( 'TGMPA_List_Table' ) ) {\n\n  /**\n   * List table class for handling plugins.\n   *\n   * Extends the WP_List_Table class to provide a future-compatible\n   * way of listing out all required/recommended plugins.\n   *\n   * Gives users an interface similar to the Plugin Administration\n   * area with similar (albeit stripped down) capabilities.\n   *\n   * This class also allows for the bulk install of plugins.\n   *\n   * @since 2.2.0\n   *\n   * @package TGM-Plugin-Activation\n   * @author  Thomas Griffin\n   * @author  Gary Jones\n   */\n  class TGMPA_List_Table extends WP_List_Table {\n    /**\n     * TGMPA instance.\n     *\n     * @since 2.5.0\n     *\n     * @var object\n     */\n    protected $tgmpa;\n\n    /**\n     * The currently chosen view.\n     *\n     * @since 2.5.0\n     *\n     * @var string One of: 'all', 'install', 'update', 'activate'\n     */\n    public $view_context = 'all';\n\n    /**\n     * The plugin counts for the various views.\n     *\n     * @since 2.5.0\n     *\n     * @var array\n     */\n    protected $view_totals = array(\n      'all'      => 0,\n      'install'  => 0,\n      'update'   => 0,\n      'activate' => 0,\n    );\n\n    /**\n     * References parent constructor and sets defaults for class.\n     *\n     * @since 2.2.0\n     */\n    public function __construct() {\n      $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );\n\n      parent::__construct(\n        array(\n          'singular' => 'plugin',\n          'plural'   => 'plugins',\n          'ajax'     => false,\n        )\n      );\n\n      if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) {\n        $this->view_context = sanitize_key( $_REQUEST['plugin_status'] );\n      }\n\n      add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) );\n    }\n\n    /**\n     * Get a list of CSS classes for the <table> tag.\n     *\n     * Overruled to prevent the 'plural' argument from being added.\n     *\n     * @since 2.5.0\n     *\n     * @return array CSS classnames.\n     */\n    public function get_table_classes() {\n      return array( 'widefat', 'fixed' );\n    }\n\n    /**\n     * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table.\n     *\n     * @since 2.2.0\n     *\n     * @return array $table_data Information for use in table.\n     */\n    protected function _gather_plugin_data() {\n      // Load thickbox for plugin links.\n      $this->tgmpa->admin_init();\n      $this->tgmpa->thickbox();\n\n      // Categorize the plugins which have open actions.\n      $plugins = $this->categorize_plugins_to_views();\n\n      // Set the counts for the view links.\n      $this->set_view_totals( $plugins );\n\n      // Prep variables for use and grab list of all installed plugins.\n      $table_data = array();\n      $i          = 0;\n\n      // Redirect to the 'all' view if no plugins were found for the selected view context.\n      if ( empty( $plugins[ $this->view_context ] ) ) {\n        $this->view_context = 'all';\n      }\n\n      foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) {\n        $table_data[ $i ]['sanitized_plugin']  = $plugin['name'];\n        $table_data[ $i ]['slug']              = $slug;\n        $table_data[ $i ]['plugin']            = '<strong>' . $this->tgmpa->get_info_link( $slug ) . '</strong>';\n        $table_data[ $i ]['source']            = $this->get_plugin_source_type_text( $plugin['source_type'] );\n        $table_data[ $i ]['type']              = $this->get_plugin_advise_type_text( $plugin['required'] );\n        $table_data[ $i ]['status']            = $this->get_plugin_status_text( $slug );\n        $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug );\n        $table_data[ $i ]['minimum_version']   = $plugin['version'];\n        $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug );\n\n        // Prep the upgrade notice info.\n        $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug );\n        if ( ! empty( $upgrade_notice ) ) {\n          $table_data[ $i ]['upgrade_notice'] = $upgrade_notice;\n\n          add_action( \"tgmpa_after_plugin_row_{$slug}\", array( $this, 'wp_plugin_update_row' ), 10, 2 );\n        }\n\n        $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin );\n\n        $i++;\n      }\n\n      return $table_data;\n    }\n\n    /**\n     * Categorize the plugins which have open actions into views for the TGMPA page.\n     *\n     * @since 2.5.0\n     */\n    protected function categorize_plugins_to_views() {\n      $plugins = array(\n        'all'      => array(), // Meaning: all plugins which still have open actions.\n        'install'  => array(),\n        'update'   => array(),\n        'activate' => array(),\n      );\n\n      foreach ( $this->tgmpa->plugins as $slug => $plugin ) {\n        if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {\n          // No need to display plugins if they are installed, up-to-date and active.\n          continue;\n        } else {\n          $plugins['all'][ $slug ] = $plugin;\n\n          if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {\n            $plugins['install'][ $slug ] = $plugin;\n          } else {\n            if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {\n              $plugins['update'][ $slug ] = $plugin;\n            }\n\n            if ( $this->tgmpa->can_plugin_activate( $slug ) ) {\n              $plugins['activate'][ $slug ] = $plugin;\n            }\n          }\n        }\n      }\n\n      return $plugins;\n    }\n\n    /**\n     * Set the counts for the view links.\n     *\n     * @since 2.5.0\n     *\n     * @param array $plugins Plugins order by view.\n     */\n    protected function set_view_totals( $plugins ) {\n      foreach ( $plugins as $type => $list ) {\n        $this->view_totals[ $type ] = count( $list );\n      }\n    }\n\n    /**\n     * Get the plugin required/recommended text string.\n     *\n     * @since 2.5.0\n     *\n     * @param string $required Plugin required setting.\n     * @return string\n     */\n    protected function get_plugin_advise_type_text( $required ) {\n      if ( true === $required ) {\n        return __( 'Required', 'tgmpa' );\n      }\n\n      return __( 'Recommended', 'tgmpa' );\n    }\n\n    /**\n     * Get the plugin source type text string.\n     *\n     * @since 2.5.0\n     *\n     * @param string $type Plugin type.\n     * @return string\n     */\n    protected function get_plugin_source_type_text( $type ) {\n      $string = '';\n\n      switch ( $type ) {\n        case 'repo':\n          $string = __( 'WordPress Repository', 'tgmpa' );\n          break;\n        case 'external':\n          $string = __( 'External Source', 'tgmpa' );\n          break;\n        case 'bundled':\n          $string = __( 'Pre-Packaged', 'tgmpa' );\n          break;\n      }\n\n      return $string;\n    }\n\n    /**\n     * Determine the plugin status message.\n     *\n     * @since 2.5.0\n     *\n     * @param string $slug Plugin slug.\n     * @return string\n     */\n    protected function get_plugin_status_text( $slug ) {\n      if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {\n        return __( 'Not Installed', 'tgmpa' );\n      }\n\n      if ( ! $this->tgmpa->is_plugin_active( $slug ) ) {\n        $install_status = __( 'Installed But Not Activated', 'tgmpa' );\n      } else {\n        $install_status = __( 'Active', 'tgmpa' );\n      }\n\n      $update_status = '';\n\n      if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {\n        $update_status = __( 'Required Update not Available', 'tgmpa' );\n\n      } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) {\n        $update_status = __( 'Requires Update', 'tgmpa' );\n\n      } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {\n        $update_status = __( 'Update recommended', 'tgmpa' );\n      }\n\n      if ( '' === $update_status ) {\n        return $install_status;\n      }\n\n      return sprintf(\n        /* translators: 1: install status, 2: update status */\n        _x( '%1$s, %2$s', 'Install/Update Status', 'tgmpa' ),\n        $install_status,\n        $update_status\n      );\n    }\n\n    /**\n     * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type.\n     *\n     * @since 2.5.0\n     *\n     * @param array $items Prepared table items.\n     * @return array Sorted table items.\n     */\n    public function sort_table_items( $items ) {\n      $type = array();\n      $name = array();\n\n      foreach ( $items as $i => $plugin ) {\n        $type[ $i ] = $plugin['type']; // Required / recommended.\n        $name[ $i ] = $plugin['sanitized_plugin'];\n      }\n\n      array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items );\n\n      return $items;\n    }\n\n    /**\n     * Get an associative array ( id => link ) of the views available on this table.\n     *\n     * @since 2.5.0\n     *\n     * @return array\n     */\n    public function get_views() {\n      $status_links = array();\n\n      foreach ( $this->view_totals as $type => $count ) {\n        if ( $count < 1 ) {\n          continue;\n        }\n\n        switch ( $type ) {\n          case 'all':\n            /* translators: 1: number of plugins. */\n            $text = _nx( 'All <span class=\"count\">(%s)</span>', 'All <span class=\"count\">(%s)</span>', $count, 'plugins', 'tgmpa' );\n            break;\n          case 'install':\n            /* translators: 1: number of plugins. */\n            $text = _n( 'To Install <span class=\"count\">(%s)</span>', 'To Install <span class=\"count\">(%s)</span>', $count, 'tgmpa' );\n            break;\n          case 'update':\n            /* translators: 1: number of plugins. */\n            $text = _n( 'Update Available <span class=\"count\">(%s)</span>', 'Update Available <span class=\"count\">(%s)</span>', $count, 'tgmpa' );\n            break;\n          case 'activate':\n            /* translators: 1: number of plugins. */\n            $text = _n( 'To Activate <span class=\"count\">(%s)</span>', 'To Activate <span class=\"count\">(%s)</span>', $count, 'tgmpa' );\n            break;\n          default:\n            $text = '';\n            break;\n        }\n\n        if ( ! empty( $text ) ) {\n\n          $status_links[ $type ] = sprintf(\n            '<a href=\"%s\"%s>%s</a>',\n            esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ),\n            ( $type === $this->view_context ) ? ' class=\"current\"' : '',\n            sprintf( $text, number_format_i18n( $count ) )\n          );\n        }\n      }\n\n      return $status_links;\n    }\n\n    /**\n     * Create default columns to display important plugin information\n     * like type, action and status.\n     *\n     * @since 2.2.0\n     *\n     * @param array  $item        Array of item data.\n     * @param string $column_name The name of the column.\n     * @return string\n     */\n    public function column_default( $item, $column_name ) {\n      return $item[ $column_name ];\n    }\n\n    /**\n     * Required for bulk installing.\n     *\n     * Adds a checkbox for each plugin.\n     *\n     * @since 2.2.0\n     *\n     * @param array $item Array of item data.\n     * @return string The input checkbox with all necessary info.\n     */\n    public function column_cb( $item ) {\n      return sprintf(\n        '<input type=\"checkbox\" name=\"%1$s[]\" value=\"%2$s\" id=\"%3$s\" />',\n        esc_attr( $this->_args['singular'] ),\n        esc_attr( $item['slug'] ),\n        esc_attr( $item['sanitized_plugin'] )\n      );\n    }\n\n    /**\n     * Create default title column along with the action links.\n     *\n     * @since 2.2.0\n     *\n     * @param array $item Array of item data.\n     * @return string The plugin name and action links.\n     */\n    public function column_plugin( $item ) {\n      return sprintf(\n        '%1$s %2$s',\n        $item['plugin'],\n        $this->row_actions( $this->get_row_actions( $item ), true )\n      );\n    }\n\n    /**\n     * Create version information column.\n     *\n     * @since 2.5.0\n     *\n     * @param array $item Array of item data.\n     * @return string HTML-formatted version information.\n     */\n    public function column_version( $item ) {\n      $output = array();\n\n      if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {\n        $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: \"version nr unknown\"', 'tgmpa' );\n\n        $color = '';\n        if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) {\n          $color = ' color: #ff0000; font-weight: bold;';\n        }\n\n        $output[] = sprintf(\n          '<p><span style=\"min-width: 32px; text-align: right; float: right;%1$s\">%2$s</span>' . __( 'Installed version:', 'tgmpa' ) . '</p>',\n          $color,\n          $installed\n        );\n      }\n\n      if ( ! empty( $item['minimum_version'] ) ) {\n        $output[] = sprintf(\n          '<p><span style=\"min-width: 32px; text-align: right; float: right;\">%1$s</span>' . __( 'Minimum required version:', 'tgmpa' ) . '</p>',\n          $item['minimum_version']\n        );\n      }\n\n      if ( ! empty( $item['available_version'] ) ) {\n        $color = '';\n        if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) {\n          $color = ' color: #71C671; font-weight: bold;';\n        }\n\n        $output[] = sprintf(\n          '<p><span style=\"min-width: 32px; text-align: right; float: right;%1$s\">%2$s</span>' . __( 'Available version:', 'tgmpa' ) . '</p>',\n          $color,\n          $item['available_version']\n        );\n      }\n\n      if ( empty( $output ) ) {\n        return '&nbsp;'; // Let's not break the table layout.\n      } else {\n        return implode( \"\\n\", $output );\n      }\n    }\n\n    /**\n     * Sets default message within the plugins table if no plugins\n     * are left for interaction.\n     *\n     * Hides the menu item to prevent the user from clicking and\n     * getting a permissions error.\n     *\n     * @since 2.2.0\n     */\n    public function no_items() {\n      echo esc_html__( 'No plugins to install, update or activate.', 'tgmpa' ) . ' <a href=\"' . esc_url( self_admin_url() ) . '\"> ' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>';\n      echo '<style type=\"text/css\">#adminmenu .wp-submenu li.current { display: none !important; }</style>';\n    }\n\n    /**\n     * Output all the column information within the table.\n     *\n     * @since 2.2.0\n     *\n     * @return array $columns The column names.\n     */\n    public function get_columns() {\n      $columns = array(\n        'cb'     => '<input type=\"checkbox\" />',\n        'plugin' => __( 'Plugin', 'tgmpa' ),\n        'source' => __( 'Source', 'tgmpa' ),\n        'type'   => __( 'Type', 'tgmpa' ),\n      );\n\n      if ( 'all' === $this->view_context || 'update' === $this->view_context ) {\n        $columns['version'] = __( 'Version', 'tgmpa' );\n        $columns['status']  = __( 'Status', 'tgmpa' );\n      }\n\n      return apply_filters( 'tgmpa_table_columns', $columns );\n    }\n\n    /**\n     * Get name of default primary column\n     *\n     * @since 2.5.0 / WP 4.3+ compatibility\n     * @access protected\n     *\n     * @return string\n     */\n    protected function get_default_primary_column_name() {\n      return 'plugin';\n    }\n\n    /**\n     * Get the name of the primary column.\n     *\n     * @since 2.5.0 / WP 4.3+ compatibility\n     * @access protected\n     *\n     * @return string The name of the primary column.\n     */\n    protected function get_primary_column_name() {\n      if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) {\n        return parent::get_primary_column_name();\n      } else {\n        return $this->get_default_primary_column_name();\n      }\n    }\n\n    /**\n     * Get the actions which are relevant for a specific plugin row.\n     *\n     * @since 2.5.0\n     *\n     * @param array $item Array of item data.\n     * @return array Array with relevant action links.\n     */\n    protected function get_row_actions( $item ) {\n      $actions      = array();\n      $action_links = array();\n\n      // Display the 'Install' action link if the plugin is not yet available.\n      if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {\n        /* translators: %2$s: plugin name in screen reader markup */\n        $actions['install'] = __( 'Install %2$s', 'tgmpa' );\n      } else {\n        // Display the 'Update' action link if an update is available and WP complies with plugin minimum.\n        if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) {\n          /* translators: %2$s: plugin name in screen reader markup */\n          $actions['update'] = __( 'Update %2$s', 'tgmpa' );\n        }\n\n        // Display the 'Activate' action link, but only if the plugin meets the minimum version.\n        if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {\n          /* translators: %2$s: plugin name in screen reader markup */\n          $actions['activate'] = __( 'Activate %2$s', 'tgmpa' );\n        }\n      }\n\n      // Create the actual links.\n      foreach ( $actions as $action => $text ) {\n        $nonce_url = wp_nonce_url(\n          add_query_arg(\n            array(\n              'plugin'           => urlencode( $item['slug'] ),\n              'tgmpa-' . $action => $action . '-plugin',\n            ),\n            $this->tgmpa->get_tgmpa_url()\n          ),\n          'tgmpa-' . $action,\n          'tgmpa-nonce'\n        );\n\n        $action_links[ $action ] = sprintf(\n          '<a href=\"%1$s\">' . esc_html( $text ) . '</a>', // $text contains the second placeholder.\n          esc_url( $nonce_url ),\n          '<span class=\"screen-reader-text\">' . esc_html( $item['sanitized_plugin'] ) . '</span>'\n        );\n      }\n\n      $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : '';\n      return apply_filters( \"tgmpa_{$prefix}plugin_action_links\", array_filter( $action_links ), $item['slug'], $item, $this->view_context );\n    }\n\n    /**\n     * Generates content for a single row of the table.\n     *\n     * @since 2.5.0\n     *\n     * @param object $item The current item.\n     */\n    public function single_row( $item ) {\n      parent::single_row( $item );\n\n      /**\n       * Fires after each specific row in the TGMPA Plugins list table.\n       *\n       * The dynamic portion of the hook name, `$item['slug']`, refers to the slug\n       * for the plugin.\n       *\n       * @since 2.5.0\n       */\n      do_action( \"tgmpa_after_plugin_row_{$item['slug']}\", $item['slug'], $item, $this->view_context );\n    }\n\n    /**\n     * Show the upgrade notice below a plugin row if there is one.\n     *\n     * @since 2.5.0\n     *\n     * @see /wp-admin/includes/update.php\n     *\n     * @param string $slug Plugin slug.\n     * @param array  $item The information available in this table row.\n     * @return null Return early if upgrade notice is empty.\n     */\n    public function wp_plugin_update_row( $slug, $item ) {\n      if ( empty( $item['upgrade_notice'] ) ) {\n        return;\n      }\n\n      echo '\n        <tr class=\"plugin-update-tr\">\n          <td colspan=\"', absint( $this->get_column_count() ), '\" class=\"plugin-update colspanchange\">\n            <div class=\"update-message\">',\n              esc_html__( 'Upgrade message from the plugin author:', 'tgmpa' ),\n              ' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong>\n            </div>\n          </td>\n        </tr>';\n    }\n\n    /**\n     * Extra controls to be displayed between bulk actions and pagination.\n     *\n     * @since 2.5.0\n     *\n     * @param string $which 'top' or 'bottom' table navigation.\n     */\n    public function extra_tablenav( $which ) {\n      if ( 'bottom' === $which ) {\n        $this->tgmpa->show_tgmpa_version();\n      }\n    }\n\n    /**\n     * Defines the bulk actions for handling registered plugins.\n     *\n     * @since 2.2.0\n     *\n     * @return array $actions The bulk actions for the plugin install table.\n     */\n    public function get_bulk_actions() {\n\n      $actions = array();\n\n      if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {\n        if ( current_user_can( 'install_plugins' ) ) {\n          $actions['tgmpa-bulk-install'] = __( 'Install', 'tgmpa' );\n        }\n      }\n\n      if ( 'install' !== $this->view_context ) {\n        if ( current_user_can( 'update_plugins' ) ) {\n          $actions['tgmpa-bulk-update'] = __( 'Update', 'tgmpa' );\n        }\n        if ( current_user_can( 'activate_plugins' ) ) {\n          $actions['tgmpa-bulk-activate'] = __( 'Activate', 'tgmpa' );\n        }\n      }\n\n      return $actions;\n    }\n\n    /**\n     * Processes bulk installation and activation actions.\n     *\n     * The bulk installation process looks for the $_POST information and passes that\n     * through if a user has to use WP_Filesystem to enter their credentials.\n     *\n     * @since 2.2.0\n     */\n    public function process_bulk_actions() {\n      // Bulk installation process.\n      if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) {\n\n        check_admin_referer( 'bulk-' . $this->_args['plural'] );\n\n        $install_type = 'install';\n        if ( 'tgmpa-bulk-update' === $this->current_action() ) {\n          $install_type = 'update';\n        }\n\n        $plugins_to_install = array();\n\n        // Did user actually select any plugins to install/update ?\n        if ( empty( $_POST['plugin'] ) ) {\n          if ( 'install' === $install_type ) {\n            $message = __( 'No plugins were selected to be installed. No action taken.', 'tgmpa' );\n          } else {\n            $message = __( 'No plugins were selected to be updated. No action taken.', 'tgmpa' );\n          }\n\n          echo '<div id=\"message\" class=\"error\"><p>', esc_html( $message ), '</p></div>';\n\n          return false;\n        }\n\n        if ( is_array( $_POST['plugin'] ) ) {\n          $plugins_to_install = (array) $_POST['plugin'];\n        } elseif ( is_string( $_POST['plugin'] ) ) {\n          // Received via Filesystem page - un-flatten array (WP bug #19643).\n          $plugins_to_install = explode( ',', $_POST['plugin'] );\n        }\n\n        // Sanitize the received input.\n        $plugins_to_install = array_map( 'urldecode', $plugins_to_install );\n        $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install );\n\n        // Validate the received input.\n        foreach ( $plugins_to_install as $key => $slug ) {\n          // Check if the plugin was registered with TGMPA and remove if not.\n          if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) {\n            unset( $plugins_to_install[ $key ] );\n            continue;\n          }\n\n          // For install: make sure this is a plugin we *can* install and not one already installed.\n          if ( 'install' === $install_type && true === $this->tgmpa->is_plugin_installed( $slug ) ) {\n            unset( $plugins_to_install[ $key ] );\n          }\n\n          // For updates: make sure this is a plugin we *can* update (update available and WP version ok).\n          if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) {\n            unset( $plugins_to_install[ $key ] );\n          }\n        }\n\n        // No need to proceed further if we have no plugins to handle.\n        if ( empty( $plugins_to_install ) ) {\n          if ( 'install' === $install_type ) {\n            $message = __( 'No plugins are available to be installed at this time.', 'tgmpa' );\n          } else {\n            $message = __( 'No plugins are available to be updated at this time.', 'tgmpa' );\n          }\n\n          echo '<div id=\"message\" class=\"error\"><p>', esc_html( $message ), '</p></div>';\n\n          return false;\n        }\n\n        // Pass all necessary information if WP_Filesystem is needed.\n        $url = wp_nonce_url(\n          $this->tgmpa->get_tgmpa_url(),\n          'bulk-' . $this->_args['plural']\n        );\n\n        // Give validated data back to $_POST which is the only place the filesystem looks for extra fields.\n        $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643.\n\n        $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.\n        $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.\n\n        if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {\n          return true; // Stop the normal page form from displaying, credential request form will be shown.\n        }\n\n        // Now we have some credentials, setup WP_Filesystem.\n        if ( ! WP_Filesystem( $creds ) ) {\n          // Our credentials were no good, ask the user for them again.\n          request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );\n\n          return true;\n        }\n\n        /* If we arrive here, we have the filesystem */\n\n        // Store all information in arrays since we are processing a bulk installation.\n        $names      = array();\n        $sources    = array(); // Needed for installs.\n        $file_paths = array(); // Needed for upgrades.\n        $to_inject  = array(); // Information to inject into the update_plugins transient.\n\n        // Prepare the data for validated plugins for the install/upgrade.\n        foreach ( $plugins_to_install as $slug ) {\n          $name   = $this->tgmpa->plugins[ $slug ]['name'];\n          $source = $this->tgmpa->get_download_url( $slug );\n\n          if ( ! empty( $name ) && ! empty( $source ) ) {\n            $names[] = $name;\n\n            switch ( $install_type ) {\n\n              case 'install':\n                $sources[] = $source;\n                break;\n\n              case 'update':\n                $file_paths[]                 = $this->tgmpa->plugins[ $slug ]['file_path'];\n                $to_inject[ $slug ]           = $this->tgmpa->plugins[ $slug ];\n                $to_inject[ $slug ]['source'] = $source;\n                break;\n            }\n          }\n        }\n        unset( $slug, $name, $source );\n\n        // Create a new instance of TGMPA_Bulk_Installer.\n        $installer = new TGMPA_Bulk_Installer(\n          new TGMPA_Bulk_Installer_Skin(\n            array(\n              'url'          => esc_url_raw( $this->tgmpa->get_tgmpa_url() ),\n              'nonce'        => 'bulk-' . $this->_args['plural'],\n              'names'        => $names,\n              'install_type' => $install_type,\n            )\n          )\n        );\n\n        // Wrap the install process with the appropriate HTML.\n        echo '<div class=\"tgmpa\">',\n          '<h2 style=\"font-size: 23px; font-weight: 400; line-height: 29px; margin: 0; padding: 9px 15px 4px 0;\">', esc_html( get_admin_page_title() ), '</h2>\n          <div class=\"update-php\" style=\"width: 100%; height: 98%; min-height: 850px; padding-top: 1px;\">';\n\n        // Process the bulk installation submissions.\n        add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );\n\n        if ( 'tgmpa-bulk-update' === $this->current_action() ) {\n          // Inject our info into the update transient.\n          $this->tgmpa->inject_update_info( $to_inject );\n\n          $installer->bulk_upgrade( $file_paths );\n        } else {\n          $installer->bulk_install( $sources );\n        }\n\n        remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 );\n\n        echo '</div></div>';\n\n        return true;\n      }\n\n      // Bulk activation process.\n      if ( 'tgmpa-bulk-activate' === $this->current_action() ) {\n        check_admin_referer( 'bulk-' . $this->_args['plural'] );\n\n        // Did user actually select any plugins to activate ?\n        if ( empty( $_POST['plugin'] ) ) {\n          echo '<div id=\"message\" class=\"error\"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'tgmpa' ), '</p></div>';\n\n          return false;\n        }\n\n        // Grab plugin data from $_POST.\n        $plugins = array();\n        if ( isset( $_POST['plugin'] ) ) {\n          $plugins = array_map( 'urldecode', (array) $_POST['plugin'] );\n          $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins );\n        }\n\n        $plugins_to_activate = array();\n        $plugin_names        = array();\n\n        // Grab the file paths for the selected & inactive plugins from the registration array.\n        foreach ( $plugins as $slug ) {\n          if ( $this->tgmpa->can_plugin_activate( $slug ) ) {\n            $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path'];\n            $plugin_names[]        = $this->tgmpa->plugins[ $slug ]['name'];\n          }\n        }\n        unset( $slug );\n\n        // Return early if there are no plugins to activate.\n        if ( empty( $plugins_to_activate ) ) {\n          echo '<div id=\"message\" class=\"error\"><p>', esc_html__( 'No plugins are available to be activated at this time.', 'tgmpa' ), '</p></div>';\n\n          return false;\n        }\n\n        // Now we are good to go - let's start activating plugins.\n        $activate = activate_plugins( $plugins_to_activate );\n\n        if ( is_wp_error( $activate ) ) {\n          echo '<div id=\"message\" class=\"error\"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>';\n        } else {\n          $count        = count( $plugin_names ); // Count so we can use _n function.\n          $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );\n          $last_plugin  = array_pop( $plugin_names ); // Pop off last name to prep for readability.\n          $imploded     = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );\n\n          printf( // WPCS: xss ok.\n            '<div id=\"message\" class=\"updated\"><p>%1$s %2$s.</p></div>',\n            esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'tgmpa' ) ),\n            $imploded\n          );\n\n          // Update recently activated plugins option.\n          $recent = (array) get_option( 'recently_activated' );\n          foreach ( $plugins_to_activate as $plugin => $time ) {\n            if ( isset( $recent[ $plugin ] ) ) {\n              unset( $recent[ $plugin ] );\n            }\n          }\n          update_option( 'recently_activated', $recent );\n        }\n\n        unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another.\n\n        return true;\n      }\n\n      return false;\n    }\n\n    /**\n     * Prepares all of our information to be outputted into a usable table.\n     *\n     * @since 2.2.0\n     */\n    public function prepare_items() {\n      $columns               = $this->get_columns(); // Get all necessary column information.\n      $hidden                = array(); // No columns to hide, but we must set as an array.\n      $sortable              = array(); // No reason to make sortable columns.\n      $primary               = $this->get_primary_column_name(); // Column which has the row actions.\n      $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers.\n\n      // Process our bulk activations here.\n      if ( 'tgmpa-bulk-activate' === $this->current_action() ) {\n        $this->process_bulk_actions();\n      }\n\n      // Store all of our plugin data into $items array so WP_List_Table can use it.\n      $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() );\n    }\n\n    /* *********** DEPRECATED METHODS *********** */\n\n    /**\n     * Retrieve plugin data, given the plugin name.\n     *\n     * @since      2.2.0\n     * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead.\n     * @see        TGM_Plugin_Activation::_get_plugin_data_from_name()\n     *\n     * @param string $name Name of the plugin, as it was registered.\n     * @param string $data Optional. Array key of plugin data to return. Default is slug.\n     * @return string|boolean Plugin slug if found, false otherwise.\n     */\n    protected function _get_plugin_data_from_name( $name, $data = 'slug' ) {\n      _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' );\n\n      return $this->tgmpa->_get_plugin_data_from_name( $name, $data );\n    }\n  }\n}\n\n\nif ( ! class_exists( 'TGM_Bulk_Installer' ) ) {\n\n  /**\n   * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+.\n   *\n   * @since 2.5.2\n   *\n   * {@internal The TGMPA_Bulk_Installer class was originally called TGM_Bulk_Installer.\n   *            For more information, see that class.}}\n   */\n  class TGM_Bulk_Installer {\n  }\n}\nif ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) {\n\n  /**\n   * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+.\n   *\n   * @since 2.5.2\n   *\n   * {@internal The TGMPA_Bulk_Installer_Skin class was originally called TGM_Bulk_Installer_Skin.\n   *            For more information, see that class.}}\n   */\n  class TGM_Bulk_Installer_Skin {\n  }\n}\n\n/**\n * The WP_Upgrader file isn't always available. If it isn't available,\n * we load it here.\n *\n * We check to make sure no action or activation keys are set so that WordPress\n * does not try to re-include the class when processing upgrades or installs outside\n * of the class.\n *\n * @since 2.2.0\n */\nadd_action( 'admin_init', 'tgmpa_load_bulk_installer' );\nif ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {\n  /**\n   * Load bulk installer\n   */\n  function tgmpa_load_bulk_installer() {\n    // Silently fail if 2.5+ is loaded *after* an older version.\n    if ( ! isset( $GLOBALS['tgmpa'] ) ) {\n      return;\n    }\n\n    // Get TGMPA class instance.\n    $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );\n\n    if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) {\n      if ( ! class_exists( 'Plugin_Upgrader', false ) ) {\n        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n      }\n\n      if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) {\n\n        /**\n         * Installer class to handle bulk plugin installations.\n         *\n         * Extends WP_Upgrader and customizes to suit the installation of multiple\n         * plugins.\n         *\n         * @since 2.2.0\n         *\n         * {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}}\n         * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer.\n         *            This was done to prevent backward compatibility issues with v2.3.6.}}\n         *\n         * @package TGM-Plugin-Activation\n         * @author  Thomas Griffin\n         * @author  Gary Jones\n         */\n        class TGMPA_Bulk_Installer extends Plugin_Upgrader {\n          /**\n           * Holds result of bulk plugin installation.\n           *\n           * @since 2.2.0\n           *\n           * @var string\n           */\n          public $result;\n\n          /**\n           * Flag to check if bulk installation is occurring or not.\n           *\n           * @since 2.2.0\n           *\n           * @var boolean\n           */\n          public $bulk = false;\n\n          /**\n           * TGMPA instance\n           *\n           * @since 2.5.0\n           *\n           * @var object\n           */\n          protected $tgmpa;\n\n          /**\n           * Whether or not the destination directory needs to be cleared ( = on update).\n           *\n           * @since 2.5.0\n           *\n           * @var bool\n           */\n          protected $clear_destination = false;\n\n          /**\n           * References parent constructor and sets defaults for class.\n           *\n           * @since 2.2.0\n           *\n           * @param \\Bulk_Upgrader_Skin|null $skin Installer skin.\n           */\n          public function __construct( $skin = null ) {\n            // Get TGMPA class instance.\n            $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );\n\n            parent::__construct( $skin );\n\n            if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) {\n              $this->clear_destination = true;\n            }\n\n            if ( $this->tgmpa->is_automatic ) {\n              $this->activate_strings();\n            }\n\n            add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) );\n          }\n\n          /**\n           * Sets the correct activation strings for the installer skin to use.\n           *\n           * @since 2.2.0\n           */\n          public function activate_strings() {\n            $this->strings['activation_failed']  = __( 'Plugin activation failed.', 'tgmpa' );\n            $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'tgmpa' );\n          }\n\n          /**\n           * Performs the actual installation of each plugin.\n           *\n           * @since 2.2.0\n           *\n           * @see WP_Upgrader::run()\n           *\n           * @param array $options The installation config options.\n           * @return null|array Return early if error, array of installation data on success.\n           */\n          public function run( $options ) {\n            $result = parent::run( $options );\n\n            // Reset the strings in case we changed one during automatic activation.\n            if ( $this->tgmpa->is_automatic ) {\n              if ( 'update' === $this->skin->options['install_type'] ) {\n                $this->upgrade_strings();\n              } else {\n                $this->install_strings();\n              }\n            }\n\n            return $result;\n          }\n\n          /**\n           * Processes the bulk installation of plugins.\n           *\n           * @since 2.2.0\n           *\n           * {@internal This is basically a near identical copy of the WP Core\n           * Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with\n           * new installs instead of upgrades.\n           * For ease of future synchronizations, the adjustments are clearly commented, but no other\n           * comments are added. Code style has been made to comply.}}\n           *\n           * @see Plugin_Upgrader::bulk_upgrade()\n           * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838\n           * (@internal Last synced: Dec 31st 2015 against https://core.trac.wordpress.org/browser/trunk?rev=36134}}\n           *\n           * @param array $plugins The plugin sources needed for installation.\n           * @param array $args    Arbitrary passed extra arguments.\n           * @return array|false   Install confirmation messages on success, false on failure.\n           */\n          public function bulk_install( $plugins, $args = array() ) {\n            // [TGMPA + ] Hook auto-activation in.\n            add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );\n\n            $defaults    = array(\n              'clear_update_cache' => true,\n            );\n            $parsed_args = wp_parse_args( $args, $defaults );\n\n            $this->init();\n            $this->bulk = true;\n\n            $this->install_strings(); // [TGMPA + ] adjusted.\n\n            /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */\n\n            /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */\n\n            $this->skin->header();\n\n            // Connect to the Filesystem first.\n            $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );\n            if ( ! $res ) {\n              $this->skin->footer();\n              return false;\n            }\n\n            $this->skin->bulk_header();\n\n            /*\n             * Only start maintenance mode if:\n             * - running Multisite and there are one or more plugins specified, OR\n             * - a plugin with an update available is currently active.\n             * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.\n             */\n            $maintenance = ( is_multisite() && ! empty( $plugins ) );\n\n            /*\n            [TGMPA - ]\n            foreach ( $plugins as $plugin )\n              $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );\n            */\n            if ( $maintenance ) {\n              $this->maintenance_mode( true );\n            }\n\n            $results = array();\n\n            $this->update_count   = count( $plugins );\n            $this->update_current = 0;\n            foreach ( $plugins as $plugin ) {\n              $this->update_current++;\n\n              /*\n              [TGMPA - ]\n              $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);\n\n              if ( !isset( $current->response[ $plugin ] ) ) {\n                $this->skin->set_result('up_to_date');\n                $this->skin->before();\n                $this->skin->feedback('up_to_date');\n                $this->skin->after();\n                $results[$plugin] = true;\n                continue;\n              }\n\n              // Get the URL to the zip file.\n              $r = $current->response[ $plugin ];\n\n              $this->skin->plugin_active = is_plugin_active($plugin);\n              */\n\n              $result = $this->run(\n                array(\n                  'package'           => $plugin, // [TGMPA + ] adjusted.\n                  'destination'       => WP_PLUGIN_DIR,\n                  'clear_destination' => false, // [TGMPA + ] adjusted.\n                  'clear_working'     => true,\n                  'is_multi'          => true,\n                  'hook_extra'        => array(\n                    'plugin' => $plugin,\n                  ),\n                )\n              );\n\n              $results[ $plugin ] = $this->result;\n\n              // Prevent credentials auth screen from displaying multiple times.\n              if ( false === $result ) {\n                break;\n              }\n            } //end foreach $plugins\n\n            $this->maintenance_mode( false );\n\n            /**\n             * Fires when the bulk upgrader process is complete.\n             *\n             * @since WP 3.6.0 / TGMPA 2.5.0\n             *\n             * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might\n             *                              be a Theme_Upgrader or Core_Upgrade instance.\n             * @param array           $data {\n             *     Array of bulk item update data.\n             *\n             *     @type string $action   Type of action. Default 'update'.\n             *     @type string $type     Type of update process. Accepts 'plugin', 'theme', or 'core'.\n             *     @type bool   $bulk     Whether the update process is a bulk update. Default true.\n             *     @type array  $packages Array of plugin, theme, or core packages to update.\n             * }\n             */\n            do_action( 'upgrader_process_complete', $this, array(\n              'action'  => 'install', // [TGMPA + ] adjusted.\n              'type'    => 'plugin',\n              'bulk'    => true,\n              'plugins' => $plugins,\n            ) );\n\n            $this->skin->bulk_footer();\n\n            $this->skin->footer();\n\n            // Cleanup our hooks, in case something else does a upgrade on this connection.\n            /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */\n\n            // [TGMPA + ] Remove our auto-activation hook.\n            remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );\n\n            // Force refresh of plugin update information.\n            wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );\n\n            return $results;\n          }\n\n          /**\n           * Handle a bulk upgrade request.\n           *\n           * @since 2.5.0\n           *\n           * @see Plugin_Upgrader::bulk_upgrade()\n           *\n           * @param array $plugins The local WP file_path's of the plugins which should be upgraded.\n           * @param array $args    Arbitrary passed extra arguments.\n           * @return string|bool Install confirmation messages on success, false on failure.\n           */\n          public function bulk_upgrade( $plugins, $args = array() ) {\n\n            add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );\n\n            $result = parent::bulk_upgrade( $plugins, $args );\n\n            remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );\n\n            return $result;\n          }\n\n          /**\n           * Abuse a filter to auto-activate plugins after installation.\n           *\n           * Hooked into the 'upgrader_post_install' filter hook.\n           *\n           * @since 2.5.0\n           *\n           * @param bool $bool The value we need to give back (true).\n           * @return bool\n           */\n          public function auto_activate( $bool ) {\n            // Only process the activation of installed plugins if the automatic flag is set to true.\n            if ( $this->tgmpa->is_automatic ) {\n              // Flush plugins cache so the headers of the newly installed plugins will be read correctly.\n              wp_clean_plugins_cache();\n\n              // Get the installed plugin file.\n              $plugin_info = $this->plugin_info();\n\n              // Don't try to activate on upgrade of active plugin as WP will do this already.\n              if ( ! is_plugin_active( $plugin_info ) ) {\n                $activate = activate_plugin( $plugin_info );\n\n                // Adjust the success string based on the activation result.\n                $this->strings['process_success'] = $this->strings['process_success'] . \"<br />\\n\";\n\n                if ( is_wp_error( $activate ) ) {\n                  $this->skin->error( $activate );\n                  $this->strings['process_success'] .= $this->strings['activation_failed'];\n                } else {\n                  $this->strings['process_success'] .= $this->strings['activation_success'];\n                }\n              }\n            }\n\n            return $bool;\n          }\n        }\n      }\n\n      if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) {\n\n        /**\n         * Installer skin to set strings for the bulk plugin installations..\n         *\n         * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple\n         * plugins.\n         *\n         * @since 2.2.0\n         *\n         * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to\n         *            TGMPA_Bulk_Installer_Skin.\n         *            This was done to prevent backward compatibility issues with v2.3.6.}}\n         *\n         * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php\n         *\n         * @package TGM-Plugin-Activation\n         * @author  Thomas Griffin\n         * @author  Gary Jones\n         */\n        class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin {\n          /**\n           * Holds plugin info for each individual plugin installation.\n           *\n           * @since 2.2.0\n           *\n           * @var array\n           */\n          public $plugin_info = array();\n\n          /**\n           * Holds names of plugins that are undergoing bulk installations.\n           *\n           * @since 2.2.0\n           *\n           * @var array\n           */\n          public $plugin_names = array();\n\n          /**\n           * Integer to use for iteration through each plugin installation.\n           *\n           * @since 2.2.0\n           *\n           * @var integer\n           */\n          public $i = 0;\n\n          /**\n           * TGMPA instance\n           *\n           * @since 2.5.0\n           *\n           * @var object\n           */\n          protected $tgmpa;\n\n          /**\n           * Constructor. Parses default args with new ones and extracts them for use.\n           *\n           * @since 2.2.0\n           *\n           * @param array $args Arguments to pass for use within the class.\n           */\n          public function __construct( $args = array() ) {\n            // Get TGMPA class instance.\n            $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );\n\n            // Parse default and new args.\n            $defaults = array(\n              'url'          => '',\n              'nonce'        => '',\n              'names'        => array(),\n              'install_type' => 'install',\n            );\n            $args     = wp_parse_args( $args, $defaults );\n\n            // Set plugin names to $this->plugin_names property.\n            $this->plugin_names = $args['names'];\n\n            // Extract the new args.\n            parent::__construct( $args );\n          }\n\n          /**\n           * Sets install skin strings for each individual plugin.\n           *\n           * Checks to see if the automatic activation flag is set and uses the\n           * the proper strings accordingly.\n           *\n           * @since 2.2.0\n           */\n          public function add_strings() {\n            if ( 'update' === $this->options['install_type'] ) {\n              parent::add_strings();\n              /* translators: 1: plugin name, 2: action number 3: total number of actions. */\n              $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );\n            } else {\n              /* translators: 1: plugin name, 2: error message. */\n              $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa' );\n              /* translators: 1: plugin name. */\n              $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'tgmpa' );\n\n              if ( $this->tgmpa->is_automatic ) {\n                // Automatic activation strings.\n                $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );\n                /* translators: 1: plugin name. */\n                $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'tgmpa' ) . ' <a href=\"#\" class=\"hide-if-no-js\" onclick=\"%2$s\"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class=\"hidden\">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';\n                $this->upgrader->strings['skin_upgrade_end']       = __( 'All installations and activations have been completed.', 'tgmpa' );\n                /* translators: 1: plugin name, 2: action number 3: total number of actions. */\n                $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );\n              } else {\n                // Default installation strings.\n                $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );\n                /* translators: 1: plugin name. */\n                $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'tgmpa' ) . ' <a href=\"#\" class=\"hide-if-no-js\" onclick=\"%2$s\"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class=\"hidden\">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';\n                $this->upgrader->strings['skin_upgrade_end']       = __( 'All installations have been completed.', 'tgmpa' );\n                /* translators: 1: plugin name, 2: action number 3: total number of actions. */\n                $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' );\n              }\n            }\n          }\n\n          /**\n           * Outputs the header strings and necessary JS before each plugin installation.\n           *\n           * @since 2.2.0\n           *\n           * @param string $title Unused in this implementation.\n           */\n          public function before( $title = '' ) {\n            if ( empty( $title ) ) {\n              $title = esc_html( $this->plugin_names[ $this->i ] );\n            }\n            parent::before( $title );\n          }\n\n          /**\n           * Outputs the footer strings and necessary JS after each plugin installation.\n           *\n           * Checks for any errors and outputs them if they exist, else output\n           * success strings.\n           *\n           * @since 2.2.0\n           *\n           * @param string $title Unused in this implementation.\n           */\n          public function after( $title = '' ) {\n            if ( empty( $title ) ) {\n              $title = esc_html( $this->plugin_names[ $this->i ] );\n            }\n            parent::after( $title );\n\n            $this->i++;\n          }\n\n          /**\n           * Outputs links after bulk plugin installation is complete.\n           *\n           * @since 2.2.0\n           */\n          public function bulk_footer() {\n            // Serve up the string to say installations (and possibly activations) are complete.\n            parent::bulk_footer();\n\n            // Flush plugins cache so we can make sure that the installed plugins list is always up to date.\n            wp_clean_plugins_cache();\n\n            $this->tgmpa->show_tgmpa_version();\n\n            // Display message based on if all plugins are now active or not.\n            $update_actions = array();\n\n            if ( $this->tgmpa->is_tgmpa_complete() ) {\n              // All plugins are active, so we display the complete string and hide the menu to protect users.\n              echo '<style type=\"text/css\">#adminmenu .wp-submenu li.current { display: none !important; }</style>';\n              $update_actions['dashboard'] = sprintf(\n                esc_html( $this->tgmpa->strings['complete'] ),\n                '<a href=\"' . esc_url( self_admin_url() ) . '\">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>'\n              );\n            } else {\n              $update_actions['tgmpa_page'] = '<a href=\"' . esc_url( $this->tgmpa->get_tgmpa_url() ) . '\" target=\"_parent\">' . esc_html( $this->tgmpa->strings['return'] ) . '</a>';\n            }\n\n            /**\n             * Filter the list of action links available following bulk plugin installs/updates.\n             *\n             * @since 2.5.0\n             *\n             * @param array $update_actions Array of plugin action links.\n             * @param array $plugin_info    Array of information for the last-handled plugin.\n             */\n            $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );\n\n            if ( ! empty( $update_actions ) ) {\n              $this->feedback( implode( ' | ', (array) $update_actions ) );\n            }\n          }\n\n          /* *********** DEPRECATED METHODS *********** */\n\n          /**\n           * Flush header output buffer.\n           *\n           * @since      2.2.0\n           * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead\n           * @see        Bulk_Upgrader_Skin::flush_output()\n           */\n          public function before_flush_output() {\n            _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );\n            $this->flush_output();\n          }\n\n          /**\n           * Flush footer output buffer and iterate $this->i to make sure the\n           * installation strings reference the correct plugin.\n           *\n           * @since      2.2.0\n           * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead\n           * @see        Bulk_Upgrader_Skin::flush_output()\n           */\n          public function after_flush_output() {\n            _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );\n            $this->flush_output();\n            $this->i++;\n          }\n        }\n      }\n    }\n  }\n}\n\nif ( ! class_exists( 'TGMPA_Utils' ) ) {\n\n  /**\n   * Generic utilities for TGMPA.\n   *\n   * All methods are static, poor-dev name-spacing class wrapper.\n   *\n   * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy.\n   *\n   * @since 2.5.0\n   *\n   * @package TGM-Plugin-Activation\n   * @author  Juliette Reinders Folmer\n   */\n  class TGMPA_Utils {\n    /**\n     * Whether the PHP filter extension is enabled.\n     *\n     * @see http://php.net/book.filter\n     *\n     * @since 2.5.0\n     *\n     * @static\n     *\n     * @var bool $has_filters True is the extension is enabled.\n     */\n    public static $has_filters;\n\n    /**\n     * Wrap an arbitrary string in <em> tags. Meant to be used in combination with array_map().\n     *\n     * @since 2.5.0\n     *\n     * @static\n     *\n     * @param string $string Text to be wrapped.\n     * @return string\n     */\n    public static function wrap_in_em( $string ) {\n      return '<em>' . wp_kses_post( $string ) . '</em>';\n    }\n\n    /**\n     * Wrap an arbitrary string in <strong> tags. Meant to be used in combination with array_map().\n     *\n     * @since 2.5.0\n     *\n     * @static\n     *\n     * @param string $string Text to be wrapped.\n     * @return string\n     */\n    public static function wrap_in_strong( $string ) {\n      return '<strong>' . wp_kses_post( $string ) . '</strong>';\n    }\n\n    /**\n     * Helper function: Validate a value as boolean\n     *\n     * @since 2.5.0\n     *\n     * @static\n     *\n     * @param mixed $value Arbitrary value.\n     * @return bool\n     */\n    public static function validate_bool( $value ) {\n      if ( ! isset( self::$has_filters ) ) {\n        self::$has_filters = extension_loaded( 'filter' );\n      }\n\n      if ( self::$has_filters ) {\n        return filter_var( $value, FILTER_VALIDATE_BOOLEAN );\n      } else {\n        return self::emulate_filter_bool( $value );\n      }\n    }\n\n    /**\n     * Helper function: Cast a value to bool\n     *\n     * @since 2.5.0\n     *\n     * @static\n     *\n     * @param mixed $value Value to cast.\n     * @return bool\n     */\n    protected static function emulate_filter_bool( $value ) {\n      // @codingStandardsIgnoreStart\n      static $true  = array(\n        '1',\n        'true', 'True', 'TRUE',\n        'y', 'Y',\n        'yes', 'Yes', 'YES',\n        'on', 'On', 'ON',\n      );\n      static $false = array(\n        '0',\n        'false', 'False', 'FALSE',\n        'n', 'N',\n        'no', 'No', 'NO',\n        'off', 'Off', 'OFF',\n      );\n      // @codingStandardsIgnoreEnd\n\n      if ( is_bool( $value ) ) {\n        return $value;\n      } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {\n        return (bool) $value;\n      } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {\n        return (bool) $value;\n      } elseif ( is_string( $value ) ) {\n        $value = trim( $value );\n        if ( in_array( $value, $true, true ) ) {\n          return true;\n        } elseif ( in_array( $value, $false, true ) ) {\n          return false;\n        } else {\n          return false;\n        }\n      }\n\n      return false;\n    }\n  } // End of class TGMPA_Utils\n} // End of class_exists wrapper"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-countdown.php",
    "content": "<?php\n/**\n * Countdown Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Countdown\n * @version     0.7\n */\nclass SP_Shortcode_Countdown {\n\n\t/**\n\t * Output the countdown shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'countdown.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-blocks.php",
    "content": "<?php\n/**\n * Event Blocks Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Blocks\n * @version     0.8\n */\nclass SP_Shortcode_Event_Blocks {\n\n\t/**\n\t * Output the event blocks shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-blocks.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-calendar.php",
    "content": "<?php\n/**\n * Event Calendar Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Calendar\n * @version     0.7\n */\nclass SP_Shortcode_Event_Calendar {\n\n\t/**\n\t * Output the event calendar shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-calendar.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-details.php",
    "content": "<?php\n/**\n * Event Details Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Details\n * @version     0.8\n */\nclass SP_Shortcode_Event_Details {\n\n\t/**\n\t * Output the event details shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-details.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-full.php",
    "content": "<?php\n/**\n * Event Full info Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Full\n * @version     2.6.9\n */\nclass SP_Shortcode_Event_Full {\n\n\t/**\n\t * Output the event full shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\t$type = 'event';\n\n\t\t$content = apply_filters( 'the_content', get_post_field( 'post_content', $atts['id'] ) );\n\n\t\t// Get layout setting\n\t\t$layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );\n\n\t\t// Get templates\n\t\t$templates = SP()->templates->$type;\n\n\t\t// Combine layout setting with available templates\n\t\t$templates = array_merge( array_flip( $layout ), $templates );\n\n\t\t$templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );\n\n\t\t// Split templates into sections and tabs\n\t\t$slice = array_search( 'tabs', array_keys( $templates ) );\n\t\tif ( $slice ) {\n\t\t\t$section_templates = array_slice( $templates, 0, $slice );\n\t\t\t$tab_templates     = array_slice( $templates, $slice );\n\t\t} else {\n\t\t\t$section_templates = $templates;\n\t\t\t$tab_templates     = array();\n\t\t}\n\n\t\tob_start();\n\n\t\t// Before template hook\n\t\tdo_action( 'sportspress_before_single_' . $type );\n\n\t\t// Loop through sections\n\t\tif ( ! empty( $section_templates ) ) {\n\t\t\tforeach ( $section_templates as $key => $template ) {\n\t\t\t\t// Ignore templates that are unavailable or that have been turned off\n\t\t\t\tif ( ! is_array( $template ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $template['option'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Render the template\n\t\t\t\techo '<div class=\"sp-section-content sp-section-content-' . esc_attr( $key ) . '\">';\n\t\t\t\tif ( 'content' === $key ) {\n\t\t\t\t\techo wp_kses_post( $content );\n\t\t\t\t\t// Template content hook\n\t\t\t\t\tdo_action( 'sportspress_single_' . $type . '_content' );\n\t\t\t\t} elseif ( 'excerpt' === $key ) {\n\t\t\t\t\tsp_get_template( 'post-excerpt.php', $atts );\n\t\t\t\t} else {\n\t\t\t\t\t// call_user_func( $template['action'] );\n\t\t\t\t\tsp_get_template( 'event-' . $key . '.php', $atts );\n\t\t\t\t}\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t}\n\n\t\t// After template hook\n\t\tdo_action( 'sportspress_after_single_' . $type );\n\n\t\t$ob = ob_get_clean();\n\n\t\t$tabs = '';\n\n\t\tif ( ! empty( $tab_templates ) ) {\n\t\t\t$i           = 0;\n\t\t\t$tab_content = '';\n\n\t\t\tforeach ( $tab_templates as $key => $template ) {\n\t\t\t\t// Ignore templates that are unavailable or that have been turned off\n\t\t\t\tif ( ! is_array( $template ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $template['option'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Put tab content into buffer\n\t\t\t\tob_start();\n\t\t\t\tif ( 'content' === $key ) {\n\t\t\t\t\techo wp_kses_post( $content );\n\t\t\t\t\t// Template content hook\n\t\t\t\t\tdo_action( 'sportspress_single_' . $type . '_content' );\n\t\t\t\t} elseif ( 'excerpt' === $key ) {\n\t\t\t\t\tsp_get_template( 'post-excerpt.php', $atts );\n\t\t\t\t} else {\n\t\t\t\t\t// call_user_func( $template['action'] );\n\t\t\t\t\tsp_get_template( 'event-' . $key . '.php', $atts );\n\t\t\t\t}\n\t\t\t\t$buffer = ob_get_clean();\n\n\t\t\t\t// Trim whitespace from buffer\n\t\t\t\t$buffer = trim( $buffer );\n\n\t\t\t\t// Continue if tab content is empty\n\t\t\t\tif ( empty( $buffer ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Get template label\n\t\t\t\t$label = sp_array_value( $template, 'label', $template['title'] );\n\n\t\t\t\t// Add to tabs\n\t\t\t\t$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>';\n\n\t\t\t\t// Render the template\n\t\t\t\t$tab_content .= '<div class=\"sp-tab-content sp-tab-content-' . $key . '\" id=\"sp-tab-content-' . $key . '\"' . ( 0 === $i ? ' style=\"display: block;\"' : '' ) . '>' . $buffer . '</div>';\n\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$ob .= '<div class=\"sp-tab-group\">';\n\n\t\t\tif ( ! empty( $tabs ) ) {\n\t\t\t\t$ob .= '<ul class=\"sp-tab-menu\">' . $tabs . '</ul>';\n\t\t\t}\n\n\t\t\t$ob .= $tab_content;\n\n\t\t\t$ob .= '</div>';\n\t\t}\n\n\t\t// Add all the native allowed html tags\n\t\t$allowed_html = wp_kses_allowed_html( 'post' );\n\t\t// Include script as allowed tag\n\t\t$allowed_html['script'] = array();\n\t\t// Include iframe as allowed tag\n\t\t$allowed_html['iframe'] = array(\n\t\t\t\t\t\t\t\t\t'src'             => array(),\n\t\t\t\t\t\t\t\t\t'height'          => array(),\n\t\t\t\t\t\t\t\t\t'width'           => array(),\n\t\t\t\t\t\t\t\t\t'allow'           => array(),\n\t\t\t\t\t\t\t\t\t'title'           => array(),\n\t\t\t\t\t\t\t\t\t'frameborder'     => array(),\n\t\t\t\t\t\t\t\t\t'allowfullscreen' => array(),\n\t\t\t\t\t\t\t\t);\n\t\techo wp_kses( $ob, $allowed_html );\n\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-list.php",
    "content": "<?php\n/**\n * Event List Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_List\n * @version     0.7\n */\nclass SP_Shortcode_Event_List {\n\n\t/**\n\t * Output the event list shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-list.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-officials.php",
    "content": "<?php\n/**\n * Event Officials Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Officials\n * @version     2.6.9\n */\nclass SP_Shortcode_Event_Officials {\n\n\t/**\n\t * Output the event officials shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-officials.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-performance.php",
    "content": "<?php\n/**\n * Event Performance Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Performance\n * @version     0.8\n */\nclass SP_Shortcode_Event_Performance {\n\n\t/**\n\t * Output the event performance shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-performance.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-results.php",
    "content": "<?php\n/**\n * Event Results Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Results\n * @version     0.8\n */\nclass SP_Shortcode_Event_Results {\n\n\t/**\n\t * Output the event results shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-results.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-teams.php",
    "content": "<?php\n/**\n * Event Teams Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Officials\n * @version     2.6.9\n */\nclass SP_Shortcode_Event_Teams {\n\n\t/**\n\t * Output the event teams shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-logos.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-event-venue.php",
    "content": "<?php\n/**\n * Event Venue Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Event_Venue\n * @version     2.6.9\n */\nclass SP_Shortcode_Event_Venue {\n\n\t/**\n\t * Output the event venue shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'event-venue.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-league-table.php",
    "content": "<?php\n/**\n * League Table Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/League_Table\n * @version     0.7\n */\nclass SP_Shortcode_League_Table {\n\n\t/**\n\t * Output the league table shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'league-table.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-player-details.php",
    "content": "<?php\n/**\n * Player Details Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Player_Details\n * @version     1.4.7\n */\nclass SP_Shortcode_Player_Details {\n\n\t/**\n\t * Output the player details shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'player-photo.php', $atts );\n\t\tsp_get_template( 'player-details.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-player-gallery.php",
    "content": "<?php\n/**\n * Player Gallery Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Player_Gallery\n * @version     0.7\n */\nclass SP_Shortcode_Player_Gallery {\n\n\t/**\n\t * Output the player gallery shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'player-gallery.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-player-list.php",
    "content": "<?php\n/**\n * Player List Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Player_List\n * @version     0.7\n */\nclass SP_Shortcode_Player_List {\n\n\t/**\n\t * Output the player list shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'player-list.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-player-statistics.php",
    "content": "<?php\n/**\n * Player Statistics Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Player_Statistics\n * @version     1.2\n */\nclass SP_Shortcode_Player_Statistics {\n\n\t/**\n\t * Output the player statistics shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'player-statistics.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-staff-profile.php",
    "content": "<?php\n/**\n * Staff Profile Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Staff\n * @version     2.7.23\n */\nclass SP_Shortcode_Staff_Profile {\n\n\t/**\n\t * Output the staff shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'staff-header.php', $atts );\n\t\tsp_get_template( 'staff-photo.php', $atts );\n\t\tsp_get_template( 'staff-details.php', $atts );\n\t\tsp_get_template( 'staff-excerpt.php', $atts );\n\t\tsp_get_template( 'staff-content.php', $atts );\n\n\t\t/**\n\t\t * Action hook to allow loading additional templates or content.\n\t\t *\n\t\t * @param array $atts Shortcode attributes.\n\t\t */\n\t\tdo_action( 'sp_staff_profile_after_templates', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-staff.php",
    "content": "<?php\n/**\n * Staff Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Staff\n * @version   2.5.5\n */\nclass SP_Shortcode_Staff {\n\n\t/**\n\t * Output the staff shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'staff-photo.php', $atts );\n\t\tsp_get_template( 'staff-details.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/shortcodes/class-sp-shortcode-team-gallery.php",
    "content": "<?php\n/**\n * Team Gallery Shortcode\n *\n * @author      ThemeBoy\n * @category    Shortcodes\n * @package     SportsPress/Shortcodes/Team_Gallery\n * @version   2.4\n */\nclass SP_Shortcode_Team_Gallery {\n\n\t/**\n\t * Output the team gallery shortcode.\n\t *\n\t * @param array $atts\n\t */\n\tpublic static function output( $atts ) {\n\n\t\tif ( ! isset( $atts['id'] ) && isset( $atts[0] ) && is_numeric( $atts[0] ) ) {\n\t\t\t$atts['id'] = $atts[0];\n\t\t}\n\n\t\tsp_get_template( 'team-gallery.php', $atts );\n\t}\n}\n"
  },
  {
    "path": "includes/sp-api-functions.php",
    "content": "<?php\n/**\n * SportsPress API Functions\n *\n * API functions for admin and front-end templates.\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     SportsPress/Functions\n * @version     2.7.26\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/*\n * General functions\n */\n\nfunction sp_post_exists( $post = 0 ) {\n\treturn is_string( get_post_status( $post ) );\n}\n\nfunction sp_get_time( $post = 0, $format = null ) {\n\tif ( null == $format ) {\n\t\t$format = get_option( 'time_format' );\n\t}\n\treturn get_post_time( $format, false, $post, true );\n}\n\nfunction sp_the_time( $post = 0, $format = null ) {\n\techo wp_kses_post( sp_get_time( $post, $format ) );\n}\n\nfunction sp_get_date( $post = 0, $format = null ) {\n\tif ( null == $format ) {\n\t\t$format = get_option( 'date_format' );\n\t}\n\treturn get_post_time( $format, false, $post, true );\n}\n\nfunction sp_the_date( $post = 0, $format = null ) {\n\techo wp_kses_post( sp_get_date( $post, $format ) );\n}\n\nfunction sp_get_posts( $post_type = 'post', $args = array() ) {\n\t$args = array_merge(\n\t\tarray(\n\t\t\t'post_type'      => $post_type,\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t),\n\t\t$args\n\t);\n\treturn get_posts( $args );\n}\n\nfunction sp_get_leagues( $post = 0, $ids = true ) {\n\t$terms = get_the_terms( $post, 'sp_league' );\n\tif ( $terms && $ids ) {\n\t\t$terms = wp_list_pluck( $terms, 'term_id' );\n\t}\n\treturn $terms;\n}\n\nfunction sp_get_seasons( $post = 0, $ids = true ) {\n\t$terms = get_the_terms( $post, 'sp_season' );\n\tif ( $terms && $ids ) {\n\t\t$terms = wp_list_pluck( $terms, 'term_id' );\n\t}\n\treturn $terms;\n}\n\nfunction sp_the_leagues( $post = 0, $delimiter = ', ' ) {\n\t$terms = sp_get_leagues( $post, false );\n\t$arr   = array();\n\tif ( $terms ) {\n\t\tforeach ( $terms as $term ) :\n\t\t\t$arr[] = $term->name;\n\t\tendforeach;\n\t}\n\techo wp_kses_post( implode( $delimiter, $arr ) );\n}\n\nfunction sp_the_seasons( $post = 0, $delimiter = ', ' ) {\n\t$terms = sp_get_seasons( $post, false );\n\t$arr   = array();\n\tif ( $terms ) {\n\t\tforeach ( $terms as $term ) :\n\t\t\t$arr[] = $term->name;\n\t\tendforeach;\n\t}\n\techo wp_kses_post( implode( $delimiter, $arr ) );\n}\n\n/**\n * Retrieve a post object by exact title for any post type.\n *\n * This function replaces the deprecated get_page_by_title() call by running a WP_Query\n * that looks for an exact match on post_title within the specified post type(s).\n *\n * @param string          $title       The exact post title to search for.\n * @param string|string[] $post_types  Post type slug (or array of slugs) to search in.\n * @param string|string[] $post_status Post status or array of statuses to include. Default 'publish'.\n * @return WP_Post|null   WP_Post object if found; null otherwise.\n */\nfunction sp_get_post_by_title( $title, $post_types, $post_status = 'publish' ) {\n\t// If the input $title came from a source that applied magic‐quotes, reverse it.\n\t$post_title = wp_unslash( $title );\n\n\t// Force $post_types and $post_status into arrays so WP_Query accepts them.\n\t$post_type_arg   = (array) $post_types;\n\t$post_status_arg = (array) $post_status;\n\n\t// Build query args. We're matching post_title exactly via 'title' (available since WP 4.4).\n\t$args = array(\n\t\t'post_type'              => $post_type_arg,       // Query one or more post types.\n\t\t'post_status'            => $post_status_arg,     // Query one or more statuses.\n\t\t'posts_per_page'         => 1,                    // Only need one match.\n\t\t'no_found_rows'          => true,                 // Skip pagination count for performance.\n\t\t'ignore_sticky_posts'    => true,                 // Not relevant, but good practice.\n\t\t'update_post_term_cache' => false,                // Skip term cache—unneeded here.\n\t\t'update_post_meta_cache' => false,                // Skip meta cache—unneeded here.\n\t\t'title'                  => $post_title,          // Exact title match.\n\t\t'orderby'                => 'post_date ID',       // Ensure deterministic ordering.\n\t\t'order'                  => 'ASC',\n\t);\n\n\t// Execute the query.\n\t$query = new WP_Query( $args );\n\n\t// If a post is found, grab it; otherwise $query->posts will be empty.\n\tif ( $query->have_posts() ) {\n\t\t$post_obj = $query->posts[0];\n\t\twp_reset_postdata(); // Reset global $post if it was changed by WP_Query.\n\t\treturn $post_obj;\n\t}\n\n\t// No match—reset global state and return null.\n\twp_reset_postdata();\n\treturn null;\n}\n\n/*\n * Event functions\n */\n\nfunction sp_get_status( $post = 0 ) {\n\t$event = new SP_Event( $post );\n\treturn $event->status();\n}\n\nfunction sp_get_results( $post = 0 ) {\n\t$event = new SP_Event( $post );\n\treturn $event->results();\n}\n\nfunction sp_get_teams( $post = 0 ) {\n\treturn get_post_meta( $post, 'sp_team' );\n}\n\nfunction sp_get_main_result_option() {\n\t$main_result = get_option( 'sportspress_primary_result', null );\n\tif ( $main_result ) {\n\t\treturn $main_result;\n\t}\n\t$results = get_posts(\n\t\tarray(\n\t\t\t'post_type'      => 'sp_result',\n\t\t\t'posts_per_page' => 1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'DESC',\n\t\t)\n\t);\n\tif ( ! $results ) {\n\t\treturn null;\n\t}\n\t$result = reset( $results );\n\t$slug   = $result->post_name;\n\treturn $slug;\n}\n\nfunction sp_get_main_results( $post = 0 ) {\n\t$event = new SP_Event( $post );\n\treturn $event->main_results();\n}\n\nfunction sp_the_main_results( $post = 0, $delimiter = '-' ) {\n\t$results = sp_get_main_results( $post );\n\techo wp_kses_post( implode( $delimiter, $results ) );\n}\n\nfunction sp_update_main_results( $post = 0, $results = array() ) {\n\t$event = new SP_Event( $post );\n\treturn $event->update_main_results( $results );\n}\n\nfunction sp_get_main_results_or_time( $post = 0 ) {\n\t$results = sp_get_main_results( $post );\n\tif ( sizeof( $results ) ) {\n\t\treturn $results;\n\t} else {\n\t\treturn array( sp_get_time( $post ) );\n\t}\n}\n\nfunction sp_the_main_results_or_time( $post = 0, $delimiter = '-' ) {\n\techo wp_kses_post( implode( $delimiter, sp_get_main_results_or_time( $post ) ) );\n}\n\nfunction sp_get_main_results_or_date( $post = 0, $format = null ) {\n\t$results = sp_get_main_results( $post );\n\tif ( sizeof( $results ) ) {\n\t\treturn $results;\n\t} else {\n\t\treturn array( sp_get_date( $post, $format ) );\n\t}\n}\n\nfunction sp_get_outcome( $post = 0 ) {\n\t$event = new SP_Event( $post );\n\treturn $event->outcome( true );\n}\n\nfunction sp_get_outcomes( $post = 0 ) {\n\t$event = new SP_Event( $post );\n\treturn $event->outcome( false );\n}\n\nfunction sp_get_winner( $post = 0 ) {\n\t$event = new SP_Event( $post );\n\treturn $event->winner();\n}\n\nfunction sp_get_main_performance_option() {\n\t$main_performance = get_option( 'sportspress_primary_performance', null );\n\tif ( $main_performance ) {\n\t\treturn $main_performance;\n\t}\n\t$options = get_posts(\n\t\tarray(\n\t\t\t'post_type'      => 'sp_performance',\n\t\t\t'posts_per_page' => 1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t)\n\t);\n\tif ( ! $options ) {\n\t\treturn null;\n\t}\n\t$performance = reset( $options );\n\t$slug        = $performance->post_name;\n\treturn $slug;\n}\n\nfunction sp_get_performance( $post = 0 ) {\n\t$event = new SP_Event( $post );\n\treturn $event->performance();\n}\n\nfunction sp_get_singular_name( $post = 0 ) {\n\t$singular = get_post_meta( $post, 'sp_singular', true );\n\tif ( $singular && '' !== $singular ) {\n\t\treturn $singular;\n\t} else {\n\t\treturn get_the_title( $post );\n\t}\n}\n\nfunction sp_event_logos( $post = 0 ) {\n\tsp_get_template( 'event-logos.php', array( 'id' => $post ) );\n}\n\nfunction sp_event_video( $post = 0 ) {\n\tsp_get_template( 'event-video.php', array( 'id' => $post ) );\n}\n\nfunction sp_event_results( $post = 0 ) {\n\tsp_get_template( 'event-results.php', array( 'id' => $post ) );\n}\n\nfunction sp_event_details( $post = 0 ) {\n\tsp_get_template( 'event-details.php', array( 'id' => $post ) );\n}\n\nfunction sp_event_venue( $post = 0 ) {\n\tsp_get_template( 'event-venue.php', array( 'id' => $post ) );\n}\n\nfunction sp_event_staff( $post = 0 ) {\n\tsp_get_template( 'event-staff.php', array( 'id' => $post ) );\n}\n\nfunction sp_event_performance( $post = 0 ) {\n\tsp_get_template( 'event-performance.php', array( 'id' => $post ) );\n}\n\n/*\n * Calendar functions\n */\n\nfunction sp_get_calendar( $post = 0 ) {\n\t$calendar = new SP_Calendar( $post );\n\treturn $calendar->data();\n}\n\nfunction sp_event_calendar( $post = 0 ) {\n\tsp_get_template( 'event-calendar.php', array( 'id' => $post ) );\n}\n\nfunction sp_event_list( $post = 0 ) {\n\tsp_get_template( 'event-list.php', array( 'id' => $post ) );\n}\n\nfunction sp_event_blocks( $post = 0 ) {\n\tsp_get_template( 'event-blocks.php', array( 'id' => $post ) );\n}\n\n/*\n * Team functions\n */\n\nfunction sp_has_logo( $post = 0 ) {\n\treturn has_post_thumbnail( $post );\n}\n\nfunction sp_get_logo( $post = 0, $size = 'icon', $attr = array() ) {\n\treturn get_the_post_thumbnail( $post, 'sportspress-fit-' . $size, $attr );\n}\n\nfunction sp_get_logo_url( $post = 0, $size = 'icon' ) {\n\t$thumbnail_id = get_post_thumbnail_id( $post );\n\t$src          = wp_get_attachment_image_src( $thumbnail_id, $size, false );\n\treturn $src[0];\n}\n\nfunction sp_get_abbreviation( $post = 0 ) {\n\treturn get_post_meta( $post, 'sp_abbreviation', true );\n}\n\nfunction sp_get_venues( $post = 0, $ids = true ) {\n\t$terms = get_the_terms( $post, 'sp_venue' );\n\tif ( $terms && $ids ) {\n\t\t$terms = wp_list_pluck( $terms, 'term_id' );\n\t}\n\treturn $terms;\n}\n\nfunction sp_the_venues( $post = 0, $delimiter = ', ' ) {\n\t$terms = sp_get_venues( $post, false );\n\t$arr   = array();\n\tif ( $terms ) {\n\t\tforeach ( $terms as $term ) :\n\t\t\t$arr[] = $term->name;\n\t\tendforeach;\n\t}\n\techo wp_kses_post( implode( $delimiter, $arr ) );\n}\n\nfunction sp_is_home_venue( $post = 0, $event = 0 ) {\n\t$pv = sp_get_venues( $post );\n\t$ev = sp_get_venues( $event );\n\tif ( is_array( $pv ) && is_array( $ev ) && sizeof( array_intersect( $pv, $ev ) ) ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}\n\nfunction sp_the_logo( $post = 0, $size = 'icon', $attr = array() ) {\n\techo wp_kses_post( sp_get_logo( $post, $size, $attr ) );\n}\n\nfunction sp_team_logo( $post = 0 ) {\n\tsp_get_template( 'team-logo.php', array( 'id' => $post ) );\n}\n\nfunction sp_team_abbreviation( $post = 0, $forced = false ) {\n\t$abbreviation = get_post_meta( $post, 'sp_abbreviation', true );\n\tif ( $abbreviation ) {\n\t\treturn $abbreviation;\n\t} else {\n\t\treturn $forced ? sp_substr( sp_strtoupper( sp_team_short_name( $post ) ), 0, 3 ) : sp_team_short_name( $post );\n\t}\n}\n\nfunction sp_the_abbreviation( $post = 0, $forced = false ) {\n\techo wp_kses_post( sp_team_abbreviation( $post, $forced ) );\n}\n\nfunction sp_team_short_name( $post = 0 ) {\n\t$short_name = get_post_meta( $post, 'sp_short_name', true );\n\tif ( $short_name ) {\n\t\treturn $short_name;\n\t} else {\n\t\treturn get_the_title( $post );\n\t}\n}\n\nfunction sp_the_short_name( $post = 0 ) {\n\techo wp_kses_post( sp_team_short_name( $post ) );\n}\n\nfunction sp_team_name( $post = 0, $length = 'full' ) {\n\tif ( 'abbreviation' == $length ) {\n\t\treturn sp_team_abbreviation( $post );\n\t} elseif ( 'short' == $length ) {\n\t\treturn sp_team_short_name( $post );\n\t} else {\n\t\treturn get_the_title( $post );\n\t}\n}\n\nfunction sp_team_details( $post = 0 ) {\n\tsp_get_template( 'team-details.php', array( 'id' => $post ) );\n}\n\nfunction sp_team_link( $post = 0 ) {\n\tsp_get_template( 'team-link.php', array( 'id' => $post ) );\n}\n\nfunction sp_team_lists( $post = 0 ) {\n\tsp_get_template( 'team-lists.php', array( 'id' => $post ) );\n}\n\nfunction sp_team_tables( $post = 0 ) {\n\tsp_get_template( 'team-tables.php', array( 'id' => $post ) );\n}\n\n/*\n * League Table functions\n */\n\nfunction sp_get_table( $post = 0 ) {\n\t$table = new SP_League_Table( $post );\n\treturn $table->data();\n}\n\nfunction sp_league_table( $post = 0 ) {\n\tsp_get_template( 'league-table.php', array( 'id' => $post ) );\n}\n\n/*\n * Player functions\n */\n\nfunction sp_get_player_number( $post = 0 ) {\n\treturn get_post_meta( $post, 'sp_number', true );\n}\n\nfunction sp_get_player_number_in_event( $player_id, $team_id, $event_id ) {\n\t$event_players = get_post_meta( $event_id, 'sp_players', true );\n\tif ( ! array_key_exists( $team_id, $event_players ) ) {\n\t\treturn;\n\t}\n\tif ( ! array_key_exists( $player_id, $event_players[ $team_id ] ) ) {\n\t\treturn;\n\t}\n\treturn $event_players[ $team_id ][ $player_id ]['number'];\n}\n\nfunction sp_get_player_number_in_event_or_profile( $player_id, $team_id, $event_id ) {\n\t$number = sp_get_player_number_in_event( $player_id, $team_id, $event_id );\n\tif ( is_null( $number ) ) {\n\t\t$number = sp_get_player_number( $player_id );\n\t}\n\treturn $number;\n}\n\nfunction sp_get_player_name( $post = 0 ) {\n\treturn apply_filters( 'sportspress_player_name', get_the_title( $post ), $post );\n}\n\nfunction sp_get_player_name_with_number( $post = 0, $prepend = '', $append = '. ' ) {\n\t$name   = sp_get_player_name( $post );\n\t$number = sp_get_player_number( $post );\n\tif ( isset( $number ) && '' !== $number ) {\n\t\treturn apply_filters( 'sportspress_player_name_with_number', $prepend . $number . $append . $name, $post );\n\t} else {\n\t\treturn $name;\n\t}\n}\n\nfunction sp_get_player_name_then_number( $post = 0, $prepend = ' (', $append = ')' ) {\n\t$name   = sp_get_player_name( $post );\n\t$number = sp_get_player_number( $post );\n\tif ( isset( $number ) && '' !== $number ) {\n\t\treturn apply_filters( 'sportspress_player_name_then_number', $name . $prepend . $number . $append, $post );\n\t} else {\n\t\treturn $name;\n\t}\n}\n\nfunction sp_player_details( $post = 0 ) {\n\tsp_get_template( 'player-details.php', array( 'id' => $post ) );\n}\n\nfunction sp_player_photo( $post = 0 ) {\n\tsp_get_template( 'player-photo.php', array( 'id' => $post ) );\n}\n\nfunction sp_player_statistics( $post = 0 ) {\n\tsp_get_template( 'player-statistics.php', array( 'id' => $post ) );\n}\n\n/*\n * Player List functions\n */\n\nfunction sp_get_list( $post = 0 ) {\n\t$list = new SP_Player_List( $post );\n\treturn $list->data();\n}\n\nfunction sp_player_list( $post = 0 ) {\n\tsp_get_template( 'player-list.php', array( 'id' => $post ) );\n}\n\n/*\n * Staff functions\n */\n\nfunction sp_staff_details( $post = 0 ) {\n\tsp_get_template( 'staff-details.php', array( 'id' => $post ) );\n}\n\nfunction sp_staff_photo( $post = 0 ) {\n\tsp_get_template( 'staff-photo.php', array( 'id' => $post ) );\n}\n\n/*\n * Venue functions\n */\n\nfunction sp_venue_map( $term = 0 ) {\n\t$meta = get_option( \"taxonomy_$term\" );\n\tsp_get_template( 'venue-map.php', array( 'meta' => $meta ) );\n}\n\n\n\nfunction sp_get_position_caption( $term = 0 ) {\n\t$meta    = get_option( \"taxonomy_$term\" );\n\t$caption = sp_array_value( $meta, 'sp_caption', '' );\n\tif ( $caption ) {\n\t\treturn $caption;\n\t} else {\n\t\t$term = get_term( $term, 'sp_position' );\n\t\treturn $term->name;\n\t}\n\n}\n"
  },
  {
    "path": "includes/sp-conditional-functions.php",
    "content": "<?php\n/**\n * SportsPress Conditional Functions\n *\n * Functions for determining the current query/page.\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     SportsPress/Functions\n * @version     2.5.1\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * is_sportspress - Returns true if on a page which uses SportsPress templates\n *\n * @access public\n * @return bool\n */\nfunction is_sportspress() {\n\treturn apply_filters( 'is_sportspress', ( is_singular( sp_post_types() ) ) ? true : false );\n}\n\n/**\n * sp_post_types - Returns array of SP post types\n *\n * @access public\n * @return array\n */\nif ( ! function_exists( 'sp_post_types' ) ) {\n\tfunction sp_post_types() {\n\t\treturn apply_filters( 'sportspress_post_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );\n\t}\n}\n\n/**\n * sp_primary_post_types - Returns array of SP primary post types\n *\n * @access public\n * @return array\n */\nif ( ! function_exists( 'sp_primary_post_types' ) ) {\n\tfunction sp_primary_post_types() {\n\t\treturn apply_filters( 'sportspress_primary_post_types', array( 'sp_event', 'sp_team', 'sp_player', 'sp_staff' ) );\n\t}\n}\n\n/**\n * sp_secondary_post_types - Returns array of SP secondary post types\n *\n * @access public\n * @return array\n */\nif ( ! function_exists( 'sp_secondary_post_types' ) ) {\n\tfunction sp_secondary_post_types() {\n\t\treturn apply_filters( 'sportspress_secondary_post_types', array_diff( sp_post_types(), sp_primary_post_types() ) );\n\t}\n}\n\n/**\n * sp_importable_post_types - Returns array of SP post types with importers\n *\n * @access public\n * @return array\n */\nif ( ! function_exists( 'sp_importable_post_types' ) ) {\n\tfunction sp_importable_post_types() {\n\t\treturn apply_filters( 'sportspress_importable_post_types', array( 'sp_event', 'sp_team', 'sp_player', 'sp_staff' ) );\n\t}\n}\n\n/**\n * sp_config_types - Returns array of SP config types\n *\n * @access public\n * @return array\n */\nif ( ! function_exists( 'sp_config_types' ) ) {\n\tfunction sp_config_types() {\n\t\treturn apply_filters( 'sportspress_config_types', array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric', 'sp_statistic' ) );\n\t}\n}\n\n/**\n * sp_taxonomies - Returns array of SP taxonomies\n *\n * @access public\n * @return array\n */\nif ( ! function_exists( 'sp_taxonomies' ) ) {\n\tfunction sp_taxonomies() {\n\t\treturn apply_filters( 'sportspress_taxonomies', array( 'sp_league', 'sp_season', 'sp_venue', 'sp_position', 'sp_role' ) );\n\t}\n}\n\n/**\n * sp_post_type_hierarchy - Returns array of SP primary post types\n *\n * @access public\n * @return array\n */\nif ( ! function_exists( 'sp_post_type_hierarchy' ) ) {\n\tfunction sp_post_type_hierarchy() {\n\t\treturn apply_filters(\n\t\t\t'sportspress_post_type_hierarchy',\n\t\t\tarray(\n\t\t\t\t'sp_event'  => array( 'sp_calendar' ),\n\t\t\t\t'sp_team'   => array( 'sp_table' ),\n\t\t\t\t'sp_player' => array( 'sp_list' ),\n\t\t\t\t'sp_staff'  => array(),\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * is_sp_post_type - Returns true if post is SportsPress post type\n *\n * @access public\n * @return bool\n */\nif ( ! function_exists( 'is_sp_post_type' ) ) {\n\tfunction is_sp_post_type( $typenow = null ) {\n\t\tif ( $typenow == null ) {\n\t\t\tglobal $typenow;\n\t\t}\n\n\t\t$post_types = sp_post_types();\n\n\t\tif ( in_array( $typenow, $post_types ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n\n/**\n * is_sp_config_type - Returns true if post is SportsPress config type\n *\n * @access public\n * @return bool\n */\nif ( ! function_exists( 'is_sp_config_type' ) ) {\n\tfunction is_sp_config_type( $typenow = null ) {\n\t\tif ( $typenow == null ) {\n\t\t\tglobal $typenow;\n\t\t}\n\n\t\t$post_types = sp_config_types();\n\n\t\tif ( in_array( $typenow, $post_types ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n\n/**\n * is_sp_taxonomy - Returns true if post is SportsPress taxonomy\n *\n * @access public\n * @return bool\n */\nif ( ! function_exists( 'is_sp_taxonomy' ) ) {\n\tfunction is_sp_taxonomy( $typenow = null ) {\n\t\tif ( $typenow == null ) {\n\t\t\tglobal $typenow;\n\t\t}\n\n\t\t$taxonomies = sp_taxonomies();\n\n\t\tif ( in_array( $typenow, $taxonomies ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n\nif ( ! function_exists( 'is_ajax' ) ) {\n\n\t/**\n\t * is_ajax - Returns true when the page is loaded via ajax.\n\t *\n\t * @access public\n\t * @return bool\n\t */\n\tfunction is_ajax() {\n\t\treturn defined( 'DOING_AJAX' );\n\t}\n}\n"
  },
  {
    "path": "includes/sp-core-functions.php",
    "content": "<?php\n/**\n * SportsPress Core Functions\n *\n * General core functions available on both the front-end and admin.\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     SportsPress/Functions\n * @version   2.7.27\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n// Include core functions\nrequire 'sp-option-filters.php';\nrequire 'sp-conditional-functions.php';\nrequire 'sp-formatting-functions.php';\nrequire 'sp-deprecated-functions.php';\nrequire 'sp-api-functions.php';\n\n/**\n * Get template part.\n *\n * @access public\n * @param mixed  $slug\n * @param string $name (default: '')\n * @return void\n */\nfunction sp_get_template_part( $slug, $name = '' ) {\n\t$template = '';\n\n\t// Look in yourtheme/slug-name.php and yourtheme/sportspress/slug-name.php\n\tif ( $name ) {\n\t\t$template = locate_template( array( \"{$slug}-{$name}.php\", SP()->template_path() . \"{$slug}-{$name}.php\" ) );\n\t}\n\n\t// Get default slug-name.php\n\tif ( ! $template && $name && file_exists( SP()->plugin_path() . \"/templates/{$slug}-{$name}.php\" ) ) {\n\t\t$template = SP()->plugin_path() . \"/templates/{$slug}-{$name}.php\";\n\t}\n\n\t// If template file doesn't exist, look in yourtheme/slug.php and yourtheme/sportspress/slug.php\n\tif ( ! $template ) {\n\t\t$template = locate_template( array( \"{$slug}.php\", SP()->template_path() . \"{$slug}.php\" ) );\n\t}\n\n\t// Allow 3rd party plugin filter template file from their plugin\n\t$template = apply_filters( 'sportspress_get_template_part', $template, $slug, $name );\n\n\tif ( $template ) {\n\t\tload_template( $template, false );\n\t}\n}\n\n/**\n * Get templates passing attributes and including the file.\n *\n * @access public\n * @param mixed  $template_name\n * @param array  $args (default: array())\n * @param string $template_path (default: '')\n * @param string $default_path (default: '')\n * @return void\n */\nfunction sp_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n\t// Store the original parameters before extract() to prevent override attacks\n\t$original_template_name = $template_name;\n\t$original_template_path = $template_path;\n\t$original_default_path  = $default_path;\n\n\tif ( $args && is_array( $args ) ) {\n\t\t// Remove security-sensitive parameters from args before extraction\n\t\t// to prevent Local File Inclusion attacks via shortcode attributes\n\t\tunset( $args['template_name'], $args['template_path'], $args['default_path'] );\n\t\textract( $args );\n\t}\n\n\t// Use original parameters for template location\n\t$located = sp_locate_template( $original_template_name, $original_template_path, $original_default_path );\n\n\tif ( ! file_exists( $located ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', esc_html( $located ) ), '0.7' );\n\t\treturn;\n\t}\n\n\tdo_action( 'sportspress_before_template', $template_name, $template_path, $located, $args );\n\n\tinclude $located;\n\n\tdo_action( 'sportspress_after_template', $template_name, $template_path, $located, $args );\n}\n\n/**\n * Locate a template and return the path for inclusion.\n *\n * This is the load order:\n *\n *      yourtheme       /   $template_path  /   $template_name\n *      yourtheme       /   $template_name\n *      $default_path   /   $template_name\n *\n * @access public\n * @param mixed  $template_name\n * @param string $template_path (default: '')\n * @param string $default_path (default: '')\n * @return string\n */\nfunction sp_locate_template( $template_name, $template_path = '', $default_path = '' ) {\n\t// Sanitize template name to prevent directory traversal attacks\n\t// First extract just the filename component, removing any directory paths\n\t$template_name = basename( $template_name );\n\n\t// Sanitize the filename to remove special characters and traversal attempts\n\t$template_name = sanitize_file_name( $template_name );\n\n\t// Additional security: ensure no path separators remain after sanitization\n\t$template_name = str_replace( array( '/', '\\\\' ), '', $template_name );\n\n\t// Prevent access to hidden files\n\t$template_name = ltrim( $template_name, '.' );\n\n\t// Sanitize path parameters if provided by user input (defense-in-depth)\n\tif ( ! empty( $template_path ) ) {\n\t\t// Validate that template_path doesn't contain directory traversal\n\t\t$template_path = str_replace( array( '../', '..\\\\' ), '', $template_path );\n\t}\n\n\tif ( ! empty( $default_path ) ) {\n\t\t// Validate that default_path doesn't contain directory traversal\n\t\t$default_path = str_replace( array( '../', '..\\\\' ), '', $default_path );\n\t}\n\n\tif ( ! $template_path ) {\n\t\t$template_path = SP()->template_path();\n\t}\n\n\tif ( ! $default_path ) {\n\t\t$default_path = SP()->plugin_path() . '/templates/';\n\t}\n\n\t// Look within passed path within the theme - this is priority\n\t$template = locate_template(\n\t\tarray(\n\t\t\ttrailingslashit( $template_path ) . $template_name,\n\t\t\t$template_name,\n\t\t)\n\t);\n\n\t// Get default template\n\tif ( ! $template ) {\n\t\t$template = $default_path . $template_name;\n\t}\n\n\t// Return what we found\n\treturn apply_filters( 'sportspress_locate_template', $template, $template_name, $template_path );\n}\n\nfunction sp_substr( $string = '', $start = 0, $length = null ) {\n\tif ( function_exists( 'mb_substr' ) ) {\n\t\treturn mb_substr( $string, $start, $length );\n\t} else {\n\t\treturn substr( $string, $start, $length );\n\t}\n}\n\nfunction sp_strtoupper( $string = '' ) {\n\tif ( function_exists( 'mb_strtoupper' ) ) {\n\t\treturn mb_strtoupper( $string );\n\t} else {\n\t\treturn strtoupper( $string );\n\t}\n}\n\n/**\n * Get the timezone string.\n *\n * @access public\n * @return string\n */\nfunction sp_get_timezone() {\n\t$tzstring = get_option( 'timezone_string' );\n\n\t// Remove old Etc mappings. Fallback to gmt_offset.\n\tif ( false !== strpos( $tzstring, 'Etc/GMT' ) ) {\n\t\t$tzstring = '';\n\t}\n\n\tif ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists\n\t\t$current_offset = get_option( 'gmt_offset' );\n\n\t\tif ( 0 == $current_offset ) {\n\t\t\t$tzstring = 'UTC+0';\n\t\t} elseif ( $current_offset < 0 ) {\n\t\t\t$tzstring = 'UTC' . $current_offset;\n\t\t} else {\n\t\t\t$tzstring = 'UTC+' . $current_offset;\n\t\t}\n\t}\n\n\treturn $tzstring;\n}\n\n/* deprecated functions below */\n\nif ( ! function_exists( 'date_diff' ) ) {\n\tclass DateInterval {\n\t\tpublic $y;\n\t\tpublic $m;\n\t\tpublic $d;\n\t\tpublic $h;\n\t\tpublic $i;\n\t\tpublic $s;\n\t\tpublic $invert;\n\t\tpublic $days;\n\n\t\tpublic function format( $format ) {\n\t\t\t$format = str_replace(\n\t\t\t\t'%R%y',\n\t\t\t\t( $this->invert ? '-' : '+' ) . $this->y,\n\t\t\t\t$format\n\t\t\t);\n\t\t\t$format = str_replace(\n\t\t\t\t'%R%m',\n\t\t\t\t( $this->invert ? '-' : '+' ) . $this->m,\n\t\t\t\t$format\n\t\t\t);\n\t\t\t$format = str_replace(\n\t\t\t\t'%R%d',\n\t\t\t\t( $this->invert ? '-' : '+' ) . $this->d,\n\t\t\t\t$format\n\t\t\t);\n\t\t\t$format = str_replace(\n\t\t\t\t'%R%h',\n\t\t\t\t( $this->invert ? '-' : '+' ) . $this->h,\n\t\t\t\t$format\n\t\t\t);\n\t\t\t$format = str_replace(\n\t\t\t\t'%R%i',\n\t\t\t\t( $this->invert ? '-' : '+' ) . $this->i,\n\t\t\t\t$format\n\t\t\t);\n\t\t\t$format = str_replace(\n\t\t\t\t'%R%s',\n\t\t\t\t( $this->invert ? '-' : '+' ) . $this->s,\n\t\t\t\t$format\n\t\t\t);\n\n\t\t\t$format = str_replace( '%y', $this->y, $format );\n\t\t\t$format = str_replace( '%m', $this->m, $format );\n\t\t\t$format = str_replace( '%d', $this->d, $format );\n\t\t\t$format = str_replace( '%h', $this->h, $format );\n\t\t\t$format = str_replace( '%i', $this->i, $format );\n\t\t\t$format = str_replace( '%s', $this->s, $format );\n\n\t\t\treturn $format;\n\t\t}\n\t}\n\n\tfunction date_diff( DateTime $date1, DateTime $date2 ) {\n\n\t\t$diff = new DateInterval();\n\n\t\tif ( $date1 > $date2 ) {\n\t\t\t$tmp          = $date1;\n\t\t\t$date1        = $date2;\n\t\t\t$date2        = $tmp;\n\t\t\t$diff->invert = 1;\n\t\t} else {\n\t\t\t$diff->invert = 0;\n\t\t}\n\n\t\t$diff->y = ( (int) $date2->format( 'Y' ) ) - ( (int) $date1->format( 'Y' ) );\n\t\t$diff->m = ( (int) $date2->format( 'n' ) ) - ( (int) $date1->format( 'n' ) );\n\t\tif ( $diff->m < 0 ) {\n\t\t\t$diff->y -= 1;\n\t\t\t$diff->m  = $diff->m + 12;\n\t\t}\n\t\t$diff->d = ( (int) $date2->format( 'j' ) ) - ( (int) $date1->format( 'j' ) );\n\t\tif ( $diff->d < 0 ) {\n\t\t\t$diff->m -= 1;\n\t\t\t$diff->d  = $diff->d + ( (int) $date1->format( 't' ) );\n\t\t}\n\t\t$diff->h = ( (int) $date2->format( 'G' ) ) - ( (int) $date1->format( 'G' ) );\n\t\tif ( $diff->h < 0 ) {\n\t\t\t$diff->d -= 1;\n\t\t\t$diff->h  = $diff->h + 24;\n\t\t}\n\t\t$diff->i = ( (int) $date2->format( 'i' ) ) - ( (int) $date1->format( 'i' ) );\n\t\tif ( $diff->i < 0 ) {\n\t\t\t$diff->h -= 1;\n\t\t\t$diff->i  = $diff->i + 60;\n\t\t}\n\t\t$diff->s = ( (int) $date2->format( 's' ) ) - ( (int) $date1->format( 's' ) );\n\t\tif ( $diff->s < 0 ) {\n\t\t\t$diff->i -= 1;\n\t\t\t$diff->s  = $diff->s + 60;\n\t\t}\n\n\t\t$start_ts   = $date1->format( 'U' );\n\t\t$end_ts     = $date2->format( 'U' );\n\t\t$days       = $end_ts - $start_ts;\n\t\t$diff->days = round( $days / 86400 );\n\n\t\tif ( ( $diff->h > 0 || $diff->i > 0 || $diff->s > 0 ) ) {\n\t\t\t$diff->days += ( (bool) $diff->invert )\n\t\t\t\t? 1\n\t\t\t\t: -1;\n\t\t}\n\n\t\treturn $diff;\n\t}\n}\n\nif ( ! function_exists( 'sp_flush_rewrite_rules' ) ) {\n\tfunction sp_flush_rewrite_rules() {\n\t\t// Flush rewrite rules\n\t\t$post_types = new SP_Post_types();\n\t\t$post_types->register_taxonomies();\n\t\t$post_types->register_post_types();\n\t\tflush_rewrite_rules();\n\t}\n}\n\nif ( ! function_exists( 'sp_add_link' ) ) {\n\tfunction sp_add_link( $string, $link = false, $active = true ) {\n\t\tif ( empty( $link ) || ! $active ) {\n\t\t\treturn $string;\n\t\t}\n\t\treturn '<a href=\"' . $link . '\" itemprop=\"url\" content=\"' . $link . '\">' . $string . '</a>';\n\t}\n}\n\nif ( ! function_exists( 'sp_nonce' ) ) {\n\tfunction sp_nonce() {\n\t\twp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_option' ) ) {\n\tfunction sp_get_option( $option, $default = null ) {\n\t\tif ( isset( $_POST[ $option ] ) ) {\n\t\t\tsanitize_text_field( wp_unslash( $_POST[ $option ] ) );\n\t\t} else {\n\t\t\treturn get_option( $option, $default );\n\t\t}\n\t}\n}\n\nif ( ! function_exists( 'sp_array_between' ) ) {\n\tfunction sp_array_between( $array = array(), $delimiter = 0, $index = 0 ) {\n\t\t$keys = array_keys( $array, $delimiter );\n\t\tif ( array_key_exists( $index, $keys ) ) :\n\t\t\t$offset = $keys[ $index ];\n\t\t\t$end    = sizeof( $array );\n\t\t\tif ( array_key_exists( $index + 1, $keys ) ) {\n\t\t\t\t$end = $keys[ $index + 1 ];\n\t\t\t}\n\t\t\t$length = $end - $offset;\n\t\t\t$array  = array_slice( $array, $offset, $length );\n\t\tendif;\n\t\treturn $array;\n\t}\n}\n\nif ( ! function_exists( 'sp_array_map_recursive' ) ) {\n\tfunction sp_array_map_recursive( callable $func, array $arr ) {\n\t\tarray_walk_recursive(\n\t\t\t$arr,\n\t\t\tfunction( &$v ) use ( $func ) {\n\t\t\t\t$v = $func( $v );\n\t\t\t}\n\t\t);\n\t\treturn $arr;\n\t}\n}\n\nif ( ! function_exists( 'sp_array_value' ) ) {\n\tfunction sp_array_value( $arr = array(), $key = 0, $default = null, $sanitize = false ) {\n\t\t$value = ( isset( $arr[ $key ] ) ? $arr[ $key ] : $default );\n\n\t\tif ( $sanitize ) :\n\t\t\tif ( is_array( $value ) ) :\n\t\t\t\tswitch ( $sanitize ) :\n\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t$value = sp_array_map_recursive( 'intval', $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'title':\n\t\t\t\t\t\t$value = sp_array_map_recursive( 'sanitize_title', $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t$value = sp_array_map_recursive( 'wp_kses_post', $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'key':\n\t\t\t\t\t\t$value = sp_array_map_recursive( 'sanitize_key', $value );\n\t\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\t  else :\n\t\t\t  switch ( $sanitize ) :\n\t\t\t\t  case 'int':\n\t\t\t\t\t  if ( empty( $value ) ) {\n\t\t\t\t\t\t  $value = $value;\n\t\t\t\t\t  }else{\n\t\t\t\t\t\t$value = intval( $value );\n\t\t\t\t\t  }\n\t\t\t\t\t  break;\n\t\t\t\t  case 'title':\n\t\t\t\t\t  $value = sanitize_title( $value );\n\t\t\t\t\t  break;\n\t\t\t\t  case 'text':\n\t\t\t\t\t  $value = sanitize_text_field( $value );\n\t\t\t\t\t  break;\n\t\t\t\t  case 'key':\n\t\t\t\t\t  $value = sanitize_key( $value );\n\t\t\t\t\t  break;\n\t\t\tendswitch;\n\t\t  endif;\n\tendif;\n\n\t\treturn $value;\n\t}\n}\n\nif ( ! function_exists( 'sp_array_combine' ) ) {\n\tfunction sp_array_combine( $keys = array(), $values = array(), $key_order = false ) {\n\t\tif ( ! is_array( $keys ) ) {\n\t\t\treturn array();\n\t\t}\n\t\tif ( ! is_array( $values ) ) {\n\t\t\t$values = array();\n\t\t}\n\n\t\t$output = array();\n\n\t\tif ( $key_order ) :\n\t\t\tforeach ( $keys as $key ) :\n\t\t\t\tif ( array_key_exists( $key, $values ) ) {\n\t\t\t\t\t$output[ $key ] = $values[ $key ];\n\t\t\t\t} else {\n\t\t\t\t\t$output[ $key ] = array();\n\t\t\t\t}\n\t\t\tendforeach;\n\t\telse :\n\t\t\tforeach ( $values as $key => $value ) :\n\t\t\t\tif ( in_array( $key, $keys ) ) :\n\t\t\t\t\t$output[ $key ] = $value;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\n\t\t\tforeach ( $keys as $key ) :\n\t\t\t\tif ( $key !== false && ! array_key_exists( $key, $output ) ) {\n\t\t\t\t\t$output[ $key ] = array();\n\t\t\t\t}\n\t\t\tendforeach;\n\t\tendif;\n\t\treturn $output;\n\t}\n}\n\nif ( ! function_exists( 'sp_numbers_to_words' ) ) {\n\tfunction sp_numbers_to_words( $str ) {\n\t\t$output = str_replace( array( '%', '1st', '2nd', '3rd', '5th', '8th', '9th', '10', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ), array( 'percent', 'first', 'second', 'third', 'fifth', 'eight', 'ninth', 'ten', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine' ), $str );\n\t\treturn $output;\n\t}\n}\n\nif ( ! function_exists( 'sp_column_active' ) ) {\n\tfunction sp_column_active( $array = null, $value = null ) {\n\t\treturn $array == null || in_array( $value, $array );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_the_term_id' ) ) {\n\tfunction sp_get_the_term_id( $post_id, $taxonomy ) {\n\t\t$terms = get_the_terms( $post_id, $taxonomy );\n\t\tif ( is_array( $terms ) && sizeof( $terms ) > 0 ) :\n\t\t\t$term = reset( $terms );\n\t\t\tif ( is_object( $term ) && property_exists( $term, 'term_id' ) ) {\n\t\t\t\treturn $term->term_id;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t} else :\n\t\t\t\treturn 0;\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_the_term_ids' ) ) {\n\tfunction sp_get_the_term_ids( $post_id, $taxonomy ) {\n\t\t$terms    = get_the_terms( $post_id, $taxonomy );\n\t\t$term_ids = array();\n\n\t\tif ( is_array( $terms ) && sizeof( $terms ) > 0 ) {\n\t\t\t$term_ids = wp_list_pluck( $terms, 'term_id' );\n\t\t}\n\n\t\t$term_ids = sp_add_auto_term( $term_ids, $post_id, $taxonomy );\n\n\t\treturn $term_ids;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_the_term_id_or_meta' ) ) {\n\tfunction sp_get_the_term_id_or_meta( $post_id, $taxonomy ) {\n\t\t$terms = get_the_terms( $post_id, $taxonomy );\n\t\tif ( is_array( $terms ) && sizeof( $terms ) > 0 ) :\n\t\t\t$term = reset( $terms );\n\t\t\tif ( is_object( $term ) && property_exists( $term, 'term_id' ) ) {\n\t\t\t\treturn $term->term_id;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t} else :\n\t\t\t\treturn get_post_meta( $post_id, $taxonomy, true );\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_add_auto_term' ) ) {\n\tfunction sp_add_auto_term( $term_ids, $post_id, $taxonomy ) {\n\t\tswitch ( $taxonomy ) {\n\t\t\tcase 'sp_league':\n\t\t\t\tif ( get_post_meta( $post_id, 'sp_main_league', true ) ) {\n\t\t\t\t\t$term_id = get_option( 'sportspress_league', false );\n\t\t\t\t\tif ( $term_id ) {\n\t\t\t\t\t\t$term_ids[] = $term_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'sp_season':\n\t\t\t\tif ( get_post_meta( $post_id, 'sp_current_season', true ) ) {\n\t\t\t\t\t$term_id = get_option( 'sportspress_season', false );\n\t\t\t\t\tif ( $term_id ) {\n\t\t\t\t\t\t$term_ids[] = $term_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $term_ids;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_url' ) ) {\n\tfunction sp_get_url( $post_id ) {\n\t\t$url = get_post_meta( $post_id, 'sp_url', true );\n\t\tif ( ! $url ) {\n\t\t\treturn;\n\t\t}\n\t\treturn ' <a class=\"sp-link\" href=\"' . $url . '\" target=\"_blank\" title=\"' . esc_attr__( 'Visit Site', 'sportspress' ) . '\">' . $url . '</a>';\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_abbreviation' ) ) {\n\tfunction sp_get_post_abbreviation( $post_id ) {\n\t\t$abbreviation = get_post_meta( $post_id, 'sp_abbreviation', true );\n\t\tif ( $abbreviation ) :\n\t\t\treturn $abbreviation;\n\t\telse :\n\t\t\treturn mb_substr( get_the_title( $post_id ), 0, 1 );\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_condition' ) ) {\n\tfunction sp_get_post_condition( $post_id ) {\n\t\t$condition   = get_post_meta( $post_id, 'sp_condition', true );\n\t\t$main_result = get_option( 'sportspress_primary_result', null );\n\t\t$result      = get_page_by_path( $main_result, ARRAY_A, 'sp_result' );\n\t\t$label       = sp_array_value( $result, 'post_title', esc_attr__( 'Primary', 'sportspress' ) );\n\t\tif ( $condition ) :\n\t\t\t$conditions = array(\n\t\t\t\t'0'    => '&mdash;',\n\t\t\t\t'>'    => sprintf( esc_attr__( 'Most %s', 'sportspress' ), $label ),\n\t\t\t\t'<'    => sprintf( esc_attr__( 'Least %s', 'sportspress' ), $label ),\n\t\t\t\t'='    => sprintf( esc_attr__( 'Equal %s', 'sportspress' ), $label ),\n\t\t\t\t'else' => sprintf( esc_attr__( 'Default', 'sportspress' ), $label ),\n\t\t\t);\n\t\t\treturn sp_array_value( $conditions, wp_specialchars_decode( $condition ), '&mdash;' );\n\t\telse :\n\t\t\treturn '&mdash;';\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_precision' ) ) {\n\tfunction sp_get_post_precision( $post_id ) {\n\t\t$precision = get_post_meta( $post_id, 'sp_precision', true );\n\t\tif ( $precision ) :\n\t\t\treturn $precision;\n\t\telse :\n\t\t\treturn 0;\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_calculate' ) ) {\n\tfunction sp_get_post_calculate( $post_id ) {\n\t\t$calculate = get_post_meta( $post_id, 'sp_calculate', true );\n\t\tif ( $calculate ) :\n\t\t\treturn str_replace(\n\t\t\t\tarray( 'total', 'average' ),\n\t\t\t\tarray( esc_attr__( 'Total', 'sportspress' ), esc_attr__( 'Average', 'sportspress' ) ),\n\t\t\t\t$calculate\n\t\t\t);\n\t\telse :\n\t\t\treturn esc_attr__( 'Total', 'sportspress' );\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_equation' ) ) {\n\tfunction sp_get_post_equation( $post_id ) {\n\t\t$equation = get_post_meta( $post_id, 'sp_equation', true );\n\t\tif ( $equation ) :\n\t\t\t$equation = str_replace(\n\t\t\t\tarray( '/', '(', ')', '+', '-', '*', '_', '$' ),\n\t\t\t\tarray( '&divide;', '(', ')', '&#43;', '&minus;', '&times;', '@', '' ),\n\t\t\t\ttrim( $equation )\n\t\t\t);\n\t\t\treturn '<code>' . implode( '</code> <code>', explode( ' ', $equation ) ) . '</code>';\n\t\telse :\n\t\t\treturn '&mdash;';\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_order' ) ) {\n\tfunction sp_get_post_order( $post_id ) {\n\t\t$priority = get_post_meta( $post_id, 'sp_priority', true );\n\t\tif ( $priority ) :\n\t\t\treturn $priority . ' ' . str_replace(\n\t\t\t\tarray( 'DESC', 'ASC' ),\n\t\t\t\tarray( '&darr;', '&uarr;' ),\n\t\t\t\tget_post_meta( $post_id, 'sp_order', true )\n\t\t\t);\n\t\telse :\n\t\t\treturn '&mdash;';\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_section' ) ) {\n\tfunction sp_get_post_section( $post_id ) {\n\t\t$section = get_post_meta( $post_id, 'sp_section', true );\n\t\tif ( isset( $section ) ) :\n\t\t\t$options = apply_filters(\n\t\t\t\t'sportspress_performance_sections',\n\t\t\t\tarray(\n\t\t\t\t\t-1 => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t\t0  => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t1  => esc_attr__(\n\t\t\t\t\t\t'Defense',\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn sp_array_value( $options, $section, esc_attr__( 'All', 'sportspress' ) );\n\t\telse :\n\t\t\treturn esc_attr__( 'All', 'sportspress' );\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_format' ) ) {\n\tfunction sp_get_post_format( $post_id ) {\n\t\t$format = get_post_meta( $post_id, 'sp_format', true );\n\t\tif ( isset( $format ) ) :\n\t\t\t$options = apply_filters(\n\t\t\t\t'sportspress_performance_formats',\n\t\t\t\tarray(\n\t\t\t\t\t'number'   => esc_attr__( 'Number', 'sportspress' ),\n\t\t\t\t\t'time'     => esc_attr__( 'Time', 'sportspress' ),\n\t\t\t\t\t'text'     => esc_attr__( 'Text', 'sportspress' ),\n\t\t\t\t\t'equation' => esc_attr__( 'Equation', 'sportspress' ),\n\t\t\t\t\t'checkbox' => esc_attr__(\n\t\t\t\t\t\t'Checkbox',\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn sp_array_value( $options, $format, esc_attr__( 'Number', 'sportspress' ) );\n\t\telse :\n\t\t\treturn esc_attr__( 'Number', 'sportspress' );\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_format_placeholder' ) ) {\n\tfunction sp_get_format_placeholder( $key = 'number' ) {\n\t\t$placeholders = apply_filters(\n\t\t\t'sportspress_format_placeholders',\n\t\t\tarray(\n\t\t\t\t'number'   => 0,\n\t\t\t\t'time'     => '0:00',\n\t\t\t\t'text'     => '&nbsp;',\n\t\t\t\t'checkbox' => '&nbsp;',\n\t\t\t)\n\t\t);\n\t\treturn sp_array_value( $placeholders, $key, 0 );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_term_sections' ) ) {\n\tfunction sp_get_term_sections( $t_id ) {\n\t\t$term_meta = get_option( \"taxonomy_$t_id\" );\n\t\tif ( isset( $term_meta['sp_sections'] ) ) {\n\t\t\t$sections = $term_meta['sp_sections'];\n\t\t} else {\n\t\t\t$sections = apply_filters(\n\t\t\t\t'sportspress_performance_sections',\n\t\t\t\tarray(\n\t\t\t\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t1 => esc_attr__(\n\t\t\t\t\t\t'Defense',\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t\t$sections = array_keys( $sections );\n\t\t}\n\n\t\tif ( '' === $sections ) {\n\t\t\t$sections = array();\n\t\t}\n\n\t\treturn $sections;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_default_mode' ) ) {\n\tfunction sp_get_default_mode() {\n\t\t$mode = get_option( 'sportspress_mode', 'team' );\n\n\t\tif ( empty( $mode ) ) {\n\t\t\t$mode = 'team';\n\t\t}\n\n\t\treturn $mode;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_mode' ) ) {\n\tfunction sp_get_post_mode( $post_id ) {\n\t\t$mode = get_post_meta( $post_id, 'sp_mode', true );\n\n\t\tif ( empty( $mode ) ) {\n\t\t\t$mode = sp_get_default_mode();\n\t\t}\n\n\t\treturn $mode;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_mode_type' ) ) {\n\tfunction sp_get_post_mode_type( $post_id ) {\n\t\t$mode = sp_get_post_mode( $post_id );\n\n\t\t$post_type = \"sp_$mode\";\n\n\t\tif ( ! in_array( $post_type, sp_primary_post_types() ) ) {\n\t\t\t$post_type = sp_get_default_mode();\n\t\t}\n\n\t\treturn $post_type;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_post_mode_label' ) ) {\n\tfunction sp_get_post_mode_label( $post_id, $singular = false ) {\n\t\t$labels = array(\n\t\t\t'team'   => array(\n\t\t\t\t__( 'Teams', 'sportspress' ),\n\t\t\t\t__( 'Team', 'sportspress' ),\n\t\t\t),\n\t\t\t'player' => array(\n\t\t\t\t__( 'Players', 'sportspress' ),\n\t\t\t\t__( 'Player', 'sportspress' ),\n\t\t\t),\n\t\t);\n\n\t\t$mode = sp_get_post_mode( $post_id );\n\n\t\tif ( ! array_key_exists( $mode, $labels ) ) {\n\t\t\t$mode = 'team';\n\t\t}\n\n\t\t$index = intval( $singular );\n\n\t\treturn $labels[ $mode ][ $index ];\n\t}\n}\n\nif ( ! function_exists( 'sp_dropdown_statuses' ) ) {\n\tfunction sp_dropdown_statuses( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'show_option_default' => false,\n\t\t\t'name'                => 'sp_status',\n\t\t\t'id'                  => null,\n\t\t\t'selected'            => null,\n\t\t\t'class'               => null,\n\t\t);\n\t\t$args     = array_merge( $defaults, $args );\n\n\t\tprintf( '<select name=\"%s\" class=\"postform %s\">', esc_attr( $args['name'] ), esc_attr( $args['class'] ) );\n\n\t\tif ( $args['show_option_default'] ) :\n\t\t\tprintf( '<option value=\"default\">%s</option>', esc_attr( $args['show_option_default'] ) );\n\t\tendif;\n\n\t\t$statuses = apply_filters(\n\t\t\t'sportspress_statuses',\n\t\t\tarray(\n\t\t\t\t'any'     => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t'publish' => esc_attr__( 'Published', 'sportspress' ),\n\t\t\t\t'future'  => esc_attr__( 'Scheduled', 'sportspress' ),\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $statuses as $value => $label ) :\n\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $value ), selected( $value, $args['selected'], false ), esc_attr( $label ) );\n\t\tendforeach;\n\t\tprint( '</select>' );\n\t\treturn true;\n\t}\n}\n\nif ( ! function_exists( 'sp_dropdown_dates' ) ) {\n\tfunction sp_dropdown_dates( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'show_option_default' => false,\n\t\t\t'name'                => 'sp_date',\n\t\t\t'id'                  => null,\n\t\t\t'selected'            => null,\n\t\t\t'class'               => null,\n\t\t);\n\t\t$args     = array_merge( $defaults, $args );\n\n\t\tprintf( '<select name=\"%s\" class=\"postform %s\">', esc_attr( $args['name'] ), esc_attr( $args['class'] ) );\n\n\t\tif ( $args['show_option_default'] ) :\n\t\t\tprintf( '<option value=\"default\">%s</option>', esc_attr( $args['show_option_default'] ) );\n\t\tendif;\n\n\t\t$dates = apply_filters(\n\t\t\t'sportspress_dates',\n\t\t\tarray(\n\t\t\t\t0       => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t'-day'  => esc_attr__( 'Yesterday', 'sportspress' ),\n\t\t\t\t'day'   => esc_attr__( 'Today', 'sportspress' ),\n\t\t\t\t'+day'  => esc_attr__( 'Tomorrow', 'sportspress' ),\n\t\t\t\t'-w'    => esc_attr__( 'Last week', 'sportspress' ),\n\t\t\t\t'w'     => esc_attr__( 'This week', 'sportspress' ),\n\t\t\t\t'+w'    => esc_attr__( 'Next week', 'sportspress' ),\n\t\t\t\t'range' => esc_attr__( 'Date range:', 'sportspress' ),\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $dates as $value => $label ) :\n\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $value ), selected( $value, $args['selected'], false ), esc_attr( $label ) );\n\t\tendforeach;\n\t\tprint( '</select>' );\n\t\treturn true;\n\t}\n}\n\nif ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {\n\tfunction sp_dropdown_taxonomies( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'show_option_blank' => false,\n\t\t\t'show_option_all'   => false,\n\t\t\t'show_option_none'  => false,\n\t\t\t'show_option_auto'  => false,\n\t\t\t'taxonomy'          => null,\n\t\t\t'name'              => null,\n\t\t\t'id'                => null,\n\t\t\t'selected'          => null,\n\t\t\t'hide_empty'        => false,\n\t\t\t'values'            => 'slug',\n\t\t\t'class'             => null,\n\t\t\t'property'          => 'none',\n\t\t\t'placeholder'       => null,\n\t\t\t'chosen'            => false,\n\t\t\t'parent'            => 0,\n\t\t\t'include_children'  => true,\n\t\t);\n\t\t$args     = array_merge( $defaults, $args );\n\t\tif ( ! $args['taxonomy'] ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$name = ( $args['name'] ) ? $args['name'] : $args['taxonomy'];\n\t\t$id   = ( $args['id'] ) ? $args['id'] : $name;\n\n\t\tunset( $args['name'] );\n\t\tunset( $args['id'] );\n\n\t\t$class = $args['class'];\n\t\tunset( $args['class'] );\n\n\t\t$property = $args['property'];\n\t\tunset( $args['property'] );\n\n\t\t$placeholder = $args['placeholder'];\n\t\tunset( $args['placeholder'] );\n\n\t\t$selected = $args['selected'];\n\t\tunset( $args['selected'] );\n\n\t\t$chosen = $args['chosen'];\n\t\tunset( $args['chosen'] );\n\n\t\t$terms = get_terms( $args['taxonomy'], $args );\n\n\t\tprintf( '<input type=\"hidden\" name=\"tax_input[%s][]\" value=\"0\">', esc_attr( $args['taxonomy'] ) );\n\n\t\tif ( $terms ) :\n\t\t\tprintf( '<select name=\"%s\" class=\"postform %s\" %s>', esc_attr( $name ), esc_attr( $class ) . ( $chosen ? ' chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' ) : '' ), ( $placeholder != null ? 'data-placeholder=\"' . esc_attr( $placeholder ) . '\" ' : '' ) . esc_attr( $property ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\n\t\t\tif ( $property && strpos( $property, 'multiple' ) === false ) :\n\t\t\t\tif ( $args['show_option_blank'] ) :\n\t\t\t\t\techo '<option value=\"\">' . ( is_bool( $args['show_option_blank'] ) ? '' : esc_attr( $args['show_option_blank'] ) ) . '</option>';\n\t\t\t\tendif;\n\t\t\t\tif ( $args['show_option_all'] ) :\n\t\t\t\t\tprintf( '<option value=\"0\" ' . selected( '0', $selected, false ) . '>%s</option>', esc_attr( $args['show_option_all'] ) );\n\t\t\t\tendif;\n\t\t\t\tif ( $args['show_option_none'] ) :\n\t\t\t\t\tprintf( '<option value=\"-1\" ' . selected( '-1', $selected, false ) . '>%s</option>', esc_attr( $args['show_option_none'] ) );\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\t\tif ( $args['show_option_auto'] ) :\n\t\t\t\tif ( $property && strpos( $property, 'multiple' ) !== false ) :\n\t\t\t\t\t$selected_prop = in_array( 'auto', $selected ) ? 'selected' : '';\n\t\t\t\telse :\n\t\t\t\t\t$selected_prop = selected( 'auto', $selected, false );\n\t\t\t\tendif;\n\t\t\t\tprintf( '<option value=\"auto\" ' . esc_attr( $selected_prop ) . '>%s</option>', esc_attr( $args['show_option_auto'] ) . ' ' . esc_attr__( '(Auto)', 'sportspress' ) );\n\t\t\tendif;\n\n\t\t\tforeach ( $terms as $term ) :\n\n\t\t\t\tif ( $args['values'] == 'term_id' ) :\n\t\t\t\t\t$this_value = $term->term_id;\n\t\t\t\telse :\n\t\t\t\t\t$this_value = $term->slug;\n\t\t\t\tendif;\n\n\t\t\t\tif ( $property && strpos( $property, 'multiple' ) !== false ) :\n\t\t\t\t\t$selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';\n\t\t\t\telse :\n\t\t\t\t\t$selected_prop = selected( $this_value, $selected, false );\n\t\t\t\tendif;\n\n\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $this_value ), esc_attr( $selected_prop ), esc_attr( $term->name ) );\n\n\t\t\t\tif ( $args['include_children'] ) :\n\t\t\t\t\tsp_dropdown_hierarchical_taxonomies( $args, $property, $selected, $term->term_id );\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\tprint( '</select>' );\n\t\t\treturn true;\n\t\telse :\n\t\t\treturn false;\n\t\tendif;\n\t}\n}\n\nfunction sp_dropdown_hierarchical_taxonomies( $args, $property, $selected, $current_term_id = 0, $depth = 1 ) {\n    $term_children = get_terms([\n        'taxonomy'   => $args['taxonomy'],\n        'hide_empty' => false,\n        'parent'     => $current_term_id,\n    ]);\n\n    if ( $term_children ) {\n\t\t$indent = str_repeat('-', $depth);\n\n\t\tforeach ( $term_children as $term_child ) {\n\t\t\tif ( $args['values'] == 'term_id' ) :\n\t\t\t\t$this_value = $term_child->term_id;\n\t\t\telse :\n\t\t\t\t$this_value = $term_child->slug;\n\t\t\tendif;\n\n\t\t\tif ( $property && strpos( $property, 'multiple' ) !== false ) :\n\t\t\t\t$selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';\n\t\t\telse :\n\t\t\t\t$selected_prop = selected( $this_value, $selected, false );\n\t\t\tendif;\n\n\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $this_value ), esc_attr( $selected_prop ), $indent . ' ' . esc_attr( $term_child->name ) );\n\n\t\t\tsp_dropdown_hierarchical_taxonomies( $args, $property, $selected, $term_child->term_id, $depth + 1 );\n\t\t}\n\t}\n}\n\nif ( ! function_exists( 'sp_dropdown_pages' ) ) {\n\tfunction sp_dropdown_pages( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'prepend_options'   => null,\n\t\t\t'append_options'    => null,\n\t\t\t'show_option_blank' => false,\n\t\t\t'show_option_all'   => false,\n\t\t\t'show_option_none'  => false,\n\t\t\t'show_dates'        => false,\n\t\t\t'option_all_value'  => 0,\n\t\t\t'option_none_value' => -1,\n\t\t\t'name'              => 'page_id',\n\t\t\t'id'                => null,\n\t\t\t'selected'          => null,\n\t\t\t'numberposts'       => -1,\n\t\t\t'posts_per_page'    => -1,\n\t\t\t'child_of'          => 0,\n\t\t\t'order'             => 'ASC',\n\t\t\t'orderby'           => 'title',\n\t\t\t'hierarchical'      => 1,\n\t\t\t'exclude'           => null,\n\t\t\t'include'           => null,\n\t\t\t'meta_key'          => null,\n\t\t\t'meta_value'        => null,\n\t\t\t'authors'           => null,\n\t\t\t'exclude_tree'      => null,\n\t\t\t'post_type'         => 'page',\n\t\t\t'post_status'       => 'publish',\n\t\t\t'values'            => 'post_name',\n\t\t\t'class'             => null,\n\t\t\t'property'          => 'none',\n\t\t\t'placeholder'       => null,\n\t\t\t'chosen'            => false,\n\t\t\t'filter'            => false,\n\t\t);\n\t\t$args     = array_merge( $defaults, $args );\n\n\t\t$name = $args['name'];\n\t\tunset( $args['name'] );\n\n\t\t$id = ( $args['id'] ) ? $args['id'] : $name;\n\t\tunset( $args['id'] );\n\n\t\t$values = $args['values'];\n\t\tunset( $args['values'] );\n\n\t\t$class = $args['class'];\n\t\tunset( $args['class'] );\n\n\t\t$property = $args['property'];\n\t\tunset( $args['property'] );\n\n\t\t$placeholder = $args['placeholder'];\n\t\tunset( $args['placeholder'] );\n\n\t\t$selected = $args['selected'];\n\t\tunset( $args['selected'] );\n\n\t\t$chosen = $args['chosen'];\n\t\tunset( $args['chosen'] );\n\n\t\t$filter = $args['filter'];\n\t\tunset( $args['filter'] );\n\n\t\t$posts = get_posts( $args );\n\t\tif ( $posts || $args['prepend_options'] || $args['append_options'] ) :\n\t\t\tprintf( '<select name=\"%s\" id=\"%s\" class=\"postform %s\" %s>', esc_attr( $name ), esc_attr( $id ), esc_attr( $class ) . ( $chosen ? ' chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' ) : '' ), ( $placeholder != null ? 'data-placeholder=\"' . esc_attr( $placeholder ) . '\" ' : '' ) . esc_attr( $property ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\n\t\t\tif ( $property && strpos( $property, 'multiple' ) === false ) :\n\t\t\t\tif ( $args['show_option_blank'] ) :\n\t\t\t\t\tprintf( '<option value=\"\"></option>' );\n\t\t\t\tendif;\n\t\t\t\tif ( $args['show_option_none'] ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $args['option_none_value'] ), selected( $selected, esc_attr( $args['option_none_value'] ), false ), ( $args['show_option_none'] === true ? '' : esc_attr( $args['show_option_none'] ) ) );\n\t\t\t\tendif;\n\t\t\t\tif ( $args['show_option_all'] ) :\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $args['option_all_value'] ), selected( $selected, esc_attr( $args['option_all_value'] ), false ), esc_attr( $args['show_option_all'] ) );\n\t\t\t\tendif;\n\t\t\t\tif ( $args['prepend_options'] && is_array( $args['prepend_options'] ) ) :\n\t\t\t\t\tforeach ( $args['prepend_options'] as $slug => $label ) :\n\t\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $slug ), selected( $selected, $slug, false ), esc_attr( $label ) );\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\t\tforeach ( $posts as $post ) :\n\t\t\t\tsetup_postdata( $post );\n\n\t\t\t\tif ( $values == 'ID' ) :\n\t\t\t\t\t$this_value = $post->ID;\n\t\t\t\telse :\n\t\t\t\t\t$this_value = $post->post_name;\n\t\t\t\tendif;\n\n\t\t\t\tif ( $property && strpos( $property, 'multiple' ) !== false ) :\n\t\t\t\t\t$selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';\n\t\t\t\telse :\n\t\t\t\t\t$selected_prop = selected( $this_value, $selected, false );\n\t\t\t\tendif;\n\n\t\t\t\tif ( $filter !== false ) :\n\t\t\t\t\t$class         = 'sp-post sp-filter-0';\n\t\t\t\t\t$filter_values = get_post_meta( $post->ID, $filter, false );\n\t\t\t\t\tforeach ( $filter_values as $filter_value ) :\n\t\t\t\t\t\t$class .= ' sp-filter-' . $filter_value;\n\t\t\t\t\tendforeach;\n\t\t\t\telse :\n\t\t\t\t\t$class = '';\n\t\t\t\tendif;\n\n\t\t\t\tprintf( '<option value=\"%s\" class=\"%s\" %s>%s</option>', esc_attr( $this_value ), esc_attr( $class ), esc_attr( $selected_prop ), esc_attr( $post->post_title ) . ( $args['show_dates'] ? ' (' . esc_attr( $post->post_date ) . ')' : '' ) );\n\t\t\tendforeach;\n\t\t\twp_reset_postdata();\n\n\t\t\tif ( $property && strpos( $property, 'multiple' ) === false ) :\n\t\t\t\tif ( $args['append_options'] && is_array( $args['append_options'] ) ) :\n\t\t\t\t\tforeach ( $args['append_options'] as $slug => $label ) :\n\t\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $slug ), selected( $selected, $slug, false ), esc_attr( $label ) );\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\tendif;\n\t\t\tprint( '</select>' );\n\t\t\treturn true;\n\t\telse :\n\t\t\treturn false;\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_posts' ) ) {\n\tfunction sp_posts( $post_id = null, $meta = 'post' ) {\n\t\tif ( ! isset( $post_id ) ) {\n\t\t\tglobal $post_id;\n\t\t}\n\t\t$ids = get_post_meta( $post_id, $meta, false );\n\t\tif ( ( $key = array_search( 0, $ids ) ) !== false ) {\n\t\t\tunset( $ids[ $key ] );\n\t\t}\n\t\t$i     = 0;\n\t\t$count = count( $ids );\n\t\tif ( isset( $ids ) && $ids && is_array( $ids ) && ! empty( $ids ) ) :\n\t\t\tforeach ( $ids as $id ) :\n\t\t\t\tif ( ! $id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$parents = get_post_ancestors( $id );\n\t\t\t\t$keys    = array_keys( $parents );\n\t\t\t\t$values  = array_reverse( array_values( $parents ) );\n\t\t\t\tif ( ! empty( $keys ) && ! empty( $values ) ) :\n\t\t\t\t\t$parents = array_combine( $keys, $values );\n\t\t\t\t\tforeach ( $parents as $parent ) :\n\t\t\t\t\t\tif ( ! in_array( $parent, $ids ) ) {\n\t\t\t\t\t\t\tedit_post_link( get_the_title( $parent ), '', '', $parent );\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo ' - ';\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\t\t$title = get_the_title( $id );\n\t\t\t\tif ( ! $title ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( empty( $title ) ) {\n\t\t\t\t\t$title = esc_attr__( '(no title)', 'sportspress' );\n\t\t\t\t}\n\t\t\t\tedit_post_link( $title, '', '', $id );\n\t\t\t\tif ( ++$i !== $count ) {\n\t\t\t\t\techo ', ';\n\t\t\t\t}\n\t\t\tendforeach;\n\t\tendif;\n\t}\n}\n\nif ( ! function_exists( 'sp_post_checklist' ) ) {\n\tfunction sp_post_checklist( $post_id = null, $meta = 'post', $display = 'block', $filters = null, $index = null, $slug = null ) {\n\t\tif ( ! isset( $post_id ) ) {\n\t\t\tglobal $post_id;\n\t\t}\n\t\tif ( ! isset( $slug ) ) {\n\t\t\t$slug = $meta;\n\t\t}\n\t\t?>\n\t\t<div id=\"<?php echo esc_attr( $slug ); ?>-all\" class=\"posttypediv tabs-panel wp-tab-panel sp-tab-panel sp-tab-filter-panel sp-select-all-range\" style=\"display: <?php echo esc_attr( $display ); ?>;\">\n\t\t\t<input type=\"hidden\" value=\"0\" name=\"<?php echo esc_attr( $slug ); ?><?php if ( isset( $index ) ) { echo '[' . esc_attr( $index ) . ']';} ?>[]\" />\n\t\t\t<ul class=\"categorychecklist form-no-clear\">\n\t\t\t\t<li class=\"sp-select-all-container\"><label class=\"selectit\"><input type=\"checkbox\" class=\"sp-select-all\"> <strong><?php esc_attr_e( 'Select All', 'sportspress' ); ?></strong></label></li>\n\t\t\t\t<?php\n\t\t\t\t$selected = (array) get_post_meta( $post_id, $slug, false );\n\t\t\t\tif ( ! sizeof( $selected ) ) {\n\t\t\t\t\t$selected = (array) get_post_meta( $post_id, $meta, false );\n\t\t\t\t}\n\t\t\t\t$selected = sp_array_between( $selected, 0, $index );\n\t\t\t\tif ( empty( $posts ) ) :\n\t\t\t\t\t$query = array(\n\t\t\t\t\t\t'post_type'     => $meta,\n\t\t\t\t\t\t'numberposts'   => -1,\n\t\t\t\t\t\t'post_per_page' => -1,\n\t\t\t\t\t\t'orderby'       => 'menu_order',\n\t\t\t\t\t);\n\t\t\t\t\tif ( $meta == 'sp_player' ) :\n\t\t\t\t\t\t$query['meta_key'] = 'sp_number';\n\t\t\t\t\t\t$query['orderby']  = 'meta_value_num';\n\t\t\t\t\t\t$query['order']    = 'ASC';\n\t\t\t\t\tendif;\n\t\t\t\t\t// Add a hook to alter $query args.\n\t\t\t\t\t$query = apply_filters( 'sportspress_sp_post_checklist_args', $query, $meta );\n\t\t\t\t\t$posts = get_posts( $query );\n\t\t\t\tendif;\n\t\t\t\tforeach ( $posts as $post ) :\n\t\t\t\t\t$parents = get_post_ancestors( $post );\n\t\t\t\t\tif ( $filters ) :\n\t\t\t\t\t\tif ( is_array( $filters ) ) :\n\t\t\t\t\t\t\t$filter_values = array();\n\t\t\t\t\t\t\tforeach ( $filters as $filter ) :\n\t\t\t\t\t\t\t\tif ( get_taxonomy( $filter ) ) :\n\t\t\t\t\t\t\t\t\t$terms = (array) get_the_terms( $post->ID, $filter );\n\t\t\t\t\t\t\t\t\tforeach ( $terms as $term ) :\n\t\t\t\t\t\t\t\t\t\tif ( is_object( $term ) && property_exists( $term, 'term_id' ) ) {\n\t\t\t\t\t\t\t\t\t\t\t$filter_values[] = $term->term_id;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t$filter_values = array_merge( $filter_values, (array) get_post_meta( $post->ID, $filter, false ) );\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t$filter = $filters;\n\t\t\t\t\t\t\tif ( get_taxonomy( $filter ) ) :\n\t\t\t\t\t\t\t\t$terms = (array) get_the_terms( $post->ID, $filter );\n\t\t\t\t\t\t\t\tforeach ( $terms as $term ) :\n\t\t\t\t\t\t\t\t\tif ( is_object( $term ) && property_exists( $term, 'term_id' ) ) {\n\t\t\t\t\t\t\t\t\t\t$filter_values[] = $term->term_id;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$filter_values = (array) get_post_meta( $post->ID, $filter, false );\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"sp-post sp-filter-0\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( $filters ) :\n\t\t\t\t\t\tforeach ( $filter_values as $filter_value ) :\n\t\t\t\t\t\t\techo ' sp-filter-' . esc_attr( $filter_value );\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t\t\">\n\t\t\t\t\t\t<?php echo str_repeat( '<ul><li>', sizeof( $parents ) ); ?>\n\t\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"<?php echo esc_attr( $post->ID ); ?>\" name=\"<?php echo esc_attr( $slug ); ?><?php if ( isset( $index ) ) { echo '[' . esc_attr( $index ) . ']';} ?>[]\"\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( in_array( $post->ID, $selected ) ) {\n\t\t\t\t\t\t\t\techo ' checked=\"checked\"';}\n\t\t\t\t\t\t\t?>\n>\n\t\t\t\t\t\t\t<?php echo esc_html( sp_get_player_name_with_number( $post->ID ) ); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<?php echo str_repeat( '</li></ul>', sizeof( $parents ) ); ?>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t\t<li class=\"sp-not-found-container\">\n\t\t\t\t\t<?php esc_attr_e( 'No results found.', 'sportspress' ); ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( sizeof( $posts ) ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<a class=\"sp-show-all\" href=\"#show-all-<?php echo esc_attr( $slug ); ?>s\"><?php esc_attr_e( 'Show all', 'sportspress' ); ?></a><?php endif; ?>\n\t\t\t\t</li>\n\t\t\t\t<?php if ( sizeof( $posts ) ) : ?>\n\t\t\t\t\t<li class=\"sp-show-all-container\"><a class=\"sp-show-all\" href=\"#show-all-<?php echo esc_attr( $slug ); ?>s\"><?php esc_attr_e( 'Show all', 'sportspress' ); ?></a></li>\n\t\t\t\t<?php endif; ?>\n\t\t\t</ul>\n\t\t</div>\n\t\t<?php\n\t}\n}\n\nif ( ! function_exists( 'sp_column_checklist' ) ) {\n\tfunction sp_column_checklist( $post_id = null, $meta = 'post', $display = 'block', $selected = array(), $default_checked = false ) {\n\t\tif ( ! isset( $post_id ) ) {\n\t\t\tglobal $post_id;\n\t\t}\n\t\t?>\n\t\t<div id=\"<?php echo esc_attr( $meta ); ?>-all\" class=\"posttypediv tabs-panel wp-tab-panel sp-tab-panel sp-select-all-range\" style=\"display: <?php echo esc_attr( $display ); ?>;\">\n\t\t\t<input type=\"hidden\" value=\"0\" name=\"sp_columns[]\" />\n\t\t\t<ul class=\"categorychecklist form-no-clear\">\n\t\t\t\t<li class=\"sp-select-all-container\"><label class=\"selectit\"><input type=\"checkbox\" class=\"sp-select-all\"> <strong><?php esc_attr_e( 'Select All', 'sportspress' ); ?></strong></label></li>\n\t\t\t\t<?php\n\t\t\t\t$posts = get_pages(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type' => $meta,\n\t\t\t\t\t\t'number'    => 0,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif ( empty( $posts ) ) :\n\t\t\t\t\t$query = array(\n\t\t\t\t\t\t'post_type'     => $meta,\n\t\t\t\t\t\t'numberposts'   => -1,\n\t\t\t\t\t\t'post_per_page' => -1,\n\t\t\t\t\t\t'order'         => 'ASC',\n\t\t\t\t\t\t'orderby'       => 'menu_order',\n\t\t\t\t\t\t'meta_query'    => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t\t\t\t'value'   => 'number',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_format',\n\t\t\t\t\t\t\t\t'value'   => array( 'equation', 'text' ),\n\t\t\t\t\t\t\t\t'compare' => 'NOT IN',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\t$posts = get_posts( $query );\n\t\t\t\tendif;\n\t\t\t\tif ( sizeof( $posts ) ) :\n\t\t\t\t\tforeach ( $posts as $post ) :\n\t\t\t\t\t\tif ( 'sp_performance' == $meta ) {\n\t\t\t\t\t\t\t$format = get_post_meta( $post->ID, 'sp_format', true );\n\t\t\t\t\t\t\tif ( 'text' === $format ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li class=\"sp-post\">\n\t\t\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"<?php echo esc_attr( $post->post_name ); ?>\" name=\"sp_columns[]\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ( ! is_array( $selected ) && $default_checked ) || in_array( $post->post_name, $selected ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo ' checked=\"checked\"';}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<?php echo esc_html( sp_draft_or_post_title( $post ) ); ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<?php\n\t\t\t\t\tendforeach;\n\t\t\t\telse :\n\t\t\t\t\t?>\n\t\t\t\t<li class=\"sp-not-found-container\"><?php esc_attr_e( 'No results found.', 'sportspress' ); ?></li>\n\t\t\t\t<?php endif; ?>\n\t\t\t</ul>\n\t\t</div>\n\t\t<?php\n\t}\n}\n\n\n/**\n * Get the post title.\n *\n * The post title is fetched and if it is blank then a default string is\n * returned.\n *\n * @since 2.7.0\n * @param mixed $post Post id or object. If not supplied the global $post is used.\n * @return string The post title if set\n */\nif ( ! function_exists( 'sp_draft_or_post_title' ) ) {\n\tfunction sp_draft_or_post_title( $post = 0 ) {\n\t\t$title = get_the_title( $post );\n\t\tif ( empty( $title ) ) {\n\t\t\t$title = esc_attr__( '(no title)', 'sportspress' );\n\t\t}\n\t\treturn $title;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_var_labels' ) ) {\n\tfunction sp_get_var_labels( $post_type, $neg = null, $all = true ) {\n\t\t$args = array(\n\t\t\t'post_type'      => $post_type,\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\n\t\tif ( ! $all ) {\n\t\t\t$args['meta_query'] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => 'sp_visible',\n\t\t\t\t\t'value' => 1,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_visible',\n\t\t\t\t\t'value'   => 1,\n\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t),\n\t\t\t\t'relation' => 'OR',\n\t\t\t);\n\t\t}\n\n\t\t$vars = get_posts( $args );\n\n\t\t$output = array();\n\t\tforeach ( $vars as $var ) :\n\t\t\tif ( $neg === null || ( $neg && $var->menu_order < 0 ) || ( ! $neg && $var->menu_order >= 0 ) ) {\n\t\t\t\t$output[ $var->post_name ] = $var->post_title;\n\t\t\t}\n\t\tendforeach;\n\n\t\treturn $output;\n\t}\n}\n\nif ( ! function_exists( 'sp_get_var_equations' ) ) {\n\tfunction sp_get_var_equations( $post_type ) {\n\t\t$args = array(\n\t\t\t'post_type'      => $post_type,\n\t\t\t'numberposts'    => -1,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t);\n\n\t\t$vars = get_posts( $args );\n\n\t\t$output = array();\n\t\tforeach ( $vars as $var ) :\n\t\t\t$equation = get_post_meta( $var->ID, 'sp_equation', true );\n\t\t\tif ( ! $equation ) {\n\t\t\t\t$equation = 0;\n\t\t\t}\n\t\t\t$precision = get_post_meta( $var->ID, 'sp_precision', true );\n\t\t\tif ( ! $precision ) {\n\t\t\t\t$precision = 0;\n\t\t\t}\n\t\t\t$output[ $var->post_name ] = array(\n\t\t\t\t'equation'  => $equation,\n\t\t\t\t'precision' => $precision,\n\t\t\t);\n\t\tendforeach;\n\n\t\treturn $output;\n\t}\n}\n\nif ( ! function_exists( 'sp_post_adder' ) ) {\n\tfunction sp_post_adder( $post_type = 'post', $label = null, $attributes = array() ) {\n\t\t$obj = get_post_type_object( $post_type );\n\t\tif ( $label == null ) {\n\t\t\t$label = esc_attr__( 'Add New', 'sportspress' );\n\t\t}\n\t\t?>\n\t\t<div id=\"<?php echo esc_attr( $post_type ); ?>-adder\">\n\t\t\t<h4>\n\t\t\t\t<a title=\"<?php echo esc_attr( $label ); ?>\" href=\"<?php echo esc_url( admin_url( add_query_arg( $attributes, 'post-new.php?post_type=' . $post_type ) ) ); ?>\" target=\"_blank\">\n\t\t\t\t\t+ <?php echo esc_html( $label ); ?>\n\t\t\t\t</a>\n\t\t\t</h4>\n\t\t</div>\n\t\t<?php\n\t}\n}\n\nif ( ! function_exists( 'sp_taxonomy_adder' ) ) {\n\tfunction sp_taxonomy_adder( $taxonomy = 'category', $post_type = null, $label = null ) {\n\t\t$obj = get_taxonomy( $taxonomy );\n\t\tif ( $label == null ) {\n\t\t\t$label = esc_attr__( 'Add New', 'sportspress' );\n\t\t}\n\t\t?>\n\t\t<div id=\"<?php echo esc_attr( $taxonomy ); ?>-adder\">\n\t\t\t<h4>\n\t\t\t\t<a title=\"<?php echo esc_attr( $label ); ?>\" href=\"<?php echo esc_url( admin_url( 'edit-tags.php?taxonomy=' . $taxonomy . ( $post_type ? '&post_type=' . $post_type : '' ) ) ); ?>\" target=\"_blank\">\n\t\t\t\t\t+ <?php echo esc_html( $label ); ?>\n\t\t\t\t</a>\n\t\t\t</h4>\n\t\t</div>\n\t\t<?php\n\t}\n}\n\nif ( ! function_exists( 'sp_update_post_meta' ) ) {\n\tfunction sp_update_post_meta( $post_id, $meta_key, $meta_value, $default = null ) {\n\t\tif ( ! isset( $meta_value ) && isset( $default ) ) {\n\t\t\t$meta_value = $default;\n\t\t}\n\t\tadd_post_meta( $post_id, $meta_key, $meta_value, true );\n\t}\n}\n\nif ( ! function_exists( 'sp_add_post_meta_recursive' ) ) {\n\tfunction sp_add_post_meta_recursive( $post_id, $meta_key, $meta_value ) {\n\t\t$values = new RecursiveIteratorIterator( new RecursiveArrayIterator( $meta_value ) );\n\t\tforeach ( $values as $value ) :\n\t\t\tadd_post_meta( $post_id, $meta_key, $value, false );\n\t\tendforeach;\n\t}\n}\n\nif ( ! function_exists( 'sp_update_post_meta_recursive' ) ) {\n\tfunction sp_update_post_meta_recursive( $post_id, $meta_key, $meta_value ) {\n\t\tdelete_post_meta( $post_id, $meta_key );\n\t\tsp_add_post_meta_recursive( $post_id, $meta_key, $meta_value );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_user_meta_backward_compatible' ) ) {\n\tfunction sp_get_user_meta_backward_compatible( $user_id, $meta_key ) {\n\t\t// First try to get data from new format (user options).\n\t\t$new_data = get_user_option( $meta_key, $user_id );\n\t\t\n\t\t// If new data exists and is not empty, return it.\n\t\tif ( ! empty( $new_data ) ) {\n\t\t\treturn is_array( $new_data ) ? $new_data : array( $new_data );\n\t\t}\n\t\t\n\t\t// If no new data, try old format (user meta).\n\t\t$old_data = get_user_meta( $user_id, $meta_key, false );\n\t\t\n\t\t// If old data exists, migrate it to new format.\n\t\tif ( ! empty( $old_data ) ) {\n\t\t\t// Store in new format.\n\t\t\tupdate_user_option( $user_id, $meta_key, $old_data );\n\t\t\t\n\t\t\t// Clean up old data.\n\t\t\tdelete_user_meta( $user_id, $meta_key );\n\t\t\t\n\t\t\treturn $old_data;\n\t\t}\n\t\t\n\t\t// Return empty array if no data found.\n\t\treturn array();\n\t}\n}\n\nif ( ! function_exists( 'sp_update_user_meta_recursive' ) ) {\n\tfunction sp_update_user_meta_recursive( $user_id, $meta_key, $meta_value ) {\n\t\t// Delete existing data.\n\t\tdelete_user_option( $user_id, $meta_key );\n\t\t\n\t\t// Get existing values for this site.\n\t\t$existing_values = get_user_option( $meta_key, $user_id );\n\t\tif ( ! is_array( $existing_values ) ) {\n\t\t\t$existing_values = array();\n\t\t}\n\t\t\n\t\t// Add new values to existing array\n\t\t$values = new RecursiveIteratorIterator( new RecursiveArrayIterator( $meta_value ) );\n\t\tforeach ( $values as $value ) :\n\t\t\t$existing_values[] = $value;\n\t\tendforeach;\n\n\t\t// Remove duplicates.\n\t\t$existing_values = array_unique( $existing_values );\n\t\t\n\t\t// Store all values as array in user option (site-specific).\n\t\tupdate_user_option( $user_id, $meta_key, $existing_values );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_eos_safe_slug' ) ) {\n\tfunction sp_get_eos_safe_slug( $title, $post_id = 'var' ) {\n\n\t\t// String to lowercase\n\t\t$title = strtolower( $title );\n\n\t\t// Replace all numbers with words\n\t\t$title = sp_numbers_to_words( $title );\n\n\t\t// Remove all other non-alphabet characters\n\t\t$title = preg_replace( '/[^a-z_]/', '', $title );\n\n\t\t// Convert post ID to words if title is empty\n\t\tif ( $title == '' ) :\n\n\t\t\t$title = sp_numbers_to_words( $post_id );\n\n\t\tendif;\n\n\t\treturn $title;\n\n\t}\n}\n\nif ( ! function_exists( 'sp_solve' ) ) {\n\tfunction sp_solve( $equation, $vars, $precision = 0, $default = 0, $post_id = 0 ) {\n\n\t\t// Add a hook to alter $equation\n\t\t$equation = apply_filters( 'sportspress_equation_alter', $equation, $vars, $precision, $default );\n\n\t\tif ( $equation == null ) {\n\t\t\treturn $default;\n\t\t}\n\n\t\tif ( strpos( $equation, '$gamesback' ) !== false ) :\n\n\t\t\t// Return placeholder\n\t\t\treturn $default;\n\n\t\telseif ( strpos( $equation, '$streak' ) !== false ) :\n\n\t\t\t// Return direct value\n\t\t\treturn sp_array_value( $vars, 'streak', $default );\n\n\t\telseif ( strpos( $equation, '$form' ) !== false ) :\n\n\t\t\t// Return direct value\n\t\t\treturn sp_array_value( $vars, 'form', $default );\n\n\t\telseif ( strpos( $equation, '$last5' ) !== false ) :\n\n\t\t\t// Return imploded string\n\t\t\t$last5 = sp_array_value( $vars, 'last5', array( 0 ) );\n\t\t\tif ( array_sum( $last5 ) > 0 ) :\n\t\t\t\treturn implode( '-', $last5 );\n\t\t\telse :\n\t\t\t\treturn $default;\n\t\t\tendif;\n\n\t\telseif ( strpos( $equation, '$last10' ) !== false ) :\n\n\t\t\t// Return imploded string\n\t\t\t$last10 = sp_array_value( $vars, 'last10', array( 0 ) );\n\t\t\tif ( array_sum( $last10 ) > 0 ) :\n\t\t\t\treturn implode( '-', $last10 );\n\t\t\telse :\n\t\t\t\treturn $default;\n\t\t\tendif;\n\n\t\telseif ( strpos( $equation, '$homerecord' ) !== false ) :\n\n\t\t\t// Return imploded string\n\t\t\t$homerecord = sp_array_value( $vars, 'homerecord', array( 0 ) );\n\t\t\treturn implode( '-', $homerecord );\n\n\t\telseif ( strpos( $equation, '$awayrecord' ) !== false ) :\n\n\t\t\t// Return imploded string\n\t\t\t$awayrecord = sp_array_value( $vars, 'awayrecord', array( 0 ) );\n\t\t\treturn implode( '-', $awayrecord );\n\n\t\tendif;\n\n\t\tif ( $solution = apply_filters( 'sportspress_equation_solve_for_presets', null, $equation, $post_id ) ) :\n\t\t\treturn $solution;\n\t\tendif;\n\n\t\t// Remove unnecessary variables from vars before calculating\n\t\tunset( $vars['gamesback'] );\n\t\tunset( $vars['streak'] );\n\t\tunset( $vars['last5'] );\n\t\tunset( $vars['last10'] );\n\n\t\t// Equation Operating System\n\t\tif ( ! class_exists( 'phpStack' ) ) {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/libraries/class-phpstack.php';\n\t\t}\n\t\tif ( ! class_exists( 'eqEOS' ) ) {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/libraries/class-eqeos.php';\n\t\t}\n\t\t$eos = new eqEOS();\n\n\t\t// Remove spaces from equation\n\t\t$equation = str_replace( ' ', '', $equation );\n\n\t\t// Create temporary equation replacing operators with spaces\n\t\t$temp = str_replace( array( '+', '-', '*', '/', '(', ')' ), ' ', $equation );\n\n\t\t// Check if each variable part is in vars\n\t\t$parts = explode( ' ', $temp );\n\t\tforeach ( $parts as $key => $value ) :\n\t\t\tif ( substr( $value, 0, 1 ) == '$' ) :\n\t\t\t\tif ( ! array_key_exists( preg_replace( '/[^a-z0-9_]/', '', $value ), $vars ) ) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\tendif;\n\t\tendforeach;\n\n\t\t// Remove space between equation parts\n\t\t$equation = str_replace( ' ', '', $equation );\n\n\t\t// Initialize Subequations\n\t\t$subequations = array( $equation );\n\n\t\t// Find all equation parts contained in parentheses\n\t\tif ( preg_match_all( '~\\((.*?)\\)~', $equation, $results ) ) {\n\t\t\tforeach ( sp_array_value( $results, 1, array() ) as $result ) {\n\t\t\t\tif ( ! empty( $result ) ) {\n\t\t\t\t\t$subequations[] = $result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Initialize subequation\n\t\t$subequation = $equation;\n\n\t\t// Check each subequation separated by division\n\t\tforeach ( $subequations as $subequation ) {\n\t\t\twhile ( $pos = strpos( $subequation, '/' ) ) {\n\t\t\t\t$subequation = substr( $subequation, $pos + 1 );\n\n\t\t\t\t// Make sure paretheses match\n\t\t\t\tif ( substr_count( $subequation, '(' ) === substr_count( $subequation, ')' ) ) {\n\n\t\t\t\t\t// Return zero if denominator is zero\n\t\t\t\t\tif ( $eos->solveIF( $subequation, $vars ) == 0 ) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Return solution\n\t\treturn number_format( $eos->solveIF( str_replace( ' ', '', $equation ), $vars ), $precision, '.', '' );\n\n\t}\n}\n\nif ( ! function_exists( 'sp_sort_table_teams' ) ) {\n\tfunction sp_sort_table_teams( $a, $b ) {\n\n\t\tglobal $sportspress_column_priorities;\n\n\t\t// Loop through priorities\n\t\tforeach ( $sportspress_column_priorities as $priority ) :\n\n\t\t\t// Proceed if columns are not equal\n\t\t\tif ( sp_array_value( $a, $priority['column'], 0 ) != sp_array_value( $b, $priority['column'], 0 ) ) :\n\n\t\t\t\t// Compare column values\n\t\t\t\t$output = sp_array_value( $a, $priority['column'], 0 ) - sp_array_value( $b, $priority['column'], 0 );\n\n\t\t\t\t// Flip value if descending order\n\t\t\t\tif ( $priority['order'] == 'DESC' ) {\n\t\t\t\t\t$output = 0 - $output;\n\t\t\t\t}\n\n\t\t\t\treturn ( $output > 0 );\n\n\t\t\tendif;\n\n\t\tendforeach;\n\n\t\t// Default sort by alphabetical\n\t\treturn strcmp( sp_array_value( $a, 'name', '' ), sp_array_value( $b, 'name', '' ) );\n\t}\n}\n\nif ( ! function_exists( 'sp_sort_terms' ) ) {\n\n\t/**\n\t * Sorts terms by `sp_order`.\n\t *\n\t * @param  int|object $a Term ID or term.\n\t * @param  int|object $b Term ID or term.\n\t * @return int    Sorting order.\n\t */\n\tfunction sp_sort_terms( $a, $b ) {\n\t\tif ( is_numeric( $a ) ) {\n\t\t\t$a = intval( $a );\n\t\t\t$a = get_term( $a );\n\t\t}\n\t\tif ( is_numeric( $b ) ) {\n\t\t\t$b = intval( $b );\n\t\t\t$b = get_term( $b );\n\t\t}\n\t\t$term_meta_a = get_term_meta( $a->term_id, 'sp_order', true );\n\t\t$term_meta_b = get_term_meta( $b->term_id, 'sp_order', true );\n\t\treturn $term_meta_a == $term_meta_b ? 0 : ( $term_meta_a > $term_meta_b ? 1 : -1 );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_next_event' ) ) {\n\tfunction sp_get_next_event( $args = array() ) {\n\t\t$options = array(\n\t\t\t'post_type'      => 'sp_event',\n\t\t\t'posts_per_page' => 1,\n\t\t\t'order'          => 'ASC',\n\t\t\t'post_status'    => 'future',\n\t\t);\n\t\t$options = array_merge( $options, $args );\n\t\t$posts   = get_posts( $options );\n\t\tif ( $posts && is_array( $posts ) ) {\n\t\t\treturn array_pop( $posts );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\nif ( ! function_exists( 'sp_taxonomy_field' ) ) {\n\tfunction sp_taxonomy_field( $taxonomy = 'category', $post = null, $multiple = false, $trigger = false, $placeholder = null ) {\n\t\t$obj = get_taxonomy( $taxonomy );\n\t\tif ( $obj && $obj->public) {\n\t\t\t$post_type = get_post_type( $post );\n\t\t\t?>\n\t\t\t<div class=\"<?php echo esc_attr( $post_type ); ?>-<?php echo esc_attr( $taxonomy ); ?>-field\">\n\t\t\t\t<p><strong><?php echo esc_attr( $obj->labels->singular_name ); ?></strong></p>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\t$terms    = get_the_terms( $post->ID, $taxonomy );\n\t\t\t\t\t$term_ids = array();\n\t\t\t\t\tif ( $terms ) :\n\t\t\t\t\t\tforeach ( $terms as $term ) :\n\t\t\t\t\t\t\t$term_ids[] = $term->term_id;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendif;\n\n\t\t\t\t\t// Set auto option\n\t\t\t\t\t$auto = false;\n\t\t\t\t\tif ( in_array( $post_type, sp_secondary_post_types() ) ) {\n\t\t\t\t\t\tswitch ( $taxonomy ) {\n\t\t\t\t\t\t\tcase 'sp_league':\n\t\t\t\t\t\t\t\t$auto = esc_attr__( 'Main League', 'sportspress' );\n\t\t\t\t\t\t\t\tif ( get_post_meta( $post->ID, 'sp_main_league', true ) ) {\n\t\t\t\t\t\t\t\t\t$term_ids[] = 'auto';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'sp_season':\n\t\t\t\t\t\t\t\t$auto = esc_attr__( 'Current Season', 'sportspress' );\n\t\t\t\t\t\t\t\tif ( get_post_meta( $post->ID, 'sp_current_season', true ) ) {\n\t\t\t\t\t\t\t\t\t$term_ids[] = 'auto';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'show_option_auto' => $auto,\n\t\t\t\t\t\t'taxonomy'         => $taxonomy,\n\t\t\t\t\t\t'name'             => 'tax_input[' . $taxonomy . '][]',\n\t\t\t\t\t\t'selected'         => $term_ids,\n\t\t\t\t\t\t'values'           => 'term_id',\n\t\t\t\t\t\t'class'            => 'sp-has-dummy widefat' . ( $trigger ? ' sp-ajax-trigger' : '' ),\n\t\t\t\t\t\t'chosen'           => true,\n\t\t\t\t\t\t'placeholder'      => $placeholder ? $placeholder : esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t\t);\n\t\t\t\t\tif ( $multiple ) {\n\t\t\t\t\t\t$args['property'] = 'multiple';\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! sp_dropdown_taxonomies( $args ) ) :\n\t\t\t\t\t\tsp_taxonomy_adder( $taxonomy, $post_type, $obj->labels->add_new_item );\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n}\n\n/**\n * Get an array of text options per context.\n *\n * @return array\n */\nfunction sp_get_text_options() {\n\t$strings = apply_filters(\n\t\t'sportspress_text',\n\t\tarray(\n\t\t\t__( 'Article', 'sportspress' ),\n\t\t\t__( 'Away', 'sportspress' ),\n\t\t\t__( 'Box Score', 'sportspress' ),\n\t\t\t__( 'Canceled', 'sportspress' ),\n\t\t\t__( 'Career Total', 'sportspress' ),\n\t\t\t__( 'Current Team', 'sportspress' ),\n\t\t\t__( 'Date', 'sportspress' ),\n\t\t\t__( 'Defense', 'sportspress' ),\n\t\t\t__( 'Details', 'sportspress' ),\n\t\t\t__( 'Event', 'sportspress' ),\n\t\t\t__( 'Events', 'sportspress' ),\n\t\t\t__( 'Excerpt', 'sportspress' ),\n\t\t\t__( 'Fixtures', 'sportspress' ),\n\t\t\t__( 'Full Time', 'sportspress' ),\n\t\t\t__( 'Home', 'sportspress' ),\n\t\t\t__( 'League', 'sportspress' ),\n\t\t\t__( 'Leagues', 'sportspress' ),\n\t\t\t__( 'League Table', 'sportspress' ),\n\t\t\t__( 'Match Day', 'sportspress' ),\n\t\t\t__( 'Nationality', 'sportspress' ),\n\t\t\t__( 'Offense', 'sportspress' ),\n\t\t\t__( 'Outcome', 'sportspress' ),\n\t\t\t__( 'Past Teams', 'sportspress' ),\n\t\t\t__( 'Photo', 'sportspress' ),\n\t\t\t__( 'Player', 'sportspress' ),\n\t\t\t__( 'Player of the Match', 'sportspress' ),\n\t\t\t__( 'Players', 'sportspress' ),\n\t\t\t__( 'Pos', 'sportspress' ),\n\t\t\t__( 'Position', 'sportspress' ),\n\t\t\t__( 'Postponed', 'sportspress' ),\n\t\t\t__( 'Preview', 'sportspress' ),\n\t\t\t__( 'Profile', 'sportspress' ),\n\t\t\t__( 'Rank', 'sportspress' ),\n\t\t\t__( 'Recap', 'sportspress' ),\n\t\t\t__( 'Results', 'sportspress' ),\n\t\t\t__( 'Season', 'sportspress' ),\n\t\t\t__( 'Seasons', 'sportspress' ),\n\t\t\t__( 'Staff', 'sportspress' ),\n\t\t\t__( 'Statistics', 'sportspress' ),\n\t\t\t__( 'TBD', 'sportspress' ),\n\t\t\t__( 'Team', 'sportspress' ),\n\t\t\t__( 'Teams', 'sportspress' ),\n\t\t\t__( 'Time', 'sportspress' ),\n\t\t\t__( 'Time/Results', 'sportspress' ),\n\t\t\t__( 'Total', 'sportspress' ),\n\t\t\t__( 'Venue', 'sportspress' ),\n\t\t\t__( 'Video', 'sportspress' ),\n\t\t\t__( 'View all events', 'sportspress' ),\n\t\t\t__( 'View all players', 'sportspress' ),\n\t\t\t__( 'View full table', 'sportspress' ),\n\t\t\t__( 'Visit Site', 'sportspress' ),\n\t\t)\n\t);\n\n\tasort( $strings );\n\treturn array_unique( $strings );\n}\n\n/**\n * Display a link to review SportsPress\n *\n * @return null\n */\nfunction sp_review_link() {\n\t?>\n\t<p>\n\t\t<a href=\"https://wordpress.org/support/plugin/sportspress/reviews/?rate=5#new-post\">\n\t\t\t<?php esc_attr_e( 'Love SportsPress? Help spread the word by rating us 5★ on WordPress.org', 'sportspress' ); ?>\n\t\t</a>\n\t</p>\n\t<?php\n}\n\n/**\n * Return shortcode template for meta boxes\n *\n * @return null\n */\nfunction sp_get_shortcode_template( $shortcode, $id = null, $args = array() ) {\n\t$args   = apply_filters( 'sportspress_shortcode_template_args', $args );\n\t$output = '[' . $shortcode;\n\tif ( $id ) {\n\t\t$output .= ' ' . $id;\n\t}\n\tif ( sizeof( $args ) ) {\n\t\tforeach ( $args as $key => $value ) {\n\t\t\t$output .= ' ' . $key . '=\"' . $value . '\"';\n\t\t}\n\t}\n\t$output .= ']';\n\treturn esc_attr( $output );\n}\n\n/**\n * Display shortcode template for meta boxes\n *\n * @return null\n */\nfunction sp_shortcode_template( $shortcode, $id = null, $args = array() ) {\n\techo esc_attr( sp_get_shortcode_template( $shortcode, $id, $args ) );\n}\n\nif ( ! function_exists( 'array_replace' ) ) {\n\t/**\n\t * array_replace for PHP version earlier than 5.3\n\t *\n\t * @link   http://be2.php.net/manual/fr/function.array-replace.php#115215\n\t */\n\tfunction array_replace() {\n\t\t$args     = func_get_args();\n\t\t$num_args = func_num_args();\n\t\t$res      = array();\n\t\tfor ( $i = 0; $i < $num_args; $i++ ) {\n\t\t\tif ( is_array( $args[ $i ] ) ) {\n\t\t\t\tforeach ( $args[ $i ] as $key => $val ) {\n\t\t\t\t\t$res[ $key ] = $val;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttrigger_error( __FUNCTION__ . '(): Argument #' . esc_html( $i + 1 ) . ' is not an array', E_USER_WARNING );\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}\n}\n\n/**\n * Check if a shortcode is shown on content\n *\n * @return bool\n */\nfunction sp_has_shortcodes( $content, $tags ) {\n\tif ( is_array( $tags ) ) {\n\t\tforeach ( $tags as $tag ) {\n\t\t\tpreg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );\n\t\t\tif ( empty( $matches ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tforeach ( $matches as $shortcode ) {\n\t\t\t\tif ( $tag === $shortcode[2] ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ( shortcode_exists( $tags ) ) {\n\t\t\tpreg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );\n\t\t\tif ( empty( $matches ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tforeach ( $matches as $shortcode ) {\n\t\t\t\tif ( $tags === $shortcode[2] ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Check if a custom flag was uploaded from the user\n *\n * @return string\n */\nfunction sp_flags( $nationality ) {\n\t$nationality = strtolower( $nationality );\n\t$flag        = '';\n\t$custom_flag_post_id = false;\n\t$args = array(\n\t\t'post_type' => 'attachment',\n\t\t'title' => $nationality,\n\t\t'posts_per_page' => 1,\n\t\t'fields' => 'ids',\n\t);\n\t$custom_flag = get_posts( $args );\n\tif( $custom_flag ){\n\t\t$custom_flag_post_id = $custom_flag[0];\n\t}\n\tif ( $custom_flag_post_id ) {\n\t\t$flag_src = wp_get_attachment_image_url( $custom_flag_post_id, array( 23, 15 ), false );\n\t\t$flag     = '<img src=\"' . $flag_src . '\" alt=\"' . $nationality . '\">';\n\t} else {\n\t\t$flag = '<img src=\"' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/flags/' . $nationality . '.png\" alt=\"' . $nationality . '\">';\n\t}\n\n\treturn $flag;\n}\n"
  },
  {
    "path": "includes/sp-deprecated-functions.php",
    "content": "<?php\n/**\n * Deprecated functions\n *\n * Where functions come to retire.\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     ThemeBoy/Functions\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/* Shortcodes */\nadd_shortcode( 'events-calendar', 'SP_Shortcodes::event_calendar' );\nadd_shortcode( 'events-list', 'SP_Shortcodes::event_list' );\nadd_shortcode( 'league-table', 'SP_Shortcodes::league_table' );\nadd_shortcode( 'player-list', 'SP_Shortcodes::player_list' );\nadd_shortcode( 'player-gallery', 'SP_Shortcodes::player_gallery' );\n\n/* Actions */\nfunction sportspress_before_template_part_action( $template_name, $template_path, $located, $args ) {\n\tdo_action( 'sportspress_before_template_part', $template_name, $template_path, $located, $args );\n}\nadd_action( 'sportspress_before_template', 'sportspress_before_template_part_action', 10, 4 );\n\nfunction sportspress_after_template_part_action( $template_name, $template_path, $located, $args ) {\n\tdo_action( 'sportspress_after_template_part', $template_name, $template_path, $located, $args );\n}\nadd_action( 'sportspress_after_template', 'sportspress_after_template_part_action', 10, 4 );\n\n/* Functions */\nfunction sportspress_flush_rewrite_rules() {\n\treturn sp_flush_rewrite_rules();\n}\nfunction sportspress_nonce() {\n\treturn sp_nonce();\n}\nfunction sportspress_array_between( $array = array(), $delimiter = 0, $index = 0 ) {\n\treturn sp_array_between( $array, $delimiter, $index );\n}\nfunction sportspress_array_value( $arr = array(), $key = 0, $default = null ) {\n\treturn sp_array_value( $arr, $key, $default );\n}\nfunction sportspress_array_combine( $keys = array(), $values = array() ) {\n\treturn sp_array_combine( $keys, $values );\n}\nfunction sportspress_numbers_to_words( $str ) {\n\treturn sp_numbers_to_words( $str );\n}\nfunction sportspress_get_the_term_id( $post_id, $taxonomy, $index ) {\n\treturn sp_get_the_term_id( $post_id, $taxonomy, $index );\n}\nfunction sportspress_get_post_views( $post_id ) {\n\treturn sp_get_post_views( $post_id );\n}\nfunction sportspress_set_post_views( $post_id ) {\n\treturn sp_set_post_views( $post_id );\n}\nfunction sportspress_get_post_precision( $post_id ) {\n\treturn sp_get_post_precision( $post_id );\n}\nfunction sportspress_get_post_calculate( $post_id ) {\n\treturn sp_get_post_calculate( $post_id );\n}\nfunction sportspress_get_post_equation( $post_id ) {\n\treturn sp_get_post_equation( $post_id );\n}\nfunction sportspress_get_post_order( $post_id ) {\n\treturn sp_get_post_order( $post_id );\n}\nfunction sportspress_dropdown_taxonomies( $args = array() ) {\n\treturn sp_dropdown_taxonomies( $args );\n}\nfunction sportspress_dropdown_pages( $args = array() ) {\n\treturn sp_dropdown_pages( $args );\n}\nfunction sportspress_posts( $post_id = null, $meta = 'post' ) {\n\treturn sp_posts( $post_id, $meta );\n}\nfunction sportspress_post_checklist( $post_id = null, $meta = 'post', $display = 'block', $filter = null, $index = null ) {\n\treturn sp_post_checklist( $post_id, $meta, $display, $filter, $index );\n}\nfunction sportspress_calculate_selector( $post_id, $selected = null ) {\n\treturn sp_calculate_selector( $post_id, $selected );\n}\nfunction sportspress_get_equation_optgroup_array( $post_id, $type = null, $variations = null, $defaults = null, $totals = true ) {\n\treturn sp_get_equation_optgroup_array( $post_id, $type, $variations, $defaults, $totals );\n}\nfunction sportspress_equation_selector( $post_id, $selected = null, $groups = array() ) {\n\treturn sp_equation_selector( $post_id, $selected, $groups );\n}\nfunction sportspress_get_var_labels( $post_type ) {\n\treturn sp_get_var_labels( $post_type );\n}\nfunction sportspress_get_var_equations( $post_type ) {\n\treturn sp_get_var_equations( $post_type );\n}\nfunction sportspress_edit_calendar_table( $data = array(), $usecolumns = null ) {\n\treturn sp_edit_calendar_table( $data, $usecolumns );\n}\nfunction sportspress_edit_league_table( $columns = array(), $usecolumns = null, $data = array(), $placeholders = array() ) {\n\treturn sp_edit_league_table( $columns, $usecolumns, $data, $placeholders );\n}\nfunction sportspress_edit_player_list_table( $columns = array(), $usecolumns = null, $data = array(), $placeholders = array() ) {\n\treturn sp_edit_player_list_table( $columns, $usecolumns, $data, $placeholders );\n}\nfunction sportspress_edit_team_columns_table( $league_id, $columns = array(), $data = array(), $placeholders = array(), $merged = array(), $seasons = array(), $readonly = true ) {\n\treturn sp_edit_team_columns_table( $league_id, $columns, $data, $placeholders, $merged, $seasons, $readonly );\n}\nfunction sportspress_edit_player_performance_table( $id = null, $league_id = null, $columns = array(), $data = array(), $placeholders = array(), $merged = array(), $seasons_teams = array(), $readonly = true ) {\n\treturn sp_edit_player_performance_table( $id, $league_id, $columns, $data, $placeholders, $merged, $seasons_teams, $readonly );\n}\nfunction sportspress_edit_event_results_table( $columns = array(), $data = array() ) {\n\treturn sp_edit_event_results_table( $columns, $data );\n}\nfunction sportspress_event_player_status_selector( $team_id, $player_id, $value = null ) {\n\treturn sp_event_player_status_selector( $team_id, $player_id, $value );\n}\nfunction sportspress_event_player_sub_selector( $team_id, $player_id, $value, $data = array() ) {\n\treturn sp_event_player_sub_selector( $team_id, $player_id, $value, $data );\n}\nfunction sportspress_edit_event_players_table( $columns = array(), $data = array(), $team_id = null ) {\n\treturn sp_edit_event_players_table( $columns, $data, $team_id );\n}\nfunction sportspress_post_adder( $post_type = 'post', $label = null ) {\n\treturn sp_post_adder( $post_type, $label );\n}\nfunction sportspress_taxonomy_adder( $taxonomy = 'category', $post_type = 'post', $label = null ) {\n\treturn sp_taxonomy_adder( $taxonomy, $post_type, $label );\n}\nfunction sportspress_update_post_meta( $post_id, $meta_key, $meta_value, $default = null ) {\n\treturn sp_update_post_meta( $post_id, $meta_key, $meta_value, $default );\n}\nfunction sportspress_update_post_meta_recursive( $post_id, $meta_key, $meta_value ) {\n\treturn sp_update_post_meta_recursive( $post_id, $meta_key, $meta_value );\n}\nfunction sportspress_get_eos_safe_slug( $title, $post_id = 'var' ) {\n\treturn sp_get_eos_safe_slug( $title, $post_id );\n}\nfunction sportspress_solve( $equation, $vars, $precision = 0 ) {\n\treturn sp_solve( $equation, $vars, $precision );\n}\nfunction sportspress_get_calendar_data( $post_id = null, $admin = false ) {\n\treturn sp_get_calendar_data( $post_id, $admin );\n}\nfunction sportspress_get_team_columns_data( $post_id, $league_id, $admin = false ) {\n\treturn sp_get_team_columns_data( $post_id, $league_id, $admin );\n}\nfunction sportspress_get_league_table_data( $post_id, $breakdown = false ) {\n\treturn sp_get_league_table_data( $post_id, $breakdown );\n}\nfunction sportspress_sort_table_teams( $a, $b ) {\n\treturn sp_sort_table_teams( $a, $b );\n}\nfunction sportspress_get_player_list_data( $post_id, $admin = false ) {\n\treturn sp_get_player_list_data( $post_id, $admin );\n}\nfunction sportspress_get_player_roster_data( $post_id, $admin = false ) {\n\treturn sp_get_player_roster_data( $post_id, $admin );\n}\nfunction sportspress_sort_list_players( $a, $b ) {\n\treturn sp_sort_list_players( $a, $b );\n}\nfunction sportspress_get_player_metrics_data( $post_id ) {\n\treturn sp_get_player_metrics_data( $post_id );\n}\nfunction sportspress_get_next_event( $args = array() ) {\n\treturn sp_get_next_event( $args );\n}\nfunction sportspress_delete_duplicate_post( &$post ) {\n\treturn sp_delete_duplicate_post( $post );\n}\nfunction sportspress_highlight_admin_menu( $p = 'options-general.php', $s = 'sportspress' ) {\n\treturn sp_highlight_admin_menu( $p, $s );\n}\n\nif ( ! function_exists( 'sp_get_team_columns_data' ) ) {\n\tfunction sp_get_team_columns_data( $post_id, $league_id, $admin = false ) {\n\t\t$team = new SP_Team( $post_id );\n\t\treturn $team->data( $league_id, $admin );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_league_table_data' ) ) {\n\tfunction sp_get_league_table_data( $post_id, $admin = false ) {\n\t\t$table = new SP_League_Table( $post_id );\n\t\treturn $table->data( $admin );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_player_statistics_data' ) ) {\n\tfunction sp_get_player_statistics_data( $post_id, $league_id, $admin = false ) {\n\t\t$list = new SP_Player_List( $post_id );\n\t\treturn $list->data( $league_id, $admin );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_player_list_data' ) ) {\n\tfunction sp_get_player_list_data( $post_id, $admin = false ) {\n\t\t$list = new SP_Player_List( $post_id );\n\t\treturn $list->data( $admin );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_short_name' ) ) {\n\tfunction sp_get_short_name( $post = 0 ) {\n\t\t$abbreviation = sp_get_abbreviation( $post, 'sp_abbreviation', true );\n\t\tif ( $abbreviation ) {\n\t\t\treturn $abbreviation;\n\t\t} else {\n\t\t\treturn get_the_title( $post );\n\t\t}\n\t}\n}\n\nif ( ! function_exists( 'sp_short_name' ) ) {\n\tfunction sp_short_name( $post = 0 ) {\n\t\techo wp_kses_post( sp_get_short_name( $post ) );\n\t}\n}\n\nif ( ! function_exists( 'sp_get_team_name' ) ) {\n\tfunction sp_get_team_name( $post = 0, $short = true ) {\n\t\tif ( $short ) {\n\t\t\treturn sp_team_abbreviation( $post );\n\t\t} else {\n\t\t\treturn get_the_title( $post );\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/sp-formatting-functions.php",
    "content": "<?php\n/**\n * SportsPress Formatting\n *\n * Functions for formatting data.\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     SportsPress/Functions\n * @version   2.7.3\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * Sanitize taxonomy names. Slug format (no spaces, lowercase).\n *\n * Doesn't use sanitize_title as this destroys utf chars.\n *\n * @access public\n * @param mixed $taxonomy\n * @return string\n */\nfunction sp_sanitize_taxonomy_name( $taxonomy ) {\n\t$filtered = strtolower( remove_accents( stripslashes( strip_tags( $taxonomy ) ) ) );\n\t$filtered = preg_replace( '/&.+?;/', '', $filtered ); // Kill entities\n\t$filtered = str_replace( array( '.', '\\'', '\"' ), '', $filtered ); // Kill quotes and full stops.\n\t$filtered = str_replace( array( ' ', '_' ), '-', $filtered ); // Replace spaces and underscores.\n\n\treturn apply_filters( 'sanitize_taxonomy_name', $filtered, $taxonomy );\n}\n\n/**\n * Clean variables\n *\n * @access public\n * @param string $var\n * @return string\n */\nfunction sp_clean( $var ) {\n\treturn sanitize_text_field( $var );\n}\n\n/**\n * Merge two arrays\n *\n * @access public\n * @param array $a1\n * @param array $a2\n * @return array\n */\nfunction sp_array_overlay( $a1, $a2 ) {\n\tforeach ( $a1 as $k => $v ) {\n\t\tif ( ! array_key_exists( $k, $a2 ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( is_array( $v ) && is_array( $a2[ $k ] ) ) {\n\t\t\t$a1[ $k ] = sp_array_overlay( $v, $a2[ $k ] );\n\t\t} else {\n\t\t\t$a1[ $k ] = $a2[ $k ];\n\t\t}\n\t}\n\treturn $a1;\n}\n\n/**\n * Array filter returns positive values only.\n *\n * @access public\n * @param int $var\n * @return bool\n */\nfunction sp_filter_positive( $var = 0 ) {\n\treturn $var > 0;\n}\n\n/**\n * Array filter returns non-empty array values.\n *\n * @access public\n * @param str $var\n * @return bool\n */\nfunction sp_filter_non_empty( $var = '' ) {\n\treturn strlen( $var ) > 0;\n}\n\n/**\n * Sort array randomly and maintain index association.\n *\n * @access public\n * @param array $array\n * @return bool\n */\nfunction sp_sort_random() {\n\treturn mt_rand( 0, 1 );\n}\n\n/**\n * Sort array by name field.\n *\n * @access public\n * @param array $array\n * @return bool\n */\nfunction sp_sort_by_name( $a, $b ) {\n\treturn strcmp( $a['name'], $b['name'] );\n}\n\n/**\n * let_to_num function.\n *\n * This function transforms the php.ini notation for numbers (like '2M') to an integer.\n *\n * @access public\n * @param $size\n * @return int\n */\nfunction sp_let_to_num( $size ) {\n\t$l   = substr( $size, -1 );\n\t$ret = substr( $size, 0, -1 );\n\tswitch ( strtoupper( $l ) ) {\n\t\tcase 'P':\n\t\t\t$ret *= 1024;\n\t\tcase 'T':\n\t\t\t$ret *= 1024;\n\t\tcase 'G':\n\t\t\t$ret *= 1024;\n\t\tcase 'M':\n\t\t\t$ret *= 1024;\n\t\tcase 'K':\n\t\t\t$ret *= 1024;\n\t}\n\treturn $ret;\n}\n\n/**\n * SportsPress Date Format - Allows to change date format for everything SportsPress\n *\n * @access public\n * @return string\n */\nfunction sp_date_format() {\n\treturn apply_filters( 'sportspress_date_format', get_option( 'date_format' ) );\n}\n\n/**\n * SportsPress Time Format - Allows to change time format for everything SportsPress\n *\n * @access public\n * @return string\n */\nfunction sp_time_format() {\n\treturn apply_filters( 'sportspress_time_format', get_option( 'time_format' ) );\n}\n\nif ( ! function_exists( 'sp_time_value' ) ) {\n\n\t/**\n\t * Convert number of seconds to formatted time\n\t *\n\t * @access public\n\t * @param mixed $value\n\t * @return string\n\t */\n\tfunction sp_time_value( $value = 0 ) {\n\t\t$intval  = intval( $value );\n\t\t$timeval = gmdate( 'i:s', $intval );\n\t\t$hours   = floor( $intval / 3600 );\n\n\t\tif ( '00' != $hours ) {\n\t\t\t$timeval = $hours . ':' . $timeval;\n\t\t}\n\n\t\treturn preg_replace( '/^0/', '', $timeval );\n\t}\n}\n\nif ( ! function_exists( 'sp_value_time' ) ) {\n\n\t/**\n\t * Convert a time string to the equivalent number of seconds.\n\t *\n\t * @param string $time_string The time string in the format 'hh:mm:ss'.\n\t * @return int The total time in seconds.\n\t */\n\tfunction sp_value_time( $time_string ) {\n\t    // Initialize variables for hours, minutes, and seconds\n\t    $hours   = 0;\n\t    $minutes = 0;\n\t    $seconds = 0;\n\n\t    // Split the time string into hours, minutes, and seconds\n\t    $time_parts = explode( ':', $time_string );\n\n\t    // Determine the number of components in the time string\n\t    $component_count = count( $time_parts );\n\n\t    // Set values based on the number of components\n\t    if ( 1 === $component_count ) {\n\t        $seconds = isset( $time_parts[0] ) ? $time_parts[0] : 0;\n\t    } elseif ( 2 === $component_count ) {\n\t        $minutes = isset( $time_parts[0] ) ? $time_parts[0] : 0;\n\t        $seconds = isset( $time_parts[1] ) ? $time_parts[1] : 0;\n\t    } elseif ( 2 < $component_count ) {\n\t        $hours = isset( $time_parts[0] ) ? $time_parts[0] : 0;\n\t        $minutes = isset( $time_parts[1] ) ? $time_parts[1] : 0;\n\t        $seconds = isset( $time_parts[2] ) ? $time_parts[2] : 0;\n\t    }\n\n\t    // Convert each part to seconds and calculate the total time in seconds\n\t    $total_seconds = ( $hours * 3600 ) + ( $minutes * 60 ) + $seconds;\n\n\t    return $total_seconds;\n\t}\n\n}\n\nif ( ! function_exists( 'sp_rgb_from_hex' ) ) {\n\n\t/**\n\t * Hex darker/lighter/contrast functions for colours\n\t *\n\t * @access public\n\t * @param mixed $color\n\t * @return string\n\t */\n\tfunction sp_rgb_from_hex( $color ) {\n\t\t$color = str_replace( '#', '', $color );\n\t\t// Convert shorthand colors to full format, e.g. \"FFF\" -> \"FFFFFF\"\n\t\t$color = preg_replace( '~^(.)(.)(.)$~', '$1$1$2$2$3$3', $color );\n\n\t\t$rgb['R'] = hexdec( $color[0] . $color[1] );\n\t\t$rgb['G'] = hexdec( $color[2] . $color[3] );\n\t\t$rgb['B'] = hexdec( $color[4] . $color[5] );\n\t\treturn $rgb;\n\t}\n}\n\nif ( ! function_exists( 'sp_hex_darker' ) ) {\n\n\t/**\n\t * Hex darker/lighter/contrast functions for colours\n\t *\n\t * @access public\n\t * @param mixed $color\n\t * @param int   $factor (default: 30)\n\t * @return string\n\t */\n\tfunction sp_hex_darker( $color, $factor = 30, $absolute = false ) {\n\t\t$base  = sp_rgb_from_hex( $color );\n\t\t$color = '#';\n\n\t\tforeach ( $base as $k => $v ) :\n\t\t\tif ( $absolute ) {\n\t\t\t\t$amount = $factor;\n\t\t\t} else {\n\t\t\t\t$amount = $v / 100;\n\t\t\t\t$amount = round( $amount * $factor );\n\t\t\t}\n\t\t\t$new_decimal = max( $v - $amount, 0 );\n\n\t\t\t$new_hex_component = dechex( $new_decimal );\n\t\t\tif ( strlen( $new_hex_component ) < 2 ) :\n\t\t\t\t$new_hex_component = '0' . $new_hex_component;\n\t\t\tendif;\n\t\t\t$color .= $new_hex_component;\n\t\tendforeach;\n\n\t\treturn $color;\n\t}\n}\n\nif ( ! function_exists( 'sp_hex_lighter' ) ) {\n\n\t/**\n\t * Hex darker/lighter/contrast functions for colours\n\t *\n\t * @access public\n\t * @param mixed $color\n\t * @param int   $factor (default: 30)\n\t * @return string\n\t */\n\tfunction sp_hex_lighter( $color, $factor = 30, $absolute = false ) {\n\t\t$base  = sp_rgb_from_hex( $color );\n\t\t$color = '#';\n\n\t\tforeach ( $base as $k => $v ) :\n\t\t\tif ( $absolute ) {\n\t\t\t\t$amount = $factor;\n\t\t\t} else {\n\t\t\t\t$amount = 255 - $v;\n\t\t\t\t$amount = $amount / 100;\n\t\t\t\t$amount = round( $amount * $factor );\n\t\t\t}\n\t\t\t$new_decimal = min( $v + $amount, 255 );\n\n\t\t\t$new_hex_component = dechex( $new_decimal );\n\t\t\tif ( strlen( $new_hex_component ) < 2 ) :\n\t\t\t\t$new_hex_component = '0' . $new_hex_component;\n\t\t\tendif;\n\t\t\t$color .= $new_hex_component;\n\t\tendforeach;\n\n\t\treturn $color;\n\t}\n}\n\nif ( ! function_exists( 'sp_light_or_dark' ) ) {\n\n\t/**\n\t * Detect if we should use a light or dark colour on a background colour\n\t *\n\t * @access public\n\t * @param mixed  $color\n\t * @param string $dark (default: '#000000')\n\t * @param string $light (default: '#FFFFFF')\n\t * @return string\n\t */\n\tfunction sp_light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) {\n\t\t// return ( hexdec( $color ) > 0xffffff / 2 ) ? $dark : $light;\n\t\t$hex = str_replace( '#', '', $color );\n\n\t\t$c_r        = hexdec( substr( $hex, 0, 2 ) );\n\t\t$c_g        = hexdec( substr( $hex, 2, 2 ) );\n\t\t$c_b        = hexdec( substr( $hex, 4, 2 ) );\n\t\t$brightness = ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000;\n\n\t\treturn $brightness > 155 ? $dark : $light;\n\t}\n}\n\nif ( ! function_exists( 'sp_format_hex' ) ) {\n\n\t/**\n\t * Format string as hex\n\t *\n\t * @access public\n\t * @param string $hex\n\t * @return string\n\t */\n\tfunction sp_format_hex( $hex ) {\n\n\t\t$hex = preg_replace( '/[^A-Fa-f0-9]/', '', $hex );\n\t\t$hex = trim( str_replace( '#', '', $hex ) );\n\n\t\tif ( strlen( $hex ) == 3 ) {\n\t\t\t$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];\n\t\t}\n\n\t\t$hex = substr( $hex, 0, 6 );\n\n\t\tif ( $hex ) {\n\t\t\treturn '#' . $hex;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "includes/sp-option-filters.php",
    "content": "<?php\n/**\n * SportsPress Option Filters\n *\n * Filters for SportsPress options.\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     SportsPress/Functions\n * @version     1.7\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nfunction sportspress_primary_performance_filter( $option ) {\n\tif ( $option ) {\n\t\treturn $option;\n\t}\n\t$performance_posts = get_posts(\n\t\tarray(\n\t\t\t'posts_per_page' => 1,\n\t\t\t'orderby'        => 'menu_order',\n\t\t\t'order'          => 'ASC',\n\t\t\t'post_type'      => 'sp_performance',\n\t\t)\n\t);\n\tif ( ! $performance_posts ) {\n\t\treturn $option;\n\t}\n\t$post = reset( $performance_posts );\n\treturn $post->post_name;\n}\nadd_filter( 'option_sportspress_primary_performance', 'sportspress_primary_performance_filter' );\n"
  },
  {
    "path": "includes/sp-template-functions.php",
    "content": "<?php\n/**\n * SportsPress Template\n *\n * Functions for the templating system.\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     SportsPress/Functions\n * @version     2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n/**\n * Output generator tag to aid debugging.\n *\n * @access public\n * @return void\n */\nfunction sp_generator_tag( $gen, $type ) {\n\tswitch ( $type ) {\n\t\tcase 'html':\n\t\t\t$gen .= \"\\n\" . '<meta name=\"generator\" content=\"SportsPress ' . esc_attr( SP_VERSION ) . '\">';\n\t\t\tbreak;\n\t\tcase 'xhtml':\n\t\t\t$gen .= \"\\n\" . '<meta name=\"generator\" content=\"SportsPress ' . esc_attr( SP_VERSION ) . '\" />';\n\t\t\tbreak;\n\t}\n\treturn $gen;\n}\n\n/**\n * Add body classes for SP pages\n *\n * @param  array $classes\n * @return array\n */\nfunction sp_body_class( $classes ) {\n\t$classes = (array) $classes;\n\n\tif ( is_sportspress() ) {\n\t\t$classes[] = 'sportspress';\n\t\t$classes[] = 'sportspress-page';\n\t}\n\n\t$post_type = get_post_type();\n\n\tif ( 'sp_event' == $post_type ) {\n\t\t$id         = get_the_ID();\n\t\t$show_venue = get_option( 'sportspress_event_show_venue', 'yes' ) == 'yes' ? true : false;\n\t\tif ( $show_venue && get_the_terms( $id, 'sp_venue' ) ) {\n\t\t\tif ( get_option( 'sportspress_event_show_maps', 'yes' ) == 'yes' ) {\n\t\t\t\t$classes[] = 'sp-has-venue';\n\t\t\t}\n\t\t}\n\t\tif ( 'results' == sp_get_status( $id ) ) {\n\t\t\tif ( get_option( 'sportspress_event_show_results', 'yes' ) == 'yes' ) {\n\t\t\t\t$classes[] = 'sp-has-results';\n\t\t\t}\n\t\t}\n\t\t$classes[] = 'sp-performance-sections-' . get_option( 'sportspress_event_performance_sections', -1 );\n\t} elseif ( 'sp_team' == $post_type && 'yes' == get_option( 'sportspress_team_show_logo', 'yes' ) ) {\n\t\t$classes[] = 'sp-show-image';\n\t} elseif ( 'sp_player' == $post_type && 'yes' == get_option( 'sportspress_player_show_photo', 'yes' ) ) {\n\t\t$classes[] = 'sp-show-image';\n\t} elseif ( 'sp_staff' == $post_type && 'yes' == get_option( 'sportspress_staff_show_photo', 'yes' ) ) {\n\t\t$classes[] = 'sp-show-image';\n\t}\n\n\treturn array_unique( $classes );\n}\n\n/** Template pages */\n\nif ( ! function_exists( 'sportspress_taxonomy_archive_description' ) ) {\n\n\t/**\n\t * Show an archive description on taxonomy archives\n\t *\n\t * @access public\n\t * @subpackage  Archives\n\t * @return void\n\t */\n\tfunction sportspress_taxonomy_archive_description() {\n\t\tif ( is_tax( array( 'sp_season', 'sp_league', 'sp_venue', 'sp_position' ) ) && get_query_var( 'paged' ) == 0 ) {\n\t\t\t$description = apply_filters( 'the_content', term_description() );\n\t\t\tif ( $description ) {\n\t\t\t\techo '<div class=\"term-description\">' . wp_kses_post( $description ) . '</div>';\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Single Post */\n\nif ( ! function_exists( 'sportspress_output_post_excerpt' ) ) {\n\n\t/**\n\t * Output the post excerpt.\n\t *\n\t * @access public\n\t * @subpackage  Excerpt\n\t * @return void\n\t */\n\tfunction sportspress_output_post_excerpt() {\n\t\tsp_get_template( 'post-excerpt.php' );\n\t}\n}\n\n/** Single Event */\n\nif ( ! function_exists( 'sportspress_output_event_logos' ) ) {\n\n\t/**\n\t * Output the event logos.\n\t *\n\t * @access public\n\t * @subpackage  Event/Logos\n\t * @return void\n\t */\n\tfunction sportspress_output_event_logos() {\n\t\tsp_get_template( 'event-logos.php' );\n\t}\n}\n\nif ( ! function_exists( 'sportspress_output_event_video' ) ) {\n\n\t/**\n\t * Output the event video.\n\t *\n\t * @access public\n\t * @subpackage  Event/Video\n\t * @return void\n\t */\n\tfunction sportspress_output_event_video() {\n\t\tsp_get_template( 'event-video.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_event_results' ) ) {\n\n\t/**\n\t * Output the event results.\n\t *\n\t * @access public\n\t * @subpackage  Event/Results\n\t * @return void\n\t */\n\tfunction sportspress_output_event_results() {\n\t\tsp_get_template( 'event-results.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_event_details' ) ) {\n\n\t/**\n\t * Output the event details.\n\t *\n\t * @access public\n\t * @subpackage  Event/Details\n\t * @return void\n\t */\n\tfunction sportspress_output_event_details() {\n\t\tsp_get_template( 'event-details.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_event_overview' ) ) {\n\n\t/**\n\t * Output the event details, venue, and results.\n\t *\n\t * @access public\n\t * @subpackage  Event/Overview\n\t * @return void\n\t */\n\tfunction sportspress_output_event_overview() {\n\t\tsp_get_template( 'event-overview.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_event_venue' ) ) {\n\n\t/**\n\t * Output the event venue.\n\t *\n\t * @access public\n\t * @subpackage  Event/Venue\n\t * @return void\n\t */\n\tfunction sportspress_output_event_venue() {\n\t\tsp_get_template( 'event-venue.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_event_performance' ) ) {\n\n\t/**\n\t * Output the event performance.\n\t *\n\t * @access public\n\t * @subpackage  Event/Performance\n\t * @return void\n\t */\n\tfunction sportspress_output_event_performance() {\n\t\tsp_get_template( 'event-performance.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_event_officials' ) ) {\n\n\t/**\n\t * Output the event officials.\n\t *\n\t * @access public\n\t * @subpackage  Event/Officials\n\t * @return void\n\t */\n\tfunction sportspress_output_event_officials() {\n\t\tsp_get_template( 'event-officials.php' );\n\t}\n}\n\n/** Single Calendar */\n\nif ( ! function_exists( 'sportspress_output_calendar' ) ) {\n\n\t/**\n\t * Output the calendar.\n\t *\n\t * @access public\n\t * @subpackage  Calendar\n\t * @return void\n\t */\n\tfunction sportspress_output_calendar() {\n\t\t$id     = get_the_ID();\n\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\tif ( array_key_exists( $format, SP()->formats->calendar ) ) {\n\t\t\tsp_get_template( 'event-' . $format . '.php', array( 'id' => $id ) );\n\t\t} else {\n\t\t\tsp_get_template( 'event-calendar.php', array( 'id' => $id ) );\n\t\t}\n\t}\n}\n\n/** Single Team */\n\nif ( ! function_exists( 'sportspress_output_team_link' ) ) {\n\n\t/**\n\t * Output the team link.\n\t *\n\t * @access public\n\t * @subpackage  Team/Link\n\t * @return void\n\t */\n\tfunction sportspress_output_team_link() {\n\t\tsp_get_template( 'team-link.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_team_logo' ) ) {\n\n\t/**\n\t * Output the team logo.\n\t *\n\t * @access public\n\t * @subpackage  Team/Logo\n\t * @return void\n\t */\n\tfunction sportspress_output_team_logo() {\n\t\tsp_get_template( 'team-logo.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_team_details' ) ) {\n\n\t/**\n\t * Output the team details.\n\t *\n\t * @access public\n\t * @subpackage  Team/Details\n\t * @return void\n\t */\n\tfunction sportspress_output_team_details() {\n\t\tsp_get_template( 'team-details.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_team_staff' ) ) {\n\n\t/**\n\t * Output the team staff.\n\t *\n\t * @access public\n\t * @subpackage  Team/Staff\n\t * @return void\n\t */\n\tfunction sportspress_output_team_staff() {\n\t\tsp_get_template( 'team-staff.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_team_tables' ) ) {\n\n\t/**\n\t * Output the team tables.\n\t *\n\t * @access public\n\t * @subpackage  Team/Tables\n\t * @return void\n\t */\n\tfunction sportspress_output_team_tables() {\n\t\tsp_get_template( 'team-tables.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_team_lists' ) ) {\n\n\t/**\n\t * Output the team lists.\n\t *\n\t * @access public\n\t * @subpackage  Team/Lists\n\t * @return void\n\t */\n\tfunction sportspress_output_team_lists() {\n\t\tsp_get_template( 'team-lists.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_team_events' ) ) {\n\n\t/**\n\t * Output the team events.\n\t *\n\t * @access public\n\t * @subpackage  Team/Events\n\t * @return void\n\t */\n\tfunction sportspress_output_team_events() {\n\t\tsp_get_template( 'team-events.php' );\n\t}\n}\n\n/** Single League Table */\n\nif ( ! function_exists( 'sportspress_output_league_table' ) ) {\n\n\t/**\n\t * Output the team columns.\n\t *\n\t * @access public\n\t * @subpackage  Table\n\t * @return void\n\t */\n\tfunction sportspress_output_league_table() {\n\t\t$id     = get_the_ID();\n\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\tif ( array_key_exists( $format, SP()->formats->table ) && 'standings' !== $format ) {\n\t\t\tsp_get_template( 'team-' . $format . '.php', array( 'id' => $id ) );\n\t\t} else {\n\t\t\tsp_get_template( 'league-table.php', array( 'id' => $id ) );\n\t\t}\n\t}\n}\n\n/** Single Player */\n\nif ( ! function_exists( 'sportspress_output_player_selector' ) ) {\n\n\t/**\n\t * Output the player dropdown.\n\t *\n\t * @access public\n\t * @subpackage  Player/Dropdown\n\t * @return void\n\t */\n\tfunction sportspress_output_player_selector() {\n\t\tsp_get_template( 'player-selector.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_player_photo' ) ) {\n\n\t/**\n\t * Output the player photo.\n\t *\n\t * @access public\n\t * @subpackage  Player/Photo\n\t * @return void\n\t */\n\tfunction sportspress_output_player_photo() {\n\t\tsp_get_template( 'player-photo.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_player_details' ) ) {\n\n\t/**\n\t * Output the player details.\n\t *\n\t * @access public\n\t * @subpackage  Player/Details\n\t * @return void\n\t */\n\tfunction sportspress_output_player_details() {\n\t\tsp_get_template( 'player-details.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_player_statistics' ) ) {\n\n\t/**\n\t * Output the player statistics.\n\t *\n\t * @access public\n\t * @subpackage  Player/Statistics\n\t * @return void\n\t */\n\tfunction sportspress_output_player_statistics() {\n\t\tsp_get_template( 'player-statistics.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_player_events' ) ) {\n\n\t/**\n\t * Output the player events.\n\t *\n\t * @access public\n\t * @subpackage  Player/Events\n\t * @return void\n\t */\n\tfunction sportspress_output_player_events() {\n\t\tsp_get_template( 'player-events.php' );\n\t}\n}\n\n/** Single Player List */\n\nif ( ! function_exists( 'sportspress_output_player_list' ) ) {\n\n\t/**\n\t * Output the player list.\n\t *\n\t * @access public\n\t * @subpackage  List\n\t * @return void\n\t */\n\tfunction sportspress_output_player_list() {\n\t\t$id     = get_the_ID();\n\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\tif ( array_key_exists( $format, SP()->formats->list ) ) {\n\t\t\tsp_get_template( 'player-' . $format . '.php', array( 'id' => $id ) );\n\t\t} else {\n\t\t\tsp_get_template( 'player-list.php', array( 'id' => $id ) );\n\t\t}\n\t}\n}\n\n/** Single Staff */\n\nif ( ! function_exists( 'sportspress_output_staff_selector' ) ) {\n\n\t/**\n\t * Output the staff dropdown.\n\t *\n\t * @access public\n\t * @subpackage  Staff/Dropdown\n\t * @return void\n\t */\n\tfunction sportspress_output_staff_selector() {\n\t\tsp_get_template( 'staff-selector.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_staff_photo' ) ) {\n\n\t/**\n\t * Output the staff photo.\n\t *\n\t * @access public\n\t * @subpackage  Staff/Photo\n\t * @return void\n\t */\n\tfunction sportspress_output_staff_photo() {\n\t\tsp_get_template( 'staff-photo.php' );\n\t}\n}\nif ( ! function_exists( 'sportspress_output_staff_details' ) ) {\n\n\t/**\n\t * Output the staff details.\n\t *\n\t * @access public\n\t * @subpackage  Staff/Details\n\t * @return void\n\t */\n\tfunction sportspress_output_staff_details() {\n\t\tsp_get_template( 'staff-details.php' );\n\t}\n}\n\n/** Venue Archive ********************************************************/\n\nfunction sportspress_output_venue_map( $query ) {\n\tif ( ! is_tax( 'sp_venue' ) ) {\n\t\treturn;\n\t}\n\n\t$slug = sp_array_value( $query->query, 'sp_venue', null );\n\n\tif ( ! $slug ) {\n\t\treturn;\n\t}\n\n\t$venue = get_term_by( 'slug', $slug, 'sp_venue' );\n\t$t_id  = $venue->term_id;\n\t$meta  = get_option( \"taxonomy_$t_id\" );\n\tsp_get_template( 'venue-map.php', array( 'meta' => $meta ) );\n}\n\n/** Misc ********************************************************/\n\nfunction sportspress_output_br_tag() {\n\t?>\n\t<br>\n\t<?php\n}\nif ( ! function_exists( 'sportspress_responsive_tables_css' ) ) {\n\n\t/**\n\t * Output the inlince css code for responsive tables.\n\t *\n\t * @access public\n\t * @subpackage  Responsive\n\t * @return void\n\t */\n\tfunction sportspress_responsive_tables_css( $identity ) {\n\t\t$custom_css = '/* \n\t\tMax width before this PARTICULAR table gets nasty\n\t\tThis query will take effect for any screen smaller than 760px\n\t\tand also iPads specifically.\n\t\t*/\n\t\t@media \n\t\tonly screen and (max-width: 800px) {\n\t\t\n\t\t\t/* Force table to not be like tables anymore */\n\t\t\ttable.' . $identity . ', table.' . $identity . ' thead, table.' . $identity . ' tfoot, table.' . $identity . ' tbody, table.' . $identity . ' th, table.' . $identity . ' td, table.' . $identity . ' tr { \n\t\t\t\tdisplay: block; \n\t\t\t}\n\t\t\t\n\t\t\t/* Hide table headers (but not display: none;, for accessibility) */\n\t\t\ttable.' . $identity . ' thead tr { \n\t\t\t\tposition: absolute;\n\t\t\t\ttop: -9999px;\n\t\t\t\tleft: -9999px;\n\t\t\t}\n\n\t\t\t/* Add subtle border to table rows */\n\t\t\ttable.' . $identity . ' tbody tr { \n\t\t\t\tborder-top: 1px solid rgba(0, 0, 0, 0.1);\n\t\t\t}\n\n\t\t\t.sp-data-table .data-number, .sp-data-table .data-rank {\n\t\t\t\twidth: auto !important;\n\t\t\t}\n\t\t\t\n\t\t\t.sp-data-table th,\n\t\t\t.sp-data-table td {\n\t\t\t\ttext-align: center !important;\n\t\t\t}\n\t\t\t\n\t\t\ttable.' . $identity . ' td { \n\t\t\t\t/* Behave  like a \"row\" */\n\t\t\t\tborder: none;\n\t\t\t\tposition: relative;\n\t\t\t\tpadding-left: 50%;\n\t\t\t\tvertical-align: middle;\n\t\t\t}\n\t\t\t\n\t\t\ttable.' . $identity . ' td:before { \n\t\t\t\t/* Now like a table header */\n\t\t\t\tposition: absolute;\n\t\t\t\t/* Label the data */\n\t\t\t\tcontent: attr(data-label);\n\t\t\t\t/* Top/left values mimic padding */\n\t\t\t\ttop: 6px;\n\t\t\t\tleft: 6px;\n\t\t\t\twidth: 45%; \n\t\t\t\tpadding-right: 10px; \n\t\t\t\twhite-space: nowrap;\n\t\t\t}\n\t\t}\n\t\t\t';\n\n\t\t$dummystyle = 'sportspress-style-inline-' . $identity;\n\t\twp_register_style( $dummystyle, false );\n\t\twp_enqueue_style( $dummystyle );\n\t\twp_add_inline_style( $dummystyle, $custom_css );\n\t}\n}\n"
  },
  {
    "path": "includes/sp-template-hooks.php",
    "content": "<?php\n/**\n * SportsPress Template\n *\n * Functions for the templating system.\n *\n * @author      ThemeBoy\n * @category    Core\n * @package     SportsPress/Functions\n * @version     2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nadd_filter( 'body_class', 'sp_body_class' );\n\n/**\n * WP Header\n *\n * @see  sp_generator_tag()\n */\nadd_action( 'get_the_generator_html', 'sp_generator_tag', 10, 2 );\nadd_action( 'get_the_generator_xhtml', 'sp_generator_tag', 10, 2 );\n\n/**\n * Venue Archive Content\n */\nadd_action( 'loop_start', 'sportspress_output_venue_map' );\n\n/**\n * Adjacent Post Links\n */\nadd_filter( 'previous_post_link', 'sportspress_hide_adjacent_post_links', 10, 4 );\nadd_filter( 'next_post_link', 'sportspress_hide_adjacent_post_links', 10, 4 );\n\nfunction sportspress_the_title( $title, $id = null ) {\n\tif ( ! $id ) {\n\t\treturn $title;\n\t}\n\n\tif ( ! is_admin() && in_the_loop() && $id == get_the_ID() ) :\n\t\tif ( is_singular( 'sp_player' ) ) :\n\t\t\t$number = get_post_meta( $id, 'sp_number', true );\n\t\t\tif ( $number != null ) :\n\t\t\t\t$title = '<strong class=\"sp-player-number\">' . $number . '</strong> ' . $title;\n\t\t\tendif;\n\t\telseif ( is_singular( 'sp_staff' ) ) :\n\t\t\t$staff = new SP_Staff( $id );\n\t\t\t$role  = $staff->role();\n\t\t\tif ( $role ) {\n\t\t\t\t$title = '<strong class=\"sp-staff-role\">' . $role->name . '</strong> ' . $title;\n\t\t\t}\n\t\tendif;\n\tendif;\n\n\treturn $title;\n}\nadd_filter( 'the_title', 'sportspress_the_title', 10, 2 );\n\nfunction sportspress_gettext( $translated_text, $untranslated_text, $domain = null ) {\n\tglobal $typenow;\n\n\tif ( is_admin() ) :\n\t\tif ( is_sp_config_type( $typenow ) ) :\n\t\t\tswitch ( $untranslated_text ) :\n\t\t\t\tcase 'Excerpt':\n\t\t\t\t\t$translated_text = esc_attr__( 'Description', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href=\"http://codex.wordpress.org/Excerpt\" target=\"_blank\">Learn more about manual excerpts.</a>':\n\t\t\t\t\t$translated_text = esc_attr__( 'The description is not prominent by default; however, some themes may show it.', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Slug':\n\t\t\t\t\t$translated_text = ( in_array( $typenow, array( 'sp_column', 'sp_statistic' ) ) ) ? esc_attr__( 'Key', 'sportspress' ) : esc_attr__( 'Variable', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\tendif;\n\n\t\tif ( is_sp_post_type( $typenow ) ) :\n\t\t\tswitch ( $untranslated_text ) :\n\t\t\t\tcase 'Author':\n\t\t\t\t\t$translated_text = esc_attr__( 'User', 'sportspress' );\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\tendif;\n\n\t\tif ( in_array( $typenow, array( 'sp_event' ) ) ) :\n\t\t\tswitch ( $untranslated_text ) :\n\t\t\t\tcase 'Publish <b>immediately</b>':\n\t\t\t\t\t$translated_text = esc_attr__( 'Date/Time:', 'sportspress' ) . ' <b>' . esc_attr__( 'Now', 'sportspress' ) . '</b>';\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\t\tendif;\n\telse :\n\t\tif ( $domain == 'sportspress' ) :\n\t\t\tif ( ! empty( SP()->text[ $translated_text ] ) ) :\n\t\t\t\t$translated_text = SP()->text[ $translated_text ];\n\t\t\tendif;\n\t\telseif ( ! current_theme_supports( 'sportspress' ) && $untranslated_text == 'Archives' ) :\n\t\t\tadd_action( 'wp', function() use ( &$translated_text ) {\n\t\t\t\tif ( is_tax( 'sp_venue' ) ) :\n\t\t\t\t\t$slug = get_query_var( 'sp_venue' );\n\t\t\t\t\tif ( $slug ) :\n\t\t\t\t\t\t$venue = get_term_by( 'slug', $slug, 'sp_venue' );\n\t\t\t\t\t\t$translated_text = $venue->name;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\t});\n\t\tendif;\n\tendif;\n\n\treturn $translated_text;\n}\nadd_filter( 'gettext', 'sportspress_gettext', 20, 3 );\n\nfunction sportspress_team_permalink( $permalink, $post ) {\n\tif ( ! is_admin() && 'sp_team' == get_post_type( $post ) ) :\n\n\t\t$url = get_post_meta( $post->ID, 'sp_url', true );\n\n\t\tif ( ! empty( $url ) ) :\n\t\t\t$redirect = get_post_meta( $post->ID, 'sp_redirect', true );\n\n\t\t\tif ( $redirect === '' ) :\n\t\t\t\t$redirect = ( empty( $post->post_content ) ) ? 1 : 0;\n\t\t\tendif;\n\n\t\t\tif ( $redirect ) :\n\t\t\t\treturn $url;\n\t\t\tendif;\n\t\tendif;\n\tendif;\n\treturn $permalink;\n}\nadd_filter( 'post_type_link', 'sportspress_team_permalink', 10, 2 );\n\nfunction sportspress_no_terms_links( $term_list, $taxonomy ) {\n\n\tif ( in_array( $taxonomy, array( 'sp_league', 'sp_season', 'sp_position', 'sp_role' ) ) ) {\n\t\treturn wp_filter_nohtml_kses( $term_list );\n\t}\n\n\treturn $term_list;\n}\nadd_filter( 'the_terms', 'sportspress_no_terms_links', 10, 2 );\n\nfunction sportspress_strcmp_term_slug( $a, $b ) {\n\treturn strcmp( $a->slug, $b->slug );\n}\n\nfunction sportspress_term_order( $terms, $post_id, $taxonomy ) {\n\n\tif ( ! is_array( $terms ) ) {\n\t\treturn array();\n\t}\n\n\tif ( is_sp_taxonomy( $taxonomy ) ) {\n\t\tuasort( $terms, 'sportspress_strcmp_term_slug' );\n\t}\n\n\treturn $terms;\n}\nadd_filter( 'get_the_terms', 'sportspress_term_order', 10, 3 );\n\nfunction sportspress_pre_get_posts( $query ) {\n\t$post_type = sp_array_value( $query->query, 'post_type', null );\n\n\tif ( is_sp_post_type( $post_type ) ) :\n\t\t$query->set( 'suppress_filters', 0 );\n\tendif;\n\n\tif ( is_admin() ) :\n\t\tif ( isset( $query->query['orderby'] ) || isset( $query->query['order'] ) ) :\n\t\t\treturn $query;\n\t\tendif;\n\n\t\tif ( is_sp_config_type( $post_type ) ) :\n\t\t\t$query->set( 'orderby', 'menu_order' );\n\t\t\t$query->set( 'order', 'ASC' );\n\t\tendif;\n\telse :\n\t\tif ( isset( $query->query['sp_venue'] ) ) :\n\t\t\t$query->set( 'post_type', 'sp_event' );\n\t\t\t$GLOBALS['wp_post_statuses']['future']->public = true;\n\t\tendif;\n\tendif;\n\n\treturn $query;\n}\nadd_filter( 'pre_get_posts', 'sportspress_pre_get_posts' );\n\nfunction sportspress_show_future_posts( $where, $that ) {\n\tglobal $wpdb;\n\tif ( 'sp_event' == $that->query_vars['post_type'] && is_archive() ) {\n\t\t$where = str_replace( \"{$wpdb->posts}.post_status = 'publish'\", \"{$wpdb->posts}.post_status = 'publish' OR $wpdb->posts.post_status = 'future'\", $where );\n\t}\n\treturn $where;\n}\nadd_filter( 'posts_where', 'sportspress_show_future_posts', 2, 10 );\n\nfunction sportspress_redirect_future_events() {\n\tif ( is_main_query() && 'sp_event' == get_query_var( 'post_type' ) && 'future' == get_post_status( get_query_var( 'p' ) ) && ! empty( $_GET['p'] ) ) {\n\t\tif ( $redirect_url = get_post_permalink( get_query_var( 'p' ), false, true ) ) {\n\t\t\twp_redirect( $redirect_url, 301 );\n\t\t}\n\t\t\tdie();\n\t}\n}\nadd_action( 'template_redirect', 'sportspress_redirect_future_events' );\n\nfunction sportspress_give_event_read_permissions( $allcaps, $caps, $args ) {\n\n\t// Bail out if we're not asking about viewing an event\n\tif ( 'read_sp_event' !== $args[0] ) {\n\t\treturn $allcaps;\n\t}\n\n\t// Load the post data\n\t$post = get_post( $args[2] );\n\n\t// Bail out if the event isn't scheduled\n\tif ( 'future' != $post->post_status ) {\n\t\treturn $allcaps;\n\t}\n\n\t// Add post capabilities\n\tforeach ( $caps as $cap ) {\n\t\t$allcaps[ $cap ] = true;\n\t}\n\n\treturn $allcaps;\n}\nadd_filter( 'user_has_cap', 'sportspress_give_event_read_permissions', 10, 3 );\n\nfunction sportspress_sanitize_title( $title ) {\n\n\tif ( isset( $_POST ) && array_key_exists( 'taxonomy', $_POST ) ) :\n\n\t\treturn $title;\n\n\telseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && is_sp_config_type( sanitize_key( $_POST['post_type'] ) ) ) :\n\n\t\t$key = isset( $_POST['sp_key'] ) ? sanitize_text_field( wp_unslash( $_POST['sp_key'] ) ) : null;\n\n\t\tif ( ! $key ) {\n\t\t\t$key = isset( $_POST['sp_default_key'] ) ? sanitize_text_field( wp_unslash( $_POST['sp_default_key'] ) ) : null;\n\t\t}\n\n\t\tif ( ! $key ) {\n\t\t\t$key = sanitize_text_field( wp_unslash( $_POST['post_title'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput\n\t\t}\n\n\t\t$id = sp_array_value( $_POST, 'post_ID', 'var', 'text' );\n\n\t\t$title = sp_get_eos_safe_slug( $key, $id );\n\n\tendif;\n\n\treturn $title;\n}\nadd_filter( 'sanitize_title', 'sportspress_sanitize_title' );\n\nfunction sportspress_widget_text( $content ) {\n\tif ( ! preg_match( '/\\[[\\r\\n\\t ]*(countdown|events?(_|-)(results|details|performance|calendar|list|blocks)|team(_|-)columns|league(_|-)table|player(_|-)(metrics|performance|list|gallery))?[\\r\\n\\t ].*?\\]/', $content ) ) {\n\t\treturn $content;\n\t}\n\n\t$content = do_shortcode( $content );\n\n\treturn $content;\n}\nadd_filter( 'widget_text', 'sportspress_widget_text', 9 );\n\nfunction sportspress_post_updated_messages( $messages ) {\n\n\tglobal $typenow, $post;\n\n\tif ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_metric', 'sp_spec', 'sp_performance' ) ) ) :\n\t\t$obj = get_post_type_object( $typenow );\n\n\t\tfor ( $i = 0; $i <= 10; $i++ ) :\n\t\t\t$messages['post'][ $i ] = esc_attr__( 'Settings saved.', 'sportspress' ) .\n\t\t\t\t' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=' . $typenow ) ) . '\">' .\n\t\t\t\t__( 'View All', 'sportspress' ) . '</a>';\n\t\tendfor;\n\n\telseif ( in_array( $typenow, array( 'sp_event', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ) ) :\n\t\t$obj = get_post_type_object( $typenow );\n\n\t\t$messages['post'][1] = esc_attr__( 'Changes saved.', 'sportspress' ) .\n\t\t\t' <a href=\"' . esc_url( get_permalink( $post->ID ) ) . '\">' . $obj->labels->view_item . '</a>';\n\n\t\t$messages['post'][4] = esc_attr__( 'Changes saved.', 'sportspress' );\n\n\t\t$messages['post'][6] = esc_attr__( 'Success!', 'sportspress' ) .\n\t\t\t' <a href=\"' . esc_url( get_permalink( $post->ID ) ) . '\">' . $obj->labels->view_item . '</a>';\n\n\t\t$messages['post'][7] = esc_attr__( 'Changes saved.', 'sportspress' );\n\n\t\t$messages['post'][8] = esc_attr__( 'Success!', 'sportspress' ) .\n\t\t\t' <a target=\"_blank\" href=\"' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '\">' .\n\t\t\tsprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';\n\n\t\t$messages['post'][9] = sprintf(\n\t\t\t__( 'Scheduled for: <b>%1$s</b>.', 'sportspress' ),\n\t\t\tdate_i18n( esc_attr__( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) ),\n\t\t\tesc_url( get_permalink( $post->ID ) )\n\t\t) .\n\t\t\t' <a target=\"_blank\" href=\"' . esc_url( get_permalink( $post->ID ) ) . '\">' .\n\t\t\tsprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';\n\n\t\t$messages['post'][10] = esc_attr__( 'Success!', 'sportspress' ) .\n\t\t\t' <a target=\"_blank\" href=\"' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '\">' .\n\t\t\tsprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';\n\n\tendif;\n\n\treturn $messages;\n}\n\nfunction sportspress_hide_adjacent_post_links( $output = null, $format = null, $link = null, $post = null ) {\n\tif ( is_object( $post ) && property_exists( $post, 'post_type' ) && in_array( $post->post_type, sp_post_types() ) ) {\n\t\treturn false;\n\t}\n\treturn $output;\n}\n\nadd_filter( 'post_updated_messages', 'sportspress_post_updated_messages' );\n\nfunction sportspress_remove_page_parent_class( $classes, $item ) {\n\tif ( ( is_sp_post_type( get_post_type() ) && $key = array_search( 'current_page_parent', $classes ) ) !== false ) {\n\t\tunset( $classes[ $key ] );\n\t}\n\treturn $classes;\n}\n\nadd_filter( 'nav_menu_css_class', 'sportspress_remove_page_parent_class', 10, 2 );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-birthdays.php",
    "content": "<?php\nclass SP_Widget_Birthdays extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_birthdays widget_sp_birthdays',\n\t\t\t'description' => esc_attr__( 'Display players and staff on their birthday.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-birthdays', esc_attr__( 'Birthdays', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\t\t$title           = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$date            = empty( $instance['date'] ) ? 'day' : strip_tags( $instance['date'] );\n\t\t$birthday_format = empty( $instance['birthday_format'] ) ? 'birthday' : strip_tags( $instance['birthday_format'] );\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'birthdays' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'birthdays' );\n\n\t\tsp_get_template(\n\t\t\t'birthdays.php',\n\t\t\tarray(\n\t\t\t\t'date'            => $date,\n\t\t\t\t'birthday_format' => $birthday_format,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'birthdays' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'birthdays' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                    = $old_instance;\n\t\t$instance['title']           = strip_tags( $new_instance['title'] );\n\t\t$instance['date']            = strip_tags( $new_instance['date'] );\n\t\t$instance['birthday_format'] = strip_tags( $new_instance['birthday_format'] );\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'birthdays' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance         = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'           => '',\n\t\t\t\t'date'            => 'day',\n\t\t\t\t'birthday_format' => 'birthday',\n\t\t\t)\n\t\t);\n\t\t$title            = strip_tags( $instance['title'] );\n\t\t$date             = strip_tags( $instance['date'] );\n\t\t$options          = array(\n\t\t\t'day'   => esc_attr__( 'Today', 'sportspress' ),\n\t\t\t'week'  => esc_attr__( 'This week', 'sportspress' ),\n\t\t\t'month' => esc_attr__( 'This month', 'sportspress' ),\n\t\t);\n\t\t$birthday_format  = strip_tags( $instance['birthday_format'] );\n\t\t$birthday_options = array(\n\t\t\t'hide'        => esc_attr__( 'Hide', 'sportspress' ),\n\t\t\t'birthday'    => esc_attr__( 'Birthday', 'sportspress' ),\n\t\t\t'age'         => esc_attr__( 'Age', 'sportspress' ),\n\t\t\t'birthdayage' => esc_attr__( 'Birthday (Age)', 'sportspress' ),\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'birthdays' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>\"><?php esc_attr_e( 'Birthday:', 'sportspress' ); ?></label>\n\t\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'date' ) ); ?>\" id=\"<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>\" class=\"postform widefat\">\n\t\t\t\t<?php foreach ( $options as $value => $label ) { ?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $value ); ?>\" <?php selected( $value, $date ); ?>><?php echo esc_attr( $label ); ?></option>\n\t\t\t\t<?php } ?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'birthday_format' ) ); ?>\"><?php esc_attr_e( 'Format:', 'sportspress' ); ?></label>\n\t\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'birthday_format' ) ); ?>\" id=\"<?php echo esc_attr( $this->get_field_id( 'birthday_format' ) ); ?>\" class=\"postform widefat\">\n\t\t\t\t<?php foreach ( $birthday_options as $value => $label ) { ?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $value ); ?>\" <?php selected( $value, $birthday_format ); ?>><?php echo esc_html( $label ); ?></option>\n\t\t\t\t<?php } ?>\n\t\t\t</select>\n\t\t</p>\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'birthdays' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Birthdays' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-countdown.php",
    "content": "<?php\nclass SP_Widget_Countdown extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_countdown widget_sp_countdown',\n\t\t\t'description' => esc_attr__( 'A clock that counts down to an upcoming event.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-countdown', esc_attr__( 'Countdown', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\t\t$title         = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$caption       = empty( $instance['caption'] ) ? null : $instance['caption'];\n\t\t$calendar      = empty( $instance['calendar'] ) ? null : $instance['calendar'];\n\t\t$team          = empty( $instance['team'] ) ? null : $instance['team'];\n\t\t$id            = empty( $instance['id'] ) ? null : $instance['id'];\n\t\t$show_venue    = empty( $instance['show_venue'] ) ? false : $instance['show_venue'];\n\t\t$show_league   = empty( $instance['show_league'] ) ? false : $instance['show_league'];\n\t\t$show_date     = empty( $instance['show_date'] ) ? false : $instance['show_date'];\n\t\t$show_excluded = empty( $instance['show_excluded'] ) ? false : $instance['show_excluded'];\n\t\t$order         = empty( $instance['order'] ) ? false : $instance['order'];\n\t\t$orderby       = empty( $instance['orderby'] ) ? false : $instance['orderby'];\n\t\t$show_status   = empty( $instance['show_status'] ) ? false : $instance['show_status'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'countdown' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'countdown' );\n\n\t\tsp_get_template(\n\t\t\t'countdown.php',\n\t\t\tarray(\n\t\t\t\t'calendar'      => $calendar,\n\t\t\t\t'team'          => $team,\n\t\t\t\t'id'            => $id,\n\t\t\t\t'title'         => $caption,\n\t\t\t\t'show_venue'    => $show_venue,\n\t\t\t\t'show_league'   => $show_league,\n\t\t\t\t'show_date'     => $show_date,\n\t\t\t\t'show_excluded' => $show_excluded,\n\t\t\t\t'order'         => $order,\n\t\t\t\t'orderby'       => $orderby,\n\t\t\t\t'show_status'   => $show_status,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'countdown' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'countdown' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                  = $old_instance;\n\t\t$instance['title']         = strip_tags( $new_instance['title'] );\n\t\t$instance['calendar']      = intval( $new_instance['calendar'] );\n\t\t$instance['team']          = intval( $new_instance['team'] );\n\t\t$instance['caption']       = strip_tags( $new_instance['caption'] );\n\t\t$instance['id']            = intval( $new_instance['id'] );\n\t\t$instance['show_venue']    = isset( $new_instance['show_venue'] ) ? $new_instance['show_venue'] : false;\n\t\t$instance['show_league']   = isset( $new_instance['show_league'] ) ? $new_instance['show_league'] : false;\n\t\t$instance['show_date']     = isset( $new_instance['show_date'] ) ? $new_instance['show_date'] : false;\n\t\t$instance['show_excluded'] = isset( $new_instance['show_excluded'] ) ? $new_instance['show_excluded'] : false;\n\t\t$instance['order']         = strip_tags( $new_instance['order'] );\n\t\t$instance['orderby']       = strip_tags( $new_instance['orderby'] );\n\t\t$instance['show_status']   = isset( $new_instance['show_status'] ) ? $new_instance['show_status'] : false;\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'countdown' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance      = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'         => '',\n\t\t\t\t'calendar'      => '',\n\t\t\t\t'team'          => '',\n\t\t\t\t'id'            => '',\n\t\t\t\t'caption'       => '',\n\t\t\t\t'show_venue'    => false,\n\t\t\t\t'show_league'   => false,\n\t\t\t\t'show_date'     => false,\n\t\t\t\t'show_excluded' => false,\n\t\t\t\t'order'         => '',\n\t\t\t\t'orderby'       => '',\n\t\t\t\t'show_status'   => true,\n\t\t\t)\n\t\t);\n\t\t$title         = strip_tags( $instance['title'] );\n\t\t$caption       = strip_tags( $instance['caption'] );\n\t\t$calendar      = intval( $instance['calendar'] );\n\t\t$team          = intval( $instance['team'] );\n\t\t$id            = intval( $instance['id'] );\n\t\t$show_venue    = intval( $instance['show_venue'] );\n\t\t$show_league   = intval( $instance['show_league'] );\n\t\t$show_date     = intval( $instance['show_date'] );\n\t\t$show_excluded = intval( $instance['show_excluded'] );\n\t\t$order         = strip_tags( $instance['order'] );\n\t\t$orderby       = strip_tags( $instance['orderby'] );\n\t\t$show_status   = intval( $instance['show_status'] );\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'countdown' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $caption ); ?>\" /></p>\n\t\t\n\t\t<p class=\"sp-dropdown-filter\"><label for=\"<?php echo esc_attr( $this->get_field_id( 'calendar' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'       => 'sp_calendar',\n\t\t\t'name'            => $this->get_field_name( 'calendar' ),\n\t\t\t'id'              => $this->get_field_id( 'calendar' ),\n\t\t\t'selected'        => $calendar,\n\t\t\t'show_option_all' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t'values'          => 'ID',\n\t\t\t'class'           => 'widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\t\t\n\t\t<p class=\"sp-dropdown-filter\"><label for=\"<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>\"><?php printf( esc_attr__( 'Sort by:', 'sportspress' ) ); ?></label>\n\t\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'orderby' ) ); ?>\" class=\"postform widefat\">\n\t\t\t\t<option value=\"\" <?php selected( 'default', $orderby ); ?>><?php esc_attr_e( 'Default', 'sportspress' ); ?></option>\n\t\t\t\t<option value=\"date\" <?php selected( 'date', $orderby ); ?>><?php esc_attr_e( 'Date', 'sportspress' ); ?></option>\n\t\t\t\t<option value=\"day\" <?php selected( 'day', $orderby ); ?>><?php esc_attr_e( 'Match Day', 'sportspress' ); ?></option>\n\t\t\t</select>\n\t\t</p>\n\t\t\n\t\t<p class=\"sp-dropdown-filter\"><label for=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\"><?php printf( esc_attr__( 'Sort Order:', 'sportspress' ) ); ?></label>\n\t\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>\" class=\"postform widefat\">\n\t\t\t\t<option value=\"ASC\" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t\t<option value=\"DESC\" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p class=\"sp-dropdown-filter\"><label for=\"<?php echo esc_attr( $this->get_field_id( 'team' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Team', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'       => 'sp_team',\n\t\t\t'name'            => $this->get_field_name( 'team' ),\n\t\t\t'id'              => $this->get_field_id( 'team' ),\n\t\t\t'selected'        => $team,\n\t\t\t'show_option_all' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t'values'          => 'ID',\n\t\t\t'class'           => 'widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_team', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p class=\"sp-dropdown-target\"><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Event', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'       => 'sp_event',\n\t\t\t'name'            => $this->get_field_name( 'id' ),\n\t\t\t'id'              => $this->get_field_id( 'id' ),\n\t\t\t'selected'        => $id,\n\t\t\t'show_option_all' => esc_attr__( '(Auto)', 'sportspress' ),\n\t\t\t'values'          => 'ID',\n\t\t\t'class'           => 'widefat',\n\t\t\t'show_dates'      => true,\n\t\t\t'post_status'     => 'future',\n\t\t\t'filter'          => 'sp_team',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_event', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_venue' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_venue' ) ); ?>\" value=\"1\" <?php checked( $show_venue, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_venue' ) ); ?>\"><?php esc_attr_e( 'Display venue', 'sportspress' ); ?></label></p>\n\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_league' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_league' ) ); ?>\" value=\"1\" <?php checked( $show_league, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_league' ) ); ?>\"><?php esc_attr_e( 'Display league', 'sportspress' ); ?></label></p>\n\t\t\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_date' ) ); ?>\" value=\"1\" <?php checked( $show_date, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>\"><?php esc_attr_e( 'Display date', 'sportspress' ); ?></label></p>\n\t\t\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_excluded' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_excluded' ) ); ?>\" value=\"1\" <?php checked( $show_excluded, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_excluded' ) ); ?>\"><?php esc_attr_e( 'Display excluded events', 'sportspress' ); ?></label></p>\n\t\t\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_status' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_status' ) ); ?>\" value=\"1\" <?php checked( $show_status, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_status' ) ); ?>\"><?php esc_attr_e( 'Display event status', 'sportspress' ); ?></label></p>\n\t\t\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'countdown' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Countdown' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-event-blocks.php",
    "content": "<?php\nclass SP_Widget_Event_Blocks extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_sp_event_blocks',\n\t\t\t'description' => esc_attr__( 'A list of events.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-event-blocks', esc_attr__( 'Event Blocks', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\n\t\t$id = empty( $instance['id'] ) ? null : $instance['id'];\n\t\tif ( $id && 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) {\n\t\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\t\tif ( 'blocks' == $format ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$title                = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$caption              = empty( $instance['caption'] ) ? null : $instance['caption'];\n\t\t$status               = empty( $instance['status'] ) ? 'default' : $instance['status'];\n\t\t$date                 = empty( $instance['date'] ) ? 'default' : $instance['date'];\n\t\t$date_from            = empty( $instance['date_from'] ) ? 'default' : $instance['date_from'];\n\t\t$date_to              = empty( $instance['date_to'] ) ? 'default' : $instance['date_to'];\n\t\t$date_past            = empty( $instance['date_past'] ) ? 'default' : $instance['date_past'];\n\t\t$date_future          = empty( $instance['date_future'] ) ? 'default' : $instance['date_future'];\n\t\t$date_relative        = empty( $instance['date_relative'] ) ? 'default' : $instance['date_relative'];\n\t\t$day                  = empty( $instance['day'] ) ? 'default' : $instance['day'];\n\t\t$number               = empty( $instance['number'] ) ? null : $instance['number'];\n\t\t$order                = empty( $instance['order'] ) ? 'default' : $instance['order'];\n\t\t$show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'event-blocks' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'event-blocks' );\n\n\t\tsp_get_template(\n\t\t\t'event-blocks.php',\n\t\t\tarray(\n\t\t\t\t'id'                   => $id,\n\t\t\t\t'title'                => $caption,\n\t\t\t\t'status'               => $status,\n\t\t\t\t'date'                 => $date,\n\t\t\t\t'date_from'            => $date_from,\n\t\t\t\t'date_to'              => $date_to,\n\t\t\t\t'date_past'            => $date_past,\n\t\t\t\t'date_future'          => $date_future,\n\t\t\t\t'date_relative'        => $date_relative,\n\t\t\t\t'day'                  => $day,\n\t\t\t\t'number'               => $number,\n\t\t\t\t'order'                => $order,\n\t\t\t\t'show_all_events_link' => $show_all_events_link,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'event-blocks' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'event-blocks' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                         = $old_instance;\n\t\t$instance['title']                = strip_tags( $new_instance['title'] );\n\t\t$instance['id']                   = intval( $new_instance['id'] );\n\t\t$instance['caption']              = strip_tags( $new_instance['caption'] );\n\t\t$instance['status']               = $new_instance['status'];\n\t\t$instance['date']                 = $new_instance['date'];\n\t\t$instance['date_from']            = $new_instance['date_from'];\n\t\t$instance['date_to']              = $new_instance['date_to'];\n\t\t$instance['date_past']            = $new_instance['date_past'];\n\t\t$instance['date_future']          = $new_instance['date_future'];\n\t\t$instance['date_relative']   \t  = isset( $new_instance['date_relative'] ) ? $new_instance['date_relative'] : false;\n\t\t$instance['day']                  = $new_instance['day'];\n\t\t$instance['number']               = intval( $new_instance['number'] );\n\t\t$instance['order']                = strip_tags( $new_instance['order'] );\n\t\t$instance['show_all_events_link'] = isset( $new_instance['show_all_events_link'] ) ? $new_instance['show_all_events_link'] : false;\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'event-blocks' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance             = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'                => '',\n\t\t\t\t'id'                   => null,\n\t\t\t\t'caption'              => '',\n\t\t\t\t'status'               => 'default',\n\t\t\t\t'date'                 => 'default',\n\t\t\t\t'date_from'            => date_i18n( 'Y-m-d' ),\n\t\t\t\t'date_to'              => date_i18n( 'Y-m-d' ),\n\t\t\t\t'date_past'            => 7,\n\t\t\t\t'date_future'          => 7,\n\t\t\t\t'date_relative'        => false,\n\t\t\t\t'day'                  => '',\n\t\t\t\t'number'               => 5,\n\t\t\t\t'order'                => 'default',\n\t\t\t\t'show_all_events_link' => true,\n\t\t\t)\n\t\t);\n\t\t$title                = strip_tags( $instance['title'] );\n\t\t$id                   = intval( $instance['id'] );\n\t\t$caption              = strip_tags( $instance['caption'] );\n\t\t$status               = $instance['status'];\n\t\t$date                 = $instance['date'];\n\t\t$date_from            = $instance['date_from'];\n\t\t$date_to              = $instance['date_to'];\n\t\t$date_past            = $instance['date_past'];\n\t\t$date_future          = $instance['date_future'];\n\t\t$date_relative        = $instance['date_relative'];\n\t\t$day                  = $instance['day'];\n\t\t$number               = intval( $instance['number'] );\n\t\t$order                = strip_tags( $instance['order'] );\n\t\t$show_all_events_link = $instance['show_all_events_link'];\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-blocks' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $caption ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'       => 'sp_calendar',\n\t\t\t'show_option_all' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t'name'            => $this->get_field_name( 'id' ),\n\t\t\t'id'              => $this->get_field_id( 'id' ),\n\t\t\t'selected'        => $id,\n\t\t\t'values'          => 'ID',\n\t\t\t'class'           => 'sp-event-calendar-select widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'status' ) ); ?>\"><?php esc_attr_e( 'Status:', 'sportspress' ); ?></label>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'show_option_default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t'name'                => $this->get_field_name( 'status' ),\n\t\t\t\t'id'                  => $this->get_field_id( 'status' ),\n\t\t\t\t'selected'            => $status,\n\t\t\t\t'class'               => 'sp-event-status-select widefat',\n\t\t\t);\n\t\t\tsp_dropdown_statuses( $args );\n\t\t\t?>\n\t\t</p>\n\n\t\t<div class=\"sp-date-selector\">\n\t\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>\"><?php esc_attr_e( 'Date:', 'sportspress' ); ?></label>\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'show_option_default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t'name'                => $this->get_field_name( 'date' ),\n\t\t\t\t\t'id'                  => $this->get_field_id( 'date' ),\n\t\t\t\t\t'selected'            => $date,\n\t\t\t\t\t'class'               => 'sp-event-date-select widefat',\n\t\t\t\t);\n\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<div class=\"sp-date-range\n\t\t\t<?php\n\t\t\tif ( 'range' !== $date ) :\n\t\t\t\t?>\n\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t<p class=\"sp-date-range-absolute\n\t\t\t\t<?php\n\t\t\t\tif ( $date_relative ) :\n\t\t\t\t\t?>\n\t\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t\t<input type=\"text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_from' ) ); ?>\" value=\"<?php echo esc_attr( $date_from ); ?>\" class=\"sp-datepicker-from\" placeholder=\"yyyy-mm-dd\" size=\"10\">\n\t\t\t\t\t:\n\t\t\t\t\t<input type=\"text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_to' ) ); ?>\" value=\"<?php echo esc_attr( $date_to ); ?>\" class=\"sp-datepicker-to\" placeholder=\"yyyy-mm-dd\" size=\"10\">\n\t\t\t\t</p>\n\n\t\t\t\t<p class=\"sp-date-range-relative\n\t\t\t\t<?php\n\t\t\t\tif ( ! $date_relative ) :\n\t\t\t\t\t?>\n\t\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t\t<?php esc_attr_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_past' ) ); ?>\" value=\"<?php echo esc_attr( $date_past ); ?>\">\n\t\t\t\t\t&rarr;\n\t\t\t\t\t<?php esc_attr_e( 'Next', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_future' ) ); ?>\" value=\"<?php echo esc_attr( $date_future ); ?>\">\n\t\t\t\t\t<?php esc_attr_e( 'days', 'sportspress' ); ?>\n\t\t\t\t</p>\n\n\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_relative' ) ); ?>\" value=\"1\" id=\"<?php echo esc_attr( $this->get_field_id( 'date_relative' ) ); ?>\" <?php checked( $date_relative ); ?>>\n\t\t\t\t\t\t<?php esc_attr_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>\"><?php esc_attr_e( 'Match Day:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'day' ) ); ?>\" type=\"text\" placeholder=\"<?php esc_attr_e( 'All', 'sportspress' ); ?>\" value=\"<?php echo esc_attr( $day ); ?>\" size=\"10\"></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\"><?php esc_attr_e( 'Number of events to show:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $number ); ?>\" size=\"3\"></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\"><?php esc_attr_e( 'Sort Order:', 'sportspress' ); ?></label>\n\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>\" id=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\" class=\"sp-select-order widefat\">\n\t\t\t<option value=\"default\" <?php selected( 'default', $order ); ?>><?php esc_attr_e( 'Default', 'sportspress' ); ?></option>\n\t\t\t<option value=\"ASC\" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t<option value=\"DESC\" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>\n\t\t</select></p>\n\n\t\t<p class=\"sp-event-calendar-show-all-toggle\n\t\t<?php\n\t\tif ( ! $id ) :\n\t\t\t?>\n\t\t\t hidden<?php endif; ?>\"><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_all_events_link' ) ); ?>\" value=\"1\" <?php checked( $show_all_events_link, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>\"><?php esc_attr_e( 'Display link to view all events', 'sportspress' ); ?></label></p>\n\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'event-blocks' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Event_Blocks' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-event-calendar.php",
    "content": "<?php\nclass SP_Widget_Event_Calendar extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_calendar widget_sp_event_calendar',\n\t\t\t'description' => esc_attr__( 'A calendar of events.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-event-calendar', esc_attr__( 'Event Calendar', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\n\t\t$id = empty( $instance['id'] ) ? null : $instance['id'];\n\t\tif ( $id && 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) {\n\t\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\t\tif ( 'calendar' == $format ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$title                = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$status               = empty( $instance['status'] ) ? 'default' : $instance['status'];\n\t\t$date                 = empty( $instance['date'] ) ? 'default' : $instance['date'];\n\t\t$date_from            = empty( $instance['date_from'] ) ? 'default' : $instance['date_from'];\n\t\t$date_to              = empty( $instance['date_to'] ) ? 'default' : $instance['date_to'];\n\t\t$date_past            = empty( $instance['date_past'] ) ? 'default' : $instance['date_past'];\n\t\t$date_future          = empty( $instance['date_future'] ) ? 'default' : $instance['date_future'];\n\t\t$date_relative        = empty( $instance['date_relative'] ) ? 'default' : $instance['date_relative'];\n\t\t$day                  = empty( $instance['day'] ) ? 'default' : $instance['day'];\n\t\t$show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'event-calendar' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'event-calendar' );\n\n\t\tsp_get_template(\n\t\t\t'event-calendar.php',\n\t\t\tarray(\n\t\t\t\t'id'                   => $id,\n\t\t\t\t'status'               => $status,\n\t\t\t\t'date'                 => $date,\n\t\t\t\t'date_from'            => $date_from,\n\t\t\t\t'date_to'              => $date_to,\n\t\t\t\t'date_past'            => $date_past,\n\t\t\t\t'date_future'          => $date_future,\n\t\t\t\t'date_relative'        => $date_relative,\n\t\t\t\t'caption_tag'          => 'caption',\n\t\t\t\t'day'                  => $day,\n\t\t\t\t'show_all_events_link' => $show_all_events_link,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'event-calendar' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'event-calendar' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                         = $old_instance;\n\t\t$instance['title']                = strip_tags( $new_instance['title'] );\n\t\t$instance['id']                   = intval( $new_instance['id'] );\n\t\t$instance['status']               = $new_instance['status'];\n\t\t$instance['date']                 = $new_instance['date'];\n\t\t$instance['date_from']            = $new_instance['date_from'];\n\t\t$instance['date_to']              = $new_instance['date_to'];\n\t\t$instance['date_past']            = $new_instance['date_past'];\n\t\t$instance['date_future']          = $new_instance['date_future'];\n\t\t$instance['date_relative']   \t  = isset( $new_instance['date_relative'] ) ? $new_instance['date_relative'] : false;\n\t\t$instance['day']                  = $new_instance['day'];\n\t\t$instance['show_all_events_link'] = isset( $new_instance['show_all_events_link'] ) ? $new_instance['show_all_events_link'] : false;\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'event-calendar' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance             = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'                => '',\n\t\t\t\t'id'                   => null,\n\t\t\t\t'status'               => 'default',\n\t\t\t\t'date'                 => 'default',\n\t\t\t\t'date_from'            => date_i18n( 'Y-m-d' ),\n\t\t\t\t'date_to'              => date_i18n( 'Y-m-d' ),\n\t\t\t\t'date_past'            => 7,\n\t\t\t\t'date_future'          => 7,\n\t\t\t\t'date_relative'        => false,\n\t\t\t\t'day'                  => '',\n\t\t\t\t'show_all_events_link' => false,\n\t\t\t)\n\t\t);\n\t\t$title                = strip_tags( $instance['title'] );\n\t\t$id                   = intval( $instance['id'] );\n\t\t$status               = $instance['status'];\n\t\t$date                 = $instance['date'];\n\t\t$date_from            = $instance['date_from'];\n\t\t$date_to              = $instance['date_to'];\n\t\t$date_past            = $instance['date_past'];\n\t\t$date_future          = $instance['date_future'];\n\t\t$date_relative        = $instance['date_relative'];\n\t\t$day                  = $instance['day'];\n\t\t$show_all_events_link = $instance['show_all_events_link'];\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-calendar' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'       => 'sp_calendar',\n\t\t\t'show_option_all' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t'name'            => $this->get_field_name( 'id' ),\n\t\t\t'id'              => $this->get_field_id( 'id' ),\n\t\t\t'selected'        => $id,\n\t\t\t'values'          => 'ID',\n\t\t\t'class'           => 'sp-event-calendar-select widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'status' ) ); ?>\"><?php esc_attr_e( 'Status:', 'sportspress' ); ?></label>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'show_option_default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t'name'                => $this->get_field_name( 'status' ),\n\t\t\t\t'id'                  => $this->get_field_id( 'status' ),\n\t\t\t\t'selected'            => $status,\n\t\t\t\t'class'               => 'sp-event-status-select widefat',\n\t\t\t);\n\t\t\tsp_dropdown_statuses( $args );\n\t\t\t?>\n\t\t</p>\n\n\t\t<div class=\"sp-date-selector\">\n\t\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>\"><?php esc_attr_e( 'Date:', 'sportspress' ); ?></label>\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'show_option_default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t'name'                => $this->get_field_name( 'date' ),\n\t\t\t\t\t'id'                  => $this->get_field_id( 'date' ),\n\t\t\t\t\t'selected'            => $date,\n\t\t\t\t\t'class'               => 'sp-event-date-select widefat',\n\t\t\t\t);\n\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<div class=\"sp-date-range\n\t\t\t<?php\n\t\t\tif ( 'range' !== $date ) :\n\t\t\t\t?>\n\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t<p class=\"sp-date-range-absolute\n\t\t\t\t<?php\n\t\t\t\tif ( $date_relative ) :\n\t\t\t\t\t?>\n\t\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t\t<input type=\"text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_from' ) ); ?>\" value=\"<?php echo esc_attr( $date_from ); ?>\" class=\"sp-datepicker-from\" placeholder=\"yyyy-mm-dd\" size=\"10\">\n\t\t\t\t\t:\n\t\t\t\t\t<input type=\"text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_to' ) ); ?>\" value=\"<?php echo esc_attr( $date_to ); ?>\" class=\"sp-datepicker-to\" placeholder=\"yyyy-mm-dd\" size=\"10\">\n\t\t\t\t</p>\n\n\t\t\t\t<p class=\"sp-date-range-relative\n\t\t\t\t<?php\n\t\t\t\tif ( ! $date_relative ) :\n\t\t\t\t\t?>\n\t\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t\t<?php esc_attr_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_past' ) ); ?>\" value=\"<?php echo esc_attr( $date_past ); ?>\">\n\t\t\t\t\t&rarr;\n\t\t\t\t\t<?php esc_attr_e( 'Next', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_future' ) ); ?>\" value=\"<?php echo esc_attr( $date_future ); ?>\">\n\t\t\t\t\t<?php esc_attr_e( 'days', 'sportspress' ); ?>\n\t\t\t\t</p>\n\n\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_relative' ) ); ?>\" value=\"1\" id=\"<?php echo esc_attr( $this->get_field_id( 'date_relative' ) ); ?>\" <?php checked( $date_relative ); ?>>\n\t\t\t\t\t\t<?php esc_attr_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>\"><?php esc_attr_e( 'Match Day:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'day' ) ); ?>\" type=\"text\" placeholder=\"<?php esc_attr_e( 'All', 'sportspress' ); ?>\" value=\"<?php echo esc_attr( $day ); ?>\" size=\"10\"></p>\n\n\t\t<p class=\"sp-event-calendar-show-all-toggle\n\t\t<?php\n\t\tif ( ! $id ) :\n\t\t\t?>\n\t\t\t hidden<?php endif; ?>\"><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_all_events_link' ) ); ?>\" value=\"1\" <?php checked( $show_all_events_link, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>\"><?php esc_attr_e( 'Display link to view all events', 'sportspress' ); ?></label></p>\n\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'event-calendar' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Event_Calendar' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-event-list.php",
    "content": "<?php\nclass SP_Widget_Event_List extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_sp_event_list',\n\t\t\t'description' => esc_attr__( 'A list of events.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-event-list', esc_attr__( 'Event List', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\n\t\t$id = empty( $instance['id'] ) ? null : $instance['id'];\n\t\tif ( $id && 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) {\n\t\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\t\tif ( 'list' == $format ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$title                = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$caption              = empty( $instance['caption'] ) ? null : $instance['caption'];\n\t\t$status               = empty( $instance['status'] ) ? 'default' : $instance['status'];\n\t\t$date                 = empty( $instance['date'] ) ? 'default' : $instance['date'];\n\t\t$date_from            = empty( $instance['date_from'] ) ? 'default' : $instance['date_from'];\n\t\t$date_to              = empty( $instance['date_to'] ) ? 'default' : $instance['date_to'];\n\t\t$date_past            = empty( $instance['date_past'] ) ? 'default' : $instance['date_past'];\n\t\t$date_future          = empty( $instance['date_future'] ) ? 'default' : $instance['date_future'];\n\t\t$date_relative        = empty( $instance['date_relative'] ) ? 'default' : $instance['date_relative'];\n\t\t$day                  = empty( $instance['day'] ) ? 'default' : $instance['day'];\n\t\t$number               = empty( $instance['number'] ) ? null : $instance['number'];\n\t\t$columns              = empty( $instance['columns'] ) ? null : $instance['columns'];\n\t\t$order                = empty( $instance['order'] ) ? 'default' : $instance['order'];\n\t\t$show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'event-list' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'event-list' );\n\n\t\tsp_get_template(\n\t\t\t'event-list.php',\n\t\t\tarray(\n\t\t\t\t'id'                   => $id,\n\t\t\t\t'title'                => $caption,\n\t\t\t\t'status'               => $status,\n\t\t\t\t'date'                 => $date,\n\t\t\t\t'date_from'            => $date_from,\n\t\t\t\t'date_to'              => $date_to,\n\t\t\t\t'date_past'            => $date_past,\n\t\t\t\t'date_future'          => $date_future,\n\t\t\t\t'date_relative'        => $date_relative,\n\t\t\t\t'day'                  => $day,\n\t\t\t\t'number'               => $number,\n\t\t\t\t'columns'              => $columns,\n\t\t\t\t'order'                => $order,\n\t\t\t\t'show_all_events_link' => $show_all_events_link,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'event-list' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'event-list' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                         = $old_instance;\n\t\t$instance['title']                = strip_tags( $new_instance['title'] );\n\t\t$instance['id']                   = intval( $new_instance['id'] );\n\t\t$instance['caption']              = strip_tags( $new_instance['caption'] );\n\t\t$instance['status']               = $new_instance['status'];\n\t\t$instance['date']                 = $new_instance['date'];\n\t\t$instance['date_from']            = $new_instance['date_from'];\n\t\t$instance['date_to']              = $new_instance['date_to'];\n\t\t$instance['date_past']            = $new_instance['date_past'];\n\t\t$instance['date_future']          = $new_instance['date_future'];\n\t\t$instance['date_relative']   \t  = isset( $new_instance['date_relative'] ) ? $new_instance['date_relative'] : false;\n\t\t$instance['day']                  = $new_instance['day'];\n\t\t$instance['number']               = intval( $new_instance['number'] );\n\t\t$instance['columns']              = isset( $new_instance['columns'] ) ? (array) $new_instance['columns'] : array();\n\t\t$instance['order']                = strip_tags( $new_instance['order'] );\n\t\t$instance['show_all_events_link'] = isset( $new_instance['show_all_events_link'] ) ? $new_instance['show_all_events_link'] : false;\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'event-list' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance             = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'                => '',\n\t\t\t\t'id'                   => null,\n\t\t\t\t'caption'              => '',\n\t\t\t\t'status'               => 'default',\n\t\t\t\t'date'                 => 'default',\n\t\t\t\t'date_from'            => date_i18n( 'Y-m-d' ),\n\t\t\t\t'date_to'              => date_i18n( 'Y-m-d' ),\n\t\t\t\t'date_past'            => 7,\n\t\t\t\t'date_future'          => 7,\n\t\t\t\t'date_relative'        => false,\n\t\t\t\t'day'                  => '',\n\t\t\t\t'number'               => 5,\n\t\t\t\t'columns'              => null,\n\t\t\t\t'order'                => 'default',\n\t\t\t\t'show_all_events_link' => true,\n\t\t\t)\n\t\t);\n\t\t$title                = strip_tags( $instance['title'] );\n\t\t$id                   = intval( $instance['id'] );\n\t\t$caption              = strip_tags( $instance['caption'] );\n\t\t$status               = $instance['status'];\n\t\t$date                 = $instance['date'];\n\t\t$date_from            = $instance['date_from'];\n\t\t$date_to              = $instance['date_to'];\n\t\t$date_past            = $instance['date_past'];\n\t\t$date_future          = $instance['date_future'];\n\t\t$date_relative        = $instance['date_relative'];\n\t\t$day                  = $instance['day'];\n\t\t$number               = intval( $instance['number'] );\n\t\t$columns              = $instance['columns'];\n\t\t$order                = strip_tags( $instance['order'] );\n\t\t$show_all_events_link = $instance['show_all_events_link'];\n\n\t\t$time_format = get_option( 'sportspress_event_list_time_format', 'combined' );\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-list' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $caption ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'       => 'sp_calendar',\n\t\t\t'show_option_all' => esc_attr__( 'All', 'sportspress' ),\n\t\t\t'name'            => $this->get_field_name( 'id' ),\n\t\t\t'id'              => $this->get_field_id( 'id' ),\n\t\t\t'selected'        => $id,\n\t\t\t'values'          => 'ID',\n\t\t\t'class'           => 'sp-event-calendar-select widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'status' ) ); ?>\"><?php esc_attr_e( 'Status:', 'sportspress' ); ?></label>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'show_option_default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t'name'                => $this->get_field_name( 'status' ),\n\t\t\t\t'id'                  => $this->get_field_id( 'status' ),\n\t\t\t\t'selected'            => $status,\n\t\t\t\t'class'               => 'sp-event-status-select widefat',\n\t\t\t);\n\t\t\tsp_dropdown_statuses( $args );\n\t\t\t?>\n\t\t</p>\n\n\t\t<div class=\"sp-date-selector\">\n\t\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>\"><?php esc_attr_e( 'Date:', 'sportspress' ); ?></label>\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'show_option_default' => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t\t'name'                => $this->get_field_name( 'date' ),\n\t\t\t\t\t'id'                  => $this->get_field_id( 'date' ),\n\t\t\t\t\t'selected'            => $date,\n\t\t\t\t\t'class'               => 'sp-event-date-select widefat',\n\t\t\t\t);\n\t\t\t\tsp_dropdown_dates( $args );\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<div class=\"sp-date-range\n\t\t\t<?php\n\t\t\tif ( 'range' !== $date ) :\n\t\t\t\t?>\n\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t<p class=\"sp-date-range-absolute\n\t\t\t\t<?php\n\t\t\t\tif ( $date_relative ) :\n\t\t\t\t\t?>\n\t\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t\t<input type=\"text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_from' ) ); ?>\" value=\"<?php echo esc_attr( $date_from ); ?>\" class=\"sp-datepicker-from\" placeholder=\"yyyy-mm-dd\" size=\"10\">\n\t\t\t\t\t:\n\t\t\t\t\t<input type=\"text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_to' ) ); ?>\" value=\"<?php echo esc_attr( $date_to ); ?>\" class=\"sp-datepicker-to\" placeholder=\"yyyy-mm-dd\" size=\"10\">\n\t\t\t\t</p>\n\n\t\t\t\t<p class=\"sp-date-range-relative\n\t\t\t\t<?php\n\t\t\t\tif ( ! $date_relative ) :\n\t\t\t\t\t?>\n\t\t\t\t\t hidden<?php endif; ?>\">\n\t\t\t\t\t<?php esc_attr_e( 'Past', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_past' ) ); ?>\" value=\"<?php echo esc_attr( $date_past ); ?>\">\n\t\t\t\t\t&rarr;\n\t\t\t\t\t<?php esc_attr_e( 'Next', 'sportspress' ); ?>\n\t\t\t\t\t<input type=\"number\" min=\"0\" step=\"1\" class=\"tiny-text\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_future' ) ); ?>\" value=\"<?php echo esc_attr( $date_future ); ?>\">\n\t\t\t\t\t<?php esc_attr_e( 'days', 'sportspress' ); ?>\n\t\t\t\t</p>\n\n\t\t\t\t<p class=\"sp-date-relative\">\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"<?php echo esc_attr( $this->get_field_name( 'date_relative' ) ); ?>\" value=\"1\" id=\"<?php echo esc_attr( $this->get_field_id( 'date_relative' ) ); ?>\" <?php checked( $date_relative ); ?>>\n\t\t\t\t\t\t<?php esc_attr_e( 'Relative', 'sportspress' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>\"><?php esc_attr_e( 'Match Day:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'day' ) ); ?>\" type=\"text\" placeholder=\"<?php esc_attr_e( 'All', 'sportspress' ); ?>\" value=\"<?php echo esc_attr( $day ); ?>\" size=\"10\"></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\"><?php esc_attr_e( 'Number of events to show:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $number ); ?>\" size=\"3\"></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\"><?php esc_attr_e( 'Sort Order:', 'sportspress' ); ?></label>\n\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>\" id=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\" class=\"sp-select-order widefat\">\n\t\t\t<option value=\"default\" <?php selected( 'default', $order ); ?>><?php esc_attr_e( 'Default', 'sportspress' ); ?></option>\n\t\t\t<option value=\"ASC\" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t<option value=\"DESC\" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>\n\t\t</select></p>\n\n\t\t<p class=\"sp-prefs\">\n\t\t\t<?php esc_attr_e( 'Columns:', 'sportspress' ); ?><br>\n\t\t\t<?php\n\t\t\t$the_columns          = array();\n\t\t\t$the_columns['event'] = esc_attr__( 'Event', 'sportspress' );\n\n\t\t\tif ( 'combined' === $time_format ) {\n\n\t\t\t\t$the_columns['time'] = esc_attr__( 'Time/Results', 'sportspress' );\n\n\t\t\t} else {\n\n\t\t\t\tif ( in_array( $time_format, array( 'time', 'separate' ) ) ) {\n\t\t\t\t\t$the_columns['time'] = esc_attr__( 'Time', 'sportspress' );\n\t\t\t\t}\n\n\t\t\t\tif ( in_array( $time_format, array( 'results', 'separate' ) ) ) {\n\t\t\t\t\t$the_columns['results'] = esc_attr__( 'Results', 'sportspress' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$the_columns['venue']   = esc_attr__( 'Venue', 'sportspress' );\n\t\t\t$the_columns['article'] = esc_attr__( 'Article', 'sportspress' );\n\t\t\t$the_columns['day']     = esc_attr__( 'Match Day', 'sportspress' );\n\n\t\t\t$field_name = $this->get_field_name( 'columns' ) . '[]';\n\t\t\t$field_id   = $this->get_field_id( 'columns' );\n\t\t\t?>\n\t\t\t<?php foreach ( $the_columns as $key => $label ) : ?>\n\t\t\t\t<label class=\"button\"><input name=\"<?php echo esc_attr( $field_name ); ?>\" type=\"checkbox\" id=\"<?php echo esc_attr( $field_id . '-' . $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $columns === null || in_array( $key, $columns ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\tchecked=\"checked\"<?php endif; ?>><?php echo esc_attr( $label ); ?></label>\n\t\t\t<?php endforeach; ?>\n\t\t</p>\n\n\t\t<p class=\"sp-event-calendar-show-all-toggle\n\t\t<?php\n\t\tif ( ! $id ) :\n\t\t\t?>\n\t\t\t hidden<?php endif; ?>\"><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_all_events_link' ) ); ?>\" value=\"1\" <?php checked( $show_all_events_link, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>\"><?php esc_attr_e( 'Display link to view all events', 'sportspress' ); ?></label></p>\n\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'event-list' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Event_List' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-league-table.php",
    "content": "<?php\nclass SP_Widget_League_Table extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_league_table widget_sp_league_table',\n\t\t\t'description' => esc_attr__( 'Display a league table.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-league-table', esc_attr__( 'League Table', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\n\t\t$id = empty( $instance['id'] ) ? 0 : $instance['id'];\n\n\t\tif ( $id <= 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$title                = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$caption              = empty( $instance['caption'] ) ? null : $instance['caption'];\n\t\t$number               = empty( $instance['number'] ) ? null : $instance['number'];\n\t\t$columns              = empty( $instance['columns'] ) ? array() : $instance['columns'];\n\t\t$show_team_logo       = empty( $instance['show_team_logo'] ) ? false : $instance['show_team_logo'];\n\t\t$show_full_table_link = empty( $instance['show_full_table_link'] ) ? false : $instance['show_full_table_link'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'league-table' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'league-table' );\n\n\t\tsp_get_template(\n\t\t\t'league-table.php',\n\t\t\tarray(\n\t\t\t\t'id'                   => $id,\n\t\t\t\t'title'                => $caption,\n\t\t\t\t'number'               => $number,\n\t\t\t\t'columns'              => $columns,\n\t\t\t\t'show_full_table_link' => $show_full_table_link,\n\t\t\t\t'show_team_logo'       => $show_team_logo,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'league-table' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'league-table' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                         = $old_instance;\n\t\t$instance['title']                = strip_tags( $new_instance['title'] );\n\t\t$instance['id']                   = intval( $new_instance['id'] );\n\t\t$instance['caption']              = strip_tags( $new_instance['caption'] );\n\t\t$instance['number']               = intval( $new_instance['number'] );\n\t\t$instance['columns']              = isset( $new_instance['columns'] ) ? (array) $new_instance['columns'] : array();\n\t\t$instance['show_team_logo']   \t  = isset( $new_instance['show_team_logo'] ) ? $new_instance['show_team_logo'] : false;\n\t\t$instance['show_full_table_link'] = isset( $new_instance['show_full_table_link'] ) ? $new_instance['show_full_table_link'] : false;\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'league-table' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$defaults             = apply_filters(\n\t\t\t'sportspress_widget_defaults',\n\t\t\tarray(\n\t\t\t\t'title'                => '',\n\t\t\t\t'id'                   => '',\n\t\t\t\t'caption'              => '',\n\t\t\t\t'number'               => 5,\n\t\t\t\t'columns'              => null,\n\t\t\t\t'show_team_logo'       => false,\n\t\t\t\t'show_full_table_link' => true,\n\t\t\t)\n\t\t);\n\t\t$instance             = wp_parse_args( (array) $instance, $defaults );\n\t\t$title                = strip_tags( $instance['title'] );\n\t\t$id                   = intval( $instance['id'] );\n\t\t$caption              = strip_tags( $instance['caption'] );\n\t\t$number               = intval( $instance['number'] );\n\t\t$columns              = $instance['columns'];\n\t\t$show_team_logo       = $instance['show_team_logo'];\n\t\t$show_full_table_link = $instance['show_full_table_link'];\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'league-table' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $caption ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'League Table', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type'        => 'sp_table',\n\t\t\t'name'             => $this->get_field_name( 'id' ),\n\t\t\t'id'               => $this->get_field_id( 'id' ),\n\t\t\t'show_option_none' => esc_attr__( '&mdash; Select &mdash;', 'sportspress' ),\n\t\t\t'selected'         => $id,\n\t\t\t'values'           => 'ID',\n\t\t\t'class'            => 'widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_table', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\"><?php esc_attr_e( 'Number of teams to show:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $number ); ?>\" size=\"3\"></p>\n\n\t\t<p class=\"sp-prefs\">\n\t\t\t<?php esc_attr_e( 'Columns:', 'sportspress' ); ?><br>\n\t\t\t<?php\n\t\t\t$args        = array(\n\t\t\t\t'post_type'      => 'sp_column',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$the_columns = get_posts( $args );\n\n\t\t\t$field_name = $this->get_field_name( 'columns' ) . '[]';\n\t\t\t$field_id   = $this->get_field_id( 'columns' );\n\t\t\t?>\n\t\t\t<?php foreach ( $the_columns as $column ) : ?>\n\t\t\t\t<label class=\"button\"><input name=\"<?php echo esc_attr( $field_name ); ?>\" type=\"checkbox\" id=\"<?php echo esc_attr( $field_id ) . '-' . esc_attr( $column->post_name ); ?>\" value=\"<?php echo esc_attr( $column->post_name ); ?>\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $columns === null || in_array( $column->post_name, $columns ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\tchecked=\"checked\"<?php endif; ?>><?php echo esc_attr( $column->post_title ); ?></label>\n\t\t\t<?php endforeach; ?>\n\t\t</p>\n\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_team_logo' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_team_logo' ) ); ?>\" value=\"1\" <?php checked( $show_team_logo, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_team_logo' ) ); ?>\"><?php esc_attr_e( 'Display logos', 'sportspress' ); ?></label><br>\n\n\t\t<input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_full_table_link' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_full_table_link' ) ); ?>\" value=\"1\" <?php checked( $show_full_table_link, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_full_table_link' ) ); ?>\"><?php esc_attr_e( 'Display link to view full table', 'sportspress' ); ?></label></p>\n\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'league-table' );\n\t}\n}\n\nregister_widget( 'SP_Widget_League_Table' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-player-gallery.php",
    "content": "<?php\nclass SP_Widget_Player_Gallery extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_player_gallery widget_sp_player_gallery',\n\t\t\t'description' => esc_attr__( 'Display a gallery of players.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-player-gallery', esc_attr__( 'Player Gallery', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\n\t\t$id = empty( $instance['id'] ) ? 0 : $instance['id'];\n\n\t\tif ( $id <= 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) {\n\t\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\t\tif ( 'gallery' == $format ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$title                 = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$caption               = empty( $instance['caption'] ) ? null : $instance['caption'];\n\t\t$number                = empty( $instance['number'] ) ? null : $instance['number'];\n\t\t$columns               = empty( $instance['columns'] ) ? null : $instance['columns'];\n\t\t$orderby               = empty( $instance['orderby'] ) ? 'default' : $instance['orderby'];\n\t\t$order                 = empty( $instance['order'] ) ? 'ASC' : $instance['order'];\n\t\t$show_all_players_link = empty( $instance['show_all_players_link'] ) ? false : $instance['show_all_players_link'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'player-gallery' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'player-gallery' );\n\n\t\tsp_get_template(\n\t\t\t'player-gallery.php',\n\t\t\tarray(\n\t\t\t\t'id'                    => $id,\n\t\t\t\t'title'                 => $caption,\n\t\t\t\t'number'                => $number,\n\t\t\t\t'columns'               => $columns,\n\t\t\t\t'orderby'               => $orderby,\n\t\t\t\t'order'                 => $order,\n\t\t\t\t'grouping'              => 0,\n\t\t\t\t'show_all_players_link' => $show_all_players_link,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'player-gallery' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'player-gallery' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                          = $old_instance;\n\t\t$instance['title']                 = strip_tags( $new_instance['title'] );\n\t\t$instance['id']                    = intval( $new_instance['id'] );\n\t\t$instance['caption']               = strip_tags( $new_instance['caption'] );\n\t\t$instance['number']                = intval( $new_instance['number'] );\n\t\t$instance['columns']               = isset( $new_instance['columns'] ) ? intval( $new_instance['columns'] ) : 2;\n\t\t$instance['orderby']               = isset( $new_instance['orderby'] ) ? strip_tags( $new_instance['orderby'] ) : 'default';\n\t\t$instance['order']                 = isset( $new_instance['order'] ) ? strip_tags( $new_instance['order'] ) : 'ASC';\n\t\t$instance['show_all_players_link'] = isset( $new_instance['show_all_players_link'] ) ? $new_instance['show_all_players_link'] : false;\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'player-gallery' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance              = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'                 => '',\n\t\t\t\t'id'                    => '',\n\t\t\t\t'caption'               => '',\n\t\t\t\t'number'                => 5,\n\t\t\t\t'columns'               => 2,\n\t\t\t\t'orderby'               => 'default',\n\t\t\t\t'order'                 => 'ASC',\n\t\t\t\t'show_all_players_link' => true,\n\t\t\t)\n\t\t);\n\t\t$title                 = strip_tags( $instance['title'] );\n\t\t$id                    = intval( $instance['id'] );\n\t\t$caption               = strip_tags( $instance['caption'] );\n\t\t$number                = intval( $instance['number'] );\n\t\t$columns               = intval( $instance['columns'] );\n\t\t$orderby               = strip_tags( $instance['orderby'] );\n\t\t$order                 = strip_tags( $instance['order'] );\n\t\t$show_all_players_link = $instance['show_all_players_link'];\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'player-gallery' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $caption ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Player List', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type' => 'sp_list',\n\t\t\t'name'      => $this->get_field_name( 'id' ),\n\t\t\t'id'        => $this->get_field_id( 'id' ),\n\t\t\t'selected'  => $id,\n\t\t\t'values'    => 'ID',\n\t\t\t'class'     => 'widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\"><?php esc_attr_e( 'Number of players to show:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $number ); ?>\" size=\"3\"></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>\"><?php esc_attr_e( 'Columns:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'columns' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $columns ); ?>\" size=\"3\"></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>\"><?php esc_attr_e( 'Sort by:', 'sportspress' ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'prepend_options' => array(\n\t\t\t\t'default'      => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t'number'       => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t'name'         => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'eventsplayed' => esc_attr__( 'Played', 'sportspress' ),\n\t\t\t),\n\t\t\t'append_options'  => array(\n\t\t\t\t'rand' => esc_attr__( 'Random', 'sportspress' ),\n\t\t\t),\n\t\t\t'post_type'       => 'sp_performance',\n\t\t\t'name'            => $this->get_field_name( 'orderby' ),\n\t\t\t'id'              => $this->get_field_id( 'orderby' ),\n\t\t\t'selected'        => $orderby,\n\t\t\t'values'          => 'slug',\n\t\t\t'class'           => 'sp-select-orderby widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\"><?php esc_attr_e( 'Sort Order:', 'sportspress' ); ?></label>\n\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>\" id=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\" class=\"sp-select-order widefat\" <?php disabled( $orderby, 'default' ); ?>>\n\t\t\t<option value=\"ASC\" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t<option value=\"DESC\" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>\n\t\t</select></p>\n\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_all_players_link' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_all_players_link' ) ); ?>\" value=\"1\" <?php checked( $show_all_players_link, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_all_players_link' ) ); ?>\"><?php esc_attr_e( 'Display link to view all players', 'sportspress' ); ?></label></p>\n\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'player-gallery' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Player_Gallery' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-player-list.php",
    "content": "<?php\nclass SP_Widget_Player_list extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_player_list widget_sp_player_list',\n\t\t\t'description' => esc_attr__( 'Display a list of players.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-player-list', esc_attr__( 'Player List', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\n\t\t$id = empty( $instance['id'] ) ? 0 : $instance['id'];\n\n\t\tif ( $id <= 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) {\n\t\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\t\tif ( 'list' == $format ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$title                 = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$caption               = empty( $instance['caption'] ) ? null : $instance['caption'];\n\t\t$number                = empty( $instance['number'] ) ? null : $instance['number'];\n\t\t$columns               = $instance['columns'];\n\t\t$orderby               = empty( $instance['orderby'] ) ? 'default' : $instance['orderby'];\n\t\t$order                 = empty( $instance['order'] ) ? 'ASC' : $instance['order'];\n\t\t$show_all_players_link = empty( $instance['show_all_players_link'] ) ? false : $instance['show_all_players_link'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'player-list' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'player-list' );\n\n\t\tsp_get_template(\n\t\t\t'player-list.php',\n\t\t\tarray(\n\t\t\t\t'id'                    => $id,\n\t\t\t\t'title'                 => $caption,\n\t\t\t\t'number'                => $number,\n\t\t\t\t'columns'               => $columns,\n\t\t\t\t'orderby'               => $orderby,\n\t\t\t\t'order'                 => $order,\n\t\t\t\t'grouping'              => 0,\n\t\t\t\t'show_all_players_link' => $show_all_players_link,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'player-list' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'player-list' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                          = $old_instance;\n\t\t$instance['title']                 = strip_tags( $new_instance['title'] );\n\t\t$instance['id']                    = intval( $new_instance['id'] );\n\t\t$instance['caption']               = strip_tags( $new_instance['caption'] );\n\t\t$instance['number']                = intval( $new_instance['number'] );\n\t\t$instance['columns']               = isset( $new_instance['columns'] ) ? (array) $new_instance['columns'] : array();\n\t\t$instance['orderby']               = isset( $new_instance['orderby'] ) ? strip_tags( $new_instance['orderby'] ) : 'default';\n\t\t$instance['order']                 = isset( $new_instance['order'] ) ? strip_tags( $new_instance['order'] ) : 'ASC';\n\t\t$instance['show_all_players_link'] = isset( $new_instance['show_all_players_link'] ) ? $new_instance['show_all_players_link'] : false;\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'player-list' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance              = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'                 => '',\n\t\t\t\t'id'                    => '',\n\t\t\t\t'caption'               => '',\n\t\t\t\t'number'                => 5,\n\t\t\t\t'columns'               => null,\n\t\t\t\t'orderby'               => 'default',\n\t\t\t\t'order'                 => 'ASC',\n\t\t\t\t'show_all_players_link' => true,\n\t\t\t)\n\t\t);\n\t\t$title                 = strip_tags( $instance['title'] );\n\t\t$id                    = intval( $instance['id'] );\n\t\t$caption               = strip_tags( $instance['caption'] );\n\t\t$number                = intval( $instance['number'] );\n\t\t$columns               = $instance['columns'];\n\t\t$orderby               = strip_tags( $instance['orderby'] );\n\t\t$order                 = strip_tags( $instance['order'] );\n\t\t$show_all_players_link = $instance['show_all_players_link'];\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'player-list' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $caption ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Player List', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type' => 'sp_list',\n\t\t\t'name'      => $this->get_field_name( 'id' ),\n\t\t\t'id'        => $this->get_field_id( 'id' ),\n\t\t\t'selected'  => $id,\n\t\t\t'values'    => 'ID',\n\t\t\t'class'     => 'widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\"><?php esc_attr_e( 'Number of players to show:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $number ); ?>\" size=\"3\"></p>\n\n\t\t<p class=\"sp-prefs\">\n\t\t\t<?php esc_attr_e( 'Performance:', 'sportspress' ); ?><br>\n\t\t\t<?php\n\t\t\t$args        = array(\n\t\t\t\t'post_type'      => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$the_columns = get_posts( $args );\n\n\t\t\t$field_name = $this->get_field_name( 'columns' ) . '[]';\n\t\t\t$field_id   = $this->get_field_id( 'columns' );\n\t\t\t?>\n\t\t\t<label class=\"button\"><input name=\"<?php echo esc_attr( $field_name ); ?>\" type=\"checkbox\" id=\"<?php echo esc_attr( $field_id ); ?>-number\" value=\"number\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $columns === null || in_array( 'number', $columns ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\tchecked=\"checked\"<?php endif; ?>>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( 'default' == $orderby ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Rank', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '/';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Squad Number', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} elseif ( in_array( $orderby, array( 'number', 'name' ) ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Squad Number', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Rank', 'sportspress' );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t</label>\n\t\t\t<?php foreach ( $the_columns as $column ) : ?>\n\t\t\t\t<label class=\"button\"><input name=\"<?php echo esc_attr( $field_name ); ?>\" type=\"checkbox\" id=\"<?php echo esc_attr( $field_id . '-' . $column->post_name ); ?>\" value=\"<?php echo esc_attr( $column->post_name ); ?>\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $columns === null || in_array( $column->post_name, $columns ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\tchecked=\"checked\"<?php endif; ?>><?php echo esc_attr( $column->post_title ); ?></label>\n\t\t\t<?php endforeach; ?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>\"><?php esc_attr_e( 'Sort by:', 'sportspress' ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'prepend_options' => array(\n\t\t\t\t'default'      => esc_attr__( 'Default', 'sportspress' ),\n\t\t\t\t'number'       => esc_attr__( 'Squad Number', 'sportspress' ),\n\t\t\t\t'name'         => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'eventsplayed' => esc_attr__( 'Played', 'sportspress' ),\n\t\t\t),\n\t\t\t'post_type'       => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),\n\t\t\t'name'            => $this->get_field_name( 'orderby' ),\n\t\t\t'id'              => $this->get_field_id( 'orderby' ),\n\t\t\t'selected'        => $orderby,\n\t\t\t'values'          => 'slug',\n\t\t\t'class'           => 'sp-select-orderby widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\"><?php esc_attr_e( 'Sort Order:', 'sportspress' ); ?></label>\n\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>\" id=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\" class=\"sp-select-order widefat\" <?php disabled( $orderby, 'default' ); ?>>\n\t\t\t<option value=\"ASC\" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>\n\t\t\t<option value=\"DESC\" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>\n\t\t</select></p>\n\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_all_players_link' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_all_players_link' ) ); ?>\" value=\"1\" <?php checked( $show_all_players_link, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_all_players_link' ) ); ?>\"><?php esc_attr_e( 'Display link to view all players', 'sportspress' ); ?></label></p>\n\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'player-list' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Player_list' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-staff.php",
    "content": "<?php\nclass SP_Widget_Staff extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_staff widget_sp_staff',\n\t\t\t'description' => esc_attr__( 'Display a single staff member.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-staff', esc_attr__( 'Staff', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\t\t$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? null : $instance['title'], $instance, $this->id_base );\n\t\t$id    = empty( $instance['id'] ) ? null : $instance['id'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'staff' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'staff' );\n\n\t\techo '<h4 class=\"sp-table-caption\">' . wp_kses_post( get_the_title( $id ) ) . '</h4>';\n\n\t\tsp_get_template( 'staff-photo.php', array( 'id' => $id ) );\n\t\tsp_get_template( 'staff-details.php', array( 'id' => $id ) );\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'staff' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'staff' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance          = $old_instance;\n\t\t$instance['title'] = strip_tags( $new_instance['title'] );\n\t\t$instance['id']    = intval( $new_instance['id'] );\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'staff' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title' => '',\n\t\t\t\t'id'    => '',\n\t\t\t)\n\t\t);\n\t\t$title    = strip_tags( $instance['title'] );\n\t\t$id       = intval( $instance['id'] );\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'staff' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Staff', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type' => 'sp_staff',\n\t\t\t'name'      => $this->get_field_name( 'id' ),\n\t\t\t'id'        => $this->get_field_id( 'id' ),\n\t\t\t'selected'  => $id,\n\t\t\t'values'    => 'ID',\n\t\t\t'class'     => 'widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_staff', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'staff' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Staff' );\n"
  },
  {
    "path": "includes/widgets/class-sp-widget-team-gallery.php",
    "content": "<?php\nclass SP_Widget_Team_Gallery extends WP_Widget {\n\n\tfunction __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'   => 'widget_sportspress widget_team_gallery widget_sp_team_gallery',\n\t\t\t'description' => esc_attr__( 'Display a gallery of teams.', 'sportspress' ),\n\t\t);\n\t\tparent::__construct( 'sportspress-team-gallery', esc_attr__( 'Team Gallery', 'sportspress' ), $widget_ops );\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\textract( $args );\n\n\t\t$id = empty( $instance['id'] ) ? 0 : $instance['id'];\n\n\t\tif ( $id <= 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) {\n\t\t\t$format = get_post_meta( $id, 'sp_format', true );\n\t\t\tif ( 'gallery' == $format ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$title               = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );\n\t\t$caption             = empty( $instance['caption'] ) ? null : $instance['caption'];\n\t\t$number              = empty( $instance['number'] ) ? null : $instance['number'];\n\t\t$columns             = empty( $instance['columns'] ) ? null : $instance['columns'];\n\t\t$orderby             = empty( $instance['orderby'] ) ? 'default' : $instance['orderby'];\n\t\t$show_all_teams_link = empty( $instance['show_all_teams_link'] ) ? false : $instance['show_all_teams_link'];\n\n\t\tdo_action( 'sportspress_before_widget', $args, $instance, 'team-gallery' );\n\t\techo wp_kses_post( $before_widget );\n\n\t\tif ( $title ) {\n\t\t\techo wp_kses_post( $before_title . $title . $after_title );\n\t\t}\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template', $args, $instance, 'team-gallery' );\n\n\t\tsp_get_template(\n\t\t\t'team-gallery.php',\n\t\t\tarray(\n\t\t\t\t'id'                  => $id,\n\t\t\t\t'title'               => $caption,\n\t\t\t\t'number'              => $number,\n\t\t\t\t'columns'             => $columns,\n\t\t\t\t'orderby'             => $orderby,\n\t\t\t\t'grouping'            => 0,\n\t\t\t\t'show_all_teams_link' => $show_all_teams_link,\n\t\t\t)\n\t\t);\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template', $args, $instance, 'team-gallery' );\n\n\t\techo wp_kses_post( $after_widget );\n\t\tdo_action( 'sportspress_after_widget', $args, $instance, 'team-gallery' );\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance                        = $old_instance;\n\t\t$instance['title']               = strip_tags( $new_instance['title'] );\n\t\t$instance['id']                  = intval( $new_instance['id'] );\n\t\t$instance['caption']             = strip_tags( $new_instance['caption'] );\n\t\t$instance['number']              = intval( $new_instance['number'] );\n\t\t$instance['columns']             = intval( $new_instance['columns'] );\n\t\t$instance['orderby']             = strip_tags( $new_instance['orderby'] );\n\t\t$instance['show_all_teams_link'] = isset( $new_instance['show_all_teams_link'] ) ? $new_instance['show_all_teams_link'] : false;\n\n\t\t// Filter to hook into\n\t\t$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'team-gallery' );\n\n\t\treturn $instance;\n\t}\n\n\tfunction form( $instance ) {\n\t\t$instance            = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'               => '',\n\t\t\t\t'id'                  => '',\n\t\t\t\t'caption'             => '',\n\t\t\t\t'number'              => 5,\n\t\t\t\t'columns'             => 2,\n\t\t\t\t'orderby'             => 'default',\n\t\t\t\t'show_all_teams_link' => true,\n\t\t\t)\n\t\t);\n\t\t$title               = strip_tags( $instance['title'] );\n\t\t$id                  = intval( $instance['id'] );\n\t\t$caption             = strip_tags( $instance['caption'] );\n\t\t$number              = intval( $instance['number'] );\n\t\t$columns             = intval( $instance['columns'] );\n\t\t$orderby             = strip_tags( $instance['orderby'] );\n\t\t$show_all_teams_link = $instance['show_all_teams_link'];\n\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_before_widget_template_form', $this, $instance, 'team-gallery' );\n\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $caption ); ?>\" /></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>\"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'League Table', 'sportspress' ) ); ?></label>\n\t\t<?php\n\t\t$args = array(\n\t\t\t'post_type' => 'sp_table',\n\t\t\t'name'      => $this->get_field_name( 'id' ),\n\t\t\t'id'        => $this->get_field_id( 'id' ),\n\t\t\t'selected'  => $id,\n\t\t\t'values'    => 'ID',\n\t\t\t'class'     => 'widefat',\n\t\t);\n\t\tif ( ! sp_dropdown_pages( $args ) ) :\n\t\t\tsp_post_adder( 'sp_table', esc_attr__( 'Add New', 'sportspress' ) );\n\t\tendif;\n\t\t?>\n\t\t</p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\"><?php esc_attr_e( 'Number of teams to show:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $number ); ?>\" size=\"3\"></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>\"><?php esc_attr_e( 'Columns:', 'sportspress' ); ?></label>\n\t\t<input id=\"<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'columns' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $columns ); ?>\" size=\"3\"></p>\n\n\t\t<p><label for=\"<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>\"><?php esc_attr_e( 'Sort by:', 'sportspress' ); ?></label>\n\t\t<select id=\"<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'orderby' ) ); ?>\">\n\t\t\t<option value=\"default\" <?php selected( 'default', $orderby ); ?>><?php esc_attr_e( 'Rank', 'sportspress' ); ?></option>\n\t\t\t<option value=\"name\" <?php selected( 'name', $orderby ); ?>><?php esc_attr_e( 'Alphabetical', 'sportspress' ); ?></option>\n\t\t\t<option value=\"rand\" <?php selected( 'rand', $orderby ); ?>><?php esc_attr_e( 'Random', 'sportspress' ); ?></option>\n\t\t</select></p>\n\n\t\t<p><input class=\"checkbox\" type=\"checkbox\" id=\"<?php echo esc_attr( $this->get_field_id( 'show_all_teams_link' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'show_all_teams_link' ) ); ?>\" value=\"1\" <?php checked( $show_all_teams_link, 1 ); ?>>\n\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'show_all_teams_link' ) ); ?>\"><?php esc_attr_e( 'Display link to view all teams', 'sportspress' ); ?></label></p>\n\n\t\t<?php\n\t\t// Action to hook into\n\t\tdo_action( 'sportspress_after_widget_template_form', $this, $instance, 'team-gallery' );\n\t}\n}\n\nregister_widget( 'SP_Widget_Team_Gallery' );\n"
  },
  {
    "path": "index.php",
    "content": "<?php\n// Silence is golden.\n"
  },
  {
    "path": "languages/sportspress.pot",
    "content": "#, fuzzy\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: SportsPress\\n\"\n\"POT-Creation-Date: 2023-03-12 18:56+0200\\n\"\n\"PO-Revision-Date: 2016-03-19 20:08+1100\\n\"\n\"Last-Translator: Brian Miyaji <brian@themeboy.com>\\n\"\n\"Language-Team: ThemeBoy <support@themeboy.com>\\n\"\n\"Language: en_US\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Generator: Poedit 2.4.3\\n\"\n\"X-Poedit-Basepath: ..\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;\"\n\"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;\"\n\"_nx_noop:3c,1,2;__ngettext_noop:1,2\\n\"\n\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"\n\"X-Poedit-SearchPath-0: .\\n\"\n\"X-Poedit-SearchPathExcluded-0: includes/libraries\\n\"\n\n#: assets/js/admin/editor-lang.php:35\nmsgid \"SportsPress Shortcodes\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:36\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:77\n#: includes/admin/post-types/class-sp-admin-cpt-table.php:81\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:162\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:90\n#: includes/admin/settings/class-sp-settings-events.php:350\n#: includes/admin/settings/class-sp-settings-events.php:413\n#: includes/admin/settings/class-sp-settings-general.php:154\n#: includes/admin/settings/class-sp-settings-general.php:241\n#: includes/admin/settings/class-sp-settings-players.php:162\nmsgid \"Auto\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:37\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:163\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:91\n#: includes/admin/settings/class-sp-settings-events.php:351\n#: includes/admin/settings/class-sp-settings-events.php:414\n#: includes/admin/settings/class-sp-settings-players.php:163\nmsgid \"Manual\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:38\nmsgid \"Select...\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:39\n#: includes/admin/class-sp-admin-importers.php:68\n#: includes/admin/class-sp-admin-sample-data.php:441\n#: includes/admin/class-sp-admin-setup-wizard.php:817\n#: includes/admin/importers/class-sp-event-importer.php:159\n#: includes/admin/importers/class-sp-event-importer.php:341\n#: includes/admin/importers/class-sp-event-performance-importer.php:184\n#: includes/admin/importers/class-sp-event-performance-importer.php:206\n#: includes/admin/importers/class-sp-fixture-importer.php:125\n#: includes/admin/importers/class-sp-fixture-importer.php:229\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:149\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:295\n#: includes/class-sp-ajax.php:64 includes/class-sp-ajax.php:109\n#: includes/class-sp-ajax.php:139 includes/class-sp-ajax.php:169\n#: includes/class-sp-ajax.php:199 includes/class-sp-ajax.php:229\n#: includes/class-sp-ajax.php:259 includes/class-sp-ajax.php:289\n#: includes/class-sp-ajax.php:626 includes/class-sp-post-types.php:446\n#: includes/sp-core-functions.php:1776\n#: includes/widgets/class-sp-widget-countdown.php:171\n#: includes/widgets/class-sp-widget-event-list.php:244\n#: templates/event-list.php:178 templates/event-list.php:385\nmsgid \"Event\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:40\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:34\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:43\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:59\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:75\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:91\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:100\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:136\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:166\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:195\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:224\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:287\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:28\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:264\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-shortcode.php:29\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:117\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:112\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:113\n#: includes/admin/settings/class-sp-settings-events.php:74\n#: includes/admin/settings/class-sp-settings-players.php:69\n#: includes/admin/settings/class-sp-settings-staff.php:71\n#: includes/class-sp-templates.php:62 includes/class-sp-templates.php:147\n#: includes/class-sp-templates.php:201 includes/class-sp-templates.php:274\n#: includes/sp-core-functions.php:1775 modules/sportspress-calendars.php:214\n#: modules/sportspress-calendars.php:355\n#: modules/sportspress-league-tables.php:205\n#: modules/sportspress-player-lists.php:214 templates/event-details.php:74\nmsgid \"Details\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:41\n#: includes/admin/importers/class-sp-event-importer.php:32\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:150\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:49\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:92\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:27\n#: includes/admin/settings/class-sp-settings-events.php:288\n#: includes/api/class-sp-rest-api.php:274 includes/class-sp-templates.php:74\n#: includes/sp-core-functions.php:1801\n#: includes/widgets/class-sp-widget-event-list.php:257\n#: templates/event-fixtures-results.php:89 templates/event-list.php:162\n#: templates/event-list.php:188 templates/event-list.php:198\n#: templates/event-list.php:344 templates/event-list.php:403\n#: templates/event-list.php:433 templates/event-results.php:29\nmsgid \"Results\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:42\n#: includes/widgets/class-sp-widget-countdown.php:9\n#: modules/sportspress-countdowns.php:88\nmsgid \"Countdown\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:43\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:157\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:29\n#: includes/admin/settings/class-sp-settings-events.php:372\n#: includes/api/class-sp-rest-api.php:291 includes/class-sp-templates.php:80\n#: includes/sp-core-functions.php:1769 modules/sportspress-tutorials.php:135\n#: templates/event-performance.php:132\nmsgid \"Box Score\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:44\n#: includes/admin/class-sp-admin-setup-wizard.php:80\n#: includes/admin/class-sp-admin-setup-wizard.php:566\n#: includes/admin/class-sp-admin-setup-wizard.php:610\n#: includes/admin/importers/class-sp-event-importer.php:30\n#: includes/admin/importers/class-sp-fixture-importer.php:30\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:55\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:144\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:54\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:113\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:84\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:51\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:30\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:109\n#: includes/admin/settings/class-sp-settings-teams.php:77\n#: includes/class-sp-ajax.php:631 includes/class-sp-post-types.php:118\n#: includes/class-sp-templates.php:68 includes/sp-core-functions.php:1812\n#: includes/widgets/class-sp-widget-event-list.php:261\n#: templates/event-list.php:217 templates/event-list.php:219\n#: templates/event-list.php:486 templates/event-list.php:499\n#: templates/event-venue.php:43\nmsgid \"Venue\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:45\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php:57\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:31\n#: includes/class-sp-modules.php:141 modules/sportspress-officials.php:141\n#: modules/sportspress-officials.php:335 modules/sportspress-officials.php:350\n#: modules/sportspress-officials.php:364 modules/sportspress-officials.php:380\n#: modules/sportspress-officials.php:399 templates/event-officials-list.php:17\n#: templates/event-officials-table.php:17\nmsgid \"Officials\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:46\n#: includes/admin/class-sp-admin-permalink-settings.php:32\n#: includes/admin/class-sp-admin-sample-data.php:173\n#: includes/admin/class-sp-admin-setup-wizard.php:70\n#: includes/admin/importers/class-sp-event-importer.php:31\n#: includes/admin/importers/class-sp-player-importer.php:31\n#: includes/admin/importers/class-sp-staff-importer.php:30\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:141\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:82\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:72\n#: includes/admin/post-types/class-sp-admin-cpt-table.php:55\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:143\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:37\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:68\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:32\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:132\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:149\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:108\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:125\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:60\n#: includes/admin/settings/class-sp-settings-events.php:136\n#: includes/admin/settings/class-sp-settings-events.php:242\n#: includes/admin/settings/class-sp-settings-modules.php:39\n#: includes/admin/settings/class-sp-settings-teams.php:27\n#: includes/api/class-sp-rest-api.php:73 includes/api/class-sp-rest-api.php:426\n#: includes/api/class-sp-rest-api.php:527 includes/class-sp-ajax.php:627\n#: includes/class-sp-post-types.php:480 includes/class-sp-templates.php:31\n#: includes/sp-core-functions.php:741 includes/sp-core-functions.php:1808\n#: modules/sportspress-calendars.php:270 modules/sportspress-calendars.php:284\n#: modules/sportspress-calendars.php:347\n#: modules/sportspress-league-tables.php:260\n#: modules/sportspress-player-lists.php:287\n#: modules/sportspress-player-lists.php:295\n#: modules/sportspress-tutorials.php:90 modules/sportspress-tutorials.php:144\n#: modules/sportspress-wordpay.php:207 templates/event-list.php:176\n#: templates/event-list.php:379\nmsgid \"Teams\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:47\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:33\nmsgid \"Full Info\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:48\n#: includes/admin/class-sp-admin-sample-data.php:571\n#: includes/class-sp-ajax.php:319 includes/class-sp-ajax.php:472\n#: includes/class-sp-ajax.php:679 includes/class-sp-formats.php:33\n#: includes/class-sp-templates.php:102\n#: includes/widgets/class-sp-widget-countdown.php:122\n#: includes/widgets/class-sp-widget-event-blocks.php:140\n#: includes/widgets/class-sp-widget-event-calendar.php:123\n#: includes/widgets/class-sp-widget-event-list.php:147\n#: modules/sportspress-bulk-actions.php:80 modules/sportspress-calendars.php:79\n#: modules/sportspress-calendars.php:435 modules/sportspress-calendars.php:478\n#: modules/sportspress-gutenberg.php:90\nmsgid \"Calendar\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:49\n#: includes/admin/class-sp-admin-taxonomies.php:186\n#: includes/admin/class-sp-admin-taxonomies.php:223\n#: includes/admin/class-sp-admin-taxonomies.php:334\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:209\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:61\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-shortcode.php:33\n#: includes/admin/settings/class-sp-settings-players.php:150\n#: includes/api/class-sp-rest-api.php:510 includes/class-sp-post-types.php:413\n#: includes/class-sp-templates.php:226 includes/sp-core-functions.php:1805\nmsgid \"Statistics\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:50\n#: includes/admin/class-sp-admin-sample-data.php:173\n#: includes/admin/importers/class-sp-event-performance-importer.php:217\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:56\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:55\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:78\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:113\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php:281\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:45\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:62\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:86\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:119\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:99\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:186\n#: includes/admin/settings/class-sp-settings-events.php:540\n#: includes/admin/settings/class-sp-settings-events.php:542\n#: includes/class-sp-ajax.php:1154 includes/class-sp-league-table.php:854\n#: includes/class-sp-player-list.php:901 includes/class-sp-player-list.php:960\n#: includes/class-sp-player.php:836 includes/class-sp-player.php:856\n#: includes/class-sp-post-types.php:481 includes/sp-core-functions.php:742\n#: includes/sp-core-functions.php:1807\n#: includes/widgets/class-sp-widget-countdown.php:154\n#: modules/sportspress-user-registration.php:126\n#: modules/sportspress-user-registration.php:132\n#: modules/sportspress-wordpay.php:166 modules/sportspress-wordpay.php:172\n#: templates/event-results.php:121\nmsgid \"Team\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:51\n#: includes/admin/class-sp-admin-sample-data.php:621\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:57\n#: includes/class-sp-ajax.php:870 includes/class-sp-ajax.php:955\n#: includes/class-sp-templates.php:175 includes/sp-core-functions.php:1784\n#: includes/widgets/class-sp-widget-league-table.php:9\n#: includes/widgets/class-sp-widget-league-table.php:108\n#: includes/widgets/class-sp-widget-team-gallery.php:111\n#: modules/sportspress-league-tables.php:76\n#: modules/sportspress-league-tables.php:150\n#: modules/sportspress-league-tables.php:212\n#: modules/sportspress-league-tables.php:341\nmsgid \"League Table\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:52\n#: includes/admin/class-sp-admin-sample-data.php:233\n#: includes/admin/importers/class-sp-event-performance-importer.php:28\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:131\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:356\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:60\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:211\n#: includes/class-sp-ajax.php:1013 includes/class-sp-ajax.php:1043\n#: includes/class-sp-install.php:153 includes/class-sp-player-list.php:958\n#: includes/class-sp-post-types.php:524 includes/sp-core-functions.php:746\n#: includes/sp-core-functions.php:1791 templates/event-performance-table.php:80\n#: templates/event-performance-table.php:233\nmsgid \"Player\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:53 includes/class-sp-formats.php:34\n#: includes/class-sp-formats.php:42 modules/sportspress-calendars.php:436\n#: modules/sportspress-calendars.php:479 modules/sportspress-officials.php:386\nmsgid \"List\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:54 includes/class-sp-formats.php:35\n#: modules/sportspress-calendars.php:434 modules/sportspress-calendars.php:477\nmsgid \"Blocks\"\nmsgstr \"\"\n\n#: assets/js/admin/editor-lang.php:55 includes/class-sp-formats.php:39\n#: includes/class-sp-formats.php:43\nmsgid \"Gallery\"\nmsgstr \"\"\n\n#: assets/js/leaflet.js:5\nmsgid \"number\"\nmsgstr \"\"\n\n#: assets/js/leaflet.js:5\nmsgid \"shadow\"\nmsgstr \"\"\n\n#: feeds/ical.php:16\nmsgid \"ERROR: This is not a valid feed template.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-assets.php:114\n#: includes/admin/class-sp-admin-settings.php:147\n#: includes/admin/class-sp-admin-setup-wizard.php:111\n#: includes/admin/importers/class-sp-event-importer.php:540\n#: includes/admin/importers/class-sp-event-importer.php:557\n#: includes/admin/importers/class-sp-fixture-importer.php:325\n#: includes/admin/importers/class-sp-fixture-importer.php:342\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:247\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:47\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:631\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:139\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:126\n#: includes/admin/settings/class-sp-settings-events.php:435\n#: includes/admin/settings/class-sp-settings-status.php:309\n#: includes/admin/views/html-admin-page-status.php:268\n#: modules/sportspress-league-tables.php:315\n#: modules/sportspress-widget-alignment.php:74\nmsgid \"None\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-assets.php:115\n#: includes/admin/class-sp-admin-setup-wizard.php:112\nmsgid \"&mdash; Remove &mdash;\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-assets.php:116\n#: includes/admin/class-sp-admin-dashboard.php:85\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:87\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:91\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:69\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:67\n#: includes/class-sp-ajax.php:420 includes/class-sp-ajax.php:424\n#: includes/class-sp-ajax.php:585 includes/class-sp-ajax.php:589\n#: includes/class-sp-ajax.php:792 includes/class-sp-ajax.php:796\n#: includes/class-sp-frontend-scripts.php:87\n#: includes/widgets/class-sp-widget-event-blocks.php:208\n#: includes/widgets/class-sp-widget-event-calendar.php:191\n#: includes/widgets/class-sp-widget-event-list.php:215\n#: modules/sportspress-countdowns.php:130 templates/countdown.php:237\nmsgid \"days\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-assets.php:117\n#: includes/class-sp-frontend-scripts.php:88\n#: modules/sportspress-countdowns.php:131 templates/countdown.php:238\nmsgid \"hrs\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-assets.php:118\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:39\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:549\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:570\n#: includes/admin/settings/class-sp-settings-events.php:157\n#: includes/class-sp-frontend-scripts.php:89\n#: modules/sportspress-countdowns.php:132 templates/countdown.php:239\nmsgid \"mins\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-assets.php:119\n#: includes/class-sp-frontend-scripts.php:90\n#: modules/sportspress-countdowns.php:133 templates/countdown.php:240\nmsgid \"secs\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-assets.php:120\n#: includes/admin/importers/class-sp-importer.php:198\n#, php-format\nmsgid \"Displaying %1$s&#8211;%2$s of %3$s\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-dashboard.php:36\nmsgid \"Sports News\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-dashboard.php:37\n#: includes/admin/class-sp-admin-menus.php:50\n#: includes/admin/class-sp-admin-permalink-settings.php:52\n#: includes/admin/class-sp-admin-setup-wizard.php:146\n#: includes/admin/class-sp-admin-setup-wizard.php:150\n#: includes/admin/class-sp-admin-welcome.php:110\n#: includes/admin/views/html-admin-settings.php:2\n#: modules/sportspress-admin-bar.php:63 modules/sportspress-gutenberg.php:72\n#: modules/sportspress-overview.php:107 modules/sportspress-overview.php:286\n#: modules/sportspress-overview.php:452 modules/sportspress-overview.php:535\n#: modules/sportspress-overview.php:760 modules/sportspress-overview.php:890\n#: modules/sportspress-overview.php:928\nmsgid \"SportsPress\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-dashboard.php:54\n#, php-format\nmsgid \"%s \"\nmsgid_plural \"%s \"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n\n#: includes/admin/class-sp-admin-dashboard.php:85\n#, php-format\nmsgid \"<strong>%s</strong> until next event\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-dashboard.php:92\n#, php-format\nmsgid \"<strong>%s event</strong> scheduled\"\nmsgid_plural \"<strong>%s events</strong> scheduled\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n\n#: includes/admin/class-sp-admin-dashboard.php:97\n#, php-format\nmsgid \"<strong>%s event</strong> published\"\nmsgid_plural \"<strong>%s events</strong> published\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n\n#: includes/admin/class-sp-admin-importers.php:38\nmsgid \"SportsPress Events (CSV)\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:39\nmsgid \"Import <strong>events</strong> from a csv file.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:43\nmsgid \"SportsPress Fixtures (CSV)\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:44\nmsgid \"Import <strong>upcoming events</strong> from a csv file.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:48\nmsgid \"SportsPress Teams (CSV)\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:49\nmsgid \"Import <strong>teams</strong> from a csv file.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:53\nmsgid \"SportsPress Players (CSV)\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:54\nmsgid \"Import <strong>players</strong> from a csv file.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:58\nmsgid \"SportsPress Staff (CSV)\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:59\nmsgid \"Import <strong>staff</strong> from a csv file.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:67\nmsgid \"SportsPress Box Score (CSV)\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-importers.php:68\n#: includes/admin/importers/class-sp-event-performance-importer.php:184\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:287\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php:57\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:197\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:264\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:108\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:90\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:114\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:132\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:149\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:167\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:186\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:73\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:85\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:108\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:125\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:142\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:159\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:173\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:229\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:71\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:90\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:109\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:117\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:112\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:113\n#: modules/sportspress-user-registration.php:132\n#: modules/sportspress-wordpay.php:172\n#, php-format\nmsgid \"Select %s\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-menus.php:57\n#: includes/admin/class-sp-admin-settings.php:558\n#: includes/admin/views/html-admin-config.php:7\nmsgid \"Configure\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-menus.php:64\n#: includes/admin/class-sp-admin-menus.php:260\n#: includes/admin/class-sp-admin-permalink-settings.php:33\n#: includes/admin/importers/class-sp-player-importer.php:32\n#: includes/admin/importers/class-sp-staff-importer.php:31\n#: includes/admin/importers/class-sp-team-importer.php:29\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:83\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:73\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:73\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:159\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:167\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:134\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:142\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:63\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:71\n#: includes/admin/settings/class-sp-settings-players.php:118\n#: includes/admin/settings/class-sp-settings-status.php:448\n#: includes/admin/views/html-admin-page-status.php:406\n#: includes/class-sp-post-types.php:39 includes/class-sp-post-types.php:55\n#: includes/sp-core-functions.php:1783 modules/sportspress-tutorials.php:85\n#: templates/official-details.php:115 templates/player-details.php:115\n#: templates/team-details.php:29\nmsgid \"Leagues\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-menus.php:71\n#: includes/admin/class-sp-admin-menus.php:268\n#: includes/admin/class-sp-admin-permalink-settings.php:34\n#: includes/admin/importers/class-sp-player-importer.php:33\n#: includes/admin/importers/class-sp-staff-importer.php:32\n#: includes/admin/importers/class-sp-team-importer.php:30\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:84\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:74\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:74\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:178\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:186\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:151\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:159\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:82\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:90\n#: includes/admin/settings/class-sp-settings-players.php:126\n#: includes/admin/settings/class-sp-settings-status.php:461\n#: includes/admin/views/html-admin-page-status.php:419\n#: includes/class-sp-post-types.php:78 includes/class-sp-post-types.php:94\n#: includes/sp-core-functions.php:1803 modules/sportspress-tutorials.php:85\n#: templates/official-details.php:126 templates/player-details.php:126\n#: templates/team-details.php:38\nmsgid \"Seasons\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-menus.php:109\n#: includes/admin/class-sp-admin-welcome.php:140\n#: modules/sportspress-tutorials.php:124 sportspress.php:147\nmsgid \"Settings\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-menus.php:256\n#: includes/admin/importers/class-sp-event-importer.php:541\n#: includes/admin/importers/class-sp-event-importer.php:558\n#: includes/admin/importers/class-sp-fixture-importer.php:326\n#: includes/admin/importers/class-sp-fixture-importer.php:343\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:127\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:145\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:68\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php:64\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-specs.php:45\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:142\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:97\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:178\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-metrics.php:45\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:79\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:97\n#: includes/admin/views/html-admin-config.php:66\n#: includes/admin/views/html-admin-config.php:154\n#: includes/admin/views/html-admin-config.php:283\n#: includes/admin/views/html-admin-config.php:347\n#: includes/admin/views/html-admin-config.php:408\n#: includes/admin/views/html-admin-config.php:514\n#: includes/class-sp-post-types.php:45 includes/class-sp-post-types.php:84\n#: includes/class-sp-post-types.php:123 includes/class-sp-post-types.php:162\n#: includes/class-sp-post-types.php:201 includes/sp-core-functions.php:1400\n#: includes/sp-core-functions.php:1418\n#: includes/widgets/class-sp-widget-countdown.php:134\n#: includes/widgets/class-sp-widget-countdown.php:166\n#: includes/widgets/class-sp-widget-countdown.php:186\n#: includes/widgets/class-sp-widget-event-blocks.php:152\n#: includes/widgets/class-sp-widget-event-calendar.php:135\n#: includes/widgets/class-sp-widget-event-list.php:159\n#: includes/widgets/class-sp-widget-league-table.php:120\n#: includes/widgets/class-sp-widget-player-gallery.php:127\n#: includes/widgets/class-sp-widget-player-gallery.php:158\n#: includes/widgets/class-sp-widget-player-list.php:127\n#: includes/widgets/class-sp-widget-player-list.php:193\n#: includes/widgets/class-sp-widget-staff.php:78\n#: includes/widgets/class-sp-widget-team-gallery.php:122\n#: modules/sportspress-event-specs.php:190 modules/sportspress-officials.php:94\nmsgid \"Add New\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-menus.php:264\n#: includes/admin/class-sp-admin-permalink-settings.php:37\n#: includes/admin/importers/class-sp-player-importer.php:30\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:81\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:106\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:114\n#: includes/admin/settings/class-sp-settings-events.php:443\n#: includes/admin/settings/class-sp-settings-status.php:487\n#: includes/admin/views/html-admin-page-status.php:445\n#: includes/class-sp-post-types.php:156 includes/class-sp-post-types.php:172\n#: modules/sportspress-tutorials.php:87\nmsgid \"Positions\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-menus.php:272\n#: includes/admin/class-sp-admin-permalink-settings.php:30\n#: includes/admin/settings/class-sp-settings-events.php:183\n#: includes/admin/settings/class-sp-settings-status.php:474\n#: includes/admin/views/html-admin-page-status.php:432\n#: includes/class-sp-post-types.php:117 includes/class-sp-post-types.php:133\n#: modules/sportspress-tutorials.php:86\nmsgid \"Venues\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-permalink-settings.php:29\n#: includes/admin/class-sp-admin-sample-data.php:441\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:57\n#: includes/admin/settings/class-sp-settings-events.php:27\n#: includes/admin/settings/class-sp-settings-modules.php:38\n#: includes/api/class-sp-rest-api.php:358 includes/class-sp-post-types.php:445\n#: includes/sp-core-functions.php:1777 modules/sportspress-calendars.php:169\n#: modules/sportspress-calendars.php:221 modules/sportspress-calendars.php:429\n#: modules/sportspress-calendars.php:453 modules/sportspress-calendars.php:472\n#: modules/sportspress-calendars.php:496 modules/sportspress-tutorials.php:111\n#: modules/sportspress-tutorials.php:131\nmsgid \"Events\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-permalink-settings.php:31\n#: includes/admin/class-sp-admin-sample-data.php:571\n#: includes/class-sp-modules.php:30 modules/sportspress-calendars.php:78\n#: modules/sportspress-template-selector.php:183\n#: modules/sportspress-tutorials.php:116 modules/sportspress-tutorials.php:138\nmsgid \"Calendars\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-permalink-settings.php:35\n#: includes/admin/class-sp-admin-sample-data.php:621\n#: includes/api/class-sp-rest-api.php:325 includes/class-sp-modules.php:93\n#: modules/sportspress-league-tables.php:75\n#: modules/sportspress-league-tables.php:177\n#: modules/sportspress-league-tables.php:243\n#: modules/sportspress-league-tables.php:340\n#: modules/sportspress-tutorials.php:94\nmsgid \"League Tables\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-permalink-settings.php:36\n#: includes/admin/class-sp-admin-sample-data.php:233\n#: includes/admin/class-sp-admin-setup-wizard.php:75\n#: includes/admin/class-sp-admin-setup-wizard.php:445\n#: includes/admin/importers/class-sp-event-importer.php:34\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:56\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:91\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:159\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:60\n#: includes/admin/settings/class-sp-settings-events.php:304\n#: includes/admin/settings/class-sp-settings-events.php:392\n#: includes/admin/settings/class-sp-settings-modules.php:40\n#: includes/admin/settings/class-sp-settings-players.php:27\n#: includes/api/class-sp-rest-api.php:206 includes/class-sp-post-types.php:523\n#: includes/class-sp-templates.php:189 includes/sp-core-functions.php:745\n#: includes/sp-core-functions.php:1793 modules/sportspress-player-lists.php:270\n#: modules/sportspress-player-lists.php:348\n#: modules/sportspress-tutorials.php:97 modules/sportspress-tutorials.php:152\n#: modules/sportspress-wordpay.php:208\nmsgid \"Players\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-permalink-settings.php:38\n#: includes/admin/class-sp-admin-sample-data.php:663\n#: includes/admin/class-sp-admin-sample-data.php:708\n#: includes/api/class-sp-rest-api.php:342 includes/class-sp-modules.php:121\n#: modules/sportspress-player-lists.php:75\n#: modules/sportspress-player-lists.php:186\n#: modules/sportspress-player-lists.php:253\n#: modules/sportspress-player-lists.php:347\nmsgid \"Player Lists\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-permalink-settings.php:39\n#: includes/admin/class-sp-admin-sample-data.php:345\n#: includes/admin/class-sp-admin-setup-wizard.php:75\n#: includes/admin/class-sp-admin-setup-wizard.php:460\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:173\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:96\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:57\n#: includes/admin/settings/class-sp-settings-events.php:384\n#: includes/admin/settings/class-sp-settings-modules.php:40\n#: includes/admin/settings/class-sp-settings-staff.php:27\n#: includes/admin/settings/class-sp-settings-teams.php:61\n#: includes/api/class-sp-rest-api.php:257\n#: includes/api/class-sp-rest-api.php:308 includes/class-sp-install.php:185\n#: includes/class-sp-post-types.php:562 includes/class-sp-post-types.php:563\n#: includes/class-sp-templates.php:153 includes/class-sp-templates.php:262\n#: includes/sp-core-functions.php:1804\n#: includes/widgets/class-sp-widget-staff.php:9\n#: includes/widgets/class-sp-widget-staff.php:67\n#: modules/sportspress-tutorials.php:97 templates/event-staff.php:50\nmsgid \"Staff\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-permalink-settings.php:81\nmsgid \"\"\n\"These settings control the permalinks used for SportsPress. These settings \"\n\"only apply when <strong>not using \\\"default\\\" permalinks above</strong>.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-post-types.php:77\n#: includes/sp-template-hooks.php:279\nmsgid \"Settings saved.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-post-types.php:79\n#: includes/admin/views/html-admin-config.php:65\n#: includes/admin/views/html-admin-config.php:153\n#: includes/admin/views/html-admin-config.php:282\n#: includes/admin/views/html-admin-config.php:346\n#: includes/admin/views/html-admin-config.php:407\n#: includes/admin/views/html-admin-config.php:513\n#: includes/sp-template-hooks.php:281 modules/sportspress-event-specs.php:189\n#: modules/sportspress-overview.php:755\nmsgid \"View All\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-post-types.php:84\n#: includes/admin/class-sp-admin-post-types.php:87\n#: includes/admin/class-sp-admin-post-types.php:92\n#: includes/sp-template-hooks.php:287 includes/sp-template-hooks.php:290\n#: includes/sp-template-hooks.php:295\nmsgid \"Changes saved.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-post-types.php:89\n#: includes/admin/class-sp-admin-post-types.php:94\n#: includes/admin/class-sp-admin-post-types.php:106\n#: includes/sp-template-hooks.php:292 includes/sp-template-hooks.php:297\n#: includes/sp-template-hooks.php:309\nmsgid \"Success!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-post-types.php:96\n#: includes/admin/class-sp-admin-post-types.php:104\n#: includes/admin/class-sp-admin-post-types.php:108\n#: includes/sp-template-hooks.php:299 includes/sp-template-hooks.php:307\n#: includes/sp-template-hooks.php:311\n#, php-format\nmsgid \"Preview %s\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-post-types.php:99\n#: includes/sp-template-hooks.php:302\n#, php-format\nmsgid \"Scheduled for: <b>%1$s</b>.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-post-types.php:100\n#: includes/sp-template-hooks.php:303\nmsgid \"M j, Y @ G:i\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sample-data.php:44\n#: includes/admin/class-sp-admin-setup-wizard.php:289\n#: includes/admin/class-sp-admin-setup-wizard.php:341\nmsgctxt \"example\"\nmsgid \"Primary League\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sample-data.php:44\nmsgctxt \"example\"\nmsgid \"Secondary League\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sample-data.php:117\n#: includes/admin/class-sp-admin-setup-wizard.php:693\n#, php-format\nmsgctxt \"example\"\nmsgid \"\"\n\"This is an example %1$s. As a new SportsPress user, you should go to <a href=\"\n\"\\\\\\\"%3$s\\\\\\\">your dashboard</a> to delete this %1$s and create new %2$s for \"\n\"your content. Have fun!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sample-data.php:568\nmsgctxt \"example\"\nmsgid \"Fixtures & Results\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sample-data.php:660\nmsgctxt \"example\"\nmsgid \"Roster\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sample-data.php:663\n#: includes/admin/class-sp-admin-sample-data.php:708\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:57\n#: includes/class-sp-ajax.php:1079 includes/class-sp-ajax.php:1221\n#: includes/class-sp-templates.php:248\n#: includes/widgets/class-sp-widget-player-gallery.php:116\n#: includes/widgets/class-sp-widget-player-list.php:9\n#: includes/widgets/class-sp-widget-player-list.php:116\n#: modules/sportspress-player-lists.php:76\n#: modules/sportspress-player-lists.php:168\n#: modules/sportspress-player-lists.php:221\nmsgid \"Player List\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sample-data.php:705\nmsgctxt \"example\"\nmsgid \"Player Ranking\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-settings.php:69\nmsgid \"Action failed. Please refresh the page and retry.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-settings.php:77\n#: includes/admin/class-sp-admin-welcome.php:191\nmsgid \"Your settings have been saved.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-settings.php:562\nmsgid \"Install demo content\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:60\nmsgid \"Introduction\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:65\n#: includes/admin/class-sp-admin-setup-wizard.php:221\nmsgid \"Basic Setup\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:85\n#: includes/admin/class-sp-admin-setup-wizard.php:647\nmsgid \"Pages\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:90\nmsgid \"Ready!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:160\nmsgid \"Return to the WordPress Dashboard\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:205\n#: includes/admin/class-sp-admin-welcome.php:52\n#: includes/admin/settings/class-sp-settings-modules.php:195\n#: includes/admin/views/html-notice-install.php:7\nmsgid \"Welcome to SportsPress\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:206\nmsgid \"\"\n\"Thank you for choosing SportsPress to power your sports website! This quick \"\n\"setup wizard will help you configure the basic settings. <strong>It’s \"\n\"completely optional and shouldn’t take longer than five minutes.</strong>\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:207\nmsgid \"\"\n\"No time right now? If you don’t want to go through the wizard, you can skip \"\n\"and return to the WordPress dashboard. Come back anytime if you change your \"\n\"mind!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:209\nmsgid \"Let's Go!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:210\nmsgid \"Not right now\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:223\nmsgid \"Select your timezone and sport to get started.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:226\n#: includes/admin/settings/class-sp-settings-general.php:357\n#: includes/admin/settings/class-sp-settings-general.php:360\nmsgid \"Timezone\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:226\n#: includes/admin/settings/class-sp-settings-general.php:357\nmsgid \"Choose a city in the same timezone as you.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:256\nmsgctxt \"Page title\"\nmsgid \"Sport\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:287\n#: includes/admin/settings/class-sp-settings-general.php:98\n#: includes/sp-core-functions.php:1720\nmsgid \"Main League\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:287\nmsgid \"The name of a league or division.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:293\n#: includes/admin/settings/class-sp-settings-general.php:106\n#: includes/sp-core-functions.php:1726\nmsgid \"Current Season\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:301\n#: includes/admin/class-sp-admin-setup-wizard.php:388\n#: includes/admin/class-sp-admin-setup-wizard.php:470\n#: includes/admin/class-sp-admin-setup-wizard.php:582\n#: includes/admin/class-sp-admin-setup-wizard.php:668\nmsgid \"Continue\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:302\n#: includes/admin/class-sp-admin-setup-wizard.php:389\n#: includes/admin/class-sp-admin-setup-wizard.php:471\n#: includes/admin/class-sp-admin-setup-wizard.php:583\n#: includes/admin/class-sp-admin-setup-wizard.php:669\nmsgid \"Skip this step\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:368\nmsgid \"Team Setup\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:370\nmsgid \"Great! Now let's add some teams.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:373\nmsgid \"Home Team\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:375\nmsgid \"What is your team called?\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:379\nmsgid \"Rival Team\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:381\nmsgid \"Who are you playing against next?\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:382\nmsgid \"You can add more teams later.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:440\nmsgid \"Player & Staff Setup\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:442\nmsgid \"Let's add players and a staff member.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:445\nmsgid \"Enter a squad number, name, and position for each player.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:449\n#: includes/admin/class-sp-admin-setup-wizard.php:463\n#: includes/admin/class-sp-admin-setup-wizard.php:564\n#: includes/admin/importers/class-sp-official-importer.php:28\n#: includes/admin/importers/class-sp-player-importer.php:29\n#: includes/admin/importers/class-sp-staff-importer.php:28\n#: includes/admin/importers/class-sp-team-importer.php:28\n#: includes/admin/post-types/class-sp-admin-cpt-official.php:48\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:65\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:88\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:56\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:78\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:55\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:136\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:112\n#: includes/admin/settings/class-sp-settings-events.php:272\n#: includes/admin/settings/class-sp-settings-players.php:78\n#: includes/class-sp-ajax.php:1168 includes/class-sp-ajax.php:1252\n#: includes/class-sp-post-types.php:46 includes/class-sp-post-types.php:85\n#: includes/class-sp-post-types.php:124 includes/class-sp-post-types.php:163\n#: includes/class-sp-post-types.php:202\n#: includes/widgets/class-sp-widget-player-gallery.php:144\n#: includes/widgets/class-sp-widget-player-list.php:182\n#: modules/sportspress-officials.php:95\n#: modules/sportspress-player-lists.php:300 templates/official-details.php:50\n#: templates/player-details.php:50\nmsgid \"Name\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:449\n#: includes/admin/class-sp-admin-setup-wizard.php:522\n#: includes/admin/class-sp-admin-sports.php:114\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:359\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:51\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:65\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:127\n#: includes/admin/settings/class-sp-settings-events.php:463\n#: includes/admin/settings/class-sp-settings-players.php:94\n#: includes/class-sp-ajax.php:1155 includes/class-sp-event.php:182\n#: includes/class-sp-player-list.php:963 includes/class-sp-post-types.php:157\n#: includes/sp-core-functions.php:1795 templates/event-performance.php:54\n#: templates/event-performance.php:164 templates/official-details.php:72\n#: templates/player-details.php:72\nmsgid \"Position\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:456\nmsgid \"You can add more players later.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:463\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:71\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:60\n#: includes/class-sp-post-types.php:196\nmsgid \"Job\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:559\nmsgid \"Venue Setup\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:561\nmsgid \"Enter the details of your home venue.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:570\n#: includes/admin/class-sp-admin-taxonomies.php:121\n#: includes/admin/class-sp-admin-taxonomies.php:156\n#: includes/admin/class-sp-admin-taxonomies.php:312\nmsgid \"Address\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:574\n#: includes/admin/class-sp-admin-taxonomies.php:118\n#: includes/admin/class-sp-admin-taxonomies.php:152\nmsgid \"Drag the marker to the venue's location.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:641\n#: includes/admin/class-sp-admin-setup-wizard.php:685\n#: includes/class-sp-modules.php:32\nmsgid \"Organize and publish calendars using different layouts.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:642\n#: includes/admin/class-sp-admin-setup-wizard.php:686\n#: includes/class-sp-modules.php:95\nmsgid \"Create automated league tables to keep track of team standings.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:643\n#: includes/admin/class-sp-admin-setup-wizard.php:687\n#: includes/class-sp-modules.php:123\nmsgid \"Create team rosters, player galleries, and ranking charts.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:649\nmsgid \"\"\n\"The following will be created automatically (if they do not already exist):\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:665\nmsgid \"Once created, these pages can be managed from your admin dashboard.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:859\nmsgid \"Next Steps\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:860\nmsgid \"Schedule your first event!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:863\n#: includes/admin/class-sp-admin-welcome.php:253\n#: includes/admin/settings/class-sp-settings-modules.php:185\n#: includes/admin/settings/class-sp-settings-modules.php:229\nmsgid \"Upgrade to Pro\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:864\n#: includes/admin/class-sp-admin-welcome.php:255\n#: includes/admin/settings/class-sp-settings-modules.php:72\nmsgid \"\"\n\"Get SportsPress Pro to get access to all modules. You can upgrade any time \"\n\"without losing any of your data.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:864\n#: includes/admin/settings/class-sp-settings-modules.php:237\nmsgid \"Learn more\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-setup-wizard.php:872\n#: includes/admin/class-sp-admin-welcome.php:121\nmsgid \"Thanks for installing!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:324\nmsgid \"Team Sports\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:325\nmsgid \"Racket Sports\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:326\nmsgid \"Water Sports\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:327\nmsgid \"Target Sports\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:328\nmsgid \"Esports\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:329\n#: includes/admin/settings/class-sp-settings-modules.php:42\n#: modules/sportspress-tutorials.php:159\nmsgid \"Other\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:340\nmsgid \"Baseball\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:341\nmsgid \"Basketball\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:342\nmsgid \"Cricket\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:343\nmsgid \"Darts\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:344\nmsgid \"Floorball\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:345\nmsgid \"Association Football\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:346\nmsgid \"American Football\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:347\nmsgid \"Australian Rules Football\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:348\nmsgid \"Handball\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:349\nmsgid \"Ice Hockey\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:350\nmsgid \"Lacrosse\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:351\nmsgid \"Netball\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:352\nmsgid \"Rugby League\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:353\nmsgid \"Rugby Union\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:354\nmsgid \"Snooker\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:355\nmsgid \"Softball\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:356\nmsgid \"Squash\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:357\nmsgid \"Table Tennis\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:358\nmsgid \"Tennis\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:359\nmsgid \"Volleyball\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:360\nmsgid \"Water Polo\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:361\nmsgid \"Dota 2\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:362\nmsgid \"League of Legends\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-sports.php:363\nmsgid \"Counter-Strike: Global Offensive\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-taxonomies.php:79\n#: includes/admin/class-sp-admin-taxonomies.php:249\n#: includes/admin/class-sp-admin-taxonomies.php:291\n#: includes/admin/class-sp-admin-taxonomies.php:337\n#: includes/admin/settings/class-sp-settings-events.php:252\n#: includes/admin/settings/class-sp-settings-events.php:314\n#: modules/sportspress-officials.php:483 modules/sportspress-officials.php:507\nmsgid \"Order\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-taxonomies.php:125\n#: includes/admin/class-sp-admin-taxonomies.php:162\nmsgid \"Latitude\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-taxonomies.php:129\n#: includes/admin/class-sp-admin-taxonomies.php:168\nmsgid \"Longitude\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-taxonomies.php:196\n#: includes/admin/class-sp-admin-taxonomies.php:235\n#: includes/admin/class-sp-admin-taxonomies.php:375\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:255\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:258\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:73\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:86\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:80\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:58\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:61\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:66\n#: includes/admin/settings/class-sp-settings-events.php:487\n#: includes/admin/settings/class-sp-settings-events.php:488\n#: includes/admin/settings/class-sp-settings-players.php:185\n#: includes/admin/settings/class-sp-settings-players.php:186\n#: includes/api/class-sp-rest-api.php:223 includes/sp-core-functions.php:619\n#: includes/sp-core-functions.php:681 includes/sp-core-functions.php:1787\n#: modules/sportspress-officials.php:551 templates/event-performance.php:152\n#: templates/event-performance.php:155 templates/player-statistics.php:52\n#: templates/player-statistics.php:55\nmsgid \"Offense\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-taxonomies.php:198\n#: includes/admin/class-sp-admin-taxonomies.php:236\n#: includes/admin/class-sp-admin-taxonomies.php:377\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:254\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:258\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:77\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:82\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:82\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:57\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:61\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:68\n#: includes/admin/settings/class-sp-settings-events.php:487\n#: includes/admin/settings/class-sp-settings-events.php:488\n#: includes/admin/settings/class-sp-settings-players.php:185\n#: includes/admin/settings/class-sp-settings-players.php:186\n#: includes/api/class-sp-rest-api.php:240 includes/sp-core-functions.php:621\n#: includes/sp-core-functions.php:683 includes/sp-core-functions.php:1774\n#: modules/sportspress-officials.php:553 templates/event-performance.php:151\n#: templates/event-performance.php:155 templates/player-statistics.php:51\n#: templates/player-statistics.php:55\nmsgid \"Defense\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:51\nmsgid \"About SportsPress\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:112\n#, php-format\nmsgid \"Version %s\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:117\nmsgid \"Thanks, all done!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:119\nmsgid \"Thank you for updating to the latest version!\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:124\n#, php-format\nmsgid \"\"\n\"%1$s SportsPress %2$s has lots of refinements we think you&#8217;ll love.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:141 sportspress.php:148\nmsgid \"Docs\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:153\nmsgid \"Welcome\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:160\nmsgid \"Credits\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:319\nmsgid \"Go to SportsPress Settings\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:332\n#, php-format\nmsgid \"\"\n\"SportsPress is developed and maintained by a worldwide team of passionate \"\n\"individuals and backed by an awesome developer community. Want to see your \"\n\"name? <a href=\\\"%s\\\">Contribute to SportsPress</a>.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:350\n#, php-format\nmsgid \"\"\n\"SportsPress has been kindly translated into several other languages thanks \"\n\"to our translation team. Want to see your name? <a href=\\\"%s\\\">Translate \"\n\"SportsPress</a>.\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin-welcome.php:375\n#, php-format\nmsgid \"View %s\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin.php:112\n#: includes/admin/importers/class-sp-fixture-importer.php:26\nmsgid \"Import Fixtures\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin.php:114\n#: includes/admin/importers/class-sp-event-importer.php:26\nmsgid \"Import Events\"\nmsgstr \"\"\n\n#: includes/admin/class-sp-admin.php:126\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:178\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:281\nmsgid \"Import\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:28\n#: includes/admin/importers/class-sp-fixture-importer.php:28\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:139\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:55\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:66\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:152\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:48\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:46\n#: includes/admin/settings/class-sp-settings-events.php:75\n#: includes/class-sp-ajax.php:824 includes/sp-core-functions.php:1773\n#: includes/widgets/class-sp-widget-countdown.php:142\n#: templates/event-details.php:27 templates/event-list.php:150\n#: templates/event-list.php:315\nmsgid \"Date\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:29\n#: includes/admin/importers/class-sp-fixture-importer.php:29\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:140\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:43\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:81\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:101\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:88\n#: includes/admin/settings/class-sp-settings-events.php:83\n#: includes/admin/settings/class-sp-settings-events.php:280\n#: includes/class-sp-ajax.php:628 includes/sp-core-functions.php:641\n#: includes/sp-core-functions.php:1809\n#: includes/widgets/class-sp-widget-event-list.php:253\n#: templates/event-details.php:32 templates/event-list.php:170\n#: templates/event-list.php:185 templates/event-list.php:193\n#: templates/event-list.php:365 templates/event-list.php:392\n#: templates/event-list.php:420\nmsgid \"Time\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:33\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php:296\n#: includes/admin/settings/class-sp-settings-events.php:356\n#: includes/api/class-sp-rest-api.php:105 includes/class-sp-event.php:69\n#: includes/class-sp-event.php:90 includes/class-sp-post-types.php:280\n#: includes/sp-core-functions.php:1788\nmsgid \"Outcome\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:473\n#: includes/admin/importers/class-sp-fixture-importer.php:263\n#, php-format\nmsgid \"\"\n\"Import complete - imported <strong>%1$s</strong> events and skipped <strong>\"\n\"%2$s</strong>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:483\n#: includes/admin/importers/class-sp-event-performance-importer.php:148\n#: includes/admin/importers/class-sp-fixture-importer.php:273\n#: includes/admin/importers/class-sp-official-importer.php:96\n#: includes/admin/importers/class-sp-player-importer.php:229\n#: includes/admin/importers/class-sp-staff-importer.php:177\n#: includes/admin/importers/class-sp-team-importer.php:133\nmsgid \"All done!\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:483\nmsgid \"View Events\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:496\n#: includes/admin/importers/class-sp-event-performance-importer.php:180\n#: includes/admin/importers/class-sp-fixture-importer.php:286\n#: includes/admin/importers/class-sp-official-importer.php:119\n#: includes/admin/importers/class-sp-player-importer.php:252\n#: includes/admin/importers/class-sp-staff-importer.php:200\n#: includes/admin/importers/class-sp-team-importer.php:146\nmsgid \"\"\n\"Hi there! Choose a .csv file to upload, then click \\\"Upload file and import\"\n\"\\\".\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:497\n#, php-format\nmsgid \"\"\n\"Events need to be defined with columns in a specific order (3+ columns). <a \"\n\"href=\\\"%s\\\">Click here to download a sample</a>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:498\n#: includes/admin/importers/class-sp-fixture-importer.php:288\n#, php-format\nmsgid \"Supports CSV files generated by <a href=\\\"%s\\\">LeagueLobster</a>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:514\n#: includes/admin/importers/class-sp-fixture-importer.php:304\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:137\n#: includes/admin/post-types/class-sp-admin-cpt-performance.php:50\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:122\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:93\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:79\n#: includes/admin/views/html-admin-config.php:197\n#: includes/api/class-sp-rest-api.php:138\nmsgid \"Format\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:530\n#: includes/admin/importers/class-sp-fixture-importer.php:315\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:53\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:142\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:53\n#: includes/admin/post-types/class-sp-admin-cpt-table.php:53\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:52\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:99\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:63\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:63\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:63\n#: includes/class-sp-ajax.php:629 includes/class-sp-post-types.php:40\n#: includes/sp-core-functions.php:1782 templates/event-list.php:209\n#: templates/event-list.php:468\nmsgid \"League\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:537\n#: includes/admin/importers/class-sp-event-importer.php:554\n#: includes/admin/importers/class-sp-fixture-importer.php:322\n#: includes/admin/importers/class-sp-fixture-importer.php:339\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:61\nmsgid \"&mdash; Not set &mdash;\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:547\n#: includes/admin/importers/class-sp-fixture-importer.php:332\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:54\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:143\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:54\n#: includes/admin/post-types/class-sp-admin-cpt-table.php:54\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:53\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:106\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:116\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-columns.php:64\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:66\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:66\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:66\n#: includes/class-sp-ajax.php:630 includes/class-sp-player.php:855\n#: includes/class-sp-post-types.php:79 includes/sp-core-functions.php:1802\n#: templates/event-list.php:213 templates/event-list.php:477\nmsgid \"Season\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-importer.php:565\n#: includes/admin/importers/class-sp-fixture-importer.php:350\nmsgid \"Date Format\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-performance-importer.php:26\nmsgid \"Import Box Score\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-performance-importer.php:138\n#, php-format\nmsgid \"\"\n\"Import complete - imported <strong>%1$s</strong> rows and skipped <strong>\"\n\"%2$s</strong>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-performance-importer.php:156\n#: includes/class-sp-post-types.php:450\nmsgid \"View Event\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-event-performance-importer.php:181\n#, php-format\nmsgid \"\"\n\"Box scores need to be defined with columns in a specific order. <a href=\\\"%s\"\n\"\\\">Click here to download a sample</a>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-fixture-importer.php:31\n#: includes/admin/importers/class-sp-team-importer.php:33\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:35\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:62\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:82\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:101\n#: includes/sp-core-functions.php:1781 modules/sportspress-calendars.php:285\n#: templates/event-list.php:155 templates/event-list.php:326\n#: templates/team-details.php:44 templates/team-details.php:50\nmsgid \"Home\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-fixture-importer.php:32\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:35\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:66\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:83\n#: includes/sp-core-functions.php:1768 modules/sportspress-calendars.php:285\n#: templates/event-list.php:166 templates/event-list.php:361\nmsgid \"Away\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-fixture-importer.php:33\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:145\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:315\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:56\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:127\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:103\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:153\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:30\n#: includes/admin/settings/class-sp-settings-events.php:91\n#: includes/api/class-sp-rest-api.php:172 includes/class-sp-ajax.php:825\n#: includes/sp-core-functions.php:1785\n#: includes/widgets/class-sp-widget-countdown.php:143\n#: includes/widgets/class-sp-widget-event-list.php:263\n#: templates/event-blocks.php:201 templates/event-details.php:55\n#: templates/event-list.php:227 templates/event-list.php:532\nmsgid \"Match Day\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-fixture-importer.php:273\nmsgid \"View Fixtures\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-fixture-importer.php:287\n#, php-format\nmsgid \"\"\n\"Fixtures need to be defined with columns in a specific order (4+ columns). \"\n\"<a href=\\\"%s\\\">Click here to download a sample</a>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-fixture-importer.php:308\n#: includes/class-sp-formats.php:29\nmsgid \"Competitive\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-fixture-importer.php:309\n#: includes/class-sp-formats.php:30\nmsgid \"Friendly\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-importer.php:108\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:52\nmsgid \"Disable\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-importer.php:153\n#: includes/admin/importers/class-sp-importer.php:178\n#: includes/admin/importers/class-sp-importer.php:192\nmsgid \"Insert row after\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-importer.php:170\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:269\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:32\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:75\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:111\n#: includes/admin/settings/class-sp-settings-events.php:214\n#: includes/admin/settings/class-sp-settings-general.php:142\n#: includes/admin/settings/class-sp-settings-status.php:134\n#: includes/admin/views/html-admin-config.php:118\n#: includes/admin/views/html-admin-config.php:218\n#: includes/admin/views/html-admin-page-status.php:93\n#: includes/class-sp-ajax.php:337 includes/class-sp-ajax.php:351\n#: includes/class-sp-ajax.php:365 includes/class-sp-ajax.php:379\n#: includes/class-sp-ajax.php:393 includes/class-sp-ajax.php:490\n#: includes/class-sp-ajax.php:504 includes/class-sp-ajax.php:518\n#: includes/class-sp-ajax.php:532 includes/class-sp-ajax.php:546\n#: includes/class-sp-ajax.php:616 includes/class-sp-ajax.php:697\n#: includes/class-sp-ajax.php:711 includes/class-sp-ajax.php:725\n#: includes/class-sp-ajax.php:739 includes/class-sp-ajax.php:753\n#: includes/class-sp-ajax.php:823 includes/class-sp-ajax.php:833\n#: includes/class-sp-ajax.php:1096 includes/class-sp-ajax.php:1110\n#: includes/class-sp-ajax.php:1124 includes/class-sp-ajax.php:1166\n#: includes/class-sp-ajax.php:1184 includes/class-sp-ajax.php:1250\n#: includes/class-sp-ajax.php:1268 includes/sp-core-functions.php:545\n#: includes/widgets/class-sp-widget-countdown.php:141\n#: includes/widgets/class-sp-widget-event-blocks.php:160\n#: includes/widgets/class-sp-widget-event-blocks.php:174\n#: includes/widgets/class-sp-widget-event-blocks.php:228\n#: includes/widgets/class-sp-widget-event-calendar.php:143\n#: includes/widgets/class-sp-widget-event-calendar.php:157\n#: includes/widgets/class-sp-widget-event-list.php:167\n#: includes/widgets/class-sp-widget-event-list.php:181\n#: includes/widgets/class-sp-widget-event-list.php:235\n#: includes/widgets/class-sp-widget-player-gallery.php:142\n#: includes/widgets/class-sp-widget-player-list.php:180\nmsgid \"Default\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-importer.php:177\nmsgid \"Delete row\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-importer.php:207\n#: includes/admin/importers/class-sp-importer.php:243\n#: includes/admin/importers/class-sp-importer.php:258\n#: includes/admin/settings/class-sp-settings-licenses.php:162\n#: includes/admin/settings/class-sp-settings-licenses.php:217\n#: includes/admin/settings/class-sp-settings-licenses.php:229\nmsgid \"Sorry, there has been an error.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-importer.php:208\nmsgid \"The CSV is invalid.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-official-importer.php:26\n#: includes/admin/importers/class-sp-official-importer.php:108\nmsgid \"Import Officials\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-official-importer.php:86\n#, php-format\nmsgid \"\"\n\"Import complete - imported <strong>%1$s</strong> officials and skipped \"\n\"<strong>%2$s</strong>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-official-importer.php:96\nmsgid \"View Officials\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-official-importer.php:120\n#, php-format\nmsgid \"\"\n\"Officials need to be defined with columns in a specific order. <a href=\\\"%s\"\n\"\\\">Click here to download a sample</a>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:26\n#: includes/admin/importers/class-sp-player-importer.php:241\nmsgid \"Import Players\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:28\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:79\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:247\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:34\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:135\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:86\n#: includes/admin/settings/class-sp-settings-events.php:455\n#: includes/admin/settings/class-sp-settings-players.php:70\n#: includes/api/class-sp-rest-api.php:409 includes/class-sp-ajax.php:1167\n#: includes/class-sp-ajax.php:1251\n#: includes/widgets/class-sp-widget-player-gallery.php:143\n#: includes/widgets/class-sp-widget-player-list.php:159\n#: includes/widgets/class-sp-widget-player-list.php:161\n#: includes/widgets/class-sp-widget-player-list.php:181\nmsgid \"Squad Number\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:34\n#: includes/admin/importers/class-sp-staff-importer.php:33\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:106\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:108\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:89\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:90\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:84\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:85\n#: includes/admin/settings/class-sp-settings-players.php:86\n#: includes/admin/settings/class-sp-settings-players.php:134\n#: includes/admin/settings/class-sp-settings-staff.php:72\n#: includes/admin/settings/class-sp-settings-staff.php:96\n#: includes/sp-core-functions.php:1786 templates/official-details.php:61\n#: templates/player-details.php:61 templates/staff-details.php:51\nmsgid \"Nationality\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:35\n#: includes/class-sp-player-list.php:905 includes/class-sp-player-list.php:966\n#: modules/sportspress-birthdays.php:216\nmsgid \"Date of Birth\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:219\n#, php-format\nmsgid \"\"\n\"Import complete - imported <strong>%1$s</strong> players and skipped <strong>\"\n\"%2$s</strong>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:229\nmsgid \"View Players\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:253\n#, php-format\nmsgid \"\"\n\"Players need to be defined with columns in a specific order (8 columns). <a \"\n\"href=\\\"%s\\\">Click here to download a sample</a>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:270\nmsgid \"Date of Birth Format\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-player-importer.php:293\n#: includes/admin/importers/class-sp-staff-importer.php:221\n#: includes/admin/importers/class-sp-team-importer.php:167\nmsgid \"Merge duplicates\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-staff-importer.php:26\n#: includes/admin/importers/class-sp-staff-importer.php:189\nmsgid \"Import Staff\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-staff-importer.php:29\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:65\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:73\n#: includes/class-sp-post-types.php:195 includes/class-sp-post-types.php:211\n#: modules/sportspress-tutorials.php:87\nmsgid \"Jobs\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-staff-importer.php:167\n#, php-format\nmsgid \"\"\n\"Import complete - imported <strong>%1$s</strong> staff and skipped <strong>\"\n\"%2$s</strong>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-staff-importer.php:177\n#: includes/class-sp-post-types.php:567\nmsgid \"View Staff\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-staff-importer.php:201\n#, php-format\nmsgid \"\"\n\"Staff need to be defined with columns in a specific order (6 columns). <a \"\n\"href=\\\"%s\\\">Click here to download a sample</a>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-team-importer.php:26\nmsgid \"Import Teams\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-team-importer.php:31\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:119\n#: includes/admin/settings/class-sp-settings-status.php:65\n#: includes/admin/views/html-admin-page-status.php:24\n#: includes/api/class-sp-rest-api.php:392\nmsgid \"Site URL\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-team-importer.php:32\n#: includes/admin/post-types/class-sp-admin-cpt-outcome.php:48\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:72\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:55\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:126\n#: includes/admin/views/html-admin-config.php:32\n#: includes/api/class-sp-rest-api.php:375\nmsgid \"Abbreviation\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-team-importer.php:123\n#, php-format\nmsgid \"\"\n\"Import complete - imported <strong>%1$s</strong> teams and skipped <strong>\"\n\"%2$s</strong>.\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-team-importer.php:133\nmsgid \"View Teams\"\nmsgstr \"\"\n\n#: includes/admin/importers/class-sp-team-importer.php:147\n#, php-format\nmsgid \"\"\n\"Teams need to be defined with columns in a specific order (3 columns). <a \"\n\"href=\\\"%s\\\">Click here to download a sample</a>.\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:52\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:52\n#: includes/admin/post-types/class-sp-admin-cpt-table.php:52\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:39\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:70\n#: modules/sportspress-calendars.php:262 modules/sportspress-calendars.php:283\n#: modules/sportspress-calendars.php:339 modules/sportspress-gutenberg.php:89\n#: modules/sportspress-league-tables.php:252\n#: modules/sportspress-player-lists.php:262\nmsgid \"Title\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:58\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:57\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:69\n#: includes/admin/settings/class-sp-settings-events.php:260\n#: includes/admin/settings/class-sp-settings-page.php:119\n#: modules/sportspress-calendars.php:153 modules/sportspress-calendars.php:200\n#: modules/sportspress-league-tables.php:198\n#: modules/sportspress-player-lists.php:151\n#: modules/sportspress-player-lists.php:200\n#: modules/sportspress-tutorials.php:141\nmsgid \"Layout\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:73\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:76\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:79\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:85\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:81\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:84\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:90\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:105\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:124\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:142\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:92\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:101\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:182\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:79\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:65\n#: includes/admin/settings/class-sp-settings-events.php:498\n#: includes/class-sp-ajax.php:325 includes/class-sp-ajax.php:438\n#: includes/class-sp-ajax.php:476 includes/class-sp-ajax.php:603\n#: includes/class-sp-ajax.php:683 includes/class-sp-ajax.php:810\n#: includes/class-sp-post-types.php:41 includes/class-sp-post-types.php:80\n#: includes/class-sp-post-types.php:119 includes/class-sp-post-types.php:158\n#: includes/class-sp-post-types.php:197 includes/sp-core-functions.php:618\n#: includes/sp-core-functions.php:626 includes/sp-core-functions.php:628\n#: includes/sp-core-functions.php:782 includes/sp-core-functions.php:816\n#: includes/sp-core-functions.php:1742\n#: includes/widgets/class-sp-widget-countdown.php:129\n#: includes/widgets/class-sp-widget-countdown.php:161\n#: includes/widgets/class-sp-widget-event-blocks.php:144\n#: includes/widgets/class-sp-widget-event-blocks.php:221\n#: includes/widgets/class-sp-widget-event-calendar.php:127\n#: includes/widgets/class-sp-widget-event-calendar.php:204\n#: includes/widgets/class-sp-widget-event-list.php:151\n#: includes/widgets/class-sp-widget-event-list.php:228\n#: modules/sportspress-gutenberg.php:91 modules/sportspress-officials.php:90\n#: modules/sportspress-overview.php:303\nmsgid \"All\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:96\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:127\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:109\n#: includes/admin/settings/class-sp-settings-players.php:102\n#: includes/admin/settings/class-sp-settings-staff.php:80\n#: includes/sp-core-functions.php:1772 templates/official-details.php:89\n#: templates/player-details.php:89 templates/staff-details.php:63\nmsgid \"Current Team\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:125\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:298\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:121\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:180\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:147\n#: includes/admin/post-types/class-sp-admin-cpt-table.php:99\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:123\nmsgid \"Show all leagues\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:134\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:307\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:130\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:191\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:156\n#: includes/admin/post-types/class-sp-admin-cpt-table.php:108\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:132\nmsgid \"Show all seasons\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-calendar.php:145\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:290\n#: includes/admin/post-types/class-sp-admin-cpt-list.php:141\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:171\n#: includes/admin/post-types/class-sp-admin-cpt-staff.php:139\n#: includes/admin/post-types/class-sp-admin-cpt-table.php:119\nmsgid \"Show all teams\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-column.php:46\n#: includes/admin/post-types/class-sp-admin-cpt-metric.php:46\n#: includes/admin/post-types/class-sp-admin-cpt-outcome.php:46\n#: includes/admin/post-types/class-sp-admin-cpt-performance.php:47\n#: includes/admin/post-types/class-sp-admin-cpt-result.php:46\n#: includes/admin/post-types/class-sp-admin-cpt-spec.php:46\n#: includes/admin/post-types/class-sp-admin-cpt-statistic.php:47\n#: includes/admin/views/html-admin-config.php:30\n#: includes/admin/views/html-admin-config.php:100\n#: includes/admin/views/html-admin-config.php:194\n#: includes/admin/views/html-admin-config.php:311\n#: includes/admin/views/html-admin-config.php:376\n#: includes/admin/views/html-admin-config.php:442\n#: modules/sportspress-event-specs.php:158\nmsgid \"Label\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-column.php:47\n#: includes/admin/post-types/class-sp-admin-cpt-statistic.php:48\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:39\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:49\n#: includes/sp-template-hooks.php:75\nmsgid \"Key\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-column.php:48\n#: includes/admin/post-types/class-sp-admin-cpt-statistic.php:49\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:50\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:66\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:82\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:107\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:103\n#: includes/admin/views/html-admin-config.php:102\n#: includes/admin/views/html-admin-config.php:312\n#: includes/admin/views/html-admin-config.php:444\n#: includes/sp-core-functions.php:643\nmsgid \"Equation\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-column.php:49\n#: includes/admin/post-types/class-sp-admin-cpt-statistic.php:50\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:44\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:117\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php:46\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:54\n#: includes/admin/views/html-admin-config.php:103\n#: includes/admin/views/html-admin-config.php:313\n#: includes/admin/views/html-admin-config.php:445\nmsgid \"Decimal Places\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-column.php:50\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:156\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:48\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:152\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:123\n#: includes/admin/views/html-admin-config.php:314\nmsgid \"Sort Order\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-column.php:51\n#: includes/admin/post-types/class-sp-admin-cpt-metric.php:48\n#: includes/admin/post-types/class-sp-admin-cpt-outcome.php:49\n#: includes/admin/post-types/class-sp-admin-cpt-performance.php:51\n#: includes/admin/post-types/class-sp-admin-cpt-result.php:48\n#: includes/admin/post-types/class-sp-admin-cpt-spec.php:48\n#: includes/admin/post-types/class-sp-admin-cpt-statistic.php:51\n#: includes/admin/views/html-admin-config.php:34\n#: includes/admin/views/html-admin-config.php:104\n#: includes/admin/views/html-admin-config.php:204\n#: includes/admin/views/html-admin-config.php:315\n#: includes/admin/views/html-admin-config.php:378\n#: includes/admin/views/html-admin-config.php:453\n#: includes/class-sp-templates.php:92 includes/class-sp-templates.php:165\n#: includes/class-sp-templates.php:238 includes/sp-template-hooks.php:69\n#: modules/sportspress-event-specs.php:160\nmsgid \"Description\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:67\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:65\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php:325\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php:344\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:153\n#: includes/class-sp-ajax.php:70 includes/class-sp-team.php:350\n#: includes/sp-core-functions.php:906\n#: includes/widgets/class-sp-widget-countdown.php:178\n#: modules/sportspress-tutorials.php:134\nmsgid \"(Auto)\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:248\nmsgid \"Edit Results\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:250\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php:35\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:123\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:147\n#: includes/class-sp-ajax.php:93 includes/class-sp-ajax.php:123\n#: includes/class-sp-ajax.php:153 includes/class-sp-ajax.php:183\n#: includes/class-sp-ajax.php:213 includes/class-sp-ajax.php:243\n#: includes/class-sp-ajax.php:273 includes/class-sp-ajax.php:303\n#: includes/class-sp-ajax.php:450 includes/class-sp-ajax.php:651\n#: includes/class-sp-ajax.php:848 includes/class-sp-ajax.php:933\n#: includes/class-sp-ajax.php:997 includes/class-sp-ajax.php:1027\n#: includes/class-sp-ajax.php:1057 includes/class-sp-ajax.php:1199\n#: includes/class-sp-ajax.php:1283\nmsgid \"Cancel\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:251\n#: includes/class-sp-post-types.php:44 includes/class-sp-post-types.php:83\n#: includes/class-sp-post-types.php:122 includes/class-sp-post-types.php:161\n#: includes/class-sp-post-types.php:200 modules/sportspress-officials.php:93\nmsgid \"Update\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:362\n#: includes/sp-core-functions.php:1796 modules/sportspress-event-status.php:73\n#: templates/countdown.php:135\nmsgid \"Postponed\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:364\n#: includes/sp-core-functions.php:1770 modules/sportspress-event-status.php:74\n#: templates/countdown.php:136\nmsgid \"Canceled\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-event.php:366\n#: includes/sp-core-functions.php:1806 modules/sportspress-event-status.php:72\n#: templates/countdown.php:134\nmsgid \"TBD\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-metric.php:47\n#: includes/admin/post-types/class-sp-admin-cpt-outcome.php:47\n#: includes/admin/post-types/class-sp-admin-cpt-performance.php:48\n#: includes/admin/post-types/class-sp-admin-cpt-result.php:47\n#: includes/admin/post-types/class-sp-admin-cpt-spec.php:47\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:34\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:46\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:59\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php:37\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:34\n#: includes/admin/views/html-admin-config.php:31\n#: includes/admin/views/html-admin-config.php:195\n#: includes/admin/views/html-admin-config.php:377\n#: includes/sp-template-hooks.php:75 modules/sportspress-event-specs.php:159\nmsgid \"Variable\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-performance.php:46\n#: includes/admin/post-types/class-sp-admin-cpt-statistic.php:46\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:307\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:310\n#: includes/admin/views/html-admin-config.php:193\n#: includes/admin/views/html-admin-config.php:443\n#: includes/class-sp-post-types.php:385 includes/class-sp-post-types.php:422\nmsgid \"Icon\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-performance.php:49\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:72\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:58\n#: includes/admin/views/html-admin-config.php:196\n#: includes/admin/views/html-admin-config.php:446\nmsgid \"Category\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:159\nmsgid \"Show all positions\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:283\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:370\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:124\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:100\n#: includes/api/class-sp-rest-api.php:443\n#: includes/api/class-sp-rest-api.php:544\nmsgid \"Current Teams\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:290\n#: includes/admin/post-types/class-sp-admin-cpt-player.php:377\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:141\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:117\n#: includes/admin/settings/class-sp-settings-players.php:110\n#: includes/admin/settings/class-sp-settings-staff.php:88\n#: includes/api/class-sp-rest-api.php:460\n#: includes/api/class-sp-rest-api.php:561 includes/sp-core-functions.php:1789\n#: templates/official-details.php:104 templates/player-details.php:104\n#: templates/staff-details.php:75\nmsgid \"Past Teams\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:69\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:298\n#: includes/class-sp-post-types.php:489 includes/class-sp-templates.php:115\n#: modules/sportspress-player-lists.php:301\n#: modules/sportspress-tutorials.php:147\nmsgid \"Logo\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt-team.php:71\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:123\nmsgid \"Short Name\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt.php:45\n#, php-format\nmsgid \"Insert into %s\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-cpt.php:46\n#, php-format\nmsgid \"Uploaded to this %s\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:116\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:182\n#: modules/sportspress-tutorials.php:165\nmsgid \"Shortcodes\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:129\n#: includes/admin/settings/class-sp-settings-events.php:419\n#: includes/admin/settings/class-sp-settings-players.php:168\n#: includes/api/class-sp-rest-api.php:155\n#: modules/sportspress-league-tables.php:185\nmsgid \"Mode\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:188\n#: includes/admin/settings/class-sp-settings-events.php:345\n#: includes/admin/settings/class-sp-settings-events.php:408\n#: includes/admin/settings/class-sp-settings-players.php:157\n#: modules/sportspress-calendars.php:207\n#: modules/sportspress-player-lists.php:207\nmsgid \"Columns\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:202\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:60\n#: includes/api/class-sp-rest-api.php:494\nmsgid \"Metrics\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:218\n#: modules/sportspress-calendars.php:188\n#: modules/sportspress-league-tables.php:192\n#: modules/sportspress-player-lists.php:194\nmsgid \"Shortcode\"\nmsgstr \"\"\n\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:301\n#: includes/admin/post-types/class-sp-admin-meta-boxes.php:304\n#: includes/class-sp-post-types.php:532 includes/class-sp-post-types.php:571\n#: includes/class-sp-templates.php:195 includes/class-sp-templates.php:268\n#: includes/sp-core-functions.php:1790 modules/sportspress-officials.php:150\nmsgid \"Photo\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:45\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:83\n#: includes/sp-core-functions.php:1810\n#: includes/widgets/class-sp-widget-event-list.php:248\n#: templates/event-list.php:159 templates/event-list.php:160\n#: templates/event-list.php:203 templates/event-list.php:330\n#: templates/event-list.php:450\nmsgid \"Time/Results\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:55\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:120\n#: includes/class-sp-ajax.php:632 includes/class-sp-templates.php:46\n#: includes/sp-core-functions.php:1767\n#: includes/widgets/class-sp-widget-event-list.php:262\n#: templates/event-list.php:223 templates/event-list.php:507\nmsgid \"Article\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:249\n#: includes/class-sp-template-loader.php:173\n#: includes/sp-core-functions.php:1800 templates/event-list.php:519\nmsgid \"Recap\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:251\n#: includes/class-sp-template-loader.php:175\n#: includes/sp-core-functions.php:1797 templates/event-list.php:521\n#: templates/event-logos-block.php:50\nmsgid \"Preview\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:278\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:34\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:108\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:34\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:103\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:34\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:104\n#: includes/admin/views/html-admin-config.php:60\n#: includes/admin/views/html-admin-config.php:147\n#: includes/admin/views/html-admin-config.php:276\n#: includes/admin/views/html-admin-config.php:341\n#: includes/admin/views/html-admin-config.php:402\n#: includes/admin/views/html-admin-config.php:508\n#: includes/class-sp-post-types.php:50 includes/class-sp-post-types.php:89\n#: includes/class-sp-post-types.php:128 includes/class-sp-post-types.php:167\n#: includes/class-sp-post-types.php:206 includes/class-sp-post-types.php:254\n#: includes/class-sp-post-types.php:255 includes/class-sp-post-types.php:286\n#: includes/class-sp-post-types.php:287 includes/class-sp-post-types.php:318\n#: includes/class-sp-post-types.php:319 includes/class-sp-post-types.php:350\n#: includes/class-sp-post-types.php:351 includes/class-sp-post-types.php:383\n#: includes/class-sp-post-types.php:384 includes/class-sp-post-types.php:420\n#: includes/class-sp-post-types.php:421 includes/class-sp-post-types.php:452\n#: includes/class-sp-post-types.php:453 includes/class-sp-post-types.php:487\n#: includes/class-sp-post-types.php:488 includes/class-sp-post-types.php:530\n#: includes/class-sp-post-types.php:531 includes/class-sp-post-types.php:569\n#: includes/class-sp-post-types.php:570 includes/sp-core-functions.php:1218\n#: includes/sp-core-functions.php:1297 modules/sportspress-calendars.php:85\n#: modules/sportspress-calendars.php:86 modules/sportspress-event-specs.php:83\n#: modules/sportspress-event-specs.php:84\n#: modules/sportspress-event-specs.php:184\n#: modules/sportspress-lazy-loading.php:268\n#: modules/sportspress-lazy-loading.php:283\n#: modules/sportspress-league-tables.php:82\n#: modules/sportspress-league-tables.php:83\n#: modules/sportspress-officials.php:99 modules/sportspress-officials.php:148\n#: modules/sportspress-officials.php:149 modules/sportspress-overview.php:897\n#: modules/sportspress-player-lists.php:82\n#: modules/sportspress-player-lists.php:83\nmsgid \"No results found.\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:42\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:44\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:42\n#: includes/admin/settings/class-sp-settings-general.php:448\nmsgid \"Heading\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:45\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:386\nmsgid \"Status\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:56\nmsgid \"Event Format\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:85\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:67\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:103\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:65\n#: includes/class-sp-ajax.php:418 includes/class-sp-ajax.php:583\n#: includes/class-sp-ajax.php:790\n#: includes/widgets/class-sp-widget-event-blocks.php:203\n#: includes/widgets/class-sp-widget-event-calendar.php:186\n#: includes/widgets/class-sp-widget-event-list.php:210\nmsgid \"Past\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:89\n#: includes/class-sp-ajax.php:422 includes/class-sp-ajax.php:587\n#: includes/class-sp-ajax.php:794 includes/class-sp-frontend-scripts.php:93\n#: includes/widgets/class-sp-widget-event-blocks.php:206\n#: includes/widgets/class-sp-widget-event-calendar.php:189\n#: includes/widgets/class-sp-widget-event-list.php:213\nmsgid \"Next\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:97\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:75\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:73\n#: includes/class-sp-ajax.php:430 includes/class-sp-ajax.php:595\n#: includes/class-sp-ajax.php:802\n#: includes/widgets/class-sp-widget-event-blocks.php:214\n#: includes/widgets/class-sp-widget-event-calendar.php:197\n#: includes/widgets/class-sp-widget-event-list.php:221\nmsgid \"Relative\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:149\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:130\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:106\nmsgid \"Sort by\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:159\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:66\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:155\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:126\n#: includes/class-sp-ajax.php:617 includes/class-sp-ajax.php:834\n#: includes/class-sp-ajax.php:1185 includes/class-sp-ajax.php:1269\n#: includes/widgets/class-sp-widget-countdown.php:149\n#: includes/widgets/class-sp-widget-event-blocks.php:229\n#: includes/widgets/class-sp-widget-event-list.php:236\n#: includes/widgets/class-sp-widget-player-gallery.php:165\n#: includes/widgets/class-sp-widget-player-list.php:200\nmsgid \"Ascending\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:160\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:65\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:156\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:127\n#: includes/class-sp-ajax.php:618 includes/class-sp-ajax.php:835\n#: includes/class-sp-ajax.php:1186 includes/class-sp-ajax.php:1270\n#: includes/widgets/class-sp-widget-countdown.php:150\n#: includes/widgets/class-sp-widget-event-blocks.php:230\n#: includes/widgets/class-sp-widget-event-list.php:237\n#: includes/widgets/class-sp-widget-player-gallery.php:166\n#: includes/widgets/class-sp-widget-player-list.php:201\nmsgid \"Descending\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-feeds.php:47\n#: includes/admin/settings/class-sp-settings-events.php:59\n#: includes/admin/settings/class-sp-settings-events.php:193\n#: includes/admin/settings/class-sp-settings-general.php:449\n#: includes/admin/settings/class-sp-settings-players.php:61\n#: includes/admin/settings/class-sp-settings-staff.php:63\n#: includes/admin/settings/class-sp-settings-teams.php:69\n#: includes/class-sp-templates.php:141\nmsgid \"Link\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-shortcode.php:30\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:39\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-shortcode.php:30\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-shortcode.php:26\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-shortcode.php:26\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-shortcode.php:30\nmsgid \"\"\n\"Copy this code and paste it into your post, page or text widget content.\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:39\nmsgid \"Attended\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:40\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:48\n#: includes/class-sp-ajax.php:1169 includes/class-sp-ajax.php:1253\n#: includes/widgets/class-sp-widget-player-gallery.php:145\n#: includes/widgets/class-sp-widget-player-list.php:183\nmsgid \"Played\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:41\nmsgid \"Started\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:42\nmsgid \"Substituted\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:43\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:49\n#: includes/admin/settings/class-sp-settings-events.php:471\nmsgid \"Minutes\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:56\nmsgid \"for\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:58\nmsgid \"against\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:71\nmsgid \"Games Back\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:72\nmsgid \"Home Record\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:73\nmsgid \"Away Record\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:74\nmsgid \"Streak\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:75\n#: modules/sportspress-league-tables.php:289\nmsgid \"Form\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:76\nmsgid \"Last 5\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:77\nmsgid \"Last 10\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:231\nmsgid \"Presets\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:232\nmsgid \"Operators\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:233\nmsgid \"Subsets\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:234\nmsgid \"Constants\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:30\nmsgid \"Optional\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:36\n#: includes/admin/settings/class-sp-settings-events.php:99\n#: includes/admin/settings/class-sp-settings-events.php:153\n#: includes/api/class-sp-rest-api.php:189 includes/sp-core-functions.php:1780\n#: templates/event-details.php:64 templates/event-logos-block.php:66\nmsgid \"Full Time\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-mode.php:29\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php:29\n#: includes/admin/settings/class-sp-settings-events.php:114\nmsgid \"Team vs team\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-mode.php:30\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php:30\n#: includes/admin/settings/class-sp-settings-events.php:115\nmsgid \"Player vs player\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php:71\n#: modules/sportspress-officials.php:89\nmsgid \"Duty\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:390\n#: includes/admin/settings/class-sp-settings-events.php:436\n#: includes/sp-core-functions.php:1792\n#: templates/event-performance-table.php:141\nmsgid \"Player of the Match\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:390\n#: includes/admin/settings/class-sp-settings-events.php:437\n#: templates/event-performance-table.php:144\n#: templates/event-performance-table.php:147\nmsgid \"Stars\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:412\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:136\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:200\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:106\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-columns.php:42\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-columns.php:86\n#: includes/admin/settings/class-sp-settings-events.php:400\n#: includes/admin/settings/class-sp-settings-events.php:493\n#: includes/admin/settings/class-sp-settings-players.php:192\n#: includes/class-sp-player.php:274 includes/class-sp-player.php:722\n#: includes/class-sp-player.php:788 includes/class-sp-team.php:66\n#: includes/sp-core-functions.php:571 includes/sp-core-functions.php:575\n#: includes/sp-core-functions.php:1811\n#: templates/event-performance-table.php:272\nmsgid \"Total\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:603\nmsgid \"Starting Lineup\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:604\n#: includes/class-sp-event.php:460 includes/class-sp-event.php:471\nmsgid \"Substitute\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:38\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:229\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:250\n#: modules/sportspress-default-nationality.php:57\nmsgid \"&mdash; None &mdash;\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:129\n#: includes/class-sp-ajax.php:64 includes/class-sp-ajax.php:109\n#: includes/class-sp-ajax.php:139 includes/class-sp-ajax.php:169\n#: includes/class-sp-ajax.php:199 includes/class-sp-ajax.php:229\n#: includes/class-sp-ajax.php:259 includes/class-sp-ajax.php:289\n#: includes/class-sp-ajax.php:319 includes/class-sp-ajax.php:472\n#: includes/class-sp-ajax.php:679 includes/class-sp-ajax.php:870\n#: includes/class-sp-ajax.php:955 includes/class-sp-ajax.php:1013\n#: includes/class-sp-ajax.php:1043 includes/class-sp-ajax.php:1079\n#: includes/class-sp-ajax.php:1221\n#: includes/widgets/class-sp-widget-countdown.php:122\n#: includes/widgets/class-sp-widget-countdown.php:154\n#: includes/widgets/class-sp-widget-countdown.php:171\n#: includes/widgets/class-sp-widget-event-blocks.php:140\n#: includes/widgets/class-sp-widget-event-calendar.php:123\n#: includes/widgets/class-sp-widget-event-list.php:147\n#: includes/widgets/class-sp-widget-league-table.php:108\n#: includes/widgets/class-sp-widget-player-gallery.php:116\n#: includes/widgets/class-sp-widget-player-list.php:116\n#: includes/widgets/class-sp-widget-staff.php:67\n#: includes/widgets/class-sp-widget-team-gallery.php:111\n#: modules/sportspress-gutenberg.php:90\n#, php-format\nmsgid \"Select %s:\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php:29\nmsgid \"Remove video\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php:33\nmsgid \"URL\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php:42\nmsgid \"Add video\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:27\n#: includes/admin/settings/class-sp-settings-general.php:27\n#: includes/admin/settings/class-sp-settings-modules.php:37\nmsgid \"General\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:36\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:58\n#: includes/class-sp-ajax.php:982 includes/sp-core-functions.php:1799\n#: includes/widgets/class-sp-widget-player-list.php:157\n#: includes/widgets/class-sp-widget-player-list.php:163\n#: includes/widgets/class-sp-widget-team-gallery.php:135\n#: templates/player-list.php:148\nmsgid \"Rank\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:56\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:197\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:173\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:229\nmsgid \"Data\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:59\n#: includes/admin/settings/class-sp-settings-events.php:481\n#: includes/class-sp-post-types.php:376\nmsgid \"Performance\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:50\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:87\n#: includes/admin/settings/class-sp-settings-events.php:424\n#: includes/admin/settings/class-sp-settings-players.php:173\nmsgid \"Values\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:51\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:88\n#: modules/sportspress-tutorials.php:148\nmsgid \"Adjustments\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:119\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:82\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:143\n#: includes/admin/views/html-admin-config.php:53\n#: includes/admin/views/html-admin-config.php:140\n#: includes/admin/views/html-admin-config.php:269\n#: includes/admin/views/html-admin-config.php:334\n#: includes/admin/views/html-admin-config.php:395\n#: includes/admin/views/html-admin-config.php:501\n#: modules/sportspress-event-specs.php:177\n#: modules/sportspress-event-status.php:93\nmsgid \"Edit\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:124\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:148\nmsgid \"Save\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:102\nmsgid \"Current\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:123\nmsgid \"Grouping\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:149\nmsgid \"Skip if zero?\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:181\n#: includes/admin/settings/class-sp-settings-events.php:271\n#: includes/admin/settings/class-sp-settings-events.php:454\n#: includes/admin/settings/class-sp-settings-players.php:191\n#: modules/sportspress-countdowns.php:97\nmsgid \"Display\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:182\n#: modules/sportspress-player-lists.php:318\nmsgid \"players\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:40\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:170\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:40\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:120\n#: includes/admin/views/html-admin-config.php:200\n#: includes/admin/views/html-admin-config.php:449\nmsgid \"Visible\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:41\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:171\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:121\n#: includes/admin/views/html-admin-config.php:201\n#: includes/admin/views/html-admin-config.php:450\nmsgid \"Display in player profile?\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:47\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:131\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:151\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:177\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:47\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:127\n#: includes/admin/settings/class-sp-settings-status.php:81\n#: includes/admin/settings/class-sp-settings-status.php:120\n#: includes/admin/settings/class-sp-settings-status.php:158\n#: includes/admin/views/html-admin-page-status.php:40\n#: includes/admin/views/html-admin-page-status.php:79\n#: includes/admin/views/html-admin-page-status.php:117\nmsgid \"Yes\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:53\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:137\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:157\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:183\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:53\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:133\n#: includes/admin/settings/class-sp-settings-status.php:83\n#: includes/admin/settings/class-sp-settings-status.php:122\n#: includes/admin/settings/class-sp-settings-status.php:158\n#: includes/admin/views/html-admin-page-status.php:42\n#: includes/admin/views/html-admin-page-status.php:81\n#: includes/admin/views/html-admin-page-status.php:117\nmsgid \"No\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:40\n#: includes/admin/settings/class-sp-settings-events.php:499\n#: includes/admin/settings/class-sp-settings-general.php:445\n#: includes/admin/views/html-admin-config.php:99\n#: includes/admin/views/html-admin-config.php:192\n#: includes/sp-core-functions.php:538\nmsgid \"Primary\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:59\nmsgid \"Color\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:66\n#: includes/admin/views/html-admin-config.php:33\nmsgid \"Condition\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:72\n#: includes/sp-core-functions.php:542\n#, php-format\nmsgid \"Most %s\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:73\n#: includes/sp-core-functions.php:543\n#, php-format\nmsgid \"Least %s\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:74\n#: includes/sp-core-functions.php:544\n#, php-format\nmsgid \"Equal %s\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:68\nmsgid \"Singular\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:100\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:86\n#: includes/sp-core-functions.php:640 includes/sp-core-functions.php:650\n#: includes/sp-core-functions.php:652\nmsgid \"Number\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:102\n#: includes/admin/settings/class-sp-settings-general.php:447\n#: includes/admin/settings/class-sp-settings-text.php:27\n#: includes/admin/settings/class-sp-settings-text.php:43\n#: includes/sp-core-functions.php:642 modules/sportspress-tutorials.php:127\nmsgid \"Text\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:105\n#: includes/sp-core-functions.php:645\nmsgid \"Checkbox\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:124\nmsgid \"Timed\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:125\nmsgid \"Record minutes?\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:144\nmsgid \"Send Off\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:145\nmsgid \"Don't count minutes after?\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:48\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:78\n#: includes/admin/settings/class-sp-settings-players.php:200\n#: includes/sp-core-functions.php:1771 templates/player-statistics.php:97\nmsgid \"Career Total\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:41\nmsgid \"Display in event pages?\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:99\n#: includes/admin/settings/class-sp-settings-events.php:209\nmsgid \"Type\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:108\n#: includes/sp-core-functions.php:571\nmsgid \"Average\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:97\n#: modules/sportspress-tutorials.php:149\nmsgid \"Highlight\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:100\nmsgid \"Event Status (with results)\"\nmsgstr \"\"\n\n#: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:121\nmsgid \"Redirect\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:48\nmsgid \"Event Options\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:60\nmsgid \"Link events\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:109\nmsgid \"Default mode\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:117\nmsgctxt \"mode setting description\"\nmsgid \"Who competes in events?\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:121\n#: modules/sportspress-calendars.php:311 modules/sportspress-calendars.php:396\n#: modules/sportspress-league-tables.php:276\n#: modules/sportspress-player-lists.php:314\nmsgid \"Limit\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:125\n#: modules/sportspress-league-tables.php:280\nmsgid \"teams\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:137\nmsgid \"Filter by league\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:145\nmsgid \"Filter by season\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:166\n#: includes/admin/settings/class-sp-settings-teams.php:93\nmsgid \"Comments\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:167\nmsgid \"Allow people to post comments on new articles\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:194\n#: includes/admin/settings/class-sp-settings-teams.php:78\nmsgid \"Link venues\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:201\nmsgid \"Venue Map\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:202\nmsgid \"Display venue map\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:215\nmsgid \"Satellite\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:220\nmsgid \"Zoom\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:253\nmsgid \"Reverse order\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:265\nmsgid \"Inline\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:266\nmsgid \"Block\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:319\nmsgid \"Jersey (e.g. \\\"33. John Doe\\\")\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:320\nmsgid \"Name (e.g. \\\"John Doe (33)\\\")\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:335\n#: includes/admin/settings/class-sp-settings-status.php:333\n#: includes/admin/views/html-admin-config.php:89\n#: includes/admin/views/html-admin-config.php:93\n#: includes/admin/views/html-admin-page-status.php:292\n#: includes/class-sp-post-types.php:247\nmsgid \"Event Results\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:357\nmsgid \"Display outcome\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:383\nmsgid \"Rows\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:425\n#: includes/admin/settings/class-sp-settings-players.php:174\nmsgid \"Icons\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:430\nmsgid \"Awards\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:438\nmsgid \"Star Number\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:444\nmsgid \"Top-level only\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:486\n#: includes/admin/settings/class-sp-settings-players.php:184\n#: modules/sportspress-calendars.php:295\nmsgid \"Combined\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:548\n#: includes/admin/settings/class-sp-settings-events.php:552\nmsgid \"Delimiter\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-events.php:557\nmsgid \"Custom:\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:45\n#: includes/admin/settings/class-sp-settings-general.php:60\n#: includes/widgets/class-sp-widget-league-table.php:114\nmsgid \"&mdash; Select &mdash;\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:78\nmsgid \"General Options\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:90\n#: includes/admin/settings/class-sp-settings-status.php:308\n#: includes/admin/views/html-admin-page-status.php:267\nmsgid \"Sport\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:120\nmsgid \"Styles and Scripts\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:137\nmsgid \"Align\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:143\n#: modules/sportspress-widget-alignment.php:75\nmsgid \"Left\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:144\nmsgid \"Center\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:145\n#: modules/sportspress-widget-alignment.php:76\nmsgid \"Right\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:150\nmsgid \"Padding\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:169\nmsgid \"Custom CSS\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:179\nmsgid \"Scripts\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:180\nmsgid \"Live countdowns\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:185\nmsgid \"This will enable a script allowing the countdowns to be animated.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:189\nmsgid \"Shortcode menu\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:194\nmsgid \"This will enable a shortcode menu to be displayed in the visual editor.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:200\nmsgid \"Tables\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:201\nmsgid \"Responsive\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:209\nmsgid \"Scrollable\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:217\nmsgid \"Sortable\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:225\nmsgid \"Widgets\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:226\nmsgid \"Unique\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:230\nmsgid \"Hide widget when same as content.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:237\nmsgid \"Header Offset\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:393\nmsgid \"Color Scheme\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:414\n#: modules/sportspress-icons.php:203\nmsgid \"Customize\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:446\nmsgid \"Background\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-general.php:456\n#: modules/sportspress-styles.php:72\nmsgid \"Enable\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-licenses.php:32\nmsgid \"Licenses\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-licenses.php:76\nmsgid \"License Key\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-licenses.php:80\nmsgid \"Enter the license key from your purchase receipt.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-licenses.php:87\nmsgid \"Deactivate\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-licenses.php:92\nmsgid \"Activate\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-licenses.php:175\nmsgid \"License activated.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-licenses.php:177\nmsgid \"License invalid.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-licenses.php:227\nmsgid \"License deactivated.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:32\n#: includes/admin/settings/class-sp-settings-modules.php:221\nmsgid \"Modules\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:41\nmsgid \"Dashboard\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:67\nmsgid \"SportsPress Pro\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:74\n#: includes/class-sp-modules.php:203 includes/class-sp-modules.php:214\nmsgid \"Premium\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:75\nmsgid \"Upgrade Now\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:86\nmsgid \"Get Freebies\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:91\nmsgid \"Instant access to exclusive SportsPress extensions and free downloads.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:93\nmsgid \"Create a free account\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:94\nmsgid \"Sign Up\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:107\nmsgid \"Current Theme\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:113\n#: includes/admin/settings/class-sp-settings-modules.php:131\nmsgid \"Rookie is a free starter theme for SportsPress designed by ThemeBoy.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:115\nmsgid \"Need a better theme?\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:116\n#: sportspress.php:149\nmsgid \"Upgrade\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:125\nmsgid \"Free SportsPress Theme\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:133\n#: includes/class-sp-modules.php:175 includes/class-sp-modules.php:183\n#: includes/class-sp-modules.php:225\nmsgid \"Free\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:134\n#: includes/admin/views/html-notice-theme-support.php:10\nmsgid \"Install Now\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:146\nmsgid \"Documentation\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:148\nmsgid \"Getting Started\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:149\nmsgid \"Manuals\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:150\nmsgid \"Videos\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:155\nmsgid \"Help\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:157\nmsgid \"Support Forums\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:158\nmsgid \"Feature Requests\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:163\nmsgid \"Connect\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:165\n#: includes/class-sp-modules.php:170\nmsgid \"Twitter\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:166\n#: includes/class-sp-modules.php:178\nmsgid \"Facebook\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:167\nmsgid \"YouTube\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:168\nmsgid \"Google+\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:173\nmsgid \"Developers\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:175\nmsgid \"Reference\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:176\nmsgid \"Slack\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:177\nmsgid \"GitHub\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:183\n#: includes/admin/settings/class-sp-settings-modules.php:185\nmsgid \"Premium Support\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-modules.php:260\n#: includes/admin/views/html-admin-settings.php:18\nmsgid \"Save Changes\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-page.php:122\nmsgid \"Drag each item into the order you prefer.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-page.php:178\nmsgid \"Tabs\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-page.php:181\nmsgid \"Drag items here to display them as tabs.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-players.php:47\nmsgid \"Player Options\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-players.php:62\nmsgid \"Link players\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-players.php:135\n#: includes/admin/settings/class-sp-settings-staff.php:97\n#: modules/sportspress-player-lists.php:279\nmsgid \"Display national flags\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-players.php:179\nmsgid \"Categories\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-staff.php:49\nmsgid \"Staff Options\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-staff.php:64\n#: includes/admin/settings/class-sp-settings-teams.php:62\nmsgid \"Link staff\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:27\n#: includes/admin/settings/class-sp-settings-status.php:44\n#: includes/admin/views/html-admin-page-status.php:2\n#: includes/admin/views/html-notice-template-check.php:20\nmsgid \"System Status\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:46\n#: includes/admin/views/html-admin-page-status.php:5\nmsgid \"Please include this information when requesting support:\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:47\n#: includes/admin/views/html-admin-page-status.php:6\nmsgid \"Get System Report\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:55\n#: includes/admin/views/html-admin-page-status.php:14\nmsgid \"Environment\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:61\n#: includes/admin/views/html-admin-page-status.php:20\nmsgid \"Home URL\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:69\n#: includes/admin/views/html-admin-page-status.php:28\nmsgid \"SP Version\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:73\n#: includes/admin/views/html-admin-page-status.php:32\nmsgid \"WP Version\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:77\n#: includes/admin/views/html-admin-page-status.php:36\nmsgid \"WP Multisite Enabled\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:89\n#: includes/admin/views/html-admin-page-status.php:48\nmsgid \"Web Server Info\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:93\n#: includes/admin/views/html-admin-page-status.php:52\nmsgid \"PHP Version\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:102\n#: includes/admin/views/html-admin-page-status.php:61\nmsgid \"WP Memory Limit\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:108\n#: includes/admin/views/html-admin-page-status.php:67\n#, php-format\nmsgid \"\"\n\"%1$s - We recommend setting memory to at least 64MB. See: <a href=\\\"%2$s\"\n\"\\\">Increasing memory allocated to PHP</a>\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:116\n#: includes/admin/views/html-admin-page-status.php:75\nmsgid \"WP Debug Mode\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:128\n#: includes/admin/views/html-admin-page-status.php:87\nmsgid \"WP Language\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:140\n#: includes/admin/views/html-admin-page-status.php:99\nmsgid \"WP Max Upload Size\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:145\n#: includes/admin/views/html-admin-page-status.php:104\nmsgid \"PHP Post Max Size\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:149\n#: includes/admin/views/html-admin-page-status.php:108\nmsgid \"PHP Time Limit\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:153\n#: includes/admin/views/html-admin-page-status.php:112\nmsgid \"PHP Max Input Vars\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:157\n#: includes/admin/views/html-admin-page-status.php:116\nmsgid \"SUHOSIN Installed\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:162\n#: includes/admin/views/html-admin-page-status.php:121\nmsgid \"Default Timezone\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:167\n#: includes/admin/views/html-admin-page-status.php:126\n#, php-format\nmsgid \"Default timezone is %s - it should be UTC\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:169\n#: includes/admin/views/html-admin-page-status.php:128\n#, php-format\nmsgid \"Default timezone is %s\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:178\n#: includes/admin/views/html-admin-page-status.php:137\nmsgid \"fsockopen/cURL\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:181\n#: includes/admin/views/html-admin-page-status.php:140\nmsgid \"Your server has fsockopen and cURL enabled.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:183\n#: includes/admin/views/html-admin-page-status.php:142\nmsgid \"Your server has fsockopen enabled, cURL is disabled.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:185\n#: includes/admin/views/html-admin-page-status.php:144\nmsgid \"Your server has cURL enabled, fsockopen is disabled.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:189\n#: includes/admin/views/html-admin-page-status.php:148\nmsgid \"\"\n\"Your server does not have fsockopen or cURL enabled - PayPal IPN and other \"\n\"scripts which communicate with other servers will not work. Contact your \"\n\"hosting provider.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:194\n#: includes/admin/views/html-admin-page-status.php:153\nmsgid \"SOAP Client\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:196\n#: includes/admin/views/html-admin-page-status.php:155\nmsgid \"Your server has the SOAP Client class enabled.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:199\n#: includes/admin/views/html-admin-page-status.php:158\n#, php-format\nmsgid \"\"\n\"Your server does not have the <a href=\\\"%s\\\">SOAP Client</a> class enabled - \"\n\"some gateway plugins which use SOAP may not work as expected.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:223\n#: includes/admin/views/html-admin-page-status.php:182\nmsgid \"Plugins\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:229\n#: includes/admin/views/html-admin-page-status.php:188\nmsgid \"Installed Plugins\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:251\n#: includes/admin/views/html-admin-page-status.php:210\nmsgid \"Visit plugin homepage\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:280\n#: includes/admin/settings/class-sp-settings-status.php:586\n#: includes/admin/views/html-admin-page-status.php:239\n#: includes/admin/views/html-admin-page-status.php:544\nmsgid \"is available\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:284\n#: includes/admin/views/html-admin-page-status.php:243\nmsgid \"by\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:284\n#: includes/admin/views/html-admin-page-status.php:243\nmsgid \"version\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:302\n#: includes/admin/views/html-admin-page-status.php:261\nmsgid \"SP Configuration\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:312\n#: includes/admin/views/html-admin-config.php:23\n#: includes/admin/views/html-admin-page-status.php:271\n#: includes/class-sp-post-types.php:279 modules/sportspress-tutorials.php:134\nmsgid \"Event Outcomes\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:354\n#: includes/admin/views/html-admin-config.php:182\n#: includes/admin/views/html-admin-config.php:186\n#: includes/admin/views/html-admin-page-status.php:313\n#: includes/class-sp-post-types.php:375 includes/class-sp-post-types.php:377\nmsgid \"Player Performance\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:375\n#: includes/admin/views/html-admin-config.php:304\n#: includes/admin/views/html-admin-page-status.php:334\n#: includes/class-sp-post-types.php:311\n#: modules/sportspress-league-tables.php:169\nmsgid \"Table Columns\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:397\n#: includes/admin/views/html-admin-config.php:369\n#: includes/admin/views/html-admin-page-status.php:355\n#: includes/class-sp-post-types.php:343 modules/sportspress-tutorials.php:155\nmsgid \"Player Metrics\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:418\n#: includes/admin/views/html-admin-config.php:435\n#: includes/admin/views/html-admin-page-status.php:376\n#: includes/class-sp-post-types.php:412\nmsgid \"Player Statistics\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:442\n#: includes/admin/views/html-admin-page-status.php:400\nmsgid \"SP Taxonomies\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:503\n#: includes/admin/views/html-admin-page-status.php:461\nmsgid \"SP Post Types\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:530\n#: includes/admin/views/html-admin-page-status.php:488\nmsgid \"Theme\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:572\n#: includes/admin/views/html-admin-page-status.php:530\nmsgid \"Theme Name\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:580\n#: includes/admin/views/html-admin-page-status.php:538\nmsgid \"Theme Version\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:592\n#: includes/admin/views/html-admin-page-status.php:550\nmsgid \"Author URL\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:603\n#: includes/admin/views/html-admin-page-status.php:561\nmsgid \"Templates\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:639\n#: includes/admin/views/html-admin-page-status.php:595\n#, php-format\nmsgid \"\"\n\"<code>%1$s</code> version <strong style=\\\"color:red\\\">%2$s</strong> is out \"\n\"of date. The core version is %3$s\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:650\n#: includes/admin/settings/class-sp-settings-status.php:656\n#: includes/admin/views/html-admin-page-status.php:606\n#: includes/admin/views/html-admin-page-status.php:612\nmsgid \"Template Overrides\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-status.php:657\n#: includes/admin/views/html-admin-page-status.php:613\nmsgid \"No overrides present in theme.\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-teams.php:47\nmsgid \"Team Options\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-teams.php:70\nmsgid \"Link teams\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-teams.php:85\n#: includes/class-sp-templates.php:140 includes/sp-core-functions.php:518\n#: includes/sp-core-functions.php:1817 templates/team-link.php:32\nmsgid \"Visit Site\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-teams.php:86\nmsgid \"Open link in a new window/tab\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-teams.php:94\nmsgid \"Allow people to post comments on Team page\"\nmsgstr \"\"\n\n#: includes/admin/settings/class-sp-settings-text.php:45\nmsgid \"The following options affect how words are displayed on the frontend.\"\nmsgstr \"\"\n\n#: includes/admin/views/html-admin-config.php:24\n#: includes/admin/views/html-admin-config.php:90\n#: includes/admin/views/html-admin-config.php:183\nmsgid \"Used for events.\"\nmsgstr \"\"\n\n#: includes/admin/views/html-admin-config.php:101\nmsgid \"Variables\"\nmsgstr \"\"\n\n#: includes/admin/views/html-admin-config.php:116\n#: includes/admin/views/html-admin-config.php:216\n#, php-format\nmsgid \"Default (%s)\"\nmsgstr \"\"\n\n#: includes/admin/views/html-admin-config.php:305\nmsgid \"Used for league tables.\"\nmsgstr \"\"\n\n#: includes/admin/views/html-admin-config.php:370\n#: includes/admin/views/html-admin-config.php:436\nmsgid \"Used for player lists.\"\nmsgstr \"\"\n\n#: includes/admin/views/html-notice-install.php:7\nmsgid \"Let's get started with some basic settings.\"\nmsgstr \"\"\n\n#: includes/admin/views/html-notice-install.php:23\nmsgid \"Run the Setup Wizard\"\nmsgstr \"\"\n\n#: includes/admin/views/html-notice-install.php:24\n#: includes/admin/views/html-notice-template-check.php:20\n#: includes/admin/views/html-notice-theme-support.php:12\nmsgid \"Hide this notice\"\nmsgstr \"\"\n\n#: includes/admin/views/html-notice-no-access.php:7\nmsgid \"You are not allowed to edit this item.\"\nmsgstr \"\"\n\n#: includes/admin/views/html-notice-template-check.php:7\nmsgid \"\"\n\"<strong>Your theme has bundled outdated copies of SportsPress template \"\n\"files</strong> &#8211; if you encounter functionality issues on the frontend \"\n\"this could the reason. Ensure you update or remove them (in general we \"\n\"recommend only bundling the template files you actually need to customize). \"\n\"See the system report for full details.\"\nmsgstr \"\"\n\n#: includes/admin/views/html-notice-theme-support.php:7\nmsgid \"\"\n\"<strong>Your theme does not declare SportsPress support</strong> &#8211; if \"\n\"you encounter layout issues please read our integration guide or choose a \"\n\"SportsPress theme :)\"\nmsgstr \"\"\n\n#: includes/admin/views/html-notice-theme-support.php:8\nmsgid \"Have you tried the free Rookie theme yet?\"\nmsgstr \"\"\n\n#: includes/admin/views/html-notice-theme-support.php:11\nmsgid \"Theme Integration Guide\"\nmsgstr \"\"\n\n#: includes/api/class-sp-rest-api.php:89\nmsgid \"Main Results\"\nmsgstr \"\"\n\n#: includes/api/class-sp-rest-api.php:121\nmsgid \"Winner\"\nmsgstr \"\"\n\n#: includes/api/class-sp-rest-api.php:477\n#: includes/api/class-sp-rest-api.php:578\nmsgid \"Nationalities\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:81\n#: includes/widgets/class-sp-widget-countdown.php:192\n#: modules/sportspress-calendars.php:380\nmsgid \"Display venue\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:87\n#: includes/widgets/class-sp-widget-countdown.php:195\n#: modules/sportspress-calendars.php:356\nmsgid \"Display league\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:92 includes/class-sp-ajax.php:122\n#: includes/class-sp-ajax.php:152 includes/class-sp-ajax.php:182\n#: includes/class-sp-ajax.php:212 includes/class-sp-ajax.php:242\n#: includes/class-sp-ajax.php:272 includes/class-sp-ajax.php:302\n#: includes/class-sp-ajax.php:449 includes/class-sp-ajax.php:650\n#: includes/class-sp-ajax.php:847 includes/class-sp-ajax.php:932\n#: includes/class-sp-ajax.php:996 includes/class-sp-ajax.php:1026\n#: includes/class-sp-ajax.php:1056 includes/class-sp-ajax.php:1198\n#: includes/class-sp-ajax.php:1282\nmsgid \"Insert Shortcode\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:333 includes/class-sp-ajax.php:486\n#: includes/class-sp-ajax.php:693 includes/class-sp-ajax.php:1092\nmsgid \"Team:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:347 includes/class-sp-ajax.php:500\n#: includes/class-sp-ajax.php:707 includes/class-sp-ajax.php:1106\nmsgid \"League:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:361 includes/class-sp-ajax.php:514\n#: includes/class-sp-ajax.php:721 includes/class-sp-ajax.php:1120\nmsgid \"Season:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:375 includes/class-sp-ajax.php:528\n#: includes/class-sp-ajax.php:735\nmsgid \"Venue:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:389 includes/class-sp-ajax.php:542\n#: includes/class-sp-ajax.php:749\n#: includes/widgets/class-sp-widget-event-blocks.php:157\n#: includes/widgets/class-sp-widget-event-calendar.php:140\n#: includes/widgets/class-sp-widget-event-list.php:164\nmsgid \"Status:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:400 includes/class-sp-ajax.php:565\n#: includes/class-sp-ajax.php:772\n#: includes/widgets/class-sp-widget-event-blocks.php:171\n#: includes/widgets/class-sp-widget-event-calendar.php:154\n#: includes/widgets/class-sp-widget-event-list.php:178\nmsgid \"Date:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:437 includes/class-sp-ajax.php:602\n#: includes/class-sp-ajax.php:809\n#: includes/widgets/class-sp-widget-event-blocks.php:220\n#: includes/widgets/class-sp-widget-event-calendar.php:203\n#: includes/widgets/class-sp-widget-event-list.php:227\nmsgid \"Match Day:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:443 includes/class-sp-ajax.php:645\n#: includes/class-sp-ajax.php:842\n#: includes/widgets/class-sp-widget-event-blocks.php:238\n#: includes/widgets/class-sp-widget-event-calendar.php:211\n#: includes/widgets/class-sp-widget-event-list.php:282\nmsgid \"Display link to view all events\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:466 includes/class-sp-ajax.php:667\n#: includes/class-sp-ajax.php:864 includes/class-sp-ajax.php:949\n#: includes/class-sp-ajax.php:1073 includes/class-sp-ajax.php:1215\n#: includes/widgets/class-sp-widget-birthdays.php:82\n#: includes/widgets/class-sp-widget-countdown.php:116\n#: includes/widgets/class-sp-widget-event-blocks.php:134\n#: includes/widgets/class-sp-widget-event-calendar.php:120\n#: includes/widgets/class-sp-widget-event-list.php:141\n#: includes/widgets/class-sp-widget-league-table.php:102\n#: includes/widgets/class-sp-widget-player-gallery.php:110\n#: includes/widgets/class-sp-widget-player-list.php:110\n#: includes/widgets/class-sp-widget-staff.php:64\n#: includes/widgets/class-sp-widget-team-gallery.php:105\nmsgid \"Title:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:554 includes/class-sp-ajax.php:761\n#: includes/widgets/class-sp-widget-birthdays.php:94\nmsgid \"Format:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:608 includes/class-sp-ajax.php:815\n#: includes/widgets/class-sp-widget-event-blocks.php:223\n#: includes/widgets/class-sp-widget-event-list.php:230\nmsgid \"Number of events to show:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:614 includes/class-sp-ajax.php:831\n#: includes/class-sp-ajax.php:1182 includes/class-sp-ajax.php:1266\n#: includes/widgets/class-sp-widget-countdown.php:147\n#: includes/widgets/class-sp-widget-event-blocks.php:226\n#: includes/widgets/class-sp-widget-event-list.php:233\n#: includes/widgets/class-sp-widget-player-gallery.php:163\n#: includes/widgets/class-sp-widget-player-list.php:198\nmsgid \"Sort Order:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:623 includes/class-sp-ajax.php:888\n#: includes/class-sp-ajax.php:974 includes/class-sp-ajax.php:1139\n#: includes/class-sp-ajax.php:1240\n#: includes/widgets/class-sp-widget-event-list.php:241\n#: includes/widgets/class-sp-widget-league-table.php:129\n#: includes/widgets/class-sp-widget-player-gallery.php:135\n#: includes/widgets/class-sp-widget-team-gallery.php:130\nmsgid \"Columns:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:633 modules/sportspress-event-specs.php:208\n#: modules/sportspress-event-specs.php:216\nmsgid \"Specs\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:673\nmsgid \"Event:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:821 includes/class-sp-ajax.php:1162\n#: includes/class-sp-ajax.php:1246\n#: includes/widgets/class-sp-widget-countdown.php:139\n#: includes/widgets/class-sp-widget-player-gallery.php:138\n#: includes/widgets/class-sp-widget-player-list.php:176\n#: includes/widgets/class-sp-widget-team-gallery.php:133\nmsgid \"Sort by:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:883 includes/class-sp-ajax.php:968\n#: includes/widgets/class-sp-widget-league-table.php:125\n#: includes/widgets/class-sp-widget-team-gallery.php:127\nmsgid \"Number of teams to show:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:909\n#: includes/widgets/class-sp-widget-league-table.php:153\n#: modules/sportspress-calendars.php:271 modules/sportspress-calendars.php:348\n#: modules/sportspress-league-tables.php:261\n#: modules/sportspress-player-lists.php:288\nmsgid \"Display logos\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:915 includes/class-sp-ajax.php:991\n#: includes/widgets/class-sp-widget-league-table.php:156\nmsgid \"Display link to view full table\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:919\nmsgid \"Event Status:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:922\nmsgid \"Include Published/Played Events with results\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:927\nmsgid \"Include Scheduled/Future Events with results\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:980\nmsgid \"Order by\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:983\n#: includes/widgets/class-sp-widget-team-gallery.php:136\nmsgid \"Alphabetical\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:984\n#: includes/widgets/class-sp-widget-player-gallery.php:148\n#: includes/widgets/class-sp-widget-team-gallery.php:137\nmsgid \"Random\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:1134 includes/class-sp-ajax.php:1234\n#: includes/widgets/class-sp-widget-player-gallery.php:132\n#: includes/widgets/class-sp-widget-player-list.php:132\nmsgid \"Number of players to show:\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:1153\nmsgid \"#\"\nmsgstr \"\"\n\n#: includes/class-sp-ajax.php:1193 includes/class-sp-ajax.php:1277\n#: includes/widgets/class-sp-widget-player-gallery.php:170\n#: includes/widgets/class-sp-widget-player-list.php:205\nmsgid \"Display link to view all players\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:32\nmsgid \"Africa\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:89\nmsgid \"Asia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:139\nmsgid \"Europe\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:196\nmsgid \"North America\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:235\nmsgid \"Oceania\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:259\nmsgid \"South America\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:280\nmsgid \"Afghanistan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:281\nmsgid \"Anguilla\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:282\nmsgid \"Albania\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:283\nmsgid \"Algeria\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:284\nmsgid \"Andorra\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:285\nmsgid \"Angola\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:286\nmsgid \"Argentina\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:287\nmsgid \"Armenia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:288\nmsgid \"Aruba\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:289\nmsgid \"American Samoa\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:290\nmsgid \"Antigua and Barbuda\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:291\nmsgid \"Australia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:292\nmsgid \"Austria\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:293\nmsgid \"Azerbaijan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:294\nmsgid \"Bahamas\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:295\nmsgid \"Bangladesh\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:296\nmsgid \"Burundi\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:297\nmsgid \"Belgium\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:298\nmsgid \"Benin\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:299\nmsgid \"Bermuda\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:300\nmsgid \"Burkina Faso\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:301\nmsgid \"Bahrain\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:302\nmsgid \"Bhutan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:303\nmsgid \"Bosnia and Herzegovina\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:304\nmsgid \"Belarus\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:305\nmsgid \"Belize\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:306\nmsgid \"Bolivia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:307\nmsgid \"Botswana\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:308\nmsgid \"Brazil\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:309\nmsgid \"Barbados\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:310\nmsgid \"Brunei\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:311\nmsgid \"Bulgaria\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:312\nmsgid \"Cambodia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:313\nmsgid \"Canada\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:314\nmsgid \"Cayman Islands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:315\nmsgid \"Republic of the Congo\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:316\nmsgid \"Chad\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:317\nmsgid \"Chile\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:318\nmsgid \"China\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:319\nmsgid \"Ivory Coast\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:320\nmsgid \"Cameroon\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:321\nmsgid \"Democratic Republic of the Congo\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:322\nmsgid \"Cook Islands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:323\nmsgid \"Colombia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:324\nmsgid \"Comoros\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:325\nmsgid \"Cape Verde\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:326\nmsgid \"Costa Rica\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:327\nmsgid \"Croatia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:328\nmsgid \"Central African Republic\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:329\nmsgid \"Cuba\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:330\nmsgid \"Curacao\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:331\nmsgid \"Cyprus\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:332\nmsgid \"Czechia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:333\nmsgid \"Denmark\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:334\nmsgid \"Djibouti\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:335\nmsgid \"Dominica\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:336\nmsgid \"Dominican Republic\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:337\nmsgid \"Ecuador\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:338\nmsgid \"Egypt\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:339\nmsgid \"England\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:340\nmsgid \"Equatorial Guinea\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:341\nmsgid \"Eritrea\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:342\nmsgid \"Western Sahara\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:343\nmsgid \"Spain\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:344\nmsgid \"Estonia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:345\nmsgid \"Ethiopia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:346\nmsgid \"Fiji\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:347\nmsgid \"Finland\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:348\nmsgid \"France\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:349\nmsgid \"Faroe Islands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:350\nmsgid \"French Guiana\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:351\nmsgid \"French Polynesia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:352\nmsgid \"Micronesia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:353\nmsgid \"Gabon\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:354\nmsgid \"Gambia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:355\nmsgid \"United Kingdom\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:356\nmsgid \"Georgia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:357\nmsgid \"Germany\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:358\nmsgid \"Ghana\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:359\nmsgid \"Gibraltar\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:360\nmsgid \"Guadeloupe\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:361\nmsgid \"Guinea-Bissau\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:362\nmsgid \"Greece\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:363\nmsgid \"Greenland\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:364\nmsgid \"Grenada\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:365\nmsgid \"Guatemala\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:366\nmsgid \"Guinea\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:367\nmsgid \"Guam\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:368\nmsgid \"Guyana\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:369\nmsgid \"Haiti\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:370\nmsgid \"Hong Kong\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:371\nmsgid \"Honduras\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:372\nmsgid \"Hungary\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:373\nmsgid \"Indonesia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:374\nmsgid \"India\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:375\nmsgid \"Ireland\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:376\nmsgid \"Iran\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:377\nmsgid \"Iraq\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:378\nmsgid \"Iceland\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:379\nmsgid \"Israel\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:380\nmsgid \"Italy\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:381\nmsgid \"Jamaica\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:382\nmsgid \"Jordan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:383\nmsgid \"Japan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:384\nmsgid \"Kazakhstan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:385\nmsgid \"Kenya\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:386\nmsgid \"Kosovo\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:387\nmsgid \"Kyrgyzstan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:388\nmsgid \"Kiribati\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:389\nmsgid \"Martinique\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:390\nmsgid \"South Korea\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:391\nmsgid \"Saudi Arabia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:392\nmsgid \"Kuwait\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:393\nmsgid \"Laos\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:394\nmsgid \"Liberia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:395\nmsgid \"Libya\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:396\nmsgid \"Saint Lucia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:397\nmsgid \"Lesotho\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:398\nmsgid \"Lebanon\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:399\nmsgid \"Liechtenstein\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:400\nmsgid \"Lithuania\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:401\nmsgid \"Luxembourg\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:402\nmsgid \"Latvia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:403\nmsgid \"Macau\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:404\nmsgid \"Madagascar\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:405\nmsgid \"Morocco\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:406\nmsgid \"Malaysia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:407\nmsgid \"Monaco\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:408\nmsgid \"Moldova\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:409\nmsgid \"Maldives\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:410\nmsgid \"Mexico\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:411\nmsgid \"Marshall Islands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:412\nmsgid \"North Macedonia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:413\nmsgid \"Mali\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:414\nmsgid \"Malta\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:415\nmsgid \"Montenegro\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:416\nmsgid \"Mongolia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:417\nmsgid \"Mozambique\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:418\nmsgid \"Mauritius\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:419\nmsgid \"Montserrat\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:420\nmsgid \"Mauritania\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:421\nmsgid \"Malawi\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:422\nmsgid \"Myanmar\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:423\nmsgid \"Namibia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:424\nmsgid \"Nicaragua\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:425\nmsgid \"New Caledonia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:426\nmsgid \"Netherlands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:427\nmsgid \"Nepal\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:428\nmsgid \"Nigeria\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:429\nmsgid \"Niger\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:430\nmsgid \"Northern Ireland\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:431\nmsgid \"Norway\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:432\nmsgid \"Nauru\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:433\nmsgid \"New Zealand\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:434\nmsgid \"Oman\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:435\nmsgid \"Pakistan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:436\nmsgid \"Panama\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:437\nmsgid \"Paraguay\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:438\nmsgid \"Peru\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:439\nmsgid \"Philippines\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:440\nmsgid \"Palestine\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:441\nmsgid \"Palau\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:442\nmsgid \"Papua New Guinea\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:443\nmsgid \"Poland\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:444\nmsgid \"Portugal\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:445\nmsgid \"North Korea\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:446\nmsgid \"Puerto Rico\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:447\nmsgid \"Qatar\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:448\nmsgid \"Romania\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:449\nmsgid \"South Africa\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:450\nmsgid \"Reunion\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:451\nmsgid \"Russia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:452\nmsgid \"Rwanda\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:453\nmsgid \"Samoa\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:454\nmsgid \"Scotland\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:455\nmsgid \"Sudan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:456\nmsgid \"Senegal\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:457\nmsgid \"Seychelles\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:458\nmsgid \"Singapore\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:459\nmsgid \"Saint Kitts and Nevis\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:460\nmsgid \"Sierra Leone\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:461\nmsgid \"El Salvador\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:462\nmsgid \"San Marino\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:463\nmsgid \"Solomon Islands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:464\nmsgid \"Somalia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:465\nmsgid \"Serbia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:466\nmsgid \"Sri Lanka\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:467\nmsgid \"South Sudan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:468\nmsgid \"Sao Tome and Principe\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:469\nmsgid \"Switzerland\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:470\nmsgid \"Suriname\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:471\nmsgid \"Slovakia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:472\nmsgid \"Slovenia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:473\nmsgid \"Sweden\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:474\nmsgid \"Eswatini\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:475\nmsgid \"Sint Maarten\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:476\nmsgid \"Syria\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:477\nmsgid \"Tahiti\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:478\nmsgid \"Tanzania\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:479\nmsgid \"Turks and Caicos Islands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:480\nmsgid \"Tonga\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:481\nmsgid \"Thailand\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:482\nmsgid \"Tajikistan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:483\nmsgid \"Turkmenistan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:484\nmsgid \"East Timor\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:485\nmsgid \"Togo\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:486\nmsgid \"Taiwan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:487\nmsgid \"Trinidad and Tobago\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:488\nmsgid \"Tunisia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:489\nmsgid \"Turkey\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:490\nmsgid \"Tuvalu\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:491\nmsgid \"United Arab Emirates\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:492\nmsgid \"Uganda\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:493\nmsgid \"Ukraine\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:494\nmsgid \"Uruguay\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:495\nmsgid \"United States\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:496\nmsgid \"Uzbekistan\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:497\nmsgid \"Vanuatu\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:498\nmsgid \"Vatican City\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:499\nmsgid \"Venezuela\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:500\nmsgid \"British Virgin Islands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:501\nmsgid \"Vietnam\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:502\nmsgid \"Saint Vincent and the Grenadines\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:503\nmsgid \"US Virgin Islands\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:504\nmsgid \"Wales\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:505\nmsgid \"West Indies\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:506\nmsgid \"Yemen\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:507\nmsgid \"Zambia\"\nmsgstr \"\"\n\n#: includes/class-sp-countries.php:508\nmsgid \"Zimbabwe\"\nmsgstr \"\"\n\n#: includes/class-sp-feeds.php:27\nmsgid \"Apple Calendar\"\nmsgstr \"\"\n\n#: includes/class-sp-feeds.php:31\nmsgid \"Outlook\"\nmsgstr \"\"\n\n#: includes/class-sp-feeds.php:35\nmsgid \"Google\"\nmsgstr \"\"\n\n#: includes/class-sp-formats.php:38\nmsgid \"Standings\"\nmsgstr \"\"\n\n#: includes/class-sp-frontend-scripts.php:91\nmsgid \"Previous\"\nmsgstr \"\"\n\n#: includes/class-sp-install.php:223\nmsgid \"Event Manager\"\nmsgstr \"\"\n\n#: includes/class-sp-install.php:270\nmsgid \"Team Manager\"\nmsgstr \"\"\n\n#: includes/class-sp-install.php:340\nmsgid \"League Manager\"\nmsgstr \"\"\n\n#: includes/class-sp-install.php:602\nmsgid \"What's new:\"\nmsgstr \"\"\n\n#: includes/class-sp-league-table.php:852 includes/sp-core-functions.php:1794\n#: modules/sportspress-league-tables.php:302 templates/league-table.php:97\nmsgid \"Pos\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:35\nmsgid \"Results Matrix\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:39\nmsgid \"Display fixtures and results between teams in a grid layout.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:42\nmsgid \"Scoreboard\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:46\nmsgid \"Display multiple event results in a horizontal scoreboard.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:49\nmsgid \"Google Maps\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:53\nmsgid \"Use Google Maps instead of OpenStreetMap for venues.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:56\nmsgid \"User Scores\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:60\nmsgid \"Let players, staff, and visitors submit event scores for review.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:63\nmsgid \"Match Stats\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:67\nmsgid \"Display head-to-head team comparison charts in events.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:70\nmsgid \"Past Meetings\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:74\nmsgid \"Display previous events between teams in list or blocks layout.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:77\nmsgid \"Timelines\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:81\nmsgid \"Display a visual timeline of player performance in events.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:84\nmsgid \"Tournaments\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:88\nmsgid \"Schedule tournaments and create interactive playoff brackets.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:98\nmsgid \"League Menu\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:102\nmsgid \"Add a global navigation bar to display logos that link to each team.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:105\nmsgid \"Team Colors\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:109\nmsgid \"Create a custom color palette for each team.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:112\nmsgid \"Team Access\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:116\nmsgid \"Limit user access to data that is related to their team.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:126\nmsgid \"Midseason Transfers\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:130\nmsgid \"Statistics for players who transferred between teams during a season.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:134\nmsgid \"Directories\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:138\nmsgid \"Organize and display staff in list and gallery layouts.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:143\nmsgid \"Manage referees, umpires, judges, timekeepers, and other officials.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:149 modules/sportspress-tutorials.php:180\n#: modules/sportspress-tutorials.php:182 modules/sportspress-tutorials.php:193\nmsgid \"Tutorials\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:151\nmsgid \"Display a dashboard page with SportsPress video tutorials.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:154\nmsgid \"Branding\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:158\nmsgid \"Instantly rebrand the dashboard with your own logo and colors.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:161\nmsgid \"Duplicator\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:165\nmsgid \"Clone anything with just one click. Great for creating multiple events.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:174\nmsgid \"Add a Twitter feed to team, player, and staff pages.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:182\nmsgid \"Add a Facebook Page widget to embed and promote each team.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:186\nmsgid \"Sponsors\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:190\nmsgid \"Attract sponsors by offering them advertising space on your website.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:198\nmsgid \"BuddyPress\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:202\nmsgid \"Easily display SportsPress player information in BuddyPress profiles.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:209\nmsgid \"WooCommerce\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:213\nmsgid \"Sell team merchandise by integrating WooCommerce with SportsPress.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:220\nmsgid \"Yoast SEO\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:224\nmsgid \"Generate custom titles for SportsPress pages using Yoast SEO.\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:231\nmsgid \"Multisite\"\nmsgstr \"\"\n\n#: includes/class-sp-modules.php:235\nmsgid \"Manage multiple sports and display different widgets all on one site.\"\nmsgstr \"\"\n\n#: includes/class-sp-player-list.php:903\nmsgid \"Savvas\"\nmsgstr \"\"\n\n#: includes/class-sp-player-list.php:907 includes/class-sp-player-list.php:969\n#: includes/widgets/class-sp-widget-birthdays.php:75\n#: modules/sportspress-birthdays.php:99 modules/sportspress-birthdays.php:178\n#: modules/sportspress-birthdays.php:195 modules/sportspress-birthdays.php:222\nmsgid \"Age\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:42\nmsgid \"Edit League\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:43 includes/class-sp-post-types.php:82\n#: includes/class-sp-post-types.php:121 includes/class-sp-post-types.php:160\n#: includes/class-sp-post-types.php:199 includes/class-sp-post-types.php:252\n#: includes/class-sp-post-types.php:284 includes/class-sp-post-types.php:316\n#: includes/class-sp-post-types.php:348 includes/class-sp-post-types.php:381\n#: includes/class-sp-post-types.php:418\n#: modules/sportspress-bulk-actions.php:151\n#: modules/sportspress-event-specs.php:81 modules/sportspress-officials.php:92\nmsgid \"View\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:47 includes/class-sp-post-types.php:86\n#: includes/class-sp-post-types.php:125 includes/class-sp-post-types.php:164\n#: includes/class-sp-post-types.php:203 modules/sportspress-officials.php:96\nmsgid \"Parent\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:48 includes/class-sp-post-types.php:87\n#: includes/class-sp-post-types.php:126 includes/class-sp-post-types.php:165\n#: includes/class-sp-post-types.php:204 modules/sportspress-officials.php:97\nmsgid \"Parent:\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:49 includes/class-sp-post-types.php:88\n#: includes/class-sp-post-types.php:127 includes/class-sp-post-types.php:166\n#: includes/class-sp-post-types.php:205 includes/class-sp-post-types.php:253\n#: includes/class-sp-post-types.php:285 includes/class-sp-post-types.php:317\n#: includes/class-sp-post-types.php:349 includes/class-sp-post-types.php:382\n#: includes/class-sp-post-types.php:419 includes/class-sp-post-types.php:451\n#: includes/class-sp-post-types.php:486 includes/class-sp-post-types.php:529\n#: includes/class-sp-post-types.php:568 modules/sportspress-calendars.php:84\n#: modules/sportspress-event-specs.php:82\n#: modules/sportspress-league-tables.php:81\n#: modules/sportspress-officials.php:98 modules/sportspress-officials.php:147\n#: modules/sportspress-player-lists.php:81\nmsgid \"Search\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:81\nmsgid \"Edit Season\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:120\nmsgid \"Edit Venue\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:159\nmsgid \"Edit Position\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:198\nmsgid \"Edit Job\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:248\nmsgid \"Result\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:249\nmsgid \"Add New Result\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:250\nmsgid \"Edit Result\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:251 includes/class-sp-post-types.php:283\n#: includes/class-sp-post-types.php:315 includes/class-sp-post-types.php:347\n#: includes/class-sp-post-types.php:380 includes/class-sp-post-types.php:417\n#: includes/class-sp-post-types.php:449 includes/class-sp-post-types.php:484\n#: includes/class-sp-post-types.php:527 includes/class-sp-post-types.php:566\n#: modules/sportspress-calendars.php:82 modules/sportspress-event-specs.php:80\n#: modules/sportspress-league-tables.php:79\n#: modules/sportspress-officials.php:145\n#: modules/sportspress-player-lists.php:79\nmsgid \"New\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:281\nmsgid \"Add New Outcome\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:282\nmsgid \"Edit Outcome\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:312\nmsgid \"Column\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:313\nmsgid \"Add New Column\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:314\nmsgid \"Edit Column\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:344\nmsgid \"Metric\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:345\nmsgid \"Add New Metric\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:346\nmsgid \"Edit Metric\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:378\nmsgid \"Add New Performance\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:379\nmsgid \"Edit Performance\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:386 includes/class-sp-post-types.php:423\n#: modules/sportspress-icons.php:201\nmsgid \"Select Icon\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:387 includes/class-sp-post-types.php:424\nmsgid \"Remove icon\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:388 includes/class-sp-post-types.php:425\nmsgid \"Add icon\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:414\nmsgid \"Statistic\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:415\nmsgid \"Add New Statistic\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:416\nmsgid \"Edit Statistic\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:447 modules/sportspress-tutorials.php:114\nmsgid \"Add New Event\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:448 modules/sportspress-tutorials.php:115\nmsgid \"Edit Event\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:482 modules/sportspress-tutorials.php:93\nmsgid \"Add New Team\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:483\nmsgid \"Edit Team\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:485\nmsgid \"View Team\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:490 includes/class-sp-post-types.php:492\nmsgid \"Select Logo\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:491\nmsgid \"Remove Logo\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:525 modules/sportspress-tutorials.php:101\nmsgid \"Add New Player\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:526\nmsgid \"Edit Player\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:528\nmsgid \"View Player\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:533 includes/class-sp-post-types.php:535\n#: includes/class-sp-post-types.php:572 includes/class-sp-post-types.php:574\n#: modules/sportspress-officials.php:151 modules/sportspress-officials.php:153\nmsgid \"Select Photo\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:534 includes/class-sp-post-types.php:573\n#: modules/sportspress-officials.php:152\nmsgid \"Remove Photo\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:564 modules/sportspress-tutorials.php:107\nmsgid \"Add New Staff\"\nmsgstr \"\"\n\n#: includes/class-sp-post-types.php:565\nmsgid \"Edit Staff\"\nmsgstr \"\"\n\n#: includes/class-sp-templates.php:37 includes/class-sp-templates.php:121\n#: includes/class-sp-templates.php:207 includes/class-sp-templates.php:280\n#: includes/sp-core-functions.php:1778\nmsgid \"Excerpt\"\nmsgstr \"\"\n\n#: includes/class-sp-templates.php:56 includes/sp-core-functions.php:1813\n#: modules/sportspress-event-videos.php:61 templates/event-video.php:22\nmsgid \"Video\"\nmsgstr \"\"\n\n#: includes/class-sp-templates.php:130 includes/class-sp-templates.php:216\n#: includes/class-sp-templates.php:289 includes/sp-core-functions.php:1798\nmsgid \"Profile\"\nmsgstr \"\"\n\n#: includes/class-sp-templates.php:188 includes/class-sp-templates.php:261\nmsgid \"Dropdown\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:783\nmsgid \"Published\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:784\nmsgid \"Scheduled\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:817\nmsgid \"Yesterday\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:818\n#: includes/widgets/class-sp-widget-birthdays.php:67\nmsgid \"Today\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:819\nmsgid \"Tomorrow\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:820\nmsgid \"Last week\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:821\n#: includes/widgets/class-sp-widget-birthdays.php:68\nmsgid \"This week\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:822\nmsgid \"Next week\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:823\nmsgid \"Date range:\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:1117 includes/sp-core-functions.php:1320\nmsgid \"(no title)\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:1140 includes/sp-core-functions.php:1242\n#: modules/sportspress-lazy-loading.php:220\n#: modules/sportspress-lazy-loading.php:284\nmsgid \"Select All\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:1222 includes/sp-core-functions.php:1225\n#: modules/sportspress-lazy-loading.php:266\n#: modules/sportspress-lazy-loading.php:269\n#: modules/sportspress-lazy-loading.php:285\nmsgid \"Show all\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:1779 templates/event-fixtures-results.php:60\nmsgid \"Fixtures\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:1814 templates/event-blocks.php:276\n#: templates/event-calendar.php:301 templates/event-list.php:558\nmsgid \"View all events\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:1815 templates/player-gallery.php:213\n#: templates/player-list.php:278\nmsgid \"View all players\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:1816 templates/league-table.php:208\nmsgid \"View full table\"\nmsgstr \"\"\n\n#: includes/sp-core-functions.php:1834\nmsgid \"Love SportsPress? Help spread the word by rating us 5★ on WordPress.org\"\nmsgstr \"\"\n\n#: includes/sp-template-hooks.php:72\nmsgid \"\"\n\"The description is not prominent by default; however, some themes may show \"\n\"it.\"\nmsgstr \"\"\n\n#: includes/sp-template-hooks.php:83\nmsgid \"User\"\nmsgstr \"\"\n\n#: includes/sp-template-hooks.php:91\nmsgid \"Date/Time:\"\nmsgstr \"\"\n\n#: includes/sp-template-hooks.php:91\nmsgid \"Now\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-birthdays.php:7\nmsgid \"Display players and staff on their birthday.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-birthdays.php:9\nmsgid \"Birthdays\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-birthdays.php:69\nmsgid \"This month\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-birthdays.php:73\nmsgid \"Hide\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-birthdays.php:74\n#: modules/sportspress-birthdays.php:79 modules/sportspress-birthdays.php:100\n#: modules/sportspress-birthdays.php:115 modules/sportspress-birthdays.php:146\n#: modules/sportspress-birthdays.php:174 modules/sportspress-birthdays.php:191\nmsgid \"Birthday\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-birthdays.php:76\nmsgid \"Birthday (Age)\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-birthdays.php:86\nmsgid \"Birthday:\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-countdown.php:7\nmsgid \"A clock that counts down to an upcoming event.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-countdown.php:119\n#: includes/widgets/class-sp-widget-event-blocks.php:137\n#: includes/widgets/class-sp-widget-event-list.php:144\n#: includes/widgets/class-sp-widget-league-table.php:105\n#: includes/widgets/class-sp-widget-player-gallery.php:113\n#: includes/widgets/class-sp-widget-player-list.php:113\n#: includes/widgets/class-sp-widget-team-gallery.php:108\nmsgid \"Heading:\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-countdown.php:198\nmsgid \"Display date\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-countdown.php:201\nmsgid \"Display excluded events\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-countdown.php:204\nmsgid \"Display event status\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-event-blocks.php:7\n#: includes/widgets/class-sp-widget-event-list.php:7\nmsgid \"A list of events.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-event-blocks.php:9\n#: modules/sportspress-calendars.php:330\nmsgid \"Event Blocks\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-event-calendar.php:7\nmsgid \"A calendar of events.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-event-calendar.php:9\n#: modules/sportspress-gutenberg.php:87\nmsgid \"Event Calendar\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-event-list.php:9\n#: modules/sportspress-calendars.php:253\nmsgid \"Event List\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-league-table.php:7\nmsgid \"Display a league table.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-player-gallery.php:7\nmsgid \"Display a gallery of players.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-player-gallery.php:9\nmsgid \"Player Gallery\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-player-list.php:7\nmsgid \"Display a list of players.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-player-list.php:136\nmsgid \"Performance:\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-staff.php:7\nmsgid \"Display a single staff member.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-team-gallery.php:7\nmsgid \"Display a gallery of teams.\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-team-gallery.php:9\nmsgid \"Team Gallery\"\nmsgstr \"\"\n\n#: includes/widgets/class-sp-widget-team-gallery.php:141\nmsgid \"Display link to view all teams\"\nmsgstr \"\"\n\n#: modules/sportspress-birthdays.php:77\n#, php-format\nmsgid \"Birthday: <b>%1$s</b>\"\nmsgstr \"\"\n\n#: modules/sportspress-birthdays.php:116 modules/sportspress-birthdays.php:147\nmsgid \"Display birthday\"\nmsgstr \"\"\n\n#: modules/sportspress-birthdays.php:124 modules/sportspress-birthdays.php:155\nmsgid \"Display age\"\nmsgstr \"\"\n\n#: modules/sportspress-bulk-actions.php:66\nmsgid \"Generate Calendars\"\nmsgstr \"\"\n\n#: modules/sportspress-bulk-actions.php:103\nmsgid \"Postpone events\"\nmsgstr \"\"\n\n#: modules/sportspress-bulk-actions.php:104\nmsgid \"Cancel events\"\nmsgstr \"\"\n\n#: modules/sportspress-bulk-actions.php:105\nmsgid \"Set events as on time\"\nmsgstr \"\"\n\n#: modules/sportspress-bulk-actions.php:147\n#, php-format\nmsgid \"Generated %s calendar.\"\nmsgid_plural \"Generated %s calendars.\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n\n#: modules/sportspress-bulk-actions.php:160\n#, php-format\nmsgid \"Postponed %s event.\"\nmsgid_plural \"Postponed %s events.\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n\n#: modules/sportspress-bulk-actions.php:173\n#, php-format\nmsgid \"Canceled %s event.\"\nmsgid_plural \"Canceled %s events.\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n\n#: modules/sportspress-bulk-actions.php:186\n#, php-format\nmsgid \"Set %s event as on time.\"\nmsgid_plural \"Set %s event as on time.\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n\n#: modules/sportspress-calendars.php:80\nmsgid \"Add New Calendar\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:81\nmsgid \"Edit Calendar\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:83\nmsgid \"View Calendar\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:194\nmsgid \"Feeds\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:263 modules/sportspress-calendars.php:340\nmsgid \"Display calendar title\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:278\nmsgid \"Title Format\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:290\nmsgid \"Time/Results Format\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:296\nmsgid \"Separate\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:297\nmsgid \"Time Only\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:298\nmsgid \"Results Only\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:303 modules/sportspress-calendars.php:388\n#: modules/sportspress-league-tables.php:268\n#: modules/sportspress-player-lists.php:306\nmsgid \"Pagination\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:304 modules/sportspress-calendars.php:389\n#: modules/sportspress-league-tables.php:269\n#: modules/sportspress-player-lists.php:307\nmsgid \"Paginate\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:315 modules/sportspress-calendars.php:400\n#: modules/sportspress-league-tables.php:293\nmsgid \"events\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:364\nmsgid \"Display season\"\nmsgstr \"\"\n\n#: modules/sportspress-calendars.php:372\nmsgid \"Display matchday\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:82\nmsgid \"Sorry, you must be logged in to comment.\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:91\nmsgid \"<strong>ERROR</strong>: please fill the required fields (name, email).\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:91\nmsgid \"ERROR: please fill the required fields (name, email).\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:94\nmsgid \"<strong>ERROR</strong>: please enter a valid email address.\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:94\nmsgid \"ERROR: please enter a valid email address.\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:100\nmsgid \"<strong>ERROR</strong>: please type a comment.\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:100\nmsgid \"ERROR: please type a comment.\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:128\nmsgid \"\"\n\"<strong>ERROR</strong>: The comment could not be saved. Please try again \"\n\"later.\"\nmsgstr \"\"\n\n#: modules/sportspress-comments-scheduled-events.php:128\nmsgid \"ERROR: The comment could not be saved. Please try again later.\"\nmsgstr \"\"\n\n#: modules/sportspress-countdowns.php:98\nmsgid \"Logos\"\nmsgstr \"\"\n\n#: modules/sportspress-countdowns.php:105\nmsgid \"Featured Image\"\nmsgstr \"\"\n\n#: modules/sportspress-default-nationality.php:62\nmsgid \"Default Nationality\"\nmsgstr \"\"\n\n#: modules/sportspress-event-specs.php:76\n#: modules/sportspress-event-specs.php:151\n#: modules/sportspress-event-specs.php:248\nmsgid \"Event Specs\"\nmsgstr \"\"\n\n#: modules/sportspress-event-specs.php:77\nmsgid \"Event Spec\"\nmsgstr \"\"\n\n#: modules/sportspress-event-specs.php:78\nmsgid \"Add New Event Spec\"\nmsgstr \"\"\n\n#: modules/sportspress-event-specs.php:79\nmsgid \"Edit Event Spec\"\nmsgstr \"\"\n\n#: modules/sportspress-event-specs.php:152\nmsgid \"Add more details to an event.\"\nmsgstr \"\"\n\n#: modules/sportspress-event-status.php:71 templates/countdown.php:133\nmsgid \"On time\"\nmsgstr \"\"\n\n#: modules/sportspress-event-status.php:92\nmsgid \"Time:\"\nmsgstr \"\"\n\n#: modules/sportspress-event-status.php:93\nmsgid \"Edit status\"\nmsgstr \"\"\n\n#: modules/sportspress-gutenberg.php:88\nmsgid \"Properties\"\nmsgstr \"\"\n\n#: modules/sportspress-icons.php:191\nmsgid \"Image\"\nmsgstr \"\"\n\n#: modules/sportspress-lazy-loading.php:286\nmsgid \"Loading&hellip;\"\nmsgstr \"\"\n\n#: modules/sportspress-league-tables.php:77\nmsgid \"Add New League Table\"\nmsgstr \"\"\n\n#: modules/sportspress-league-tables.php:78\nmsgid \"Edit League Table\"\nmsgstr \"\"\n\n#: modules/sportspress-league-tables.php:80\nmsgid \"View League Table\"\nmsgstr \"\"\n\n#: modules/sportspress-league-tables.php:253\n#: modules/sportspress-player-lists.php:263\nmsgid \"Display title\"\nmsgstr \"\"\n\n#: modules/sportspress-league-tables.php:303\nmsgid \"Always increment\"\nmsgstr \"\"\n\n#: modules/sportspress-league-tables.php:310\nmsgid \"Tiebreaker\"\nmsgstr \"\"\n\n#: modules/sportspress-league-tables.php:316\nmsgid \"Head to head\"\nmsgstr \"\"\n\n#: modules/sportspress-next-team-preset.php:70\n#: modules/sportspress-next-team-preset.php:171\nmsgid \"Next Team\"\nmsgstr \"\"\n\n#: modules/sportspress-next-team-preset.php:172\nmsgid \"Filter by League\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:88 modules/sportspress-officials.php:104\n#: modules/sportspress-officials.php:586\nmsgid \"Duties\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:91\nmsgid \"Edit Duty\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:142 modules/sportspress-officials.php:201\nmsgid \"Official\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:143\nmsgid \"Add New Official\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:144\nmsgid \"Edit Official\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:146\nmsgid \"View Official\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:385\nmsgid \"Table\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:425\nmsgid \"SportsPress Officials (CSV)\"\nmsgstr \"\"\n\n#: modules/sportspress-officials.php:426\nmsgid \"Import <strong>officials</strong> from a csv file.\"\nmsgstr \"\"\n\n#: modules/sportspress-overview.php:57 modules/sportspress-overview.php:67\n#: modules/sportspress-tutorials.php:163\nmsgid \"Overview\"\nmsgstr \"\"\n\n#: modules/sportspress-player-lists.php:77\nmsgid \"Add New Player List\"\nmsgstr \"\"\n\n#: modules/sportspress-player-lists.php:78\nmsgid \"Edit Player List\"\nmsgstr \"\"\n\n#: modules/sportspress-player-lists.php:80\nmsgid \"View Player List\"\nmsgstr \"\"\n\n#: modules/sportspress-player-lists.php:271\nmsgid \"Display photos\"\nmsgstr \"\"\n\n#: modules/sportspress-styles.php:71\nmsgid \"Frontend Styles\"\nmsgstr \"\"\n\n#: modules/sportspress-template-selector.php:134\nmsgid \"Default Template\"\nmsgstr \"\"\n\n#: modules/sportspress-template-selector.php:139\nmsgid \"Template\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:81\nmsgid \"Get Started\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:84\nmsgid \"Installation\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:128\nmsgid \"Permalinks\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:156\nmsgid \"Player Ranking\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:162\nmsgid \"Demo Content\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:164\nmsgid \"User Roles\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:166\nmsgid \"Page not found\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:194\nmsgid \"Advanced\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:225\nmsgid \"Pop-out\"\nmsgstr \"\"\n\n#: modules/sportspress-tutorials.php:263\nmsgid \"Watch Tutorials\"\nmsgstr \"\"\n\n#: modules/sportspress-user-registration.php:66\nmsgid \"User Registration\"\nmsgstr \"\"\n\n#: modules/sportspress-user-registration.php:67\nmsgid \"Add name fields to signup form\"\nmsgstr \"\"\n\n#: modules/sportspress-user-registration.php:75\nmsgid \"Add a team name field to signup form\"\nmsgstr \"\"\n\n#: modules/sportspress-user-registration.php:83\nmsgid \"Add a team selector to signup form\"\nmsgstr \"\"\n\n#: modules/sportspress-user-registration.php:91\nmsgid \"Create player profiles for new users\"\nmsgstr \"\"\n\n#: modules/sportspress-user-registration.php:112\nmsgid \"First Name\"\nmsgstr \"\"\n\n#: modules/sportspress-user-registration.php:117\nmsgid \"Last Name\"\nmsgstr \"\"\n\n#: modules/sportspress-widget-alignment.php:112\n#: modules/sportspress-widget-alignment.php:146\n#, php-format\nmsgid \"Alignment: %s\"\nmsgstr \"\"\n\n#: modules/sportspress-wordpay.php:91\nmsgid \"There are no plans associated with the Team Manager role.\"\nmsgstr \"\"\n\n#: modules/sportspress-wordpay.php:117\nmsgid \"There are no plans associated with the Player role.\"\nmsgstr \"\"\n\n#: modules/sportspress-wordpay.php:158\nmsgid \"Team Name\"\nmsgstr \"\"\n\n#: modules/sportspress-wordpay.php:196\nmsgid \"Register Team\"\nmsgstr \"\"\n\n#: modules/sportspress-wordpay.php:197\nmsgid \"Register Player\"\nmsgstr \"\"\n\n#: modules/sportspress-wordpay.php:206\nmsgid \"Members\"\nmsgstr \"\"\n\n#: modules/sportspress-wordpay.php:212\nmsgid \"For:\"\nmsgstr \"\"\n\n#: sportspress.php:92 sportspress.php:101\nmsgid \"Cheatin&#8217; huh?\"\nmsgstr \"\"\n\n#: templates/event-blocks.php:258 templates/event-list.php:501\nmsgid \"N/A\"\nmsgstr \"\"\n\n#: templates/event-calendar.php:148 templates/event-calendar.php:181\n#: templates/event-calendar.php:194\n#, php-format\nmsgctxt \"calendar caption\"\nmsgid \"%1$s %2$s\"\nmsgstr \"\"\n\n#: templates/event-calendar.php:282\n#, php-format\nmsgid \"%s events\"\nmsgstr \"\"\n\n#: templates/team-gallery.php:155\nmsgid \"View all teams\"\nmsgstr \"\"\n"
  },
  {
    "path": "license.txt",
    "content": "SportsPress\n\nCopyright 2026 by the contributors\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n\nThis program incorporates work covered by the following copyright and\npermission notices:\n\n  The SportsPress code has been inspired by and partly adapted from the\n  beautifully coded WooCommerce plugin by WooThemes.\n\n  SportsPress includes icons from WebHostingHub Glyphs, released under the\n  SIL Open Font License; 80 Shades of White Icons by Victor Erixon; Entypo\n  and Entypo+ by Daniel Bruce, released under CC BY-SA 3.0; Font Awesome by\n  Dave Gancy, released under the GPL; Flaticon by Freepick, released under\n  CC BY 3.0. The custom designed icons included in SportsPress are released\n  under the GPL.\n\n  Wherever third party code has been used, credit has been given in the code's\n  comments.\n\nand\n\n  ThemeBoy\n\n  SportsPress is released under the GPL\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n  GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright © <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright © <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>."
  },
  {
    "path": "modules/sportspress-admin-bar.php",
    "content": "<?php\n/**\n * Admin Bar\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Admin_Bar' ) ) :\n\n\t/**\n\t * Main SportsPress Admin Bar Class\n\t *\n\t * @class SportsPress_Admin_Bar\n\t * @version 2.2\n\t */\n\tclass SportsPress_Admin_Bar {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_action( 'admin_bar_menu', array( $this, 'add_node' ), 40 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_ADMIN_BAR_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_ADMIN_BAR_VERSION', '2.2' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_ADMIN_BAR_URL' ) ) {\n\t\t\t\tdefine( 'SP_ADMIN_BAR_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_ADMIN_BAR_DIR' ) ) {\n\t\t\t\tdefine( 'SP_ADMIN_BAR_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add node to admin bar menu.\n\t\t */\n\t\tpublic function add_node( $wp_admin_bar ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'id'    => 'sportspress',\n\t\t\t\t'title' => esc_attr__( 'SportsPress', 'sportspress' ),\n\t\t\t\t'href'  => add_query_arg( 'page', 'sportspress', admin_url( 'admin.php' ) ),\n\t\t\t);\n\t\t\t$wp_admin_bar->add_node( $args );\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Admin_Bar();\n"
  },
  {
    "path": "modules/sportspress-birthdays.php",
    "content": "<?php\n/**\n * Birthdays\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.13\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Birthdays' ) ) :\n\n\t/**\n\t * Main SportsPress Birthdays Class\n\t *\n\t * @class SportsPress_Birthdays\n\t * @version 2.7.1\n\t */\n\tclass SportsPress_Birthdays {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_filter( 'gettext', array( $this, 'gettext' ), 20, 3 );\n\t\t\tadd_filter( 'sportspress_text', array( $this, 'add_text_options' ) );\n\t\t\tadd_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) );\n\t\t\tadd_filter( 'sportspress_staff_options', array( $this, 'add_staff_options' ) );\n\t\t\tadd_filter( 'sportspress_player_details', array( $this, 'add_player_details' ), 20, 2 );\n\t\t\tadd_filter( 'sportspress_staff_details', array( $this, 'add_staff_details' ), 20, 2 );\n\n\t\t\tadd_action( 'sportspress_widgets', array( $this, 'widgets' ) );\n\t\t\tadd_action( 'sportspress_list_general_columns', array( $this, 'columns' ), 10, 1 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_BIRTHDAYS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_BIRTHDAYS_VERSION', '2.7.1' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_BIRTHDAYS_URL' ) ) {\n\t\t\t\tdefine( 'SP_BIRTHDAYS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_BIRTHDAYS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_BIRTHDAYS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Text filter.\n\t\t */\n\t\tpublic function gettext( $translated_text, $untranslated_text, $domain ) {\n\t\t\tif ( ! is_admin() ) {\n\t\t\t\treturn $translated_text;\n\t\t\t}\n\n\t\t\tglobal $typenow;\n\n\t\t\tif ( 'default' == $domain && in_array( $typenow, array( 'sp_player', 'sp_staff', 'sp_official' ) ) ) :\n\t\t\t\tswitch ( $untranslated_text ) :\n\t\t\t\t\tcase 'Scheduled for: <b>%1$s</b>':\n\t\t\t\t\tcase 'Published on: <b>%1$s</b>':\n\t\t\t\t\tcase 'Schedule for: <b>%1$s</b>':\n\t\t\t\t\tcase 'Publish on: <b>%1$s</b>':\n\t\t\t\t\t\treturn wp_kses_post( __( 'Birthday: <b>%1$s</b>', 'sportspress' ) );\n\t\t\t\t\tcase 'Publish <b>immediately</b>':\n\t\t\t\t\t\treturn esc_attr__( 'Birthday', 'sportspress' );\n\t\t\t\t\tcase 'M j, Y @ G:i':\n\t\t\t\t\t\treturn 'M j, Y';\n\t\t\t\t\tcase '%1$s %2$s, %3$s @ %4$s : %5$s':\n\t\t\t\t\t\t$hour   = '<input type=\"hidden\" id=\"hh\" name=\"hh\" value=\"00\" readonly />';\n\t\t\t\t\t\t$minute = '<input type=\"hidden\" id=\"mn\" name=\"mn\" value=\"00\" readonly />';\n\t\t\t\t\t\treturn '%1$s %2$s, %3$s' . $hour . $minute;\n\t\t\t\tendswitch;\n\t\t\tendif;\n\n\t\t\treturn $translated_text;\n\t\t}\n\n\t\t/**\n\t\t * Add text options\n\t\t */\n\t\tpublic function add_text_options( $options = array() ) {\n\t\t\treturn array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\t__( 'Age', 'sportspress' ),\n\t\t\t\t\t__( 'Birthday', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add options to player settings page.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_player_options( $options ) {\n\t\t\t$options = array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'         => esc_attr__( 'Birthday', 'sportspress' ),\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Display birthday', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_player_show_birthday',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Display age', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_player_show_age',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn $options;\n\t\t}\n\n\t\t/**\n\t\t * Add options to staff settings page.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_staff_options( $options ) {\n\t\t\t$options = array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'         => esc_attr__( 'Birthday', 'sportspress' ),\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Display birthday', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_staff_show_birthday',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Display age', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_staff_show_age',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn $options;\n\t\t}\n\n\t\t/**\n\t\t * Add data to player details template.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_player_details( $data, $post_id ) {\n\t\t\tif ( 'yes' == get_option( 'sportspress_player_show_birthday', 'no' ) ) {\n\t\t\t\t$data[ esc_attr__( 'Birthday', 'sportspress' ) ] = get_the_date( get_option( 'date_format' ), $post_id );\n\t\t\t}\n\n\t\t\tif ( 'yes' == get_option( 'sportspress_player_show_age', 'no' ) ) {\n\t\t\t\t$data[ esc_attr__( 'Age', 'sportspress' ) ] = $this->get_age( get_the_date( 'm-d-Y', $post_id ) );\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\t/**\n\t\t * Add data to staff details template.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_staff_details( $data, $post_id ) {\n\t\t\tif ( 'yes' == get_option( 'sportspress_staff_show_birthday', 'no' ) ) {\n\t\t\t\t$data[ esc_attr__( 'Birthday', 'sportspress' ) ] = get_the_date( get_option( 'date_format' ), $post_id );\n\t\t\t}\n\n\t\t\tif ( 'yes' == get_option( 'sportspress_staff_show_age', 'no' ) ) {\n\t\t\t\t$data[ esc_attr__( 'Age', 'sportspress' ) ] = $this->get_age( get_the_date( 'm-d-Y', $post_id ) );\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\t/**\n\t\t * Register widgets\n\t\t */\n\t\tpublic static function widgets() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-birthdays.php';\n\t\t}\n\n\t\t/**\n\t\t * Add more General Columns at Player Lists\n\t\t */\n\t\tpublic static function columns( $selected ) {\n\t\t\t?>\n\t\t<li>\n\t\t\t<label class=\"selectit\">\n\t\t\t\t<input value=\"dob\" type=\"checkbox\" name=\"sp_columns[]\" id=\"sp_columns_dob\" <?php checked( in_array( 'dob', $selected ) ); ?>>\n\t\t\t\t<?php esc_attr_e( 'Date of Birth', 'sportspress' ); ?>\n\t\t\t</label>\n\t\t</li>\n\t\t<li>\n\t\t\t<label class=\"selectit\">\n\t\t\t\t<input value=\"age\" type=\"checkbox\" name=\"sp_columns[]\" id=\"sp_columns_age\" <?php checked( in_array( 'age', $selected ) ); ?>>\n\t\t\t\t<?php esc_attr_e( 'Age', 'sportspress' ); ?>\n\t\t\t</label>\n\t\t</li>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Get age from date.\n\t\t * Adapted from http://stackoverflow.com/questions/3776682/php-calculate-age.\n\t\t *\n\t\t * @return int\n\t\t */\n\t\tpublic static function get_age( $date ) {\n\t\t\t$date = explode( '-', $date );\n\t\t\t$age  = ( date( 'md', date( 'U', mktime( 0, 0, 0, $date[0], $date[1], $date[2] ) ) ) > date( 'md' )\n\t\t\t? ( ( date( 'Y' ) - $date[2] ) - 1 )\n\t\t\t: ( date( 'Y' ) - $date[2] ) );\n\t\t\treturn $age;\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Birthdays();\n"
  },
  {
    "path": "modules/sportspress-bulk-actions.php",
    "content": "<?php\n/**\n * Bulk Actions\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Bulk_Actions' ) ) :\n\n\t/**\n\t * Main SportsPress Bulk Actions Class\n\t *\n\t * @class SportsPress_Bulk_Actions\n\t * @version 2.7.6\n\t */\n\tclass SportsPress_Bulk_Actions {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Teams\n\t\t\tadd_filter( 'bulk_actions-edit-sp_team', array( $this, 'team_actions' ) );\n\t\t\tadd_filter( 'handle_bulk_actions-edit-sp_team', array( $this, 'team_actions_handler' ), 10, 3 );\n\n\t\t\t// Events\n\t\t\tadd_filter( 'bulk_actions-edit-sp_event', array( $this, 'event_actions' ) );\n\t\t\tadd_filter( 'handle_bulk_actions-edit-sp_event', array( $this, 'event_actions_handler' ), 10, 3 );\n\n\t\t\t// Notices\n\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_BULK_ACTIONS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_BULK_ACTIONS_VERSION', '2.7.6' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_BULK_ACTIONS_URL' ) ) {\n\t\t\t\tdefine( 'SP_BULK_ACTIONS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_BULK_ACTIONS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_BULK_ACTIONS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add option to the team bulk actions dropdown.\n\t\t */\n\t\tpublic function team_actions( $bulk_actions ) {\n\t\t\t$bulk_actions['sp_calendar'] = esc_attr__( 'Generate Calendars', 'sportspress' );\n\t\t\treturn $bulk_actions;\n\t\t}\n\n\t\t/**\n\t\t * Handle form submission for team bulk actions.\n\t\t */\n\t\tpublic function team_actions_handler( $redirect_to, $doaction, $post_ids ) {\n\t\t\tif ( $doaction !== 'sp_calendar' ) {\n\t\t\t\treturn $redirect_to;\n\t\t\t}\n\n\t\t\tforeach ( $post_ids as $post_id ) {\n\t\t\t\t$post                = array();\n\t\t\t\t$post['post_title']  = get_the_title( $post_id ) . ' ' . esc_attr__( 'Calendar', 'sportspress' );\n\t\t\t\t$post['post_type']   = 'sp_calendar';\n\t\t\t\t$post['post_status'] = 'publish';\n\n\t\t\t\t// Insert post\n\t\t\t\t$id = wp_insert_post( $post );\n\n\t\t\t\t// Flag as bulk\n\t\t\t\tupdate_post_meta( $id, '_sp_bulk', 1 );\n\n\t\t\t\t// Update meta\n\t\t\t\tupdate_post_meta( $id, 'sp_team', $post_id );\n\t\t\t\tupdate_post_meta( $id, 'sp_format', 'calendar' );\n\t\t\t}\n\n\t\t\t$redirect_to = add_query_arg( 'sp_bulk_generated_calendars', count( $post_ids ), $redirect_to );\n\t\t\treturn $redirect_to;\n\t\t}\n\n\t\t/**\n\t\t * Add option to the event bulk actions dropdown.\n\t\t */\n\t\tpublic function event_actions( $bulk_actions ) {\n\t\t\t$bulk_actions['sp_postpone'] = esc_attr__( 'Postpone events', 'sportspress' );\n\t\t\t$bulk_actions['sp_cancel']   = esc_attr__( 'Cancel events', 'sportspress' );\n\t\t\t$bulk_actions['sp_ok']       = esc_attr__( 'Set events as on time', 'sportspress' );\n\t\t\treturn $bulk_actions;\n\t\t}\n\n\t\t/**\n\t\t * Handle form submission for event bulk actions.\n\t\t */\n\t\tpublic function event_actions_handler( $redirect_to, $doaction, $post_ids ) {\n\t\t\tif ( ! in_array( $doaction, array( 'sp_postpone', 'sp_cancel', 'sp_ok' ) ) ) {\n\t\t\t\treturn $redirect_to;\n\t\t\t}\n\n\t\t\tif ( 'sp_postpone' == $doaction ) {\n\t\t\t\tforeach ( $post_ids as $post_id ) {\n\t\t\t\t\tupdate_post_meta( $post_id, 'sp_status', 'postponed' );\n\t\t\t\t}\n\t\t\t\t$redirect_to = add_query_arg( 'sp_bulk_postponed_events', count( $post_ids ), $redirect_to );\n\t\t\t} elseif ( 'sp_cancel' == $doaction ) {\n\t\t\t\tforeach ( $post_ids as $post_id ) {\n\t\t\t\t\tupdate_post_meta( $post_id, 'sp_status', 'cancelled' );\n\t\t\t\t}\n\t\t\t\t$redirect_to = add_query_arg( 'sp_bulk_cancelled_events', count( $post_ids ), $redirect_to );\n\t\t\t} elseif ( 'sp_ok' == $doaction ) {\n\t\t\t\tforeach ( $post_ids as $post_id ) {\n\t\t\t\t\tupdate_post_meta( $post_id, 'sp_status', 'ok' );\n\t\t\t\t}\n\t\t\t\t$redirect_to = add_query_arg( 'sp_bulk_ok_events', count( $post_ids ), $redirect_to );\n\t\t\t}\n\n\t\t\treturn $redirect_to;\n\t\t}\n\n\t\t/**\n\t\t * Display notices after form submission.\n\t\t */\n\t\tpublic function admin_notices() {\n\t\t\tif ( ! empty( $_REQUEST['sp_bulk_generated_calendars'] ) ) {\n\t\t\t\t$count = intval( $_REQUEST['sp_bulk_generated_calendars'] );\n\n\t\t\t\tprintf(\n\t\t\t\t\t'<div id=\"message\" class=\"updated notice notice-success is-dismissible\"><p>' .\n\t\t\t\t\tesc_attr( _n(\n\t\t\t\t\t\t'Generated %s calendar.',\n\t\t\t\t\t\t'Generated %s calendars.',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t) ) . ' <a href=\"' . esc_url( admin_url( 'edit.php?post_type=sp_calendar' ) ) . '\">' . esc_attr__( 'View', 'sportspress' ) . '</a></p><button type=\"button\" class=\"notice-dismiss\"><span class=\"screen-reader-text\">Dismiss this notice.</span></button></div>',\n\t\t\t\t\tesc_attr( $count )\n\t\t\t\t);\n\t\t\t} elseif ( ! empty( $_REQUEST['sp_bulk_postponed_events'] ) ) {\n\t\t\t\t$count = intval( $_REQUEST['sp_bulk_postponed_events'] );\n\n\t\t\t\tprintf(\n\t\t\t\t\t'<div id=\"message\" class=\"updated notice notice-success is-dismissible\"><p>' .\n\t\t\t\t\tesc_attr( _n(\n\t\t\t\t\t\t'Postponed %s event.',\n\t\t\t\t\t\t'Postponed %s events.',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t) ) . '</p><button type=\"button\" class=\"notice-dismiss\"><span class=\"screen-reader-text\">Dismiss this notice.</span></button></div>',\n\t\t\t\t\tesc_attr( $count )\n\t\t\t\t);\n\t\t\t} elseif ( ! empty( $_REQUEST['sp_bulk_cancelled_events'] ) ) {\n\t\t\t\t$count = intval( $_REQUEST['sp_bulk_cancelled_events'] );\n\n\t\t\t\tprintf(\n\t\t\t\t\t'<div id=\"message\" class=\"updated notice notice-success is-dismissible\"><p>' .\n\t\t\t\t\tesc_attr( _n(\n\t\t\t\t\t\t'Canceled %s event.',\n\t\t\t\t\t\t'Canceled %s events.',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t) ) . '</p><button type=\"button\" class=\"notice-dismiss\"><span class=\"screen-reader-text\">Dismiss this notice.</span></button></div>',\n\t\t\t\t\tesc_attr( $count )\n\t\t\t\t);\n\t\t\t} elseif ( ! empty( $_REQUEST['sp_bulk_ok_events'] ) ) {\n\t\t\t\t$count = intval( $_REQUEST['sp_bulk_ok_events'] );\n\n\t\t\t\tprintf(\n\t\t\t\t\t'<div id=\"message\" class=\"updated notice notice-success is-dismissible\"><p>' .\n\t\t\t\t\tesc_attr( _n(\n\t\t\t\t\t\t'Set %s event as on time.',\n\t\t\t\t\t\t'Set %s event as on time.',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t) ) . '</p><button type=\"button\" class=\"notice-dismiss\"><span class=\"screen-reader-text\">Dismiss this notice.</span></button></div>',\n\t\t\t\t\tesc_attr( $count )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Bulk_Actions();\n"
  },
  {
    "path": "modules/sportspress-calendars.php",
    "content": "<?php\n/**\n * Calendars\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Calendars' ) ) :\n\n\t/**\n\t * Main SportsPress Calendars Class\n\t *\n\t * @class SportsPress_Calendars\n\t * @version 2.6.15\n\t */\n\tclass SportsPress_Calendars {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'init', array( $this, 'register_post_type' ) );\n\t\t\tadd_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 );\n\t\t\tadd_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) );\n\t\t\tadd_action( 'sportspress_widgets', array( $this, 'include_widgets' ) );\n\t\t\tadd_action( 'sportspress_create_rest_routes', array( $this, 'create_rest_routes' ) );\n\t\t\tadd_action( 'sportspress_register_rest_fields', array( $this, 'register_rest_fields' ) );\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );\n\t\t\tadd_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) );\n\t\t\tadd_filter( 'sportspress_event_settings', array( $this, 'add_event_settings' ) );\n\t\t\tadd_filter( 'sportspress_team_options', array( $this, 'add_team_options' ) );\n\t\t\tadd_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 40 );\n\t\t\tadd_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) );\n\t\t\tadd_filter( 'sportspress_after_player_template', array( $this, 'add_player_template' ), 40 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_CALENDARS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_CALENDARS_VERSION', '2.6.15' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_CALENDARS_URL' ) ) {\n\t\t\t\tdefine( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_CALENDARS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_CALENDARS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Register calendars post type\n\t\t */\n\t\tpublic static function register_post_type() {\n\t\t\tregister_post_type(\n\t\t\t\t'sp_calendar',\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_register_post_type_calendar',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'labels'                => array(\n\t\t\t\t\t\t\t'name'               => esc_attr__( 'Calendars', 'sportspress' ),\n\t\t\t\t\t\t\t'singular_name'      => esc_attr__( 'Calendar', 'sportspress' ),\n\t\t\t\t\t\t\t'add_new_item'       => esc_attr__( 'Add New Calendar', 'sportspress' ),\n\t\t\t\t\t\t\t'edit_item'          => esc_attr__( 'Edit Calendar', 'sportspress' ),\n\t\t\t\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t\t'view_item'          => esc_attr__( 'View Calendar', 'sportspress' ),\n\t\t\t\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'public'                => true,\n\t\t\t\t\t\t'show_ui'               => true,\n\t\t\t\t\t\t'capability_type'       => 'sp_calendar',\n\t\t\t\t\t\t'map_meta_cap'          => true,\n\t\t\t\t\t\t'publicly_queryable'    => true,\n\t\t\t\t\t\t'exclude_from_search'   => false,\n\t\t\t\t\t\t'hierarchical'          => false,\n\t\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_calendar_slug', 'calendar' ) ),\n\t\t\t\t\t\t'supports'              => array( 'title', 'editor', 'author', 'thumbnail' ),\n\t\t\t\t\t\t'has_archive'           => false,\n\t\t\t\t\t\t'show_in_nav_menus'     => true,\n\t\t\t\t\t\t'show_in_menu'          => 'edit.php?post_type=sp_event',\n\t\t\t\t\t\t'show_in_admin_bar'     => true,\n\t\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t\t'rest_controller_class' => 'SP_REST_Posts_Controller',\n\t\t\t\t\t\t'rest_base'             => 'calendars',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Remove meta boxes.\n\t\t */\n\t\tpublic function remove_meta_boxes() {\n\t\t\tremove_meta_box( 'sp_seasondiv', 'sp_calendar', 'side' );\n\t\t\tremove_meta_box( 'sp_leaguediv', 'sp_calendar', 'side' );\n\t\t\tremove_meta_box( 'sp_venuediv', 'sp_calendar', 'side' );\n\t\t}\n\n\t\t/**\n\t\t * Conditonally load the class and functions only needed when viewing this post type.\n\t\t */\n\t\tpublic function include_post_type_handler() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-calendar.php';\n\t\t}\n\n\t\t/**\n\t\t * Add widgets.\n\t\t */\n\t\tpublic function include_widgets() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-event-calendar.php';\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-event-list.php';\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-event-blocks.php';\n\t\t}\n\n\t\t/**\n\t\t * Create REST API routes.\n\t\t */\n\t\tpublic function create_rest_routes() {\n\t\t\t$controller = new SP_REST_Posts_Controller( 'sp_calendar' );\n\t\t\t$controller->register_routes();\n\t\t}\n\n\t\t/**\n\t\t * Register REST API fields.\n\t\t */\n\t\tpublic function register_rest_fields() {\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_calendar',\n\t\t\t\t'format',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Layout', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_calendar',\n\t\t\t\t'data',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback' => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'schema'       => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add meta boxes to calendars.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_meta_boxes( $meta_boxes ) {\n\t\t\t$meta_boxes['sp_calendar'] = array(\n\t\t\t\t'shortcode' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Shortcode', 'sportspress' ),\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Calendar_Shortcode::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'feeds'     => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Feeds', 'sportspress' ),\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Calendar_Feeds::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'format'    => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Layout', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Calendar_Format::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Calendar_Format::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'columns'   => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Columns', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Calendar_Columns::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Calendar_Columns::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'details'   => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Calendar_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Calendar_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'data'      => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Calendar_Data::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Calendar_Data::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn $meta_boxes;\n\t\t}\n\n\t\t/**\n\t\t * Add shortcodes.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_shortcodes( $shortcodes ) {\n\t\t\t$shortcodes['event'][] = 'calendar';\n\t\t\t$shortcodes['event'][] = 'list';\n\t\t\t$shortcodes['event'][] = 'blocks';\n\t\t\treturn $shortcodes;\n\t\t}\n\n\t\t/**\n\t\t * Add event settings.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_event_settings( $settings ) {\n\t\t\t$settings = array_merge(\n\t\t\t\t$settings,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Event List', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'id'    => 'event_list_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_event_list_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display calendar title', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_list_show_title',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display logos', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_list_show_logos',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Title Format', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_list_title_format',\n\t\t\t\t\t\t\t'default' => 'title',\n\t\t\t\t\t\t\t'type'    => 'select',\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'title'    => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t\t\t\t'teams'    => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t\t\t'homeaway' => sprintf( '%s | %s', esc_attr__( 'Home', 'sportspress' ), esc_attr__( 'Away', 'sportspress' ) ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Time/Results Format', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_list_time_format',\n\t\t\t\t\t\t\t'default' => 'combined',\n\t\t\t\t\t\t\t'type'    => 'select',\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'combined' => esc_attr__( 'Combined', 'sportspress' ),\n\t\t\t\t\t\t\t\t'separate' => esc_attr__( 'Separate', 'sportspress' ),\n\t\t\t\t\t\t\t\t'time'     => esc_attr__( 'Time Only', 'sportspress' ),\n\t\t\t\t\t\t\t\t'results'  => esc_attr__( 'Results Only', 'sportspress' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Pagination', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Paginate', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_list_paginated',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'             => esc_attr__( 'Limit', 'sportspress' ),\n\t\t\t\t\t\t\t'id'                => 'sportspress_event_list_rows',\n\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t'default'           => '10',\n\t\t\t\t\t\t\t'desc'              => esc_attr__( 'events', 'sportspress' ),\n\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t'min'  => 1,\n\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'event_list_options',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Event Blocks', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'id'    => 'event_blocks_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_event_blocks_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display calendar title', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_blocks_show_title',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display logos', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_blocks_show_logos',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'         => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Display league', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_event_blocks_show_league',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Display season', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_event_blocks_show_season',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Display matchday', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_event_blocks_show_matchday',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Display venue', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_event_blocks_show_venue',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Pagination', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Paginate', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_event_blocks_paginated',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'             => esc_attr__( 'Limit', 'sportspress' ),\n\t\t\t\t\t\t\t'id'                => 'sportspress_event_blocks_rows',\n\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t'default'           => '5',\n\t\t\t\t\t\t\t'desc'              => esc_attr__( 'events', 'sportspress' ),\n\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t'min'  => 1,\n\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'event_list_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn $settings;\n\t\t}\n\n\t\t/**\n\t\t * Add team options.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_team_options( $options ) {\n\t\t\treturn array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t\t'id'      => 'sportspress_team_events_format',\n\t\t\t\t\t\t'default' => 'title',\n\t\t\t\t\t\t'type'    => 'select',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'blocks'   => esc_attr__( 'Blocks', 'sportspress' ),\n\t\t\t\t\t\t\t'calendar' => esc_attr__( 'Calendar', 'sportspress' ),\n\t\t\t\t\t\t\t'list'     => esc_attr__( 'List', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add player template.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_player_template( $templates ) {\n\t\t\treturn array_merge(\n\t\t\t\t$templates,\n\t\t\t\tarray(\n\t\t\t\t\t'events' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_player_show_events',\n\t\t\t\t\t\t'action'  => 'sportspress_output_player_events',\n\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add player options.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_player_options( $options ) {\n\t\t\treturn array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t\t'id'      => 'sportspress_player_events_format',\n\t\t\t\t\t\t'default' => 'title',\n\t\t\t\t\t\t'type'    => 'select',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'blocks'   => esc_attr__( 'Blocks', 'sportspress' ),\n\t\t\t\t\t\t\t'calendar' => esc_attr__( 'Calendar', 'sportspress' ),\n\t\t\t\t\t\t\t'list'     => esc_attr__( 'List', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add team template.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_team_template( $templates ) {\n\t\t\treturn array_merge(\n\t\t\t\t$templates,\n\t\t\t\tarray(\n\t\t\t\t\t'events' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Events', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_team_show_events',\n\t\t\t\t\t\t'action'  => 'sportspress_output_team_events',\n\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\nendif;\n\nif ( get_option( 'sportspress_load_calendars_module', 'yes' ) == 'yes' ) {\n\tnew SportsPress_Calendars();\n}\n"
  },
  {
    "path": "modules/sportspress-comments-scheduled-events.php",
    "content": "<?php\n/**\n * Comments Scheduled Events\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.13\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Comments_Scheduled_Events' ) ) :\n\t/**\n\t * Main SportsPress Comments Scheduled Events Class\n\t *\n\t * @class SportsPress_Comments_Scheduled_Events\n\t * @version 2.6.8\n\t */\n\tclass SportsPress_Comments_Scheduled_Events {\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'comment_on_draft', array( $this, 'sp_publish_comment' ) );\n\n\t\t}\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_COMMENTS_SCHEDULED_EVENTS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_COMMENTS_SCHEDULED_EVENTS_VERSION', '2.6.8' );\n\t\t\t}\n\t\t\tif ( ! defined( 'SP_COMMENTS_SCHEDULED_EVENTS_URL' ) ) {\n\t\t\t\tdefine( 'SP_COMMENTS_SCHEDULED_EVENTS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\t\t\tif ( ! defined( 'SP_COMMENTS_SCHEDULED_EVENTS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_COMMENTS_SCHEDULED_EVENTS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Save Additional Statistics\n\t\t */\n\t\tpublic function sp_publish_comment( $comment_post_ID ) {\n\n\t\t\tdo_action( 'pre_comment_on_post', $comment_post_ID );\n\n\t\t\t$comment_author       = ( isset( $_POST['author'] ) ) ? trim( strip_tags( sanitize_text_field( wp_unslash( $_POST['author'] ) ) ) ) : null;\n\t\t\t$comment_author_email = ( isset( $_POST['email'] ) ) ? trim( sanitize_email( wp_unslash( $_POST['email'] ) ) ) : null;\n\t\t\t$comment_author_url   = ( isset( $_POST['url'] ) ) ? trim( sanitize_url( wp_unslash( $_POST['url'] ) ) ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized\n\t\t\t$comment_content      = ( isset( $_POST['comment'] ) ) ? trim( sanitize_text_field( wp_unslash( $_POST['comment'] ) ) ) : null;\n\n\t\t\t// If the user is logged in\n\t\t\t$user = wp_get_current_user();\n\t\t\tif ( $user->exists() ) {\n\t\t\t\tif ( empty( $user->display_name ) ) {\n\t\t\t\t\t$user->display_name = $user->user_login;\n\t\t\t\t}\n\t\t\t\t$comment_author       = $user->display_name;\n\t\t\t\t$comment_author_email = $user->user_email;\n\t\t\t\t$comment_author_url   = $user->user_url;\n\t\t\t\t$user_ID              = $user->ID;\n\t\t\t\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\t\t\t\tif ( ! isset( $comment_data['_wp_unfiltered_html_comment'] )\n\t\t\t\t\t|| ! wp_verify_nonce( $comment_data['_wp_unfiltered_html_comment'], 'unfiltered-html-comment_' . $comment_post_ID )\n\t\t\t\t\t) {\n\t\t\t\t\t\tkses_remove_filters(); // start with a clean slate\n\t\t\t\t\t\tkses_init_filters(); // set up the filters\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( get_option( 'comment_registration' ) ) {\n\t\t\t\t\treturn new WP_Error( 'not_logged_in', esc_attr__( 'Sorry, you must be logged in to comment.' ), 403 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$comment_type = '';\n\n\t\t\tif ( get_option( 'require_name_email' ) && ! $user->exists() ) {\n\t\t\t\tif ( '' == $comment_author_email || '' == $comment_author ) {\n\t\t\t\t\t// return new WP_Error( 'require_name_email', esc_attr__( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 );\n\t\t\t\t\twp_die( wp_kses_post( __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ) ), esc_attr__( 'ERROR: please fill the required fields (name, email).' ), array( 'back_link' => true ) );\n\t\t\t\t} elseif ( ! is_email( $comment_author_email ) ) {\n\t\t\t\t\t// return new WP_Error( 'require_valid_email', esc_attr__( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 );\n\t\t\t\t\twp_die( wp_kses_post( __( '<strong>ERROR</strong>: please enter a valid email address.' ) ), esc_attr__( 'ERROR: please enter a valid email address.' ), array( 'back_link' => true ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( '' == $comment_content ) {\n\t\t\t\t// return new WP_Error( 'require_valid_comment', esc_attr__( '<strong>ERROR</strong>: please type a comment.' ), 200 );\n\t\t\t\twp_die( wp_kses_post( __( '<strong>ERROR</strong>: please type a comment.' ) ), esc_attr__( 'ERROR: please type a comment.' ), array( 'back_link' => true ) );\n\t\t\t}\n\n\t\t\t$comment_parent = isset( $_POST['comment_parent'] ) ? absint( $_POST['comment_parent'] ) : 0;\n\n\t\t\t$commentdata = compact(\n\t\t\t\t'comment_post_ID',\n\t\t\t\t'comment_author',\n\t\t\t\t'comment_author_email',\n\t\t\t\t'comment_author_url',\n\t\t\t\t'comment_content',\n\t\t\t\t'comment_type',\n\t\t\t\t'comment_parent',\n\t\t\t\t'user_ID'\n\t\t\t);\n\n\t\t\t$check_max_lengths = wp_check_comment_data_max_lengths( $commentdata );\n\t\t\tif ( is_wp_error( $check_max_lengths ) ) {\n\t\t\t\treturn $check_max_lengths;\n\t\t\t}\n\n\t\t\t$comment_id = wp_new_comment( wp_slash( $commentdata ), true );\n\t\t\tif ( is_wp_error( $comment_id ) ) {\n\t\t\t\treturn $comment_id;\n\t\t\t}\n\n\t\t\tif ( ! $comment_id ) {\n\t\t\t\t// return new WP_Error( 'comment_save_error', esc_attr__( '<strong>ERROR</strong>: The comment could not be saved. Please try again later.' ), 500 );\n\t\t\t\twp_die( wp_kses_post( __( '<strong>ERROR</strong>: The comment could not be saved. Please try again later.' ) ), esc_attr__( 'ERROR: The comment could not be saved. Please try again later.' ), array( 'back_link' => true ) );\n\t\t\t}\n\n\t\t\t$comment = get_comment( $comment_id );\n\n\t\t\tdo_action( 'set_comment_cookies', $comment, $user );\n\n\t\t\tif ( $user->exists() ) {\n\t\t\t\twp_set_comment_status( $comment_id, 'approve' );\n\t\t\t}\n\n\t\t\t$location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment_id ) : sanitize_url( wp_unslash( $_POST['redirect_to'] ) ) . '#comment-' . $comment_id; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized\n\n\t\t\t$location = apply_filters( 'comment_post_redirect', $location, $comment );\n\n\t\t\twp_safe_redirect( $location );\n\t\t\texit;\n\t\t}\n\n\n\t}\nendif;\n\nnew SportsPress_Comments_Scheduled_Events();\n"
  },
  {
    "path": "modules/sportspress-conditional-equations.php",
    "content": "<?php\n/**\n * Conditional Equations\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.23\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Conditional_Equations' ) ) :\n\n\t/**\n\t * Main SportsPress Conditional Equations Class\n\t *\n\t * @class SportsPress_Conditional_Equations\n\t * @version 2.7.23\n\t */\n\n\tclass SportsPress_Conditional_Equations {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Add hooks for filters\n\t\t\tadd_filter( 'sportspress_equation_options', array( $this, 'add_options' ) );\n\t\t\tadd_filter( 'sportspress_equation_alter', array( $this, 'alter_equation' ), 10, 2 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_CONDITIONAL_EQUATIONS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_CONDITIONAL_EQUATIONS_VERSION', '2.7.23' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_CONDITIONAL_EQUATIONS_URL' ) ) {\n\t\t\t\tdefine( 'SP_CONDITIONAL_EQUATIONS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_CONDITIONAL_EQUATIONS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_CONDITIONAL_EQUATIONS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add additional options.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_options( $options ) {\n\t\t\t$options['Operators']['>']  = '&gt;';\n\t\t\t$options['Operators']['<']  = '&lt;';\n\t\t\t$options['Operators']['=='] = '&equiv;';\n\t\t\t$options['Operators']['!='] = '&ne;';\n\t\t\t$options['Operators']['>='] = '&ge;';\n\t\t\t$options['Operators']['<='] = '&le;';\n\t\t\treturn $options;\n\t\t}\n\n\t\t/**\n\t\t * Alter the equation.\n\t\t *\n\t\t * @param string $equation The equation to alter.\n\t\t * @param array  $vars     Variables to use in the equation.\n\t\t * @return string\n\t\t */\n\t\tpublic function alter_equation( $equation, $vars ) {\n\t\t\t// Check if the equation contains any conditional operators\n\t\t\tif ( ! preg_match( '/[><=!]/', $equation ) ) {\n\t\t\t\t// If no conditional operators, return the equation as-is\n\t\t\t\treturn $equation;\n\t\t\t}\n\t\t\t// Replace all variables in the equation with their values\n\t\t\tforeach ( $vars as $var_name => $var_value ) {\n\t\t\t\tif ( is_null( $var_value ) || $var_value === '' ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\n\t\t\t\tif ( is_array( $var_value ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\n\t\t\t\t$var_value = (string) $var_value;\n\t\t\t\t$equation = str_replace( '$' . $var_name, $var_value, $equation );\n\t\t\t}\n\t\t\n\t\t\t// Remove spaces from the equation\n\t\t\t$equation = str_replace( ' ', '', $equation );\n\t\t\n\t\t\t// Evaluate sub-expressions in parentheses first\n\t\t\twhile ( preg_match( '/\\(([^()]+)\\)/', $equation, $matches ) ) {\n\t\t\t\t$sub_expr = $matches[1]; // Extract the innermost sub-expression\n\t\t\n\t\t\t\t// Check for conditional operators in the sub-expression\n\t\t\t\tif ( preg_match( '/[><=!]/', $sub_expr ) ) {\n\t\t\t\t\t$evaluated = $this->evaluate_condition( $sub_expr ); // Evaluate the condition\n\t\t\t\t} else {\n\t\t\t\t\t$evaluated = $this->evaluate_expression( $sub_expr ); // Evaluate as a mathematical expression\n\t\t\t\t}\n\t\t\n\t\t\t\t// Replace the sub-expression with its evaluated value\n\t\t\t\t$equation = str_replace( '(' . $sub_expr . ')', $evaluated, $equation );\n\t\t\t}\n\t\t\n\t\t\t// Evaluate the fully reduced equation as a mathematical expression\n\t\t\treturn $this->evaluate_expression( $equation );\n\t\t}\n\t\t\n\t\t/**\n\t\t * Evaluate a conditional expression (e.g., \"20 > 10\").\n\t\t *\n\t\t * @param string $expression The conditional expression to evaluate.\n\t\t * @return int 1 for true, 0 for false.\n\t\t */\n\t\tprivate function evaluate_condition( $expression ) {\n\t\t\ttry {\n\t\t\t\t// Parse the condition into left operand, operator, and right operand\n\t\t\t\tpreg_match( '/(.+?)([><=!]+)(.+)/', $expression, $matches );\n\t\t\t\t$left_operand  = $this->evaluate_expression( trim( $matches[1] ) );\n\t\t\t\t$operator      = $matches[2];\n\t\t\t\t$right_operand = $this->evaluate_expression( trim( $matches[3] ) );\n\t\t\n\t\t\t\t// Evaluate the condition\n\t\t\t\tswitch ( $operator ) {\n\t\t\t\t\tcase '>':\n\t\t\t\t\t\treturn (int) ( $left_operand > $right_operand );\n\t\t\t\t\tcase '<':\n\t\t\t\t\t\treturn (int) ( $left_operand < $right_operand );\n\t\t\t\t\tcase '>=':\n\t\t\t\t\t\treturn (int) ( $left_operand >= $right_operand );\n\t\t\t\t\tcase '<=':\n\t\t\t\t\t\treturn (int) ( $left_operand <= $right_operand );\n\t\t\t\t\tcase '==':\n\t\t\t\t\t\treturn (int) ( $left_operand == $right_operand );\n\t\t\t\t\tcase '!=':\n\t\t\t\t\t\treturn (int) ( $left_operand != $right_operand );\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Evaluate a mathematical expression safely.\n\t\t *\n\t\t * @param string $expression The expression to evaluate.\n\t\t * @return float The result of the evaluation.\n\t\t */\n\t\tprivate function evaluate_expression( $expression ) {\n\t\t\ttry {\n\t\t\t\t// Include libraries if necessary (e.g., eqEOS)\n\t\t\t\tif ( ! class_exists( 'phpStack' ) ) {\n\t\t\t\t\tinclude_once SP()->plugin_path() . '/includes/libraries/class-phpstack.php';\n\t\t\t\t}\n\t\t\t\tif ( ! class_exists( 'eqEOS' ) ) {\n\t\t\t\t\tinclude_once SP()->plugin_path() . '/includes/libraries/class-eqeos.php';\n\t\t\t\t}\n\t\t\n\t\t\t\t// Use eqEOS to safely evaluate the expression\n\t\t\t\t$eos = new eqEOS();\n\t\t\t\treturn $eos->solveIF( $expression );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Conditional_Equations();\n"
  },
  {
    "path": "modules/sportspress-countdowns.php",
    "content": "<?php\n/**\n * Countdowns\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Countdowns' ) ) :\n\n\t/**\n\t * Main SportsPress Countdowns Class\n\t *\n\t * @class SportsPress_Countdowns\n\t * @version 2.7\n\t */\n\tclass SportsPress_Countdowns {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'sportspress_widgets', array( $this, 'include_widgets' ) );\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) );\n\t\t\tadd_filter( 'sportspress_event_settings', array( $this, 'add_settings' ) );\n\t\t\tadd_filter( 'sportspress_text', array( $this, 'add_text_options' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_COUNTDOWNS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_COUNTDOWNS_VERSION', '2.7' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_COUNTDOWNS_URL' ) ) {\n\t\t\t\tdefine( 'SP_COUNTDOWNS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_COUNTDOWNS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_COUNTDOWNS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add widgets.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function include_widgets() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-countdown.php';\n\t\t}\n\n\t\t/**\n\t\t * Add shortcodes.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_shortcodes( $shortcodes ) {\n\t\t\t$shortcodes['event'][] = 'countdown';\n\t\t\treturn $shortcodes;\n\t\t}\n\n\t\t/**\n\t\t * Add settings.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_settings( $settings ) {\n\t\t\t$settings = array_merge(\n\t\t\t\t$settings,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Countdown', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'id'    => 'countdown_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_countdown_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'         => esc_attr__( 'Display', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Logos', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_countdown_show_logos',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Featured Image', 'sportspress' ),\n\t\t\t\t\t\t\t'id'            => 'sportspress_countdown_show_thumbnail',\n\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'countdown_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn $settings;\n\t\t}\n\n\t\t/**\n\t\t * Add text options\n\t\t */\n\t\tpublic function add_text_options( $options = array() ) {\n\t\t\treturn array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\t__( 'days', 'sportspress' ),\n\t\t\t\t\t__( 'hrs', 'sportspress' ),\n\t\t\t\t\t__( 'mins', 'sportspress' ),\n\t\t\t\t\t__( 'secs', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Countdowns();\n"
  },
  {
    "path": "modules/sportspress-default-nationality.php",
    "content": "<?php\n/**\n * Default Nationality\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Default_Nationality' ) ) :\n\n\t/**\n\t * Main SportsPress Default Nationality Class\n\t *\n\t * @class SportsPress_Default_Nationality\n\t * @version 2.6.18\n\t */\n\tclass SportsPress_Default_Nationality {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_filter( 'sportspress_general_options', array( $this, 'add_general_options' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_DEFAULT_NATIONALITY_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_DEFAULT_NATIONALITY_VERSION', '2.6.18' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_DEFAULT_NATIONALITY_URL' ) ) {\n\t\t\t\tdefine( 'SP_DEFAULT_NATIONALITY_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_DEFAULT_NATIONALITY_DIR' ) ) {\n\t\t\t\tdefine( 'SP_DEFAULT_NATIONALITY_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add option to SportsPress General Settings.\n\t\t */\n\t\tpublic function add_general_options( $settings ) {\n\t\t\t$countries[''] = esc_attr__( '&mdash; None &mdash;', 'sportspress' );\n\t\t\t$sp_countries  = new SP_Countries();\n\t\t\t$countries     = array_merge( $countries, $sp_countries->countries );\n\n\t\t\t$settings[] = array(\n\t\t\t\t'title'   => esc_attr__( 'Default Nationality', 'sportspress' ),\n\t\t\t\t'id'      => 'sportspress_default_nationality',\n\t\t\t\t'default' => '',\n\t\t\t\t'type'    => 'select',\n\t\t\t\t'options' => $countries,\n\t\t\t);\n\t\t\treturn $settings;\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Default_Nationality();\n"
  },
  {
    "path": "modules/sportspress-event-specs.php",
    "content": "<?php\n/**\n * Event Specs\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Event_Specs' ) ) :\n\n\t/**\n\t * Main SportsPress Event Specs Class\n\t *\n\t * @class SportsPress_Event_Specs\n\t * @version 2.6.15\n\t */\n\tclass SportsPress_Event_Specs {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'init', array( $this, 'register_post_type' ) );\n\t\t\tadd_action( 'sportspress_config_page', array( $this, 'sp_specs_config' ), 9 );\n\t\t\tadd_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) );\n\t\t\tadd_action( 'sportspress_event_list_head_row', array( $this, 'event_list_head_row' ), 11 );\n\t\t\tadd_action( 'sportspress_event_list_row', array( $this, 'event_list_row' ), 11, 2 );\n\t\t\tadd_action( 'sportspress_event_blocks_after', array( $this, 'event_blocks_after' ), 11, 2 );\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );\n\t\t\tadd_filter( 'sportspress_screen_ids', array( $this, 'screen_ids' ) );\n\t\t\tadd_filter( 'sportspress_config_types', array( $this, 'add_post_type' ) );\n\t\t\tadd_filter( 'sportspress_event_details', array( $this, 'event_details' ), 10, 2 );\n\t\t\tadd_filter( 'sportspress_calendar_columns', array( $this, 'calendar_columns' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_EVENT_SPECS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_SPECS_VERSION', '2.6.15' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_EVENT_SPECS_URL' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_SPECS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_EVENT_SPECS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_SPECS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Register event specs post type\n\t\t */\n\t\tpublic static function register_post_type() {\n\t\t\tregister_post_type(\n\t\t\t\t'sp_spec',\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_register_post_type_spec',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'labels'              => array(\n\t\t\t\t\t\t\t'name'               => esc_attr__( 'Event Specs', 'sportspress' ),\n\t\t\t\t\t\t\t'singular_name'      => esc_attr__( 'Event Spec', 'sportspress' ),\n\t\t\t\t\t\t\t'add_new_item'       => esc_attr__( 'Add New Event Spec', 'sportspress' ),\n\t\t\t\t\t\t\t'edit_item'          => esc_attr__( 'Edit Event Spec', 'sportspress' ),\n\t\t\t\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t\t'view_item'          => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'public'              => false,\n\t\t\t\t\t\t'show_ui'             => true,\n\t\t\t\t\t\t'capability_type'     => 'sp_config',\n\t\t\t\t\t\t'map_meta_cap'        => true,\n\t\t\t\t\t\t'publicly_queryable'  => false,\n\t\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t\t'hierarchical'        => false,\n\t\t\t\t\t\t'supports'            => array( 'title', 'page-attributes', 'excerpt' ),\n\t\t\t\t\t\t'has_archive'         => false,\n\t\t\t\t\t\t'show_in_nav_menus'   => false,\n\t\t\t\t\t\t'can_export'          => false,\n\t\t\t\t\t\t'show_in_menu'        => false,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add screen ids.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function screen_ids( $ids ) {\n\t\t\treturn array_merge(\n\t\t\t\t$ids,\n\t\t\t\tarray(\n\t\t\t\t\t'edit-sp_spec',\n\t\t\t\t\t'sp_spec',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tpublic static function add_post_type( $post_types = array() ) {\n\t\t\t$post_types[] = 'sp_spec';\n\t\t\treturn $post_types;\n\t\t}\n\n\t\t/**\n\t\t * Conditonally load the class and functions only needed when viewing this post type.\n\t\t */\n\t\tpublic function include_post_type_handler() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-spec.php';\n\t\t}\n\n\t\t/**\n\t\t * Display Event Specs Table at Config Page\n\t\t *\n\t\t * @return null\n\t\t */\n\t\tpublic function sp_specs_config() {\n\t\t\t?>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'sp_spec',\n\t\t\t\t'numberposts'    => -1,\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'orderby'        => 'menu_order',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t);\n\t\t\t$data = get_posts( $args );\n\t\t\t?>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<?php esc_attr_e( 'Event Specs', 'sportspress' ); ?>\n\t\t\t\t\t<p class=\"description\"><?php esc_attr_e( 'Add more details to an event.', 'sportspress' ); ?></p>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"forminp\">\n\t\t\t\t\t<table class=\"widefat sp-admin-config-table\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_attr_e( 'Label', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_attr_e( 'Variable', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\"><?php esc_attr_e( 'Description', 'sportspress' ); ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"col\" class=\"edit\"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $data ) :\n\t\t\t\t\t\t\t$i = 0; foreach ( $data as $row ) :\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $i % 2 == 0 ) {\n\t\t\t\t\t\t\t\t\techo ' class=\"alternate\"';}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<td class=\"row-title\"><?php echo wp_kses_post( $row->post_title ); ?></td>\n\t\t\t\t\t\t\t\t<td><code><?php echo wp_kses_post( $row->post_name ); ?></code></td>\n\t\t\t\t\t\t\t\t<td><p class=\"description\"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>\n\t\t\t\t\t\t\t\t<td class=\"edit\"><a class=\"button\" href=\"<?php echo esc_url( get_edit_post_link( $row->ID ) ); ?>\"><?php esc_attr_e( 'Edit', 'sportspress' ); ?></s></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\nendforeach; else :\n\t?>\n\t\t\t\t\t\t\t<tr class=\"alternate\">\n\t\t\t\t\t\t\t\t<td colspan=\"4\"><?php esc_attr_e( 'No results found.', 'sportspress' ); ?></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</table>\n\t\t\t\t\t<div class=\"tablenav bottom\">\n\t\t\t\t\t\t<a class=\"button alignleft\" href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=sp_spec' ) ); ?>\"><?php esc_attr_e( 'View All', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<a class=\"button button-primary alignright\" href=\"<?php echo esc_url( admin_url( 'post-new.php?post_type=sp_spec' ) ); ?>\"><?php esc_attr_e( 'Add New', 'sportspress' ); ?></a>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Add meta boxes.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_meta_boxes( $meta_boxes ) {\n\t\t\t$meta_boxes['sp_spec']           = array(\n\t\t\t\t'details' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Specs', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Spec_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Spec_Details::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t);\n\t\t\t$meta_boxes['sp_event']['specs'] = array(\n\t\t\t\t'title'    => esc_attr__( 'Specs', 'sportspress' ),\n\t\t\t\t'save'     => 'SP_Meta_Box_Event_Specs::save',\n\t\t\t\t'output'   => 'SP_Meta_Box_Event_Specs::output',\n\t\t\t\t'context'  => 'side',\n\t\t\t\t'priority' => 'default',\n\t\t\t);\n\t\t\treturn $meta_boxes;\n\t\t}\n\n\t\t/**\n\t\t * Add event details.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function event_details( $data, $id ) {\n\n\t\t\t$event = new SP_Event( $id );\n\n\t\t\t$specs_before = $event->specs( true );\n\t\t\t$specs_after  = $event->specs( false );\n\n\t\t\t$data = array_merge( $specs_before, $data, $specs_after );\n\n\t\t\treturn $data;\n\t\t}\n\n\t\t/**\n\t\t * Add calendar columns.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function calendar_columns( $columns = array() ) {\n\t\t\t$columns['event_specs'] = esc_attr__( 'Event Specs', 'sportspress' );\n\t\t\treturn $columns;\n\t\t}\n\n\t\t/**\n\t\t * Event list head row.\n\t\t */\n\t\tpublic function event_list_head_row( $usecolumns = array() ) {\n\t\t\tif ( sp_column_active( $usecolumns, 'event_specs' ) ) {\n\t\t\t\t$spec_labels = (array) sp_get_var_labels( 'sp_spec', null, false );\n\n\t\t\t\tif ( empty( $spec_labels ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tforeach ( $spec_labels as $spec_label ) {\n\t\t\t\t\t?>\n\t\t\t\t<th class=\"data-specs\">\n\t\t\t\t\t<?php echo wp_kses_post( $spec_label ); ?>\n\t\t\t\t</th>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Event list row.\n\t\t */\n\t\tpublic function event_list_row( $event, $usecolumns = array() ) {\n\t\t\tif ( sp_column_active( $usecolumns, 'event_specs' ) ) {\n\t\t\t\t$event       = new SP_Event( $event );\n\t\t\t\t$specs       = $event->specs( false );\n\t\t\t\t$spec_labels = (array) sp_get_var_labels( 'sp_spec', null, false );\n\n\t\t\t\tforeach ( $spec_labels as $spec_label ) {\n\t\t\t\t\t?>\n\t\t\t\t<td class=\"data-spec\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( isset( $specs[ $spec_label ] ) ) {\n\t\t\t\t\t\techo wp_kses_post( $specs[ $spec_label ] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '-';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add Event Specs after default template of Event blocks is loaded.\n\t\t */\n\t\tpublic function event_blocks_after( $event, $usecolumns = array() ) {\n\t\t\tif ( sp_column_active( $usecolumns, 'event_specs' ) ) {\n\t\t\t\t$event       = new SP_Event( $event );\n\t\t\t\t$specs       = $event->specs( false );\n\t\t\t\t$spec_labels = (array) sp_get_var_labels( 'sp_spec', null, false );\n\t\t\t\tforeach ( $specs as $spec_label => $spec_value ) {\n\t\t\t\t\techo '<div class=\"sp_event_spec\"><span class=\"sp_event_spec_label\">' . wp_kses_post( $spec_label ) . ':</span><span class=\"sp_event_spec_value\"> ' . wp_kses_post( $spec_value ) . '</span></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Event_Specs();\n"
  },
  {
    "path": "modules/sportspress-event-status.php",
    "content": "<?php\n/**\n * Event Status\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Event_Status' ) ) :\n\n\t/**\n\t * Main SportsPress Event Status Class\n\t *\n\t * @class SportsPress_Event_Status\n\t * @version 2.1\n\t */\n\tclass SportsPress_Event_Status {\n\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\tpublic $statuses = array();\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_action( 'init', array( $this, 'get_statuses' ) );\n\t\t\tadd_action( 'post_submitbox_misc_actions', array( $this, 'section' ) );\n\t\t\tadd_action( 'sportspress_process_sp_event_meta', array( $this, 'save' ), 10, 1 );\n\t\t\tadd_filter( 'sportspress_event_time', array( $this, 'filter' ), 10, 2 );\n\t\t\tadd_filter( 'sportspress_event_time_admin', array( $this, 'filter' ), 10, 2 );\n\t\t\tadd_filter( 'sportspress_main_results_or_time', array( $this, 'filter_array' ), 10, 2 );\n\t\t\tadd_filter( 'sportspress_event_blocks_team_result_or_time', array( $this, 'filter_array' ), 10, 2 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_EVENT_STATUS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_STATUS_VERSION', '2.1' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_EVENT_STATUS_URL' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_STATUS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_EVENT_STATUS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_STATUS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Define statuses.\n\t\t */\n\t\tpublic function get_statuses() {\n\t\t\t$this->statuses = apply_filters(\n\t\t\t\t'sportspress_event_statuses',\n\t\t\t\tarray(\n\t\t\t\t\t'ok'        => esc_attr__( 'On time', 'sportspress' ),\n\t\t\t\t\t'tbd'       => esc_attr__( 'TBD', 'sportspress' ),\n\t\t\t\t\t'postponed' => esc_attr__( 'Postponed', 'sportspress' ),\n\t\t\t\t\t'cancelled' => esc_attr__( 'Canceled', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add status section to submit box.\n\t\t */\n\t\tpublic function section() {\n\t\t\tif ( 'sp_event' !== get_post_type() ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$status = get_post_meta( get_the_ID(), 'sp_status', true );\n\t\t\tif ( ! $status ) {\n\t\t\t\t$status = 'ok';\n\t\t\t}\n\t\t\t?>\n\t\t<div class=\"misc-pub-section sp-pub-event-status\">\n\t\t\t<span class=\"sp-event-status\"><?php esc_attr_e( 'Time:', 'sportspress' ); ?> <strong class=\"sp-event-status-display\" data-sp-event-status=\"<?php echo esc_attr( $status ); ?>\"><?php echo wp_kses_post( $this->statuses[ $status ] ); ?></strong></span>\n\t\t\t<a href=\"#\" class=\"sp-edit-event-status hide-if-no-js\"><span aria-hidden=\"true\"><?php esc_attr_e( 'Edit', 'sportspress' ); ?></span> <span class=\"screen-reader-text\"><?php esc_attr_e( 'Edit status' ); ?></span></a>\n\t\t\t<div class=\"sp-event-status-select hide-if-js\">\n\t\t\t\t<?php foreach ( $this->statuses as $value => $label ) { ?>\n\t\t\t\t\t<label><input type=\"radio\" name=\"sp_status\" value=\"<?php echo esc_attr( $value ); ?>\" data-sp-event-status=\"<?php echo esc_attr( $label ); ?>\" <?php checked( $status, $value ); ?>> <?php echo wp_kses_post( $label ); ?></label><br>\n\t\t\t\t<?php } ?>\n\t\t\t\t<p>\n\t\t\t\t\t<a href=\"#\" class=\"sp-save-event-status hide-if-no-js button\">OK</a>\n\t\t\t\t\t<a href=\"#\" class=\"sp-cancel-event-status hide-if-no-js button-cancel\">Cancel</a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Save status option.\n\t\t */\n\t\tpublic function save( $post_id ) {\n\t\t\tupdate_post_meta( $post_id, 'sp_status', sp_array_value( $_POST, 'sp_status', 'ok' ) );\n\t\t}\n\n\t\t/**\n\t\t * Event time filter.\n\t\t */\n\t\tpublic function filter( $time, $post_id = 0 ) {\n\t\t\tif ( ! $post_id ) {\n\t\t\t\t$post_id = get_the_ID();\n\t\t\t}\n\t\t\t$status = get_post_meta( $post_id, 'sp_status', true );\n\t\t\tif ( ! $status || 'ok' === $status || ! array_key_exists( $status, $this->statuses ) ) {\n\t\t\t\treturn $time;\n\t\t\t}\n\t\t\treturn $this->statuses[ $status ];\n\t\t}\n\n\t\t/**\n\t\t * Event time array filter.\n\t\t */\n\t\tpublic function filter_array( $array, $post_id = 0 ) {\n\t\t\tif ( ! $post_id ) {\n\t\t\t\t$post_id = get_the_ID();\n\t\t\t}\n\t\t\t$status = get_post_meta( $post_id, 'sp_status', true );\n\t\t\tif ( ! $status || 'ok' === $status || ! array_key_exists( $status, $this->statuses ) ) {\n\t\t\t\treturn $array;\n\t\t\t}\n\t\t\treturn array( $this->statuses[ $status ] );\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Event_Status();\n"
  },
  {
    "path": "modules/sportspress-event-videos.php",
    "content": "<?php\n/**\n * Event Videos\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Event_Videos' ) ) :\n\n\t/**\n\t * Main SportsPress Event Videos Class\n\t *\n\t * @class SportsPress_Event_Videos\n\t * @version 1.8.3\n\t */\n\tclass SportsPress_Event_Videos {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_box' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_EVENT_VIDEOS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_VIDEOS_VERSION', '1.8.3' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_EVENT_VIDEOS_URL' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_VIDEOS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_EVENT_VIDEOS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_EVENT_VIDEOS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add meta box to events.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_meta_box( $meta_boxes ) {\n\t\t\t$meta_boxes['sp_event']['video'] = array(\n\t\t\t\t'title'    => esc_attr__( 'Video', 'sportspress' ),\n\t\t\t\t'output'   => 'SP_Meta_Box_Event_Video::output',\n\t\t\t\t'save'     => 'SP_Meta_Box_Event_Video::save',\n\t\t\t\t'context'  => 'side',\n\t\t\t\t'priority' => 'low',\n\t\t\t);\n\t\t\treturn $meta_boxes;\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Event_Videos();\n"
  },
  {
    "path": "modules/sportspress-gutenberg.php",
    "content": "<?php\n/**\n * Gutenberg\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Gutenberg' ) ) :\n\n\t/**\n\t * Main SportsPress Gutenberg Class\n\t *\n\t * @class SportsPress_Gutenberg\n\t * @version 2.6.13\n\t */\n\tclass SportsPress_Gutenberg {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_filter( 'gutenberg_can_edit_post_type', array( $this, 'can_edit_post_type' ), 10, 2 );\n\t\t\tadd_filter( 'use_block_editor_for_post_type', array( $this, 'can_edit_post_type' ), 10, 2 );\n\t\t\t// add_filter( 'block_categories', array( $this, 'add_category' ), 10, 2 );\n\t\t\t// add_action( 'enqueue_block_editor_assets', array( $this, 'load_blocks' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_GUTENBERG_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_GUTENBERG_VERSION', '2.6.13' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_GUTENBERG_URL' ) ) {\n\t\t\t\tdefine( 'SP_GUTENBERG_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_GUTENBERG_DIR' ) ) {\n\t\t\t\tdefine( 'SP_GUTENBERG_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Modify Gutenberg behavior for custom post types.\n\t\t */\n\t\tfunction can_edit_post_type( $enabled, $post_type ) {\n\t\t\treturn is_sp_post_type( $post_type ) ? false : $enabled;\n\t\t}\n\n\t\t/**\n\t\t * Add SportsPress category to Gutenberg.\n\t\t */\n\t\tfunction add_category( $categories, $post ) {\n\t\t\treturn array_merge(\n\t\t\t\t$categories,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'slug'  => 'sportspress',\n\t\t\t\t\t\t'title' => esc_attr__( 'SportsPress', 'sportspress' ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Load Gutenberg blocks.\n\t\t */\n\t\tfunction load_blocks() {\n\t\t\twp_enqueue_script( 'sp-block-event-calendar', plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/js/blocks/event-calendar.js', array( 'wp-blocks', 'wp-editor' ), true );\n\n\t\t\t$strings = apply_filters(\n\t\t\t\t'sportspress_localized_strings',\n\t\t\t\tarray(\n\t\t\t\t\t'event_calendar'  => esc_attr__( 'Event Calendar', 'sportspress' ),\n\t\t\t\t\t'properties'      => esc_attr__( 'Properties', 'sportspress' ),\n\t\t\t\t\t'title'           => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t'select_calendar' => sprintf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ),\n\t\t\t\t\t'all'             => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$posts = array(\n\t\t\t\t'events' => (array) get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'      => 'sp_event',\n\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t);\n\n\t\t\twp_localize_script( 'sp-block-event-calendar', 'strings', $strings );\n\t\t\twp_localize_script( 'sp-block-event-calendar', 'posts', $posts );\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Gutenberg();\n"
  },
  {
    "path": "modules/sportspress-icons.php",
    "content": "<?php\n/**\n * Icons\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.26\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Icons' ) ) :\n\n\t/**\n\t * Main SportsPress Icons Class\n\t *\n\t * @class SportsPress_Icons\n\t * @version 2.7.26\n\t */\n\tclass SportsPress_Icons {\n\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\tpublic $icons = array();\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Define icons\n\t\t\t$this->get_icons();\n\n\t\t\tadd_filter( 'sportspress_enqueue_styles', array( $this, 'add_styles' ) );\n\t\t\tadd_filter( 'sportspress_performance_icon', array( $this, 'icon' ), 10, 2 );\n\t\t\tadd_filter( 'sportspress_event_performance_icons', array( $this, 'replace_icons' ), 10, 3 );\n\t\t\tadd_filter( 'admin_post_thumbnail_html', array( $this, 'sp_admin_post_thumbnail_html' ), 10, 2 );\n\t\t\tadd_action( 'sportspress_process_sp_performance_meta', array( $this, 'save' ), 10, 2 );\n\t\t\tadd_action( 'sportspress_process_sp_statistic_meta', array( $this, 'save' ), 10, 2 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_ICONS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_ICONS_VERSION', '2.7.26' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_ICONS_URL' ) ) {\n\t\t\t\tdefine( 'SP_ICONS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_ICONS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_ICONS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add stylesheet.\n\t\t */\n\t\tpublic static function add_styles( $styles = array() ) {\n\t\t\t$styles['sportspress-icons'] = array(\n\t\t\t\t'src'     => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/icons.css',\n\t\t\t\t'deps'    => '',\n\t\t\t\t'version' => SP_ICONS_VERSION,\n\t\t\t\t'media'   => 'all',\n\t\t\t);\n\t\t\treturn $styles;\n\t\t}\n\n\t\t/**\n\t\t * Define icons.\n\t\t */\n\t\tprivate function get_icons() {\n\t\t\t$this->icons = apply_filters(\n\t\t\t\t'sportspress_icons',\n\t\t\t\tarray(\n\t\t\t\t\t'soccerball',\n\t\t\t\t\t'soccerball-alt',\n\t\t\t\t\t'baseball',\n\t\t\t\t\t'baseball-alt',\n\t\t\t\t\t'basketball',\n\t\t\t\t\t'golfball',\n\t\t\t\t\t'cricketball',\n\t\t\t\t\t'bowling',\n\t\t\t\t\t'ice-hockey',\n\t\t\t\t\t'football',\n\t\t\t\t\t'poolball',\n\t\t\t\t\t'table-tennis',\n\t\t\t\t\t'tennis',\n\t\t\t\t\t'racing-flag',\n\t\t\t\t\t'shoe',\n\t\t\t\t\t'card',\n\t\t\t\t\t'league',\n\t\t\t\t\t'shield',\n\t\t\t\t\t'tshirt',\n\t\t\t\t\t'whistle',\n\t\t\t\t\t'time',\n\t\t\t\t\t'friendly',\n\t\t\t\t\t'sub',\n\t\t\t\t\t'update',\n\t\t\t\t\t'undo',\n\t\t\t\t\t'redo',\n\t\t\t\t\t'marker',\n\t\t\t\t\t'no',\n\t\t\t\t\t'heart',\n\t\t\t\t\t'star-filled',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Display vector icon.\n\t\t */\n\t\tpublic function icon( $icon = '', $id = 0 ) {\n\t\t\tif ( ! $id ) {\n\t\t\t\treturn $icon;\n\t\t\t}\n\t\t\t$meta = get_post_meta( $id, 'sp_icon', true );\n\t\t\tif ( null !== $meta && in_array( $meta, $this->icons ) ) {\n\t\t\t\t$color = get_post_meta( $id, 'sp_color', true );\n\t\t\t\t$icon  = '<i class=\"sp-icon-' . $meta . '\" style=\"color:' . $color . ' !important\"></i>';\n\t\t\t}\n\t\t\treturn $icon;\n\t\t}\n\n\t\t/**\n\t\t * Replace icons with vectors when available.\n\t\t */\n\t\tpublic function replace_icons( $icons = '', $id = 0, $value = 0 ) {\n\t\t\tif ( ! $id || ! $value ) {\n\t\t\t\treturn $icons;\n\t\t\t}\n\t\t\t$icon = get_post_meta( $id, 'sp_icon', true );\n\t\t\tif ( null !== $icon && in_array( $icon, $this->icons ) ) {\n\t\t\t\t$title = sp_get_singular_name( $id );\n\t\t\t\t$color = get_post_meta( $id, 'sp_color', true );\n\t\t\t\tpreg_match( '#\\((.*?)\\)#', $value, $match );\n\t\t\t\tif ( ! empty( $match ) && isset( $match[1] ) ) {\n\t\t\t\t\t$icons = '<i class=\"sp-icon-' . $icon . '\" title=\"' . $title . '\" style=\"color:' . $color . ' !important\"></i> ' . $match[1] . '<br>';\n\t\t\t\t} else {\n\t\t\t\t\t$icons = str_repeat( '<i class=\"sp-icon-' . $icon . '\" title=\"' . $title . '\" style=\"color:' . $color . ' !important\"></i> ', intval( $value ) );\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t// Check if the performance has a thumbnail ID\n\t\t\t\t$thumbnail_id = get_post_meta( $id, '_thumbnail_id', true );\n\t\t\t\tif ( ! empty( $thumbnail_id ) ) {\n\t\t\t\t\t$title = sp_get_singular_name( $id );\n\t\t\t\t\tpreg_match( '#\\((.*?)\\)#', $value, $match );\n\t\t\t\t\t// Get the URL of the thumbnail image\n\t\t\t\t\t$custom_image = wp_get_attachment_image( $thumbnail_id, 'sportspress-fit-mini', \"\", array( \"title\" => $title ) );\n\t\t\t\t\tif ( ! empty( $custom_image ) && ! empty( $match ) && isset( $match[1] ) ) {\n\t\t\t\t\t\t$icons = $custom_image . $match[1] . '<br>';\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$icons = str_repeat( $custom_image . ' ', intval( $value ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $icons;\n\t\t}\n\n\t\t/**\n\t\t * Post thumbnail HTML.\n\t\t */\n\t\tpublic function sp_admin_post_thumbnail_html( $content = '', $id = 0 ) {\n\t\t\t// Bypass if no ID\n\t\t\tif ( ! $id ) {\n\t\t\t\treturn $content;\n\t\t\t}\n\n\t\t\t// Bypass if not performance or statistic post type\n\t\t\t$post_type = get_post_type( $id );\n\t\t\tif ( 'sp_performance' !== $post_type && 'sp_statistic' !== $post_type ) {\n\t\t\t\treturn $content;\n\t\t\t}\n\n\t\t\t// Detect if image uploaded\n\t\t\t$is_uploaded = isset( $_POST['thumbnail_id'] );\n\n\t\t\t// Enqueue scripts\n\t\t\twp_enqueue_script( 'sp_iconpicker', SP()->plugin_url() . '/assets/js/admin/iconpicker.js', array( 'jquery', 'wp-color-picker', 'iris' ), SP_ICONS_VERSION, true );\n\n\t\t\t// Get selected icon\n\t\t\t$has_icon = has_post_thumbnail( $id );\n\t\t\tif ( $has_icon ) {\n\t\t\t\t$selected = null;\n\t\t\t} else {\n\t\t\t\t$selected = $is_uploaded ? null : get_post_meta( $id, 'sp_icon', true );\n\t\t\t}\n\n\t\t\t// Generate icon selector\n\t\t\t$icons = '';\n\t\t\tforeach ( $this->icons as $icon ) {\n\t\t\t\t$icons .= '<label class=\"button\"><input name=\"sp_icon\" type=\"radio\" value=\"' . $icon . '\" ' . checked( $selected, $icon, false ) . '></input><i class=\"sp-icon-' . $icon . '\"></i></label>';\n\t\t\t}\n\n\t\t\t$icons .= '<label class=\"button\"><input name=\"sp_icon\" type=\"radio\" value=\"\" ' . checked( $selected, null, false ) . '></input>' . esc_attr__( 'Image', 'sportspress' ) . '</label>';\n\n\t\t\t// Get color value\n\t\t\t$value = get_post_meta( $id, 'sp_color', true );\n\t\t\tif ( empty( $value ) ) {\n\t\t\t\t$value = '111111';\n\t\t\t}\n\n\t\t\t$color = '<div class=\"sp-color-box-for-icon\"><input name=\"sp_color\" id=\"sp_color\" type=\"text\" value=\"' . esc_attr( $value ) . '\" size=\"7\" class=\"colorpick\" /> <div id=\"colorPickerDiv\" class=\"colorpickdiv\"></div></div>';\n\n\t\t\t$content = '<p><strong>' . esc_attr__( 'Select Icon', 'sportspress' ) . '</strong></p>\n\t\t\t<p class=\"sp-icons\">' . $icons . '</p>\n\t\t\t<div class=\"sp-para sp-custom-colors' . ( null == $selected ? ' hidden' : '' ) . '\"><label data-sp-colors=\"' . $value . '\"><strong>' . esc_attr__( 'Customize', 'sportspress' ) . '</strong><br></label>' . $color . '</div>\n\t\t\t<div class=\"sp-custom-thumbnail' . ( null == $selected ? '' : ' hidden' ) . '\">' . $content . '</div>';\n\t\t\treturn $content;\n\t\t}\n\n\t\t/**\n\t\t * Save meta boxes data\n\t\t */\n\t\tpublic static function save( $post_id, $post ) {\n\t\t\tupdate_post_meta( $post_id, 'sp_icon', sp_array_value( $_POST, 'sp_icon', null ) );\n\t\t\tupdate_post_meta( $post_id, 'sp_color', sp_array_value( $_POST, 'sp_color', null ) );\n\t\t\tif ( null != sp_array_value( $_POST, 'sp_icon', null ) ) {\n\t\t\t\tdelete_post_thumbnail( $post );\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Icons();\n"
  },
  {
    "path": "modules/sportspress-importers.php",
    "content": "<?php\n/**\n * Importers\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Importers' ) ) :\n\n\t/**\n\t * Main SportsPress Importers Class\n\t *\n\t * @class SportsPress_Importers\n\t * @version 1.8.3\n\t */\n\tclass SportsPress_Importers {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_action( 'init', array( $this, 'includes' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_IMPORTERS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_IMPORTERS_VERSION', '1.8.3' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_IMPORTERS_URL' ) ) {\n\t\t\t\tdefine( 'SP_IMPORTERS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_IMPORTERS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_IMPORTERS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Include importers.\n\t\t */\n\t\tpublic function includes() {\n\t\t\tif ( is_admin() && defined( 'WP_LOAD_IMPORTERS' ) ) {\n\t\t\t\tinclude SP()->plugin_path() . '/includes/admin/class-sp-admin-importers.php';\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Importers();\n"
  },
  {
    "path": "modules/sportspress-lazy-loading.php",
    "content": "<?php\n/**\n * Lazy Loading\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.10\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Lazy_Loading' ) ) :\n\n\t/**\n\t * Main SportsPress Lazy Loading Class\n\t *\n\t * @class SportsPress_Lazy_Loading\n\t * @version 2.7.9\n\t */\n\tclass SportsPress_Lazy_Loading {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\tadd_action( 'wp_ajax_sp-get-players', array( $this, 'get_players' ) );\n\t\t\tadd_action( 'sportspress_event_teams_meta_box_checklist', array( $this, 'checklist' ), 10, 6 );\n\t\t\tadd_filter( 'sportspress_localized_strings', array( $this, 'strings' ) );\n\t\t}\n\n\t\t/**\n\t\t * Get players.\n\t\t */\n\t\tpublic function get_players() {\n\t\t\tcheck_ajax_referer( 'sp-get-players', 'nonce' );\n\n\t\t\t$team = sp_array_value( $_POST, 'team' );\n\n\t\t\tif ( 'yes' == get_option( 'sportspress_event_filter_teams_by_league', 'no' ) ) {\n\t\t\t\t$league = sp_array_value( $_POST, 'league' );\n\t\t\t} else {\n\t\t\t\t$league = false;\n\t\t\t}\n\n\t\t\tif ( 'yes' == get_option( 'sportspress_event_filter_teams_by_season', 'no' ) ) {\n\t\t\t\t$season = sp_array_value( $_POST, 'season' );\n\t\t\t} else {\n\t\t\t\t$season = false;\n\t\t\t}\n\n\t\t\t$index    = sp_array_value( $_POST, 'index', 1 );\n\t\t\t$selected = sp_array_value( $_POST, 'selected', array() );\n\n\t\t\t$args = array(\n\t\t\t\t'orderby' => 'menu_order',\n\t\t\t);\n\n\t\t\tif ( $team ) {\n\t\t\t\t$args['meta_query'] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => 'sp_current_team',\n\t\t\t\t\t\t'value' => sp_array_value( $_POST, 'team' ),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $league || $season ) {\n\t\t\t\t$args['tax_query'] = array( 'relation' => 'AND' );\n\n\t\t\t\tif ( $league ) {\n\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t\t'terms'    => $league,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( $season ) {\n\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t\t'terms'    => $season,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$player_sort = get_option( 'sportspress_event_player_sort', 'jersey' );\n\n\t\t\tif ( $player_sort == 'name' ) {\n\t\t\t\t$args['order']   = 'ASC';\n\t\t\t\t$args['orderby'] = 'title';\n\t\t\t} else // default 'jersey'\n\t\t\t{\n\t\t\t\t$args['meta_key'] = 'sp_number';\n\t\t\t\t$args['orderby']  = 'meta_value_num';\n\t\t\t\t$args['order']    = 'ASC';\n\t\t\t}\n\n\t\t\t$player_args = $args;\n\n\t\t\t$players = sp_get_posts( 'sp_player', $player_args );\n\t\t\t$staff   = sp_get_posts( 'sp_staff', $args );\n\t\t\t$data    = array( 'index' => $index );\n\n\t\t\tforeach ( $players as $key => $value ) {\n\t\t\t\tswitch ( $player_sort ) {\n\t\t\t\t\tcase 'name':\n\t\t\t\t\t\t$players[ $key ]->post_title = sp_get_player_name_then_number( $value->ID );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:  // 'jersey'\n\t\t\t\t\t\t$players[ $key ]->post_title = sp_get_player_name_with_number( $value->ID );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$data['players']  = $players;\n\t\t\t$data['staff']    = $staff;\n\t\t\t$data['sections'] = get_option( 'sportspress_event_performance_sections', -1 );\n\n\t\t\twp_send_json_success( $data );\n\t\t}\n\n\t\t/**\n\t\t * Ajax checklist.\n\t\t */\n\t\tpublic function checklist( $post_id = null, $post_type = 'post', $display = 'block', $team = null, $index = null, $slug = null ) {\n\t\t\tif ( ! isset( $slug ) ) :\n\t\t\t\t$slug = $post_type;\n\t\t\tendif;\n\n\t\t\t$selected = (array) get_post_meta( $post_id, $slug, false );\n\t\t\tif ( sizeof( $selected ) ) {\n\t\t\t\t$selected = sp_array_between( $selected, 0, $index );\n\t\t\t} else {\n\t\t\t\t$selected = sp_array_between( (array) get_post_meta( $post_id, $post_type, false ), 0, $index );\n\t\t\t}\n\n\t\t\tif ( 'yes' == get_option( 'sportspress_event_filter_teams_by_league', 'no' ) ) {\n\t\t\t\t$leagues = get_the_terms( $post_id, 'sp_league' );\n\t\t\t} else {\n\t\t\t\t$leagues = false;\n\t\t\t}\n\n\t\t\tif ( 'yes' == get_option( 'sportspress_event_filter_teams_by_season', 'no' ) ) {\n\t\t\t\t$seasons = get_the_terms( $post_id, 'sp_season' );\n\t\t\t} else {\n\t\t\t\t$seasons = false;\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'orderby' => 'menu_order',\n\t\t\t);\n\n\t\t\t$player_sort = get_option( 'sportspress_event_player_sort', 'jersey' );\n\n\t\t\tif ( 'sp_player' == $post_type ) {\n\t\t\t\tif ( $player_sort == 'name' ) {\n\t\t\t\t\t$args['order']   = 'ASC';\n\t\t\t\t\t$args['orderby'] = 'title';\n\t\t\t\t} else // default 'jersey'\n\t\t\t\t{\n\t\t\t\t\t$args['meta_key'] = 'sp_number';\n\t\t\t\t\t$args['orderby']  = 'meta_value_num';\n\t\t\t\t\t$args['order']    = 'ASC';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$args['meta_query'] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'   => 'sp_current_team',\n\t\t\t\t\t'value' => $team,\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tif ( $leagues || $seasons ) {\n\t\t\t\t$args['tax_query'] = array( 'relation' => 'AND' );\n\n\t\t\t\tif ( $leagues ) {\n\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t\t'terms'    => wp_list_pluck( $leagues, 'term_id' ),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( $seasons ) {\n\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t\t'terms'    => wp_list_pluck( $seasons, 'term_id' ),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$posts    = sp_get_posts( $post_type, $args );\n\t\t\t$post_ids = wp_list_pluck( $posts, 'ID' );\n\t\t\t$diff     = array_diff( $post_ids, $selected );\n\t\t\t$borrowed = array_diff( $selected, $post_ids );\n\t\t\t$selected = array_flip( $selected );\n\n\t\t\tif ( sizeof( $borrowed ) ) {\n\t\t\t\t$args           = array( 'post__in' => $borrowed );\n\t\t\t\t$borrowed_posts = sp_get_posts( $post_type, $args );\n\t\t\t\tif ( is_array( $borrowed_posts ) ) {\n\t\t\t\t\t$posts += $borrowed_posts;\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t<div id=\"<?php echo esc_attr( $slug ); ?>-all\" class=\"posttypediv tabs-panel wp-tab-panel sp-tab-panel sp-ajax-checklist sp-select-all-range\" style=\"display: <?php echo esc_attr( $display ); ?>;\">\n\t\t\t<input type=\"hidden\" value=\"0\" name=\"<?php echo esc_attr( $slug ); ?><?php if ( isset( $index ) ) { echo '[' . esc_attr( $index ) . ']';} ?>[]\" />\n\t\t\t<ul class=\"categorychecklist form-no-clear\">\n\t\t\t\t<?php if ( is_array( $posts ) && sizeof( $posts ) ) { ?>\n\t\t\t\t\t<li class=\"sp-select-all-container\">\n\t\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t\t<input type=\"checkbox\" class=\"sp-select-all\" <?php checked( empty( $diff ) ); ?>>\n\t\t\t\t\t\t\t<strong><?php esc_attr_e( 'Select All', 'sportspress' ); ?></strong>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php foreach ( $posts as $post ) { ?>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"<?php echo esc_attr( $post->ID ); ?>\" name=\"<?php echo esc_attr( $slug ); ?><?php if ( isset( $index ) ) { echo '[' . esc_attr( $index ) . ']';} ?>[]\" <?php checked( array_key_exists( $post->ID, $selected ) ); ?>>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tswitch ( $player_sort ) {\n\t\t\t\t\t\t\t\t\tcase 'name':\n\t\t\t\t\t\t\t\t\t\techo esc_html( sp_get_player_name_then_number( $post->ID ) );\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:  // 'jersey'\n\t\t\t\t\t\t\t\t\t\techo esc_html( sp_get_player_name_with_number( $post->ID ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<?php unset( $selected[ $post->ID ] ); ?>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $selected ) && sizeof( $selected ) ) {\n\t\t\t\t\t\tforeach ( $selected as $post_id => $post ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! $post_id ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;}\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<label class=\"selectit\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"<?php echo esc_attr( $post_id ); ?>\" name=\"<?php echo esc_attr( $slug ); ?><?php if ( isset( $index ) ) { echo '[' . esc_attr( $index ) . ']';} ?>[]\" <?php checked( true ); ?>>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tswitch ( $player_sort ) {\n\t\t\t\t\t\t\t\t\tcase 'name':\n\t\t\t\t\t\t\t\t\t\techo esc_html( sp_get_player_name_then_number( $post_id ) );\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:  // 'jersey'\n\t\t\t\t\t\t\t\t\t\techo esc_html( sp_get_player_name_with_number( $post_id ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"sp-ajax-show-all-container\"><a class=\"sp-ajax-show-all\" href=\"#show-all-<?php echo esc_attr( $slug ); ?>s\"><?php esc_attr_e( 'Show all', 'sportspress' ); ?></a></li>\n\t\t\t\t<?php } else { ?>\n\t\t\t\t\t<li class=\"sp-ajax-show-all-container\"><?php esc_attr_e( 'No results found.', 'sportspress' ); ?>\n\t\t\t\t\t<a class=\"sp-ajax-show-all\" href=\"#show-all-<?php echo esc_attr( $slug ); ?>s\"><?php esc_attr_e( 'Show all', 'sportspress' ); ?></a></li>\n\t\t\t\t<?php } ?>\n\t\t\t</ul>\n\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t/*\n\t\t * Localized strings.\n\t\t */\n\t\tpublic function strings( $strings ) {\n\t\t\t$strings = array_merge(\n\t\t\t\t$strings,\n\t\t\t\tarray(\n\t\t\t\t\t'no_results_found'        => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t'select_all'              => esc_attr__( 'Select All', 'sportspress' ),\n\t\t\t\t\t'show_all'                => esc_attr__( 'Show all', 'sportspress' ),\n\t\t\t\t\t'loading'                 => esc_attr__( 'Loading&hellip;', 'sportspress' ),\n\t\t\t\t\t'option_filter_by_league' => get_option( 'sportspress_event_filter_teams_by_league', 'no' ),\n\t\t\t\t\t'option_filter_by_season' => get_option( 'sportspress_event_filter_teams_by_season', 'no' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn $strings;\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Lazy_Loading();\n"
  },
  {
    "path": "modules/sportspress-league-tables.php",
    "content": "<?php\n/**\n * League Tables\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_League_Tables' ) ) :\n\n\t/**\n\t * Main SportsPress League Tables Class\n\t *\n\t * @class SportsPress_League_Tables\n\t * @version 2.6.15\n\t */\n\tclass SportsPress_League_Tables {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'init', array( $this, 'register_post_type' ) );\n\t\t\tadd_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 );\n\t\t\tadd_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) );\n\t\t\tadd_action( 'sportspress_widgets', array( $this, 'include_widgets' ) );\n\t\t\tadd_action( 'sportspress_create_rest_routes', array( $this, 'create_rest_routes' ) );\n\t\t\tadd_action( 'sportspress_register_rest_fields', array( $this, 'register_rest_fields' ) );\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );\n\t\t\tadd_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) );\n\t\t\tadd_filter( 'sportspress_team_settings', array( $this, 'add_settings' ) );\n\t\t\tadd_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 30 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_LEAGUE_TABLES_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_LEAGUE_TABLES_VERSION', '2.6.15' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_LEAGUE_TABLES_URL' ) ) {\n\t\t\t\tdefine( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_LEAGUE_TABLES_DIR' ) ) {\n\t\t\t\tdefine( 'SP_LEAGUE_TABLES_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Register league tables post type\n\t\t */\n\t\tpublic static function register_post_type() {\n\t\t\tregister_post_type(\n\t\t\t\t'sp_table',\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_register_post_type_table',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'labels'                => array(\n\t\t\t\t\t\t\t'name'               => esc_attr__( 'League Tables', 'sportspress' ),\n\t\t\t\t\t\t\t'singular_name'      => esc_attr__( 'League Table', 'sportspress' ),\n\t\t\t\t\t\t\t'add_new_item'       => esc_attr__( 'Add New League Table', 'sportspress' ),\n\t\t\t\t\t\t\t'edit_item'          => esc_attr__( 'Edit League Table', 'sportspress' ),\n\t\t\t\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t\t'view_item'          => esc_attr__( 'View League Table', 'sportspress' ),\n\t\t\t\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'public'                => true,\n\t\t\t\t\t\t'show_ui'               => true,\n\t\t\t\t\t\t'capability_type'       => 'sp_table',\n\t\t\t\t\t\t'map_meta_cap'          => true,\n\t\t\t\t\t\t'publicly_queryable'    => true,\n\t\t\t\t\t\t'exclude_from_search'   => false,\n\t\t\t\t\t\t'hierarchical'          => false,\n\t\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_table_slug', 'table' ) ),\n\t\t\t\t\t\t'supports'              => array( 'title', 'editor', 'page-attributes', 'thumbnail' ),\n\t\t\t\t\t\t'has_archive'           => false,\n\t\t\t\t\t\t'show_in_nav_menus'     => true,\n\t\t\t\t\t\t'show_in_menu'          => 'edit.php?post_type=sp_team',\n\t\t\t\t\t\t'show_in_admin_bar'     => true,\n\t\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t\t'rest_controller_class' => 'SP_REST_Posts_Controller',\n\t\t\t\t\t\t'rest_base'             => 'tables',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Remove meta boxes.\n\t\t */\n\t\tpublic function remove_meta_boxes() {\n\t\t\tremove_meta_box( 'sp_seasondiv', 'sp_table', 'side' );\n\t\t\tremove_meta_box( 'sp_leaguediv', 'sp_table', 'side' );\n\t\t}\n\n\t\t/**\n\t\t * Conditonally load the class and functions only needed when viewing this post type.\n\t\t */\n\t\tpublic function include_post_type_handler() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-table.php';\n\t\t}\n\n\t\t/**\n\t\t * Add widgets.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function include_widgets() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-league-table.php';\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-team-gallery.php';\n\t\t}\n\n\t\t/**\n\t\t * Create REST API routes.\n\t\t */\n\t\tpublic function create_rest_routes() {\n\t\t\t$controller = new SP_REST_Posts_Controller( 'sp_table' );\n\t\t\t$controller->register_routes();\n\t\t}\n\n\t\t/**\n\t\t * Register REST API fields.\n\t\t */\n\t\tpublic function register_rest_fields() {\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_table',\n\t\t\t\t'data',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_arrays',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'League Table', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add meta boxes.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_meta_boxes( $meta_boxes ) {\n\t\t\tif ( 'yes' == get_option( 'sportspress_team_column_editing', 'no' ) ) {\n\t\t\t\t$meta_boxes['sp_team']['columns'] = array(\n\t\t\t\t\t'title'    => esc_attr__( 'Table Columns', 'sportspress' ),\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Team_Columns::output',\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Team_Columns::save',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t);\n\t\t\t}\n\t\t\t$meta_boxes['sp_team']['tables'] = array(\n\t\t\t\t'title'    => esc_attr__( 'League Tables', 'sportspress' ),\n\t\t\t\t'output'   => 'SP_Meta_Box_Team_Tables::output',\n\t\t\t\t'save'     => 'SP_Meta_Box_Team_Tables::save',\n\t\t\t\t'context'  => 'normal',\n\t\t\t\t'priority' => 'high',\n\t\t\t);\n\t\t\t$meta_boxes['sp_table']          = array(\n\t\t\t\t'mode'      => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Mode', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Table_Mode::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Table_Mode::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'shortcode' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Shortcode', 'sportspress' ),\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Table_Shortcode::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'format'    => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Layout', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Table_Format::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Table_Format::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'details'   => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Table_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Table_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'data'      => array(\n\t\t\t\t\t'title'    => esc_attr__( 'League Table', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_Table_Data::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_Table_Data::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn $meta_boxes;\n\t\t}\n\n\t\t/**\n\t\t * Add shortcodes.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_shortcodes( $shortcodes ) {\n\t\t\t$shortcodes['team'][] = 'standings';\n\t\t\t$shortcodes['team'][] = 'gallery';\n\t\t\treturn $shortcodes;\n\t\t}\n\n\t\t/**\n\t\t * Add settings.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_settings( $settings ) {\n\t\t\treturn array_merge(\n\t\t\t\t$settings,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'League Tables', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'id'    => 'table_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_table_options',\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display title', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_table_show_title',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display logos', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_table_show_logos',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Pagination', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Paginate', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_table_paginated',\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'             => esc_attr__( 'Limit', 'sportspress' ),\n\t\t\t\t\t\t\t'id'                => 'sportspress_table_rows',\n\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t'default'           => '10',\n\t\t\t\t\t\t\t'desc'              => esc_attr__( 'teams', 'sportspress' ),\n\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t'min'  => 1,\n\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'             => esc_attr__( 'Form', 'sportspress' ),\n\t\t\t\t\t\t\t'id'                => 'sportspress_form_limit',\n\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t'default'           => '5',\n\t\t\t\t\t\t\t'desc'              => esc_attr__( 'events', 'sportspress' ),\n\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t'min'  => 1,\n\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Pos', 'sportspress' ),\n\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Always increment', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_table_increment',\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title'   => esc_attr__( 'Tiebreaker', 'sportspress' ),\n\t\t\t\t\t\t\t'id'      => 'sportspress_table_tiebreaker',\n\t\t\t\t\t\t\t'default' => 'none',\n\t\t\t\t\t\t\t'type'    => 'select',\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'none' => esc_attr__( 'None', 'sportspress' ),\n\t\t\t\t\t\t\t\t'h2h'  => esc_attr__( 'Head to head', 'sportspress' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'table_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add team template.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_team_template( $templates ) {\n\t\t\treturn array_merge(\n\t\t\t\t$templates,\n\t\t\t\tarray(\n\t\t\t\t\t'tables' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'League Tables', 'sportspress' ),\n\t\t\t\t\t\t'label'   => esc_attr__( 'League Table', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_team_show_tables',\n\t\t\t\t\t\t'action'  => 'sportspress_output_team_tables',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\nendif;\n\nif ( get_option( 'sportspress_load_league_tables_module', 'yes' ) == 'yes' ) {\n\tnew SportsPress_League_Tables();\n\n\t/**\n\t * Create alias of SP_League_Table class for REST API.\n\t * Note: class_alias is not supported in PHP < 5.3 so extend the original class instead.\n\t */\n\tclass SP_Table extends SP_League_Table {}\n}\n"
  },
  {
    "path": "modules/sportspress-next-team-preset.php",
    "content": "<?php\n/**\n * Next Team Preset\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.17\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :\n\n\t/**\n\t * Main SportsPress Next Team Preset Class\n\t *\n\t * @class SportsPress_Next_Team_Preset\n\t * @version 2.7.17\n\t */\n\n\tclass SportsPress_Next_Team_Preset {\n\n\t\t/** @var bool The link events setting. */\n\t\tpublic $link_events = true;\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t$this->link_events = get_option( 'sportspress_link_events', 'yes' ) === 'yes' ? true : false;\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_equation_options', array( $this, 'add_options' ) );\n\t\t\tadd_filter( 'sportspress_equation_presets', array( $this, 'presets' ) );\n\t\t\tadd_filter( 'sportspress_equation_solve_for_presets', array( $this, 'solve' ), 10, 3 );\n\t\t\tadd_filter( 'sportspress_table_options', array( $this, 'add_settings' ) );\n\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_NEXT_TEAM_PRESET_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_NEXT_TEAM_PRESET_VERSION', '2.7.17' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_NEXT_TEAM_PRESET_URL' ) ) {\n\t\t\t\tdefine( 'SP_NEXT_TEAM_PRESET_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_NEXT_TEAM_PRESET_DIR' ) ) {\n\t\t\t\tdefine( 'SP_NEXT_TEAM_PRESET_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add additional options.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_options( $options ) {\n\t\t\t  $options['Presets']['$nextteam'] = esc_attr__( 'Next Team', 'sportspress' );\n\t\t\t  return $options;\n\t\t}\n\n\t\t/**\n\t\t * Add preset\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function presets( $presets ) {\n\t\t\t  $presets[] = '$nextteam';\n\t\t\t  return $presets;\n\t\t}\n\n\t\t/**\n\t\t * Solve preset\n\t\t *\n\t\t * @return mixed\n\t\t */\n\t\tpublic function solve( $input, $equation, $post_id ) {\n\t\t\tif ( strpos( $equation, '$nextteam' ) !== false ) {\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type'      => 'sp_event',\n\t\t\t\t\t'numberposts'    => 1,\n\t\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t\t'post_status'    => 'future',\n\t\t\t\t\t'meta_query'     => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_team',\n\t\t\t\t\t\t\t'value'   => $post_id,\n\t\t\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'order'          => 'ASC',\n\t\t\t\t);\n\n\t\t\t\tif ( get_option( 'sportspress_table_next_team_filter_league', 'no' ) === 'yes' ) {\n\t\t\t\t\t$leagues = get_the_terms( $post_id, 'sp_league' );\n\t\t\t\t\tif ( ! isset( $league_ids ) ) {\n\t\t\t\t\t\t$league_ids = array();\n\t\t\t\t\t}\n\t\t\t\t\tif ( empty( $league_ids ) && $leagues ) :\n\t\t\t\t\t\tforeach ( $leagues as $league ) :\n\t\t\t\t\t\t\t  $league_ids[] = $league->term_id;\n\t\t\t\t\tendforeach;\n\t\t\t\t\t\t  endif;\n\t\t\t\t\t$league_ids = sp_add_auto_term( $league_ids, $post_id, 'sp_league' );\n\n\t\t\t\t\tif ( isset( $league_ids ) ) {\n\t\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t\t\t\t'field'    => 'term_id',\n\t\t\t\t\t\t\t'terms'    => $league_ids,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$events = get_posts( $args );\n\n\t\t\t\tif ( $events ) {\n\t\t\t\t\t$event = reset( $events );\n\t\t\t\t\t$teams = array_filter( (array) get_post_meta( $event->ID, 'sp_team', false ) );\n\t\t\t\t\tif ( ( $key = array_search( $post_id, $teams ) ) !== false ) {\n\t\t\t\t\t\tunset( $teams[ $key ] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '-';\n\t\t\t\t\t}\n\n\t\t\t\t\t$team_id = reset( $teams );\n\n\t\t\t\t\tif ( ! $team_id ) {\n\t\t\t\t\t\treturn '-';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( has_post_thumbnail( $team_id ) ) {\n\t\t\t\t\t\t$logo = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon' );\n\t\t\t\t\t\t$icon = '<span class=\"team-logo\">' . $logo . '</span>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$icon = sp_team_abbreviation( $team_id, true );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this->link_events ) {\n\t\t\t\t\t\treturn '<a title=\"' . $event->post_title . '\" href=\"' . get_post_permalink( $event->ID, false, true ) . '\">' . $icon . '</a>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '<span title=\"' . $event->post_title . '\">' . $icon . '</a>';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn '-';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn $input;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add settings.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_settings( $settings ) {\n\t\t\t  $settings[] = array(\n\t\t\t\t  'title'   => esc_attr__( 'Next Team', 'sportspress' ),\n\t\t\t\t  'desc'    => esc_attr__( 'Filter by League', 'sportspress' ),\n\t\t\t\t  'id'      => 'sportspress_table_next_team_filter_league',\n\t\t\t\t  'default' => 'no',\n\t\t\t\t  'type'    => 'checkbox',\n\t\t\t  );\n\t\t\t  return $settings;\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Next_Team_Preset();\n"
  },
  {
    "path": "modules/sportspress-officials.php",
    "content": "<?php\n/**\n * Officials\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.22\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Officials' ) ) :\n\n\t/**\n\t * Main SportsPress Officials Class\n\t *\n\t * @class SportsPress_Officials\n\t * @version 2.7.22\n\t */\n\tclass SportsPress_Officials {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'sportspress_after_register_taxonomy', array( $this, 'register_taxonomy' ) );\n\t\t\tadd_action( 'sportspress_after_register_post_type', array( $this, 'register_post_type' ) );\n\t\t\tadd_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) );\n\t\t\tadd_action( 'sportspress_create_rest_routes', array( $this, 'create_rest_routes' ) );\n\t\t\tadd_action( 'sportspress_register_rest_fields', array( $this, 'register_rest_fields' ) );\n\t\t\tadd_action( 'sportspress_event_list_head_row', array( $this, 'event_list_head_row' ) );\n\t\t\tadd_action( 'sportspress_event_list_row', array( $this, 'event_list_row' ), 10, 2 );\n\t\t\tadd_action( 'sportspress_calendar_data_meta_box_table_head_row', array( $this, 'calendar_meta_head_row' ) );\n\t\t\tadd_action( 'sportspress_calendar_data_meta_box_table_row', array( $this, 'calendar_meta_row' ), 10, 2 );\n\t\t\tadd_action( 'sp_duty_edit_form_fields', array( $this, 'edit_taxonomy_fields' ), 10, 1 );\n\t\t\tadd_action( 'edited_sp_duty', array( $this, 'save_taxonomy_fields' ), 10, 1 );\n\t\t\tadd_action( 'admin_menu', array( $this, 'duties_menu' ) );\n\t\t\tadd_action( 'parent_file', array( $this, 'parent_file' ) );\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );\n\t\t\tadd_filter( 'sportspress_calendar_columns', array( $this, 'calendar_columns' ) );\n\t\t\tadd_filter( 'sportspress_after_event_template', array( $this, 'add_event_template' ), 30 );\n\t\t\tadd_filter( 'sportspress_event_options', array( $this, 'add_event_options' ) );\n\t\t\tadd_filter( 'sportspress_text', array( $this, 'add_text_options' ) );\n\t\t\tadd_filter( 'sportspress_menu_items', array( $this, 'add_menu_item' ) );\n\t\t\tadd_filter( 'sportspress_glance_items', array( $this, 'add_glance_item' ) );\n\t\t\tadd_filter( 'sportspress_importers', array( $this, 'register_importer' ) );\n\t\t\tadd_filter( 'sportspress_screen_ids', array( $this, 'screen_ids' ) );\n\t\t\tadd_filter( 'sportspress_post_types', array( $this, 'add_post_type' ) );\n\t\t\tadd_filter( 'sportspress_primary_post_types', array( $this, 'add_post_type' ) );\n\t\t\tadd_filter( 'sportspress_importable_post_types', array( $this, 'add_post_type' ) );\n\t\t\tadd_filter( 'sportspress_post_type_hierarchy', array( $this, 'add_to_hierarchy' ) );\n\t\t\tadd_filter( 'manage_edit-sp_duty_columns', array( $this, 'taxonomy_columns' ) );\n\t\t\tadd_filter( 'manage_sp_duty_custom_column', array( $this, 'taxonomy_column_value' ), 10, 3 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_OFFICIALS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_OFFICIALS_VERSION', '2.7.9' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_OFFICIALS_URL' ) ) {\n\t\t\t\tdefine( 'SP_OFFICIALS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_OFFICIALS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_OFFICIALS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Register officials taxonomy\n\t\t */\n\t\tpublic static function register_taxonomy() {\n\t\t\t$labels       = array(\n\t\t\t\t'name'              => esc_attr__( 'Duties', 'sportspress' ),\n\t\t\t\t'singular_name'     => esc_attr__( 'Duty', 'sportspress' ),\n\t\t\t\t'all_items'         => esc_attr__( 'All', 'sportspress' ),\n\t\t\t\t'edit_item'         => esc_attr__( 'Edit Duty', 'sportspress' ),\n\t\t\t\t'view_item'         => esc_attr__( 'View', 'sportspress' ),\n\t\t\t\t'update_item'       => esc_attr__( 'Update', 'sportspress' ),\n\t\t\t\t'add_new_item'      => esc_attr__( 'Add New', 'sportspress' ),\n\t\t\t\t'new_item_name'     => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t'parent_item'       => esc_attr__( 'Parent', 'sportspress' ),\n\t\t\t\t'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ),\n\t\t\t\t'search_items'      => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t'not_found'         => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t);\n\t\t\t$args         = apply_filters(\n\t\t\t\t'sportspress_register_taxonomy_duty',\n\t\t\t\tarray(\n\t\t\t\t\t'label'                 => esc_attr__( 'Duties', 'sportspress' ),\n\t\t\t\t\t'labels'                => $labels,\n\t\t\t\t\t'public'                => false,\n\t\t\t\t\t'show_ui'               => true,\n\t\t\t\t\t'show_in_menu'          => true,\n\t\t\t\t\t'show_in_nav_menus'     => false,\n\t\t\t\t\t'show_tagcloud'         => false,\n\t\t\t\t\t'hierarchical'          => true,\n\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_duty_slug', 'duty' ) ),\n\t\t\t\t\t'capabilities'          => array(\n\t\t\t\t\t\t'manage_terms' => 'manage_sp_event_terms',\n\t\t\t\t\t\t'edit_terms'   => 'edit_sp_event_terms',\n\t\t\t\t\t\t'delete_terms' => 'delete_sp_event_terms',\n\t\t\t\t\t\t'assign_terms' => 'assign_sp_event_terms',\n\t\t\t\t\t),\n\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t'rest_controller_class' => 'SP_REST_Terms_Controller',\n\t\t\t\t\t'rest_base'             => 'duties',\n\t\t\t\t)\n\t\t\t);\n\t\t\t$object_types = apply_filters( 'sportspress_duty_object_types', array() );\n\t\t\tregister_taxonomy( 'sp_duty', $object_types, $args );\n\t\t\tforeach ( $object_types as $object_type ) :\n\t\t\t\tregister_taxonomy_for_object_type( 'sp_duty', $object_type );\n\t\t\tendforeach;\n\t\t}\n\n\t\t/**\n\t\t * Register officials post type\n\t\t */\n\t\tpublic static function register_post_type() {\n\t\t\tregister_post_type(\n\t\t\t\t'sp_official',\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_register_post_type_official',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'labels'                => array(\n\t\t\t\t\t\t\t'name'                  => esc_attr__( 'Officials', 'sportspress' ),\n\t\t\t\t\t\t\t'singular_name'         => esc_attr__( 'Official', 'sportspress' ),\n\t\t\t\t\t\t\t'add_new'          \t\t=> esc_attr__( 'Add New Official', 'sportspress' ),\n\t\t\t\t\t\t\t'add_new_item'          => esc_attr__( 'Add New Official', 'sportspress' ),\n\t\t\t\t\t\t\t'edit_item'             => esc_attr__( 'Edit Official', 'sportspress' ),\n\t\t\t\t\t\t\t'new_item'              => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t\t'view_item'             => esc_attr__( 'View Official', 'sportspress' ),\n\t\t\t\t\t\t\t'search_items'          => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found'             => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found_in_trash'    => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t\t'featured_image'        => esc_attr__( 'Photo', 'sportspress' ),\n\t\t\t\t\t\t\t'set_featured_image'    => esc_attr__( 'Select Photo', 'sportspress' ),\n\t\t\t\t\t\t\t'remove_featured_image' => esc_attr__( 'Remove Photo', 'sportspress' ),\n\t\t\t\t\t\t\t'use_featured_image'    => esc_attr__( 'Select Photo', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'public'                => true,\n\t\t\t\t\t\t'show_ui'               => true,\n\t\t\t\t\t\t'capability_type'       => 'sp_event',\n\t\t\t\t\t\t'map_meta_cap'          => true,\n\t\t\t\t\t\t'publicly_queryable'    => true,\n\t\t\t\t\t\t'exclude_from_search'   => false,\n\t\t\t\t\t\t'hierarchical'          => false,\n\t\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_official_slug', 'official' ) ),\n\t\t\t\t\t\t'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'page-attributes' ),\n\t\t\t\t\t\t'has_archive'           => false,\n\t\t\t\t\t\t'show_in_nav_menus'     => true,\n\t\t\t\t\t\t'menu_icon'             => 'dashicons-flag',\n\t\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t\t'rest_controller_class' => 'SP_REST_Posts_Controller',\n\t\t\t\t\t\t'rest_base'             => 'officials',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Conditonally load the class and functions only needed when viewing this post type.\n\t\t */\n\t\tpublic function include_post_type_handler() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-official.php';\n\t\t}\n\n\t\t/**\n\t\t * Create REST API routes.\n\t\t */\n\t\tpublic function create_rest_routes() {\n\t\t\t$controller = new SP_REST_Posts_Controller( 'sp_official' );\n\t\t\t$controller->register_routes();\n\t\t}\n\n\t\t/**\n\t\t * Register REST API fields.\n\t\t */\n\t\tpublic function register_rest_fields() {\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_official',\n\t\t\t\t'data',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_arrays',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Official', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Event list head row.\n\t\t */\n\t\tpublic function event_list_head_row( $usecolumns = array() ) {\n\t\t\tif ( is_array( $usecolumns ) && in_array( 'officials', $usecolumns ) ) {\n\t\t\t\t$duties = get_terms(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy'   => 'sp_duty',\n\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t'orderby'    => 'meta_value_num',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif ( empty( $duties ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tforeach ( $duties as $duty ) {\n\t\t\t\t\t?>\n\t\t\t\t<th class=\"data-officials\">\n\t\t\t\t\t\t<?php echo wp_kses_post( $duty->name ); ?>\n\t\t\t\t</th>\n\t\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Event list row.\n\t\t */\n\t\tpublic function event_list_row( $event, $usecolumns = array() ) {\n\t\t\tif ( is_array( $usecolumns ) && in_array( 'officials', $usecolumns ) ) {\n\t\t\t\t$event        = new SP_Event( $event );\n\t\t\t\t$appointments = $event->appointments( true );\n\t\t\t\tunset( $appointments[0] );\n\n\t\t\t\tforeach ( $appointments as $officials ) {\n\t\t\t\t\t?>\n\t\t\t\t<td class=\"data-officials\">\n\t\t\t\t\t<?php echo wp_kses_post( implode( '<br>', $officials ) ); ?>\n\t\t\t\t</td>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Calendar meta box table head row.\n\t\t */\n\t\tpublic function calendar_meta_head_row( $usecolumns = array() ) {\n\t\t\tif ( is_array( $usecolumns ) && in_array( 'officials', $usecolumns ) ) {\n\t\t\t\t$duties = get_terms(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy'   => 'sp_duty',\n\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t'orderby'    => 'meta_value_num',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif ( empty( $duties ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tforeach ( $duties as $duty ) {\n\t\t\t\t\t?>\n\t\t\t\t<th class=\"column-officials\">\n\t\t\t\t\t<label for=\"sp_columns_officials\">\n\t\t\t\t\t\t<?php echo wp_kses_post( $duty->name ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</th>\n\t\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Calendar meta box table row.\n\t\t */\n\t\tpublic function calendar_meta_row( $event, $usecolumns = array() ) {\n\t\t\tif ( is_array( $usecolumns ) && in_array( 'officials', $usecolumns ) ) {\n\t\t\t\t$event        = new SP_Event( $event );\n\t\t\t\t$appointments = $event->appointments( true, '&mdash;' );\n\t\t\t\tunset( $appointments[0] );\n\n\t\t\t\tforeach ( $appointments as $officials ) {\n\t\t\t\t\t?>\n\t\t\t\t<td>\n\t\t\t\t\t<?php echo wp_kses_post( implode( '<br>', $officials ) ); ?>\n\t\t\t\t</td>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add meta boxes.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_meta_boxes( $meta_boxes ) {\n\t\t\t$meta_boxes['sp_event']['officials'] = array(\n\t\t\t\t'title'    => esc_attr__( 'Officials', 'sportspress' ),\n\t\t\t\t'output'   => 'SP_Meta_Box_Event_Officials::output',\n\t\t\t\t'save'     => 'SP_Meta_Box_Event_Officials::save',\n\t\t\t\t'context'  => 'side',\n\t\t\t\t'priority' => 'default',\n\t\t\t);\n\t\t\treturn $meta_boxes;\n\t\t}\n\n\t\t/**\n\t\t * Add calendar columns.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function calendar_columns( $columns = array() ) {\n\t\t\t$columns['officials'] = esc_attr__( 'Officials', 'sportspress' );\n\t\t\treturn $columns;\n\t\t}\n\n\t\t/**\n\t\t * Add event template.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_event_template( $templates ) {\n\t\t\treturn array_merge(\n\t\t\t\t$templates,\n\t\t\t\tarray(\n\t\t\t\t\t'officials' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Officials', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_event_show_officials',\n\t\t\t\t\t\t'action'  => 'sportspress_output_event_officials',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add event options.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_event_options( $options ) {\n\t\t\t$options[] = array(\n\t\t\t\t'title'   => esc_attr__( 'Officials', 'sportspress' ),\n\t\t\t\t'id'      => 'sportspress_event_officials_format',\n\t\t\t\t'default' => 'table',\n\t\t\t\t'type'    => 'radio',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'table' => esc_attr__( 'Table', 'sportspress' ),\n\t\t\t\t\t'list'  => esc_attr__( 'List', 'sportspress' ),\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn $options;\n\t\t}\n\n\t\t/**\n\t\t * Add text options\n\t\t */\n\t\tpublic function add_text_options( $options = array() ) {\n\t\t\treturn array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\t__( 'Officials', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function add_menu_item( $items ) {\n\t\t\t$items[] = 'edit.php?post_type=sp_official';\n\t\t\treturn $items;\n\t\t}\n\n\t\t/**\n\t\t * Add glance item\n\t\t */\n\t\tpublic function add_glance_item( $items ) {\n\t\t\t$items[] = 'sp_official';\n\t\t\treturn $items;\n\t\t}\n\n\t\t/**\n\t\t * Register importer\n\t\t */\n\t\tpublic function register_importer( $importers = array() ) {\n\t\t\t$importers['sp_official_csv'] = array(\n\t\t\t\t'name'        => esc_attr__( 'SportsPress Officials (CSV)', 'sportspress' ),\n\t\t\t\t'description' => wp_kses_post( __( 'Import <strong>officials</strong> from a csv file.', 'sportspress' ) ),\n\t\t\t\t'callback'    => array( $this, 'officials_importer' ),\n\t\t\t);\n\t\t\treturn $importers;\n\t\t}\n\n\t\t/**\n\t\t * Officials importer\n\t\t */\n\t\tpublic function officials_importer() {\n\t\t\tSP_Admin_Importers::includes();\n\n\t\t\trequire SP()->plugin_path() . '/includes/admin/importers/class-sp-official-importer.php';\n\n\t\t\t// Dispatch\n\t\t\t$importer = new SP_Official_Importer();\n\t\t\t$importer->dispatch();\n\t\t}\n\n\t\t/**\n\t\t * Add screen ids.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function screen_ids( $ids ) {\n\t\t\treturn array_merge(\n\t\t\t\t$ids,\n\t\t\t\tarray(\n\t\t\t\t\t'sp_official',\n\t\t\t\t\t'edit-sp_official',\n\t\t\t\t\t'sp_duty',\n\t\t\t\t\t'edit-sp_duty',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tpublic static function add_post_type( $post_types = array() ) {\n\t\t\t$post_types[] = 'sp_official';\n\t\t\treturn $post_types;\n\t\t}\n\n\t\tpublic static function add_to_hierarchy( $hierarchy = array() ) {\n\t\t\t$hierarchy['sp_official'] = array();\n\t\t\treturn $hierarchy;\n\t\t}\n\n\t\t/**\n\t\t * Taxonomy columns.\n\t\t *\n\t\t * @access public\n\t\t * @param mixed $columns\n\t\t * @return array\n\t\t */\n\t\tpublic function taxonomy_columns( $columns ) {\n\t\t\t$new_columns = array();\n\n\t\t\tif ( function_exists( 'get_term_meta' ) ) {\n\t\t\t\t$new_columns['sp_order'] = esc_attr__( 'Order', 'sportspress' );\n\t\t\t}\n\n\t\t\tif ( array_key_exists( 'posts', $columns ) ) {\n\t\t\t\t$new_columns['posts'] = $columns['posts'];\n\n\t\t\t\tunset( $columns['posts'] );\n\t\t\t}\n\n\t\t\treturn array_merge( $columns, $new_columns );\n\t\t}\n\n\t\t/**\n\t\t * Edit taxonomy fields.\n\t\t *\n\t\t * @access public\n\t\t * @param mixed $term Term (category) being edited\n\t\t */\n\t\tpublic function edit_taxonomy_fields( $term ) {\n\t\t\t$t_id = $term->term_id;\n\t\t\t?>\n\t\t\t<?php if ( function_exists( 'get_term_meta' ) ) { ?>\n\t\t\t\t<?php $order = get_term_meta( $t_id, 'sp_order', true ); ?>\n\t\t\t<tr class=\"form-field\">\n\t\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"sp_order\"><?php esc_attr_e( 'Order', 'sportspress' ); ?></label></th>\n\t\t\t\t<td><input name=\"sp_order\" class=\"sp-number-input\" type=\"text\" step=\"1\" size=\"4\" id=\"sp_order\" value=\"<?php echo (int) $order; ?>\"></td>\n\t\t\t</tr>\n\t\t<?php } ?>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Save taxonomy fields.\n\t\t *\n\t\t * @access public\n\t\t * @param mixed $term_id Term ID being saved\n\t\t * @return void\n\t\t */\n\t\tpublic function save_taxonomy_fields( $term_id ) {\n\t\t\tif ( function_exists( 'add_term_meta' ) ) {\n\t\t\t\tupdate_term_meta( $term_id, 'sp_order', (int) sp_array_value( $_POST, 'sp_order', 0 ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Column value added to category admin.\n\t\t *\n\t\t * @access public\n\t\t * @param mixed $columns\n\t\t * @param mixed $column\n\t\t * @param mixed $id\n\t\t * @return array\n\t\t */\n\t\tpublic function taxonomy_column_value( $columns, $column, $id ) {\n\n\t\t\tif ( $column == 'sp_address' ) {\n\n\t\t\t\t$term_meta = get_option( \"taxonomy_$id\" );\n\n\t\t\t\t$address = ( isset( $term_meta['sp_address'] ) ? esc_attr($term_meta['sp_address']) : '&mdash;' );\n\n\t\t\t\t$columns .= $address;\n\n\t\t\t} elseif ( $column == 'sp_sections' ) {\n\n\t\t\t\t$options = apply_filters(\n\t\t\t\t\t'sportspress_performance_sections',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t\t\t1 => esc_attr__(\n\t\t\t\t\t\t\t'Defense',\n\t\t\t\t\t\t\t'sportspress'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$sections = sp_get_term_sections( $id );\n\n\t\t\t\t$section_names = array();\n\n\t\t\t\tif ( is_array( $sections ) ) {\n\t\t\t\t\tforeach ( $sections as $section ) {\n\t\t\t\t\t\tif ( array_key_exists( $section, $options ) ) {\n\t\t\t\t\t\t\t$section_names[] = $options[ $section ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$columns .= implode( ', ', $section_names );\n\n\t\t\t} elseif ( $column == 'sp_order' ) {\n\n\t\t\t\t$columns = (int) get_term_meta( $id, 'sp_order', true );\n\n\t\t\t}\n\n\t\t\treturn $columns;\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function duties_menu() {\n\t\t\tadd_submenu_page( 'edit.php?post_type=sp_official', esc_attr__( 'Duties', 'sportspress' ), esc_attr__( 'Duties', 'sportspress' ), 'manage_sp_event_terms', 'edit-tags.php?taxonomy=sp_duty' );\n\t\t}\n\n\t\t/**\n\t\t * Highlight parent menu item\n\t\t */\n\t\tpublic function parent_file( $parent_file ) {\n\t\t\tglobal $current_screen;\n\t\t\t$taxonomy = $current_screen->taxonomy;\n\n\t\t\tif ( 'sp_duty' == $taxonomy ) {\n\t\t\t\t$parent_file = 'edit.php?post_type=sp_official';\n\t\t\t}\n\n\t\t\treturn $parent_file;\n\t\t}\n\t}\n\nendif;\n\nif ( get_option( 'sportspress_load_officials_module', 'no' ) == 'yes' ) {\n\tnew SportsPress_Officials();\n}\n"
  },
  {
    "path": "modules/sportspress-openstreetmap.php",
    "content": "<?php\n/**\n * OpenStreetMap\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.14\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_OpenStreetMap' ) ) :\n\n\t/**\n\t * Main SportsPress OpenStreetMap Class\n\t *\n\t * @class SportsPress_OpenStreetMap\n\t * @version 2.7.14\n\t */\n\n\tclass SportsPress_OpenStreetMap {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );\n\t\t\tadd_action( 'sp_admin_venue_scripts', array( $this, 'admin_venue_scripts' ) );\n\t\t\tadd_action( 'sp_frontend_venue_scripts', array( $this, 'frontend_venue_scripts' ) );\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );\n\t\t\tadd_action( 'sp_venue_show_map', array( $this, 'show_venue_map' ), 10, 5 );\n\t\t\tadd_action( 'sp_admin_geocoder_scripts', array( $this, 'admin_geocoder_scripts' ), 10 );\n\t\t\tadd_action( 'sp_setup_geocoder_scripts', array( $this, 'setup_geocoder_scripts' ), 10 );\n\t\t\tadd_action( 'sp_setup_venue_geocoder_scripts', array( $this, 'setup_venue_geocoder_scripts' ), 10 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_OPENSTREETMAP_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_OPENSTREETMAP_VERSION', '2.7.14' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_OPENSTREETMAP_URL' ) ) {\n\t\t\t\tdefine( 'SP_OPENSTREETMAP_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_OPENSTREETMAP_DIR' ) ) {\n\t\t\t\tdefine( 'SP_OPENSTREETMAP_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Enqueue admin scripts\n\t\t */\n\t\tpublic function admin_scripts() {\n\t\t\t  do_action( 'sp_admin_venue_scripts' );\n\t\t}\n\n\t\t/**\n\t\t * Enqueue admin venue scripts\n\t\t */\n\t\tpublic function admin_venue_scripts() {\n\t\t\t  $screen = get_current_screen();\n\n\t\t\tif ( in_array( $screen->id, sp_get_screen_ids() ) ) {\n\t\t\t\twp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.8.0' );\n\t\t\t\twp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array(), '1.13.0' );\n\t\t\t}\n\n\t\t\tif ( in_array( $screen->id, sp_get_screen_ids() ) ) {\n\t\t\t\twp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.8.0' );\n\t\t\t\twp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.min.js', array( 'leaflet_js' ), '1.13.0' );\n\t\t\t\twp_register_script( 'sportspress-admin-geocoder', SP()->plugin_url() . '/assets/js/admin/sp-geocoder.js', array( 'leaflet_js', 'control-geocoder' ), SP_VERSION, true );\n\t\t\t}\n\n\t\t\tif ( in_array( $screen->id, array( 'edit-sp_venue' ) ) ) {\n\t\t\t\twp_enqueue_script( 'leaflet_js' );\n\t\t\t\twp_enqueue_script( 'control-geocoder' );\n\t\t\t\twp_enqueue_script( 'sportspress-admin-geocoder' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Enqueue frontend scripts\n\t\t */\n\t\tpublic function frontend_scripts() {\n\t\t\t  do_action( 'sp_frontend_venue_scripts' );\n\t\t}\n\n\t\t/**\n\t\t * Enqueue frontend venue scripts\n\t\t */\n\t\tpublic function frontend_venue_scripts() {\n\t\t\t  global $post;\n\t\t\tif ( is_tax( 'sp_venue' ) || is_singular( 'sp_event' ) || ( isset( $post->post_content ) && sp_has_shortcodes( $post->post_content, array( 'event_full', 'event_venue' ) ) ) ) {\n\t\t\t\twp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.8.0' );\n\t\t\t\twp_enqueue_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.8.0' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Integrate OpenStreetMap (Show Venue)\n\t\t *\n\t\t * @return mix\n\t\t */\n\t\tpublic function show_venue_map( $latitude, $longitude, $address, $zoom, $maptype ) {\n\t\t\t  $lat     = abs( $latitude );\n\t\t\t  $lat_deg = floor( $lat );\n\t\t\t  $lat_sec = ( $lat - $lat_deg ) * 3600;\n\t\t\t  $lat_min = floor( $lat_sec / 60 );\n\t\t\t  $lat_sec = floor( $lat_sec - ( $lat_min * 60 ) );\n\t\t\t  $lat_dir = $latitude > 0 ? 'N' : 'S';\n\n\t\t\t  $lon     = abs( $longitude );\n\t\t\t  $lon_deg = floor( $lon );\n\t\t\t  $lon_sec = ( $lon - $lon_deg ) * 3600;\n\t\t\t  $lon_min = floor( $lon_sec / 60 );\n\t\t\t  $lon_sec = floor( $lon_sec - ( $lon_min * 60 ) );\n\t\t\t  $lon_dir = $longitude > 0 ? 'E' : 'W';\n\t\t\t?>\n\t\t<a href=\"<?php echo esc_url( 'https://www.google.com/maps/place/' . urlencode( \"{$lat_deg}°{$lat_min}'{$lat_sec}\\\"{$lat_dir}\" ) . '+' . urlencode( \"{$lon_deg}°{$lon_min}'{$lon_sec}\\\"{$lon_dir}\" ) . '/@' . $latitude . ',' . $longitude . ',' . $zoom . 'z' ); ?>\" target=\"_blank\"><div id=\"sp_openstreetmaps_container\" style=\"width: 100%; height: 320px\"></div></a>\n\t<script>\n\t// position we will use later\n\tvar lat = <?php echo esc_attr( $latitude ); ?>;\n\tvar lon = <?php echo esc_attr( $longitude ); ?>;\n\t// initialize map\n\tmap = L.map('sp_openstreetmaps_container', { zoomControl:false }).setView([lat, lon], <?php echo esc_attr( $zoom ); ?>);\n\t// set map tiles source\n\t\t\t  <?php if ( 'satellite' === $maptype ) { ?>\n\t\tL.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {\n\t\t  attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',\n\t\t  maxZoom: 18,\n\t\t}).addTo(map);\n\t<?php } else { ?>\n\t\tL.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n\t\t  attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors',\n\t\t  maxZoom: 18,\n\t\t}).addTo(map);\n\t<?php } ?>\n\t// add marker to the map\n\tmarker = L.marker([lat, lon]).addTo(map);\n\tmap.dragging.disable();\n\tmap.touchZoom.disable();\n\tmap.doubleClickZoom.disable();\n\tmap.scrollWheelZoom.disable();\n  </script>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Print geocoder script in admin\n\t\t */\n\t\tpublic function admin_geocoder_scripts() {\n\t\t\t  wp_print_scripts( 'sportspress-admin-setup-geocoder' );\n\t\t}\n\n\t\t/**\n\t\t * Print geocoder script in setup\n\t\t */\n\t\tpublic function setup_geocoder_scripts() {\n\t\t\t  wp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.8.0' );\n\t\t\t  wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.min.js', array( 'leaflet_js' ), '1.13.0' );\n\t\t\t  wp_register_script( 'sportspress-admin-setup-geocoder', SP()->plugin_url() . '/assets/js/admin/sp-setup-geocoder.js', array( 'leaflet_js', 'control-geocoder' ), SP_VERSION, true );\n\t\t\t  wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array(), '1.13.0' );\n\t\t\t  wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.8.0' );\n\t\t}\n\n\t\t/**\n\t\t * Print geocoder script in setup venue step\n\t\t */\n\t\tpublic function setup_venue_geocoder_scripts() {\n\t\t\t  wp_print_scripts( 'leaflet_js' );\n\t\t\t  wp_print_scripts( 'control-geocoder' );\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_OpenStreetMap();\n"
  },
  {
    "path": "modules/sportspress-overview.php",
    "content": "<?php\n/**\n * Overview\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Overview' ) ) :\n\n\t/**\n\t * Main SportsPress Overview Class\n\t *\n\t * @class SportsPress_Overview\n\t * @version 2.5\n\t */\n\tclass SportsPress_Overview {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ), 11 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_OVERVIEW_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_OVERVIEW_VERSION', '2.5' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_OVERVIEW_URL' ) ) {\n\t\t\t\tdefine( 'SP_OVERVIEW_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_OVERVIEW_DIR' ) ) {\n\t\t\t\tdefine( 'SP_OVERVIEW_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function admin_menu() {\n\t\t\tadd_submenu_page( 'sportspress', esc_attr__( 'Overview', 'sportspress' ), esc_attr__( 'Overview', 'sportspress' ), 'manage_sportspress', 'sportspress-overview', array( $this, 'overview_page' ) );\n\t\t}\n\n\t\t/**\n\t\t * Init the overview page\n\t\t */\n\t\tpublic function overview_page() {\n\t\t\t?>\n\t\t<div class=\"wrap sportspress sportspress-overview-wrap\">\n\t\t\t<h2>\n\t\t\t\t<?php esc_attr_e( 'Overview', 'sportspress' ); ?>\n\t\t\t</h2>\n\t\t\t<div class=\"sp-sitemap\">\n\n\t\t\t\t<?php\n\t\t\t\t$primary_post_types = sp_primary_post_types();\n\t\t\t\t$hierarchy          = sp_post_type_hierarchy();\n\t\t\t\t?>\n\n\t\t\t\t<?php if ( ! isset( $_GET['type'] ) && ! isset( $_GET['taxonomy'] ) ) : // Overview ?>\n\n\t\t\t\t\t<ul class=\"sp-utility\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $primary_post_types as $post_type ) :\n\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t$object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<li><a class=\"button button-primary\" href=\"\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'page' => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t'type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\"><?php echo esc_attr( $object->labels->name ); ?></a></li>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t?>\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<?php $taxonomies = sp_taxonomies(); ?>\n\t\t\t\t\t<ul class=\"sp-primary col<?php echo esc_attr( sizeof( $taxonomies ) ); ?>\">\n\t\t\t\t\t\t<li class=\"sp-home\"><a class=\"button disabled\"><?php esc_attr_e( 'SportsPress', 'sportspress' ); ?></a></li>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $taxonomies as $taxonomy ) :\n\t\t\t\t\t\t\t$object     = get_taxonomy( $taxonomy );\n\t\t\t\t\t\t\t$post_types = apply_filters( 'sportspress_sitemap_taxonomy_post_types', $object->object_type, $taxonomy );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<li><a class=\"button button-primary\" href=\"\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'page'     => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\"><?php echo esc_attr( $object->labels->name ); ?></a>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$terms = get_terms(\n\t\t\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t\t\t'parent'     => 0,\n\t\t\t\t\t\t\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $terms ) > 0 ) : ?>\n\t\t\t\t\t\t\t\t\t\t<?php foreach ( $terms as $term ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t$children = get_terms(\n\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parent'  => $term->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'orderby' => 'slug',\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( ! $children && sizeof( $post_types ) <= 1 ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( sizeof( $post_types ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy   => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-notification\"></span></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tendforeach;\nendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"button\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'page' => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'term' => $term->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $children ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $children as $child ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $post_types ) <= 1 ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( sizeof( $post_types ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy   => $child->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $child->name ) ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-highlight\"></span></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendforeach;\nendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"button\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'page'     => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'term'     => $child->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $child->name ) ); ?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t\t<li><a class=\"button\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'taxonomy' => $taxonomy ), 'edit-tags.php' ) ) ); ?>\"><?php echo esc_attr( $object->labels->add_new_item ); ?></a></li>\n\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<?php\n\t\t\t\telseif ( ! isset( $_GET['type'] ) ) :\n\t\t\t\t\t$taxonomy        = sanitize_key( $_GET['taxonomy'] );\n\t\t\t\t\t$taxonomy_object = get_taxonomy( $taxonomy );\n\t\t\t\t\t?>\n\t\t\t\t\t\t\n\t\t\t\t\t<?php $post_types = apply_filters( 'sportspress_sitemap_taxonomy_post_types', $taxonomy_object->object_type, $taxonomy ); ?>\n\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( isset( $_GET['term'] ) ) :\n\t\t\t\t\t\t$term = get_term( sanitize_key( $_GET['term'] ), $taxonomy ); // Posts in term\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<ul class=\"sp-utility\">\n\t\t\t\t\t\t\t<li><a class=\"button button-primary\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'taxonomy' => $taxonomy ), 'edit-tags.php' ) ) ); ?>\"><?php echo esc_attr( $taxonomy_object->labels->edit_item ); ?></a></li>\n\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$terms = get_terms(\n\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t'parent'     => $term->term_id,\n\t\t\t\t\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<?php if ( $terms ) : // Has children ?>\n\n\t\t\t\t\t\t\t<ul class=\"sp-primary col<?php echo esc_attr( sizeof( $terms ) + 1 ); ?>\">\n\t\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress-overview' ), 'admin.php' ) ) ); ?>\"><?php esc_attr_e( 'SportsPress', 'sportspress' ); ?></a></li>\n\t\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'page'     => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $taxonomy_object->labels->name ); ?></a></li>\n\t\t\t\t\t\t\t\t<li class=\"sp-home\"><a class=\"button disabled\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?></a></li>\n\t\t\t\t\t\t\t\t<li><a class=\"button disabled\"><?php esc_attr_e( 'All', 'sportspress' ); ?></a>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $post_types ) ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button button-primary action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $post_object->labels->name ); ?><span class=\"dashicons dashicons-list-view\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t<?php foreach ( $terms as $term ) : ?>\n\t\t\t\t\t\t\t\t\t<li><a class=\"button button-primary\" href=\"\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'page' => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'term' => $term->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?></a>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t$children = get_terms(\n\t\t\t\t\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t'parent'  => $term->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t'orderby' => 'slug',\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t\t\t<?php if ( $children ) : // Has children ?>\n\n\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $children as $child ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy   => $child->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $child->name ) ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-notification\"></span></a>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $post_types ) ) : // Has associated post types ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy   => $child->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $post_object->labels->name ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-highlight\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t\t\t\t\t<?php elseif ( sizeof( $post_types ) ) : // Has associated post types ?>\n\n\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy   => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $post_object->labels->name ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-notification\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<?php else : // No children ?>\n\n\t\t\t\t\t\t\t<ul class=\"sp-primary col<?php echo esc_attr( sizeof( $post_types ) ); ?>\">\n\t\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress-overview' ), 'admin.php' ) ) ); ?>\"><?php esc_attr_e( 'SportsPress', 'sportspress' ); ?></a></li>\n\t\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'page'     => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $taxonomy_object->labels->name ); ?></a></li>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( $term->parent ) :\n\t\t\t\t\t\t\t\t\t$parent = get_term( $term->parent, $taxonomy );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'page' => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'term' => $term->parent,\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $parent->name ); ?></a></li>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<li class=\"sp-home\"><a class=\"button disabled\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?></a></li>\n\t\t\t\t\t\t\t\t<?php if ( sizeof( $taxonomy_object->object_type ) ) : ?>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button button-primary action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $post_object->labels->name ); ?><span class=\"dashicons dashicons-list-view\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<?php else : // Taxonomy archive ?>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$terms = get_terms(\n\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t'parent'     => 0,\n\t\t\t\t\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<ul class=\"sp-primary col<?php echo esc_attr( sizeof( $terms ) + 1 ); ?>\">\n\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress-overview' ), 'admin.php' ) ) ); ?>\"><?php esc_attr_e( 'SportsPress', 'sportspress' ); ?></a></li>\n\t\t\t\t\t\t\t<li class=\"sp-home\"><a class=\"button disabled\"><?php echo esc_attr( $taxonomy_object->labels->name ); ?></a></li>\n\t\t\t\t\t\t\t<?php if ( $terms ) : ?>\n\t\t\t\t\t\t\t\t<?php foreach ( $terms as $term ) : ?>\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tif ( sizeof( $post_types ) <= 1 ) :\n\t\t\t\t\t\t\t\t\t\t\t$post_type = reset( $post_types );\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<a class=\"button button-primary action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?><span class=\"dashicons dashicons-list-view\"></span></a>\n\t\t\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t\t\t<a class=\"button button-primary\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'page' => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'term' => $term->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?></a>\n\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t$children = get_terms(\n\t\t\t\t\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t'parent'  => $term->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t'orderby' => 'slug',\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<ul>\n\n\t\t\t\t\t\t\t\t\t\t\t<?php if ( $children ) : // Has children ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $post_types ) <= 1 ) : ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $children as $child ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $post_types ) ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy   => $child->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $child->name ) ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-notification\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t<?php else : ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $post_types ) ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy   => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $post_object->labels->name ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-notification\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $children as $child ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'page'     => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'term'     => $child->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $child->name ) ); ?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $post_types ) ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $child->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $post_object->labels->name ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-highlight\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t<?php else : // No children ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( sizeof( $post_types ) > 1 ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_types as $post_type ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( post_type_exists( $post_type ) ) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $post_object->labels->name ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-notification\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<li><a class=\"button button-primary action\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'taxonomy' => $taxonomy ), 'edit-tags.php' ) ) ); ?>\"><?php echo esc_attr( $taxonomy_object->labels->add_new_item ); ?><span class=\"dashicons dashicons-plus\"></span></a></li>\n\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<?php\n\t\t\t\telseif ( ! isset( $_GET['taxonomy'] ) ) :\n\t\t\t\t\t$post_type = sanitize_key( $_GET['type'] ); // Post type archive\n\t\t\t\t\t?>\n\n\t\t\t\t\t<?php\n\t\t\t\t\t$post_object = get_post_type_object( $post_type );\n\t\t\t\t\t$taxonomies  = get_object_taxonomies( $post_type, 'objects' );\n\t\t\t\t\t?>\n\n\t\t\t\t\t<ul class=\"sp-utility\">\n\t\t\t\t\t\t<li><a class=\"button button-primary\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => $post_type ), 'post-new.php' ) ) ); ?>\"><?php echo esc_attr( $post_object->labels->add_new_item ); ?></a></li>\n\t\t\t\t\t\t<li><a class=\"button\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => $post_type ), 'edit.php' ) ) ); ?>\"><?php esc_attr_e( 'View All', 'sportspress' ); ?></a></li>\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<?php if ( sizeof( $taxonomies ) || sizeof( sp_array_value( $hierarchy, $post_type ) ) ) : // Display taxonomies ?>\n\t\t\t\t\t\t<ul class=\"sp-primary col<?php echo esc_attr( sizeof( $taxonomies ) + sizeof( sp_array_value( $hierarchy, $post_type ) ) ); ?>\">\n\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress-overview' ), 'admin.php' ) ) ); ?>\"><?php esc_attr_e( 'SportsPress', 'sportspress' ); ?></a></li>\n\t\t\t\t\t\t\t<li class=\"sp-home\"><a class=\"button disabled\"><?php echo esc_attr( $post_object->labels->name ); ?></a></li>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( sp_array_value( $hierarchy, $post_type ) as $secondary_post_type ) :\n\t\t\t\t\t\t\t\tif ( post_type_exists( $secondary_post_type ) ) :\n\t\t\t\t\t\t\t\t\t$secondary_post_object = get_post_type_object( $secondary_post_type );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<li><a class=\"button button-primary action\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => $secondary_post_type ), 'edit.php' ) ) ); ?>\"><?php echo esc_attr( $secondary_post_object->labels->name ); ?><span class=\"dashicons dashicons-list-view\"></span></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$posts = get_posts(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $secondary_post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $posts ) : ?>\n\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $posts as $post ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"<?php echo esc_url( get_edit_post_link( $post->ID ) ); ?>\"><?php echo esc_html( wp_strip_all_tags( $post->post_title ) ); ?><span class=\"dashicons dashicons-edit wp-ui-text-notification\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tendif;\nendforeach;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $taxonomies as $taxonomy_object ) :\n\t\t\t\t\t\t\t\t$taxonomy = $taxonomy_object->name;\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<li><a class=\"button button-primary\" href=\"\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'page'     => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t\t'type'     => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t'taxonomy' => $taxonomy_object->name,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $taxonomy_object->labels->name ); ?></a>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$terms = get_terms(\n\t\t\t\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t\t\t\t'parent'     => 0,\n\t\t\t\t\t\t\t\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<?php if ( $terms ) : ?>\n\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $terms as $term ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-notification\"></span></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t$children = get_terms(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'parent' => $term->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'orderby' => 'slug',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $children ) : // Has children ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $children as $child ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $child->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $child->name ) ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-highlight\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t<?php else : // Display posts ?>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$posts = get_posts(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t'post_type'      => $post_type,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<ul class=\"sp-primary col<?php echo esc_attr( sizeof( $posts ) ); ?>\">\n\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress-overview' ), 'admin.php' ) ) ); ?>\"><?php esc_attr_e( 'SportsPress', 'sportspress' ); ?></a></li>\n\t\t\t\t\t\t\t<li class=\"sp-home\"><a class=\"button disabled\"><?php echo esc_attr( $post_object->labels->name ); ?></a></li>\n\t\t\t\t\t\t\t<?php if ( $posts ) : ?>\n\t\t\t\t\t\t\t\t<?php foreach ( $posts as $post ) : ?>\n\t\t\t\t\t\t\t\t\t<li><a class=\"button button-primary action\" href=\"<?php echo esc_url( get_edit_post_link( $post->ID ) ); ?>\"><?php echo esc_html( wp_strip_all_tags( $post->post_title ) ); ?><span class=\"dashicons dashicons-edit\"></span></a></li>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t<li><a class=\"button disabled\"><?php esc_attr_e( 'No results found.', 'sportspress' ); ?></a></li>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<?php\n\t\t\t\telse :\n\t\t\t\t\t$post_type = sanitize_key( $_GET['type'] );\n\t\t\t\t\t$taxonomy  = sanitize_key( $_GET['taxonomy'] ); // Filtered posts\n\t\t\t\t\t?>\n\n\t\t\t\t\t<?php if ( post_type_exists( $post_type ) ) : ?>\n\t\t\t\t\t\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$post_object     = get_post_type_object( $post_type );\n\t\t\t\t\t\t$taxonomy_object = get_taxonomy( sanitize_key( $_GET['taxonomy'] ) );\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$terms = get_terms(\n\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t'parent'     => 0,\n\t\t\t\t\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<ul class=\"sp-primary col<?php echo esc_attr( sizeof( $terms ) + 1 ); ?>\">\n\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress-overview' ), 'admin.php' ) ) ); ?>\"><?php esc_attr_e( 'SportsPress', 'sportspress' ); ?></a></li>\n\t\t\t\t\t\t\t<li class=\"sp-breadcrumb\"><a class=\"button\" href=\"\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'page' => 'sportspress-overview',\n\t\t\t\t\t\t\t\t\t\t\t'type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $post_object->labels->name ); ?></a></li>\n\t\t\t\t\t\t\t<li class=\"sp-home\"><a class=\"button disabled\"><?php echo esc_attr( $taxonomy_object->labels->name ); ?></a></li>\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $terms ) :\n\t\t\t\t\t\t\t\tforeach ( $terms as $term ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<li><a class=\"button button-primary action\" href=\"\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $term->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $term->name ) ); ?><span class=\"dashicons dashicons-list-view\"></span></a>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$children = get_terms(\n\t\t\t\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t\t\t\t'parent'     => $term->term_id,\n\t\t\t\t\t\t\t\t\t\t\t'orderby'    => 'slug',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $children ) : // Has children ?>\n\n\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $children as $child ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $child->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_html( wp_strip_all_tags( $child->name ) ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-notification\"></span></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$grandchildren = get_terms(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'parent' => $child->term_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'orderby' => 'slug',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $grandchildren ) : // Has grandchildren ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php foreach ( $grandchildren as $grandchild ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><a class=\"button action\" href=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$taxonomy => $grandchild->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit.php'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"><?php echo esc_attr( $grandchild->name ); ?><span class=\"dashicons dashicons-list-view wp-ui-text-highlight\"></span></a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tendforeach;\nendif;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<li><a class=\"button button-primary\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'taxonomy' => $taxonomy ), 'edit-tags.php' ) ) ); ?>\"><?php echo esc_attr( $taxonomy_object->labels->add_new_item ); ?></a></li>\n\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t\t\t<?php do_action( 'sportspress_overview_page' ); ?>\n\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Overview();\n"
  },
  {
    "path": "modules/sportspress-player-assignments.php",
    "content": "<?php\n/**\n * Player Assignments\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Player_Assignments' ) ) :\n\t/**\n\t * Main SportsPress Player Assignments Class\n\t *\n\t * @class SportsPress_Player_Assignments\n\t * @version 2.7.3\n\t */\n\tclass SportsPress_Player_Assignments {\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'sportspress_process_sp_player_meta', array( $this, 'save' ) );\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_player_list_args', array( $this, 'add_args' ), 10, 2 );\n\t\t\tadd_filter( 'sportspress_player_list_players', array( $this, 'add_players' ), 10, 4 );\n\t\t}\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_PLAYER_ASSIGNMENTS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_PLAYER_ASSIGNMENTS_VERSION', '2.7.3' );\n\t\t\t}\n\t\t\tif ( ! defined( 'SP_PLAYER_ASSIGNMENTS_URL' ) ) {\n\t\t\t\tdefine( 'SP_PLAYER_ASSIGNMENTS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\t\t\tif ( ! defined( 'SP_PLAYER_ASSIGNMENTS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_PLAYER_ASSIGNMENTS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Save Additional Statistics\n\t\t */\n\t\tpublic function save( $post_id ) {\n\t\t\tdelete_post_meta( $post_id, 'sp_assignments' );\n\n\t\t\t$leagues = sp_array_value( $_POST, 'sp_leagues', array() );\n\n\t\t\tif ( ! is_array( $leagues ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $leagues as $l_id => $season ) {\n\t\t\t\tif ( 0 === $l_id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach ( $season as $s_id => $team_id ) {\n\t\t\t\t\tif ( 0 >= $team_id ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$serialized = intval( $l_id ) . '_' . intval( $s_id ) . '_' . intval( $team_id );\n\t\t\t\t\tadd_post_meta( $post_id, 'sp_assignments', $serialized, false );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add args to filter out assigned players\n\t\t */\n\t\tpublic function add_args( $args = array(), $team = false ) {\n\t\t\tif ( ! $team ) {\n\t\t\t\treturn $args;\n\t\t\t}\n\n\t\t\t$tax_query  = (array) sp_array_value( $args, 'tax_query', array() );\n\t\t\t$league_ids = array();\n\t\t\t$season_ids = array();\n\n\t\t\tforeach ( $tax_query as $param ) {\n\t\t\t\tif ( 'sp_league' === sp_array_value( $param, 'taxonomy' ) ) {\n\t\t\t\t\t$league_ids = sp_array_value( $param, 'terms', array() );\n\t\t\t\t}\n\t\t\t\tif ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) {\n\t\t\t\t\t$season_ids = sp_array_value( $param, 'terms', array() );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $league_ids ) && empty( $season_ids ) ) {\n\t\t\t\treturn $args;\n\t\t\t}\n\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\t'key'     => 'sp_assignments',\n\t\t\t\t'value'   => '',\n\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t);\n\n\t\t\t$args['meta_query']['relation'] = 'AND';\n\n\t\t\treturn $args;\n\t\t}\n\n\t\t/**\n\t\t * Add assigned players to player list\n\t\t */\n\t\tpublic function add_players( $players = array(), $args = array(), $team = false, $team_key = 'sp_team' ) {\n\t\t\tif ( ! $team ) {\n\t\t\t\treturn $players;\n\t\t\t}\n\n\t\t\t$tax_query  = (array) sp_array_value( $args, 'tax_query', array() );\n\t\t\t$league_ids = array();\n\t\t\t$season_ids = array();\n\n\t\t\tforeach ( $tax_query as $param ) {\n\t\t\t\tif ( 'sp_league' === sp_array_value( $param, 'taxonomy' ) ) {\n\t\t\t\t\t$league_ids = sp_array_value( $param, 'terms', array() );\n\t\t\t\t}\n\t\t\t\tif ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) {\n\t\t\t\t\t$season_ids = sp_array_value( $param, 'terms', array() );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $league_ids ) && empty( $season_ids ) ) {\n\t\t\t\treturn $players;\n\t\t\t}\n\n\t\t\t$assignments = array();\n\n\t\t\tif ( ! empty( $league_ids ) && ! empty( $season_ids ) ) {\n\t\t\t\tforeach ( $league_ids as $l_id ) {\n\t\t\t\t\tforeach ( $season_ids as $s_id ) {\n\t\t\t\t\t\tif ( $team && $team != '0' ) {\n\t\t\t\t\t\t\t$assignments[] = $l_id . '_' . $s_id . '_' . $team;\n\t\t\t\t\t\t\t$compare       = 'IN';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $league_ids ) && ! empty( $season_ids ) ) {\n\t\t\t\tforeach ( $season_ids as $s_id ) {\n\t\t\t\t\tif ( $team && $team != '0' ) {\n\t\t\t\t\t\t$assignments[] = '_' . $s_id . '_' . $team;\n\t\t\t\t\t\t$compare       = 'LIKE';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $league_ids ) && empty( $season_ids ) ) {\n\t\t\t\tforeach ( $league_ids as $l_id ) {\n\t\t\t\t\tif ( $team && $team != '0' ) {\n\t\t\t\t\t\t$assignments[] = $l_id . '_%_' . $team;\n\t\t\t\t\t\t$compare       = 'LIKE';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( sizeof( $assignments ) ) {\n\t\t\t\tif ( 'IN' == $compare ) {\n\t\t\t\t\t$args['meta_query'] = array(\n\t\t\t\t\t\t'relation' => 'AND',\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'     => 'sp_assignments',\n\t\t\t\t\t\t\t'value'   => $assignments,\n\t\t\t\t\t\t\t'compare' => $compare,\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'   => $team_key,\n\t\t\t\t\t\t\t'value' => $team,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif ( 'LIKE' == $compare ) {\n\t\t\t\t\t$args['meta_query'] = array(\n\t\t\t\t\t\t'relation' => 'AND',\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'key'   => $team_key,\n\t\t\t\t\t\t\t'value' => $team,\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\tforeach ( $assignments as $assignment ) {\n\t\t\t\t\t\t$args['meta_query'][1][] = array(\n\t\t\t\t\t\t\t'key'     => 'sp_assignments',\n\t\t\t\t\t\t\t'value'   => $assignment,\n\t\t\t\t\t\t\t'compare' => $compare,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$assigned_players = (array) get_posts( $args );\n\n\t\t\t$players = array_merge( $assigned_players, $players );\n\n\t\t\t$players = array_map( 'unserialize', array_unique( array_map( 'serialize', $players ) ) );\n\n\t\t\tforeach ( $players as $i => $player ) {\n\t\t\t\t$player->sp_number = get_post_meta( $player->ID, 'sp_number', true );\n\t\t\t}\n\n\t\t\tuasort( $players, array( $this, 'sort' ) );\n\n\t\t\treturn $players;\n\t\t}\n\n\t\tpublic function sort( $a, $b ) {\n\t\t\tif ( $a->sp_number == $b->sp_number ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ( $a->sp_number < $b->sp_number ) ? -1 : 1;\n\t\t}\n\t}\nendif;\n\nnew SportsPress_Player_Assignments();\n"
  },
  {
    "path": "modules/sportspress-player-lists.php",
    "content": "<?php\n/**\n * Player Lists\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Player_Lists' ) ) :\n\n\t/**\n\t * Main SportsPress Player Lists Class\n\t *\n\t * @class SportsPress_Player_Lists\n\t * @version 2.6.15\n\t */\n\tclass SportsPress_Player_Lists {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Actions\n\t\t\tadd_action( 'init', array( $this, 'register_post_type' ) );\n\t\t\tadd_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 );\n\t\t\tadd_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) );\n\t\t\tadd_action( 'sportspress_widgets', array( $this, 'include_widgets' ) );\n\t\t\tadd_action( 'sportspress_create_rest_routes', array( $this, 'create_rest_routes' ) );\n\t\t\tadd_action( 'sportspress_register_rest_fields', array( $this, 'register_rest_fields' ) );\n\n\t\t\t// Filters\n\t\t\tadd_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );\n\t\t\tadd_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) );\n\t\t\tadd_filter( 'sportspress_player_settings', array( $this, 'add_settings' ) );\n\t\t\tadd_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 20 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_PLAYER_LISTS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_PLAYER_LISTS_VERSION', '2.6.15' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_PLAYER_LISTS_URL' ) ) {\n\t\t\t\tdefine( 'SP_PLAYER_LISTS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_PLAYER_LISTS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_PLAYER_LISTS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Register league tables post type\n\t\t */\n\t\tpublic static function register_post_type() {\n\t\t\tregister_post_type(\n\t\t\t\t'sp_list',\n\t\t\t\tapply_filters(\n\t\t\t\t\t'sportspress_register_post_type_list',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'labels'                => array(\n\t\t\t\t\t\t\t'name'               => esc_attr__( 'Player Lists', 'sportspress' ),\n\t\t\t\t\t\t\t'singular_name'      => esc_attr__( 'Player List', 'sportspress' ),\n\t\t\t\t\t\t\t'add_new_item'       => esc_attr__( 'Add New Player List', 'sportspress' ),\n\t\t\t\t\t\t\t'edit_item'          => esc_attr__( 'Edit Player List', 'sportspress' ),\n\t\t\t\t\t\t\t'new_item'           => esc_attr__( 'New', 'sportspress' ),\n\t\t\t\t\t\t\t'view_item'          => esc_attr__( 'View Player List', 'sportspress' ),\n\t\t\t\t\t\t\t'search_items'       => esc_attr__( 'Search', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found'          => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t\t'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'public'                => true,\n\t\t\t\t\t\t'show_ui'               => true,\n\t\t\t\t\t\t'capability_type'       => 'sp_list',\n\t\t\t\t\t\t'map_meta_cap'          => true,\n\t\t\t\t\t\t'publicly_queryable'    => true,\n\t\t\t\t\t\t'exclude_from_search'   => false,\n\t\t\t\t\t\t'hierarchical'          => false,\n\t\t\t\t\t\t'rewrite'               => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ),\n\t\t\t\t\t\t'supports'              => array( 'title', 'editor', 'page-attributes', 'author', 'thumbnail' ),\n\t\t\t\t\t\t'has_archive'           => false,\n\t\t\t\t\t\t'show_in_nav_menus'     => true,\n\t\t\t\t\t\t'show_in_menu'          => 'edit.php?post_type=sp_player',\n\t\t\t\t\t\t'show_in_admin_bar'     => true,\n\t\t\t\t\t\t'show_in_rest'          => true,\n\t\t\t\t\t\t'rest_controller_class' => 'SP_REST_Posts_Controller',\n\t\t\t\t\t\t'rest_base'             => 'lists',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Remove meta boxes.\n\t\t */\n\t\tpublic function remove_meta_boxes() {\n\t\t\tremove_meta_box( 'sp_positiondiv', 'sp_list', 'side' );\n\t\t\tremove_meta_box( 'sp_seasondiv', 'sp_list', 'side' );\n\t\t\tremove_meta_box( 'sp_leaguediv', 'sp_list', 'side' );\n\t\t}\n\n\t\t/**\n\t\t * Conditonally load the class and functions only needed when viewing this post type.\n\t\t */\n\t\tpublic function include_post_type_handler() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-list.php';\n\t\t}\n\n\t\t/**\n\t\t * Add widgets.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function include_widgets() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-player-list.php';\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-player-gallery.php';\n\t\t}\n\n\t\t/**\n\t\t * Create REST API routes.\n\t\t */\n\t\tpublic function create_rest_routes() {\n\t\t\t$controller = new SP_REST_Posts_Controller( 'sp_list' );\n\t\t\t$controller->register_routes();\n\t\t}\n\n\t\t/**\n\t\t * Register REST API fields.\n\t\t */\n\t\tpublic function register_rest_fields() {\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_list',\n\t\t\t\t'format',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_meta',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Layout', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_field(\n\t\t\t\t'sp_list',\n\t\t\t\t'data',\n\t\t\t\tarray(\n\t\t\t\t\t'get_callback'    => 'SP_REST_API::get_post_data',\n\t\t\t\t\t'update_callback' => 'SP_REST_API::update_post_meta_arrays',\n\t\t\t\t\t'schema'          => array(\n\t\t\t\t\t\t'description' => esc_attr__( 'Player List', 'sportspress' ),\n\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add meta boxes.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_meta_boxes( $meta_boxes ) {\n\t\t\t$meta_boxes['sp_team']['lists'] = array(\n\t\t\t\t'title'    => esc_attr__( 'Player Lists', 'sportspress' ),\n\t\t\t\t'output'   => 'SP_Meta_Box_Team_Lists::output',\n\t\t\t\t'save'     => 'SP_Meta_Box_Team_Lists::save',\n\t\t\t\t'context'  => 'normal',\n\t\t\t\t'priority' => 'high',\n\t\t\t);\n\t\t\t$meta_boxes['sp_list']          = array(\n\t\t\t\t'shortcode' => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Shortcode', 'sportspress' ),\n\t\t\t\t\t'output'   => 'SP_Meta_Box_List_Shortcode::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'format'    => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Layout', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_List_Format::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_List_Format::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'columns'   => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Columns', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_List_Columns::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_List_Columns::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'details'   => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Details', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_List_Details::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_List_Details::output',\n\t\t\t\t\t'context'  => 'side',\n\t\t\t\t\t'priority' => 'default',\n\t\t\t\t),\n\t\t\t\t'data'      => array(\n\t\t\t\t\t'title'    => esc_attr__( 'Player List', 'sportspress' ),\n\t\t\t\t\t'save'     => 'SP_Meta_Box_List_Data::save',\n\t\t\t\t\t'output'   => 'SP_Meta_Box_List_Data::output',\n\t\t\t\t\t'context'  => 'normal',\n\t\t\t\t\t'priority' => 'high',\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn $meta_boxes;\n\t\t}\n\n\t\t/**\n\t\t * Add shortcodes.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_shortcodes( $shortcodes ) {\n\t\t\t$shortcodes['player'][] = 'list';\n\t\t\t$shortcodes['player'][] = 'gallery';\n\t\t\treturn $shortcodes;\n\t\t}\n\n\t\t/**\n\t\t * Add settings.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_settings( $settings ) {\n\t\t\treturn array_merge(\n\t\t\t\t$settings,\n\t\t\t\tarray_merge(\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title' => esc_attr__( 'Player Lists', 'sportspress' ),\n\t\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t\t'id'    => 'list_options',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tapply_filters(\n\t\t\t\t\t\t'sportspress_player_list_options',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Title', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display title', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_list_show_title',\n\t\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'         => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Display photos', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_list_show_photos',\n\t\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'desc'          => esc_attr__( 'Display national flags', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'            => 'sportspress_list_show_flags',\n\t\t\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Display logos', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_list_show_logos',\n\t\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_list_team_format',\n\t\t\t\t\t\t\t\t'default' => 'name',\n\t\t\t\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'name' => esc_attr__( 'Name', 'sportspress' ),\n\t\t\t\t\t\t\t\t\t'logo' => esc_attr__( 'Logo', 'sportspress' ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'   => esc_attr__( 'Pagination', 'sportspress' ),\n\t\t\t\t\t\t\t\t'desc'    => esc_attr__( 'Paginate', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'      => 'sportspress_list_paginated',\n\t\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'title'             => esc_attr__( 'Limit', 'sportspress' ),\n\t\t\t\t\t\t\t\t'id'                => 'sportspress_list_rows',\n\t\t\t\t\t\t\t\t'class'             => 'small-text',\n\t\t\t\t\t\t\t\t'default'           => '10',\n\t\t\t\t\t\t\t\t'desc'              => esc_attr__( 'players', 'sportspress' ),\n\t\t\t\t\t\t\t\t'type'              => 'number',\n\t\t\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t\t\t'min'  => 1,\n\t\t\t\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t\t'id'   => 'list_options',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add team template.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_team_template( $templates ) {\n\t\t\treturn array_merge(\n\t\t\t\t$templates,\n\t\t\t\tarray(\n\t\t\t\t\t'lists' => array(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Player Lists', 'sportspress' ),\n\t\t\t\t\t\t'label'   => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t\t\t\t'option'  => 'sportspress_team_show_lists',\n\t\t\t\t\t\t'action'  => 'sportspress_output_team_lists',\n\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\nendif;\n\nif ( get_option( 'sportspress_load_player_lists_module', 'yes' ) == 'yes' ) {\n\tnew SportsPress_Player_Lists();\n\n\t/**\n\t * Create alias of SP_Player_List class for REST API.\n\t * Note: class_alias is not supported in PHP < 5.3 so extend the original class instead.\n\t */\n\tclass SP_List extends SP_Player_List {}\n}\n"
  },
  {
    "path": "modules/sportspress-styles.php",
    "content": "<?php\n/**\n * Styles\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Styles' ) ) :\n\n\t/**\n\t * Main SportsPress Styles Class\n\t *\n\t * @class SportsPress_Styles\n\t * @version 2.7\n\t */\n\tclass SportsPress_Styles {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Add option\n\t\t\tadd_filter( 'sportspress_script_styling_options', array( $this, 'add_option' ) );\n\n\t\t\t// Add stylesheet\n\t\t\tadd_filter( 'sportspress_enqueue_styles', array( $this, 'add_styles' ), 20 );\n\n\t\t\t// Output custom CSS\n\t\t\tadd_action( 'sportspress_frontend_css', array( $this, 'custom_css' ), 40 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_STYLES_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_STYLES_VERSION', '2.7' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_STYLES_URL' ) ) {\n\t\t\t\tdefine( 'SP_STYLES_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_STYLES_DIR' ) ) {\n\t\t\t\tdefine( 'SP_STYLES_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add option.\n\t\t */\n\t\tpublic static function add_option( $options = array() ) {\n\t\t\tif ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) {\n\t\t\t\treturn $options;\n\t\t\t}\n\n\t\t\tarray_unshift(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\t'title'   => esc_attr__( 'Frontend Styles', 'sportspress' ),\n\t\t\t\t\t'desc'    => esc_attr__( 'Enable', 'sportspress' ),\n\t\t\t\t\t'id'      => 'sportspress_styles',\n\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t'type'    => 'checkbox',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn $options;\n\t\t}\n\n\t\t/**\n\t\t * Add stylesheet.\n\t\t */\n\t\tpublic static function add_styles( $styles = array() ) {\n\t\t\tif ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) {\n\t\t\t\treturn $styles;\n\t\t\t}\n\t\t\tif ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) {\n\t\t\t\treturn $styles;\n\t\t\t}\n\n\t\t\t$styles['sportspress-roboto'] = array(\n\t\t\t\t'src'     => '//fonts.googleapis.com/css?family=Roboto:400,500&amp;subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese',\n\t\t\t\t'deps'    => '',\n\t\t\t\t'version' => SP_STYLES_VERSION,\n\t\t\t\t'media'   => 'all',\n\t\t\t);\n\n\t\t\t$styles['sportspress-style'] = array(\n\t\t\t\t'src'     => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style.css',\n\t\t\t\t'deps'    => '',\n\t\t\t\t'version' => SP_STYLES_VERSION,\n\t\t\t\t'media'   => 'all',\n\t\t\t);\n\n\t\t\tif ( is_rtl() ) {\n\t\t\t\t$styles['sportspress-style-rtl'] = array(\n\t\t\t\t\t'src'     => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-rtl.css',\n\t\t\t\t\t'deps'    => 'sportspress-style',\n\t\t\t\t\t'version' => SP_STYLES_VERSION,\n\t\t\t\t\t'media'   => 'all',\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$styles['sportspress-style-ltr'] = array(\n\t\t\t\t\t'src'     => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-ltr.css',\n\t\t\t\t\t'deps'    => 'sportspress-style',\n\t\t\t\t\t'version' => SP_STYLES_VERSION,\n\t\t\t\t\t'media'   => 'all',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $styles;\n\t\t}\n\n\t\t/**\n\t\t * Output custom CSS.\n\t\t */\n\t\tpublic function custom_css( $colors = array() ) {\n\n\t\t\tif ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Defaults\n\t\t\tif ( empty( $colors['primary'] ) ) {\n\t\t\t\t$colors['primary'] = '#2b353e';\n\t\t\t}\n\t\t\tif ( empty( $colors['background'] ) ) {\n\t\t\t\t$colors['background'] = '#f4f4f4';\n\t\t\t}\n\t\t\tif ( empty( $colors['text'] ) ) {\n\t\t\t\t$colors['text'] = '#222222';\n\t\t\t}\n\t\t\tif ( empty( $colors['heading'] ) ) {\n\t\t\t\t$colors['heading'] = '#ffffff';\n\t\t\t}\n\t\t\tif ( empty( $colors['link'] ) ) {\n\t\t\t\t$colors['link'] = '#00a69c';\n\t\t\t}\n\n\t\t\t// Calculate primary variations\n\t\t\t$colors['primary_border'] = sp_hex_darker( $colors['primary'], 26, true );\n\n\t\t\t// Calculate background variations\n\t\t\t$colors['background_highlight'] = sp_hex_darker( $colors['background'], 6, true );\n\t\t\t$colors['background_border']    = sp_hex_darker( $colors['background'], 26, true );\n\n\t\t\t// Calculate text variations\n\t\t\t$rgb                  = sp_rgb_from_hex( $colors['text'] );\n\t\t\t$colors['text_muted'] = 'rgba(' . implode( ',', $rgb ) . ',0.5)';\n\n\t\t\t// Primary\n\t\t\techo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-caption{background:' . esc_attr( $colors['primary'] ) . ' !important}';\n\t\t\techo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-caption{border-color:' . esc_attr( $colors['primary_border'] ) . ' !important}';\n\n\t\t\t// Background\n\t\t\techo '.sp-table-caption,.sp-data-table,.sp-data-table tfoot,.sp-template .sp-view-all-link,.sp-template-gallery .sp-gallery-group-name,.sp-template-gallery .sp-gallery-wrapper,.sp-template-countdown .sp-event-name,.sp-countdown time,.sp-template-details dl,.sp-event-statistics .sp-statistic-bar,.sp-tournament-bracket .sp-team-name,.sp-profile-selector{background:' . esc_attr( $colors['background'] ) . ' !important}';\n\t\t\techo '.sp-table-caption,.sp-data-table,.sp-data-table td,.sp-template .sp-view-all-link,.sp-template-gallery .sp-gallery-group-name,.sp-template-gallery .sp-gallery-wrapper,.sp-template-countdown .sp-event-name,.sp-countdown time,.sp-countdown span,.sp-template-details dl,.sp-event-statistics .sp-statistic-bar,.sp-tournament-bracket thead th,.sp-tournament-bracket .sp-team-name,.sp-tournament-bracket .sp-event,.sp-profile-selector{border-color:' . esc_attr( $colors['background_border'] ) . ' !important}';\n\t\t\techo '.sp-tournament-bracket .sp-team .sp-team-name:before{border-left-color:' . esc_attr( $colors['background_border'] ) . ' !important;border-right-color:' . esc_attr( $colors['background_border'] ) . ' !important}';\n\t\t\techo '.sp-data-table .sp-highlight,.sp-data-table .highlighted td,.sp-template-scoreboard td:hover{background:' . esc_attr( $colors['background_highlight'] ) . ' !important}';\n\n\t\t\t// Text\n\t\t\techo '.sp-template *,.sp-data-table *,.sp-table-caption,.sp-data-table tfoot a:hover,.sp-template .sp-view-all-link a:hover,.sp-template-gallery .sp-gallery-group-name,.sp-template-details dd,.sp-template-event-logos .sp-team-result,.sp-template-event-blocks .sp-event-results,.sp-template-scoreboard a,.sp-template-scoreboard a:hover,.sp-tournament-bracket,.sp-tournament-bracket .sp-event .sp-event-title:hover,.sp-tournament-bracket .sp-event .sp-event-title:hover *{color:' . esc_attr( $colors['text'] ) . ' !important}';\n\t\t\techo '.sp-template .sp-view-all-link a,.sp-countdown span small,.sp-template-event-calendar tfoot a,.sp-template-event-blocks .sp-event-date,.sp-template-details dt,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket th,.sp-tournament-bracket .sp-event .sp-event-title,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket .sp-event .sp-event-title *{color:' . esc_attr( $colors['text_muted'] ) . ' !important}';\n\n\t\t\t// Heading\n\t\t\techo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-item a,.sp-template-gallery .gallery-caption,.sp-template-scoreboard .sp-scoreboard-nav,.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket thead th,.sp-tournament-bracket .sp-heading{color:' . esc_attr( $colors['heading'] ) . ' !important}';\n\n\t\t\t// Link\n\t\t\techo '.sp-template a,.sp-data-table a,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover,.sp-template .sp-message{color:' . esc_attr( $colors['link'] ) . ' !important}';\n\t\t\techo '.sp-template-gallery .gallery-caption strong,.sp-tournament-bracket .sp-team-name:hover,.sp-template-scoreboard .sp-scoreboard-nav,.sp-tournament-bracket .sp-heading{background:' . esc_attr( $colors['link'] ) . ' !important}';\n\t\t\techo '.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket .sp-heading,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover,.sp-template .sp-message{border-color:' . esc_attr( $colors['link'] ) . ' !important}';\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Styles();\n"
  },
  {
    "path": "modules/sportspress-template-selector.php",
    "content": "<?php\n/**\n * Template Selector\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Template_Selector' ) ) :\n\n\t/**\n\t * Main SportsPress Template Selector Class\n\t *\n\t * @class SportsPress_Template_Selector\n\t * @version 2.3\n\t */\n\tclass SportsPress_Template_Selector {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Hooks\n\t\t\tadd_filter( 'sportspress_event_options', array( $this, 'event_options' ) );\n\t\t\tadd_filter( 'sportspress_calendar_options', array( $this, 'calendar_options' ) );\n\t\t\tadd_filter( 'sportspress_team_options', array( $this, 'team_options' ) );\n\t\t\tadd_filter( 'sportspress_table_options', array( $this, 'table_options' ) );\n\t\t\tadd_filter( 'sportspress_player_options', array( $this, 'player_options' ) );\n\t\t\tadd_filter( 'sportspress_player_list_options', array( $this, 'list_options' ) );\n\t\t\tadd_filter( 'sportspress_staff_options', array( $this, 'staff_options' ) );\n\t\t\tadd_filter( 'sportspress_post_type_options', array( $this, 'post_type_options' ), 10, 2 );\n\t\t\tadd_filter( 'sportspress_event_settings', array( $this, 'add_event_settings' ), 9 );\n\t\t\tadd_filter( 'template_include', array( $this, 'template_loader' ), 99 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_TEMPLATE_SELECTOR_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_TEMPLATE_SELECTOR_VERSION', '2.3' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_TEMPLATE_SELECTOR_URL' ) ) {\n\t\t\t\tdefine( 'SP_TEMPLATE_SELECTOR_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_TEMPLATE_SELECTOR_DIR' ) ) {\n\t\t\t\tdefine( 'SP_TEMPLATE_SELECTOR_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add option to event post type.\n\t\t */\n\t\tpublic function event_options( $options ) {\n\t\t\treturn $this->options( $options, 'event' );\n\t\t}\n\n\t\t/**\n\t\t * Add option to calendar post type.\n\t\t */\n\t\tpublic function calendar_options( $options ) {\n\t\t\treturn $this->options( $options, 'calendar' );\n\t\t}\n\n\t\t/**\n\t\t * Add option to team post type.\n\t\t */\n\t\tpublic function team_options( $options ) {\n\t\t\treturn $this->options( $options, 'team' );\n\t\t}\n\n\t\t/**\n\t\t * Add option to league table post type.\n\t\t */\n\t\tpublic function table_options( $options ) {\n\t\t\treturn $this->options( $options, 'table' );\n\t\t}\n\n\t\t/**\n\t\t * Add option to player post type.\n\t\t */\n\t\tpublic function player_options( $options ) {\n\t\t\treturn $this->options( $options, 'player' );\n\t\t}\n\n\t\t/**\n\t\t * Add option to player list post type.\n\t\t */\n\t\tpublic function list_options( $options ) {\n\t\t\treturn $this->options( $options, 'list' );\n\t\t}\n\n\t\t/**\n\t\t * Add option to staff post type.\n\t\t */\n\t\tpublic function staff_options( $options ) {\n\t\t\treturn $this->options( $options, 'staff' );\n\t\t}\n\n\t\t/**\n\t\t * Filter for other post types.\n\t\t */\n\t\tpublic function post_type_options( $options = array(), $post_type = null ) {\n\t\t\tif ( null == $post_type ) {\n\t\t\t\treturn $options;\n\t\t\t}\n\n\t\t\treturn $this->options( $options, $post_type );\n\t\t}\n\n\t\t/**\n\t\t * Add template option.\n\t\t */\n\t\tpublic function options( $options, $post_type ) {\n\t\t\t// Get page templates from current theme\n\t\t\t$templates = wp_get_theme()->get_page_templates( get_post() );\n\n\t\t\t// Sort options alphabetically\n\t\t\tasort( $templates );\n\n\t\t\t// Add default option\n\t\t\t$templates = array_merge( array( 'default' => esc_attr__( 'Default Template', 'sportspress' ) ), $templates );\n\n\t\t\t$options = array_merge(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'   => esc_attr__( 'Template', 'sportspress' ),\n\t\t\t\t\t\t'id'      => 'sportspress_' . $post_type . '_page_template',\n\t\t\t\t\t\t'default' => 'default',\n\t\t\t\t\t\t'type'    => 'select',\n\t\t\t\t\t\t'options' => $templates,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t$options\n\t\t\t);\n\n\t\t\treturn $options;\n\t\t}\n\n\t\t/**\n\t\t * Load page template.\n\t\t */\n\t\tpublic function template_loader( $template ) {\n\t\t\tif ( is_single() ) {\n\t\t\t\t$post_type = get_post_type();\n\n\t\t\t\tif ( is_sp_post_type( $post_type ) ) {\n\t\t\t\t\t$option = get_option( 'sportspress_' . str_replace( 'sp_', '', $post_type ) . '_page_template', 'default' );\n\t\t\t\t\tif ( 'default' !== $option ) {\n\t\t\t\t\t\t$new_template = locate_template( array( $option ) );\n\t\t\t\t\t\tif ( '' != $new_template ) {\n\t\t\t\t\t\t\treturn $new_template;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $template;\n\t\t}\n\n\t\t/**\n\t\t * Add event settings.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_event_settings( $settings ) {\n\t\t\t$settings = array_merge(\n\t\t\t\t$settings,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => esc_attr__( 'Calendars', 'sportspress' ),\n\t\t\t\t\t\t'type'  => 'title',\n\t\t\t\t\t\t'id'    => 'calendar_options',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tapply_filters( 'sportspress_calendar_options', array() ),\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'sectionend',\n\t\t\t\t\t\t'id'   => 'calendar_options',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn $settings;\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Template_Selector();\n"
  },
  {
    "path": "modules/sportspress-tutorials.php",
    "content": "<?php\n/**\n * Tutorials\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Tutorials' ) ) :\n\n\t/**\n\t * Main SportsPress Tutorials Class\n\t *\n\t * @class SportsPress_Tutorials\n\t * @version 2.5\n\t */\n\tclass SportsPress_Tutorials {\n\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\tpublic $ids = array();\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_action( 'init', array( $this, 'get_video_ids' ) );\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ), 10 );\n\t\t\tadd_action( 'sportspress_admin_css', array( $this, 'admin_styles' ) );\n\t\t\tadd_action( 'sportspress_screen_ids', array( $this, 'screen_ids' ) );\n\t\t\tadd_filter( 'sportspress_next_steps', array( $this, 'next_steps' ) );\n\t\t}\n\n\t\t/**\n\t\t * Enqueue styles\n\t\t */\n\t\tpublic function admin_styles( $screen ) {\n\t\t\tif ( strpos( $screen->id, 'sportspress-tutorials' ) !== false ) {\n\t\t\t\twp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_TUTORIALS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_TUTORIALS_VERSION', '2.5' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_TUTORIALS_URL' ) ) {\n\t\t\t\tdefine( 'SP_TUTORIALS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_TUTORIALS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_TUTORIALS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Get video IDs.\n\t\t */\n\t\tpublic function get_video_ids() {\n\t\t\t$this->ids = apply_filters(\n\t\t\t\t'sportspress_videos',\n\t\t\t\tarray(\n\t\t\t\t\t'tutorials' => apply_filters(\n\t\t\t\t\t\t'sportspress_tutorial_videos',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t__( 'Get Started', 'sportspress' ) => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_get_started_tutorial_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Installation', 'sportspress' ) => '//www.youtube-nocookie.com/embed/nE8-RlbotmU?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Leagues', 'sportspress' ) . ' &amp; ' . esc_attr__( 'Seasons', 'sportspress' ) => '//www.youtube-nocookie.com/embed/XAf2EsDrf8M?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Venues', 'sportspress' ) => '//www.youtube-nocookie.com/embed/iTZnC_7VvYk?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Positions', 'sportspress' ) . ' &amp; ' . esc_attr__( 'Jobs', 'sportspress' ) => '//www.youtube-nocookie.com/embed/g6QKbDH05n0?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t__( 'Teams', 'sportspress' )  => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_team_tutorial_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Add New Team', 'sportspress' )  => '//www.youtube-nocookie.com/embed/x8GoxaHwC9U?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'League Tables', 'sportspress' ) => '//www.youtube-nocookie.com/embed/8AXh399Vstc?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t__( 'Players', 'sportspress' ) . ' &amp; ' . esc_attr__( 'Staff', 'sportspress' ) => array_merge(\n\t\t\t\t\t\t\t\tapply_filters(\n\t\t\t\t\t\t\t\t\t'sportspress_player_tutorial_videos',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t__( 'Add New Player', 'sportspress' ) => '//www.youtube-nocookie.com/embed/wWYQNHITz-g?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tapply_filters(\n\t\t\t\t\t\t\t\t\t'sportspress_staff_tutorial_videos',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t__( 'Add New Staff', 'sportspress' ) => '//www.youtube-nocookie.com/embed/cxm2S7qYSL4?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t__( 'Events', 'sportspress' ) => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_event_tutorial_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Add New Event', 'sportspress' ) => '//www.youtube-nocookie.com/embed/UA25lgqgnSc?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Edit Event', 'sportspress' ) => '//www.youtube-nocookie.com/embed/nL0ObdPMyBM?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Calendars', 'sportspress' )  => '//www.youtube-nocookie.com/embed/NIHBKMMqN0s?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'advanced'  => apply_filters(\n\t\t\t\t\t\t'sportspress_advanced_videos',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t__( 'Settings', 'sportspress' ) => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_settings_advanced_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Text', 'sportspress' ) => '//www.youtube-nocookie.com/embed/qEucgVVsDcE?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Permalinks', 'sportspress' ) => '//www.youtube-nocookie.com/embed/QuHmsdVyjU8?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t__( 'Events', 'sportspress' )  => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_event_advanced_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Event Outcomes', 'sportspress' ) . ' ' . esc_attr__( '(Auto)', 'sportspress' ) => '//www.youtube-nocookie.com/embed/pCVfPv2O5yY?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Box Score', 'sportspress' ) => '//www.youtube-nocookie.com/embed/rERU6X7vjTc?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t__( 'Calendars', 'sportspress' ) => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_calendar_advanced_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Layout', 'sportspress' ) => '//www.youtube-nocookie.com/embed/aLx_5D0Xgnc?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t__( 'Teams', 'sportspress' )   => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_team_advanced_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Logo', 'sportspress' ) => '//www.youtube-nocookie.com/embed/tLJZKB0fnXw?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Adjustments', 'sportspress' ) => '//www.youtube-nocookie.com/embed/VJkhn9Or0jA?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Highlight', 'sportspress' ) => '//www.youtube-nocookie.com/embed/1rKRmRzVWoU?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t__( 'Players', 'sportspress' ) => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_player_advanced_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Player Metrics', 'sportspress' ) => '//www.youtube-nocookie.com/embed/dGXYgi8esPc?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Player Ranking', 'sportspress' ) => '//www.youtube-nocookie.com/embed/xAQRZf7VOTg?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t__( 'Other', 'sportspress' )   => apply_filters(\n\t\t\t\t\t\t\t\t'sportspress_other_advanced_videos',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t__( 'Demo Content', 'sportspress' ) => '//www.youtube-nocookie.com/embed/sARiHQJqSBw?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Overview', 'sportspress' ) => '//www.youtube-nocookie.com/embed/osXGpBJDMpY?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'User Roles', 'sportspress' ) => '//www.youtube-nocookie.com/embed/UancX-33NE4?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Shortcodes', 'sportspress' ) => '//www.youtube-nocookie.com/embed/czrhafIcLaM?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t\t__( 'Page not found', 'sportspress' ) => '//www.youtube-nocookie.com/embed/2rss9qfMubw?rel=0&amp;showinfo=0',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add menu item\n\t\t */\n\t\tpublic function admin_menu() {\n\t\t\tif ( current_user_can( 'manage_sportspress' ) ) {\n\t\t\t\tadd_submenu_page( 'sportspress', esc_attr__( 'Tutorials', 'sportspress' ), esc_attr__( 'Tutorials', 'sportspress' ), 'manage_sportspress', 'sportspress-tutorials', array( $this, 'tutorials_page' ) );\n\t\t\t} else {\n\t\t\t\tadd_menu_page( esc_attr__( 'Tutorials', 'sportspress' ), esc_attr__( 'Tutorials', 'sportspress' ), 'edit_sp_players', 'sportspress-tutorials', array( $this, 'tutorials_page' ), 'dashicons-video-alt3' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Init the tutorials page\n\t\t */\n\t\tpublic function tutorials_page() {\n\t\t\t$tabs = apply_filters(\n\t\t\t\t'sportspress_tutorial_tabs',\n\t\t\t\tarray(\n\t\t\t\t\t'tutorials' => esc_attr__( 'Tutorials', 'sportspress' ),\n\t\t\t\t\t'advanced'  => esc_attr__( 'Advanced', 'sportspress' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( isset( $_GET['tab'] ) && array_key_exists( wp_unslash( $_GET['tab'] ), $tabs ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized\n\t\t\t\t$current_tab = sanitize_key( $_GET['tab'] );\n\t\t\t} else {\n\t\t\t\t$current_tab = key( $tabs );\n\t\t\t}\n\t\t\t$i = 0;\n\t\t\t?>\n\t\t<div class=\"wrap sportspress sportspress-tutorials-wrap\">\n\t\t\t<h2 class=\"nav-tab-wrapper\">\n\t\t\t\t<?php\n\t\t\t\tforeach ( $tabs as $name => $label ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<a href=\"<?php echo esc_url( admin_url( 'admin.php?page=sportspress-tutorials&tab=' . $name ) ); ?>\" class=\"nav-tab <?php echo ( $current_tab == $name ? 'nav-tab-active' : '' ); ?>\"><?php echo wp_kses_post( $label ); ?></a><?php endforeach; ?>\n\t\t\t</h2>\n\t\t\t<div class=\"sp-tutorials-main\">\n\t\t\t\t<?php foreach ( $this->ids[ $current_tab ] as $section => $urls ) { ?>\n\t\t\t\t\t<h3><?php echo wp_kses_post( $section ); ?></h3>\n\t\t\t\t\t<ul class=\"sp-tutorials-list\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $urls as $label => $url ) {\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<table class=\"widefat\" cellspacing=\"0\">\n\t\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t\t<tr><th>\n\t\t\t\t\t\t\t\t\t\t\t<strong><?php echo wp_kses_post( $i ); ?></strong> \n\t\t\t\t\t\t\t\t\t\t\t<?php echo wp_kses_post( $label ); ?>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"sp-popup sp-icon-popup\" title=\"<?php esc_attr_e( 'Pop-out', 'sportspress' ); ?>\" onclick=\"window.open('<?php echo esc_url( add_query_arg( 'autoplay', 1, $url ) ); ?>', '_blank', 'width=640, height=360');return false;\"></a>\n\t\t\t\t\t\t\t\t\t\t</th></tr>\n\t\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"sp-fitvids\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<iframe width=\"320\" height=\"180\" src=\"<?php echo esc_url( $url ); ?>\" frameborder=\"0\" allowfullscreen></iframe>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t</ul>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php do_action( 'sportspress_tutorials_page' ); ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Add screen ids\n\t\t */\n\t\tpublic function screen_ids( $ids = array() ) {\n\t\t\t$ids[] = 'sportspress_page_sportspress-tutorials';\n\t\t\treturn $ids;\n\t\t}\n\n\t\t/**\n\t\t * Add link to next steps\n\t\t */\n\t\tpublic function next_steps( $steps = array() ) {\n\t\t\t$steps = array(\n\t\t\t\t'tutorials' => array(\n\t\t\t\t\t'link'  => admin_url( add_query_arg( array( 'page' => 'sportspress-tutorials' ), 'admin.php' ) ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-video-alt3',\n\t\t\t\t\t'label' => esc_attr__( 'Watch Tutorials', 'sportspress' ),\n\t\t\t\t),\n\t\t\t) + $steps;\n\t\t\treturn $steps;\n\t\t}\n\t}\n\nendif;\n\nif ( get_option( 'sportspress_load_tutorials_module', 'yes' ) == 'yes' ) {\n\tnew SportsPress_Tutorials();\n}\n"
  },
  {
    "path": "modules/sportspress-user-registration.php",
    "content": "<?php\n/**\n * User Registration\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_User_Registration' ) ) :\n\n\t/**\n\t * Main SportsPress User Registration Class\n\t *\n\t * @class SportsPress_User_Registration\n\t * @version  2.4\n\t */\n\tclass SportsPress_User_Registration {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Hooks\n\t\t\tadd_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) );\n\t\t\tadd_action( 'register_form', array( $this, 'register_form' ) );\n\t\t\tadd_action( 'user_register', array( $this, 'user_register' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_USER_REGISTRATION_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_USER_REGISTRATION_VERSION', '2.4' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_USER_REGISTRATION_URL' ) ) {\n\t\t\t\tdefine( 'SP_USER_REGISTRATION_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_USER_REGISTRATION_DIR' ) ) {\n\t\t\t\tdefine( 'SP_USER_REGISTRATION_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add options to player settings page.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tpublic function add_player_options( $options ) {\n\t\t\t$options = array_merge(\n\t\t\t\t$options,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'         => esc_attr__( 'User Registration', 'sportspress' ),\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Add name fields to signup form', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_registration_name_inputs',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Add a team name field to signup form', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_registration_team_input',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Add a team selector to signup form', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_registration_team_select',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => '',\n\t\t\t\t\t),\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'desc'          => esc_attr__( 'Create player profiles for new users', 'sportspress' ),\n\t\t\t\t\t\t'id'            => 'sportspress_registration_add_player',\n\t\t\t\t\t\t'default'       => 'no',\n\t\t\t\t\t\t'type'          => 'checkbox',\n\t\t\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn $options;\n\t\t}\n\n\t\t/**\n\t\t * Add name fields to user registration form.\n\t\t */\n\t\tpublic static function register_form() {\n\t\t\tif ( 'yes' === get_option( 'sportspress_registration_name_inputs', 'no' ) ) {\n\t\t\t\t$first_name = ( ! empty( $_POST['first_name'] ) ) ? trim( sanitize_text_field( wp_unslash( $_POST['first_name'] ) ) ) : '';\n\t\t\t\t$last_name  = ( ! empty( $_POST['last_name'] ) ) ? trim( sanitize_text_field( wp_unslash( $_POST['last_name'] ) ) ) : '';\n\t\t\t\t?>\n\t  <p>\n\t\t  <label for=\"first_name\"><?php esc_attr_e( 'First Name', 'sportspress' ); ?><br />\n\t\t  <input type=\"text\" name=\"first_name\" id=\"first_name\" class=\"input\" value=\"<?php echo esc_attr( wp_unslash( $first_name ) ); ?>\" size=\"25\" /></label>\n\t  </p>\n\n\t  <p>\n\t\t  <label for=\"last_name\"><?php esc_attr_e( 'Last Name', 'sportspress' ); ?><br />\n\t\t  <input type=\"text\" name=\"last_name\" id=\"last_name\" class=\"input\" value=\"<?php echo esc_attr( wp_unslash( $last_name ) ); ?>\" size=\"25\" /></label>\n\t  </p>\n\t\t\t\t<?php\n\t\t\t}\n\n\t\t\tif ( 'yes' === get_option( 'sportspress_registration_team_select', 'no' ) ) {\n\t\t\t\t?>\n\t  <p>\n\t\t  <label for=\"sp_team\"><?php esc_attr_e( 'Team', 'sportspress' ); ?><br />\n\t\t\t\t<?php\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'        => 'sp_team',\n\t\t\t\t\t\t'name'             => 'sp_team',\n\t\t\t\t\t\t'values'           => 'ID',\n\t\t\t\t\t\t'show_option_none' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Team', 'sportspress' ) ),\n\t\t\t\t\t\t'property'         => 'style=\"width:100%;height:36px;margin-bottom:16px\"',\n\t\t\t\t\t);\n\t\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t\t?>\n\t  </p>\n\t\t\t\t<?php\n\t\t\t\twp_nonce_field( 'submit_team', 'sp_register_form_player' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Save fields and add player during user registration.\n\t\t */\n\t\tpublic static function user_register( $user_id ) {\n\t\t\t$parts = array();\n\n\t\t\t// Save first and last name\n\t\t\tif ( 'yes' === get_option( 'sportspress_registration_name_inputs', 'no' ) ) {\n\t\t\t\tif ( ! empty( $_POST['first_name'] ) ) {\n\t\t\t\t\t$meta    = trim( sanitize_text_field( wp_unslash( $_POST['first_name'] ) ) );\n\t\t\t\t\t$parts[] = $meta;\n\t\t\t\t\tupdate_user_meta( $user_id, 'first_name', $meta );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $_POST['last_name'] ) ) {\n\t\t\t\t\t$meta    = trim( sanitize_text_field( wp_unslash( $_POST['last_name'] ) ) );\n\t\t\t\t\t$parts[] = $meta;\n\t\t\t\t\tupdate_user_meta( $user_id, 'last_name', $meta );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add team from team name\n\t\t\tif ( isset( $_POST['sp_register_form_team'] ) && wp_verify_nonce( sanitize_key( $_POST['sp_register_form_team'] ), 'submit_team_name' ) ) {\n\t\t\t\tif ( ! empty( $_POST['team_name'] ) ) {\n\t\t\t\t\t$team_name           = trim( sanitize_text_field( wp_unslash( $_POST['team_name'] ) ) );\n\t\t\t\t\t$post['post_type']   = 'sp_team';\n\t\t\t\t\t$post['post_title']  = $team_name;\n\t\t\t\t\t$post['post_author'] = $user_id;\n\t\t\t\t\t$post['post_status'] = 'draft';\n\t\t\t\t\t$id                  = wp_insert_post( $post );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Save team\n\t\t\tif ( isset( $_POST['sp_register_form_player'] ) && wp_verify_nonce( sanitize_key( $_POST['sp_register_form_player'] ), 'submit_team' ) ) {\n\t\t\t\tif ( ! empty( $_POST['sp_team'] ) ) {\n\t\t\t\t\t$team = trim( sanitize_text_field( wp_unslash( $_POST['sp_team'] ) ) );\n\t\t\t\t\tif ( $team <= 0 ) {\n\t\t\t\t\t\t$team = 0;\n\t\t\t\t\t}\n\t\t\t\t\tupdate_user_meta( $user_id, 'sp_team', $team );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add player\n\t\t\tif ( 'yes' === get_option( 'sportspress_registration_add_player', 'no' ) ) {\n\t\t\t\tif ( ! sizeof( $parts ) && ! empty( $_POST['user_login'] ) ) {\n\t\t\t\t\t$parts[] = trim( sanitize_text_field( wp_unslash( $_POST['user_login'] ) ) );\n\t\t\t\t}\n\n\t\t\t\tif ( sizeof( $parts ) ) {\n\t\t\t\t\t$name                = implode( ' ', $parts );\n\t\t\t\t\t$post['post_type']   = 'sp_player';\n\t\t\t\t\t$post['post_title']  = trim( $name );\n\t\t\t\t\t$post['post_author'] = $user_id;\n\t\t\t\t\t$post['post_status'] = 'draft';\n\t\t\t\t\t$id                  = wp_insert_post( $post );\n\n\t\t\t\t\tif ( isset( $team ) && $team ) {\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_team', $team );\n\t\t\t\t\t\tupdate_post_meta( $id, 'sp_current_team', $team );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_User_Registration();\n"
  },
  {
    "path": "modules/sportspress-widget-alignment.php",
    "content": "<?php\n/**\n * Widget Alignment\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Widget_Alignment' ) ) :\n\n\t/**\n\t * Main SportsPress Widget Alignment Class\n\t *\n\t * @class SportsPress_Widget_Alignment\n\t * @version 1.8.3\n\t */\n\tclass SportsPress_Widget_Alignment {\n\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\tpublic $options = array();\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Initialize\n\t\t\tadd_action( 'init', array( $this, 'init' ) );\n\n\t\t\t// Widgets\n\t\t\tadd_filter( 'sportspress_widget_update', array( $this, 'widget_update' ), 10, 2 );\n\t\t\tadd_filter( 'sportspress_widget_defaults', array( $this, 'widget_defaults' ) );\n\t\t\tadd_filter( 'sportspress_shortcode_wrapper', array( $this, 'shortcode_wrapper' ), 10, 3 );\n\t\t\tadd_action( 'sportspress_before_widget_template_form', array( $this, 'before_widget_form' ), 10, 2 );\n\t\t\tadd_action( 'sportspress_before_widget', array( $this, 'before_widget' ), 10, 2 );\n\t\t\tadd_action( 'sportspress_after_widget', array( $this, 'after_widget' ) );\n\t\t\tadd_action( 'sportspress_ajax_shortcode_form', array( $this, 'ajax_shortcode_form' ) );\n\t\t\tadd_action( 'sportspress_ajax_scripts_before_shortcode', array( $this, 'ajax_scripts' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_WIDGET_ALIGNMENT_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_WIDGET_ALIGNMENT_VERSION', '1.8.3' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_WIDGET_ALIGNMENT_URL' ) ) {\n\t\t\t\tdefine( 'SP_WIDGET_ALIGNMENT_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_WIDGET_ALIGNMENT_DIR' ) ) {\n\t\t\t\tdefine( 'SP_WIDGET_ALIGNMENT_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Initialize\n\t\t */\n\t\tpublic function init() {\n\t\t\t$this->options = array(\n\t\t\t\t'none'  => esc_attr__( 'None', 'sportspress' ),\n\t\t\t\t'left'  => esc_attr__( 'Left', 'sportspress' ),\n\t\t\t\t'right' => esc_attr__( 'Right', 'sportspress' ),\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Widget update\n\t\t */\n\t\tfunction widget_update( $instance, $new_instance ) {\n\t\t\t$instance['align'] = strip_tags( $new_instance['align'] );\n\t\t\treturn $instance;\n\t\t}\n\n\t\t/**\n\t\t * Widget defaults\n\t\t */\n\t\tfunction widget_defaults( $defaults ) {\n\t\t\t$defaults['align'] = 'none';\n\t\t\treturn $defaults;\n\t\t}\n\n\t\t/**\n\t\t * Shortcode wrapper\n\t\t */\n\t\tfunction shortcode_wrapper( $wrapper = array(), $function = null, $atts = array() ) {\n\t\t\tif ( isset( $atts['align'] ) ) {\n\t\t\t\t$wrapper['class'] = sp_array_value( $wrapper, 'class', '' ) . ' ' . 'sp-widget-align-' . $atts['align'];\n\t\t\t}\n\n\t\t\treturn $wrapper;\n\t\t}\n\n\t\t/**\n\t\t * Before widget forms\n\t\t */\n\t\tfunction before_widget_form( $object, $instance ) {\n\t\t\t?>\n\t\t<p><label for=\"<?php echo esc_attr( $object->get_field_id( 'align' ) ); ?>\"><?php printf( esc_attr__( 'Alignment: %s', 'sportspress' ), '' ); ?></label>\n\t\t\t<select name=\"<?php echo esc_attr( $object->get_field_name( 'align' ) ); ?>\" id=\"<?php echo esc_attr( $object->get_field_id( 'align' ) ); ?>\">\n\t\t\t\t<?php\n\t\t\t\t$align = strip_tags( sp_array_value( $instance, 'align', 'none' ) );\n\t\t\t\tforeach ( $this->options as $value => $label ) {\n\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $value ), ( $align == $value ? 'selected' : '' ), esc_attr( $label ) );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Before widget\n\t\t */\n\t\tfunction before_widget( $args, $instance ) {\n\t\t\techo wp_kses_post( '<div class=\"sp-widget-align-' . sp_array_value( $instance, 'align', 'none' ) . '\">' );\n\t\t}\n\n\t\t/**\n\t\t * After widget\n\t\t */\n\t\tfunction after_widget() {\n\t\t\techo '</div>';\n\t\t}\n\n\t\t/**\n\t\t * Ajax shortcode form\n\t\t */\n\t\tfunction ajax_shortcode_form() {\n\t\t\t?>\n\t\t<p>\n\t\t\t<label>\n\t\t\t\t<?php printf( esc_attr__( 'Alignment: %s', 'sportspress' ), '' ); ?>\n\t\t\t\t<select id=\"align\" name=\"align\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $this->options as $value => $label ) {\n\t\t\t\t\t\tprintf( '<option value=\"%s\">%s</option>', esc_attr( $value ), esc_html( $label ) );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t</label>\n\t\t</p>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Ajax scripts\n\t\t */\n\t\tfunction ajax_scripts() {\n\t\t\t?>\n\t\targs.align = $div.find('[name=align]').val();\n\t\t\t<?php\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Widget_Alignment();\n"
  },
  {
    "path": "modules/sportspress-widgets.php",
    "content": "<?php\n/**\n * Widgets\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_Widgets' ) ) :\n\n\t/**\n\t * Main SportsPress Widgets Class\n\t *\n\t * @class SportsPress_Widgets\n\t * @version 1.8.3\n\t */\n\tclass SportsPress_Widgets {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\tadd_action( 'widgets_init', array( $this, 'includes' ) );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_WIDGETS_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_WIDGETS_VERSION', '1.8.3' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_WIDGETS_URL' ) ) {\n\t\t\t\tdefine( 'SP_WIDGETS_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_WIDGETS_DIR' ) ) {\n\t\t\t\tdefine( 'SP_WIDGETS_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Include widgets.\n\t\t */\n\t\tpublic function includes() {\n\t\t\tinclude_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-staff.php';\n\n\t\t\tdo_action( 'sportspress_widgets' );\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_Widgets();\n"
  },
  {
    "path": "modules/sportspress-wordpay.php",
    "content": "<?php\n/**\n * WordPay\n *\n * @author    ThemeBoy\n * @category  Modules\n * @package   SportsPress/Modules\n * @version   2.7.9\n */\n\n// Exit if accessed directly\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\nif ( ! class_exists( 'SportsPress_WordPay' ) ) :\n\n\t/**\n\t * Main SportsPress WordPay Class\n\t *\n\t * @class SportsPress_WordPay\n\t * @version 2.6\n\t */\n\tclass SportsPress_WordPay {\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Shortcode\n\t\t\tadd_action( 'init', array( $this, 'add_shortcodes' ) );\n\t\t\tadd_action( 'wpay_register_form_after_fields', array( $this, 'form_field' ) );\n\n\t\t\t// Editor\n\t\t\tadd_filter( 'wordpay_shortcodes', array( $this, 'editor_shortcodes' ) );\n\t\t\tadd_filter( 'wordpay_tinymce_strings', array( $this, 'editor_strings' ) );\n\n\t\t\t// Widgets\n\t\t\tadd_action( 'wordpay_after_widget_register_form', array( $this, 'widget_form' ), 10, 2 );\n\t\t\tadd_filter( 'wordpay_widget_register_update', array( $this, 'widget_update' ), 10, 2 );\n\t\t\tadd_filter( 'wordpay_widget_register_shortcode', array( $this, 'widget_shortcode' ), 10, 2 );\n\t\t}\n\n\t\t/**\n\t\t * Define constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tif ( ! defined( 'SP_WORDPAY_VERSION' ) ) {\n\t\t\t\tdefine( 'SP_WORDPAY_VERSION', '2.6' );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_WORDPAY_URL' ) ) {\n\t\t\t\tdefine( 'SP_WORDPAY_URL', plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_WORDPAY_DIR' ) ) {\n\t\t\t\tdefine( 'SP_WORDPAY_DIR', plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Add team and player registration shortcodes.\n\t\t */\n\t\tpublic function add_shortcodes() {\n\t\t\tadd_shortcode( 'wpay-register-team', array( $this, 'register_team' ) );\n\t\t\tadd_shortcode( 'wpay-register-player', array( $this, 'register_player' ) );\n\t\t}\n\n\t\t/**\n\t\t * Team registration shortcode.\n\t\t */\n\t\tpublic static function register_team( $atts = array() ) {\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'wpay-subscription',\n\t\t\t\t'post_status'    => 'active',\n\t\t\t\t'posts_per_page' => 500,\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => 'wpay_subscription_plan_user_role',\n\t\t\t\t\t\t'value' => 'sp_team_manager',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'fields'         => 'ids',\n\t\t\t);\n\n\t\t\t$plans = get_posts( $args );\n\n\t\t\tif ( empty( $plans ) ) {\n\t\t\t\treturn '<p>' . esc_attr__( 'There are no plans associated with the Team Manager role.', 'sportspress' ) . '<p>';\n\t\t\t}\n\n\t\t\treturn self::register_form( $atts, 'team', $plans );\n\t\t}\n\n\t\t/**\n\t\t * Player registration shortcode.\n\t\t */\n\t\tpublic static function register_player( $atts = array() ) {\n\t\t\t$args = array(\n\t\t\t\t'post_type'      => 'wpay-subscription',\n\t\t\t\t'post_status'    => 'active',\n\t\t\t\t'posts_per_page' => 500,\n\t\t\t\t'meta_query'     => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'   => 'wpay_subscription_plan_user_role',\n\t\t\t\t\t\t'value' => 'sp_player',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'fields'         => 'ids',\n\t\t\t);\n\n\t\t\t$plans = get_posts( $args );\n\n\t\t\tif ( empty( $plans ) ) {\n\t\t\t\treturn '<p>' . esc_attr__( 'There are no plans associated with the Player role.', 'sportspress' ) . '<p>';\n\t\t\t}\n\n\t\t\treturn self::register_form( $atts, 'player', $plans );\n\t\t}\n\n\t\t/**\n\t\t * Registration form template.\n\t\t */\n\t\tpublic static function register_form( $atts = array(), $context = '', $plans = array() ) {\n\n\t\t\t$atts = shortcode_atts(\n\t\t\t\tarray(\n\t\t\t\t\t'plans_position' => 'bottom',\n\t\t\t\t\t'selected'       => '',\n\t\t\t\t),\n\t\t\t\t$atts\n\t\t\t);\n\n\t\t\t$atts['subscription_plans'] = implode( ',', $plans );\n\n\t\t\t$atts['context'] = $context;\n\n\t\t\t$shortcode = '[wpay-register';\n\n\t\t\tforeach ( $atts as $key => $value ) {\n\t\t\t\t$shortcode .= ' ' . $key . '=\"' . esc_attr( $value ) . '\"';\n\t\t\t}\n\n\t\t\t$shortcode .= ']';\n\n\t\t\treturn do_shortcode( $shortcode );\n\t\t}\n\n\t\t/**\n\t\t * Add field to registration form.\n\t\t */\n\t\tpublic static function form_field( $atts = array() ) {\n\t\t\tif ( 'team' == $atts['context'] ) {\n\t\t\t\t?>\n\t\t\t<li class=\"wpay-field\">\n\t\t\t<label for=\"wpay_team_name\"><?php esc_attr_e( 'Team Name', 'sportspress' ); ?></label>\n\t\t\t<input id=\"wpay_team_name\" name=\"team_name\" type=\"text\" value=\"\">\n\t\t\t</li>\n\t\t\t\t<?php\n\t\t\t\twp_nonce_field( 'submit_team_name', 'sp_register_form_team' );\n\t\t\t} elseif ( 'player' == $atts['context'] ) {\n\t\t\t\t?>\n\t\t\t<li class=\"wpay-field\">\n\t\t\t\t<label for=\"sp_team\"><?php esc_attr_e( 'Team', 'sportspress' ); ?></label>\n\t\t\t\t<?php\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type'        => 'sp_team',\n\t\t\t\t\t'name'             => 'sp_team',\n\t\t\t\t\t'values'           => 'ID',\n\t\t\t\t\t'show_option_none' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Team', 'sportspress' ) ),\n\t\t\t\t\t'class'            => 'widefat',\n\t\t\t\t);\n\t\t\t\tsp_dropdown_pages( $args );\n\t\t\t\t?>\n\t\t\t</li>\n\t\t\t\t<?php\n\t\t\t\twp_nonce_field( 'submit_team', 'sp_register_form_player' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add shortcodes to editor.\n\t\t */\n\t\tpublic static function editor_shortcodes( $shortcodes = array() ) {\n\t\t\t$shortcodes[] = 'register_team';\n\t\t\t$shortcodes[] = 'register_player';\n\t\t\treturn $shortcodes;\n\t\t}\n\n\t\t/**\n\t\t * Add strings to editor.\n\t\t */\n\t\tpublic static function editor_strings( $strings = array() ) {\n\t\t\t$strings['register_team']   = esc_attr__( 'Register Team', 'sportspress' );\n\t\t\t$strings['register_player'] = esc_attr__( 'Register Player', 'sportspress' );\n\t\t\treturn $strings;\n\t\t}\n\n\t\t/**\n\t\t * Add selector to widget form.\n\t\t */\n\t\tpublic static function widget_form( $widget, $instance = array() ) {\n\t\t\t$contexts = array(\n\t\t\t\t''       => esc_attr__( 'Members', 'sportspress' ),\n\t\t\t\t'team'   => esc_attr__( 'Teams', 'sportspress' ),\n\t\t\t\t'player' => esc_attr__( 'Players', 'sportspress' ),\n\t\t\t);\n\t\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr( $widget->get_field_id( 'context' ) ); ?>\"><?php esc_attr_e( 'For:', 'sportspress' ); ?></label>\n\t\t\t\t<select id=\"<?php echo esc_attr( $widget->get_field_id( 'context' ) ); ?>\" name=\"<?php echo esc_attr( $widget->get_field_name( 'context' ) ); ?>\">\n\t\t\t\t\t<?php foreach ( $contexts as $value => $label ) { ?>\n\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $value ); ?>\" <?php selected( $value, sp_array_value( $instance, 'context' ) ); ?>><?php echo wp_kses_post( $label ); ?></option>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</select>\n\t\t</p>\n\t\t\t<?php\n\t\t}\n\n\t\t/**\n\t\t * Update widget form.\n\t\t */\n\t\tpublic static function widget_update( $instance = array(), $new_instance = array() ) {\n\t\t\t$instance['context'] = strip_tags( $new_instance['context'] );\n\t\t\treturn $instance;\n\t\t}\n\n\t\t/**\n\t\t * Modify widget shortcode.\n\t\t */\n\t\tpublic static function widget_shortcode( $shortcode = '[wpay-register]', $instance = array() ) {\n\t\t\tif ( ! empty( $instance['context'] ) && in_array( $instance['context'], array( 'team', 'player' ) ) ) {\n\t\t\t\t$shortcode = str_replace( 'wpay-register', 'wpay-register-' . $instance['context'], $shortcode );\n\t\t\t}\n\t\t\treturn $shortcode;\n\t\t}\n\t}\n\nendif;\n\nnew SportsPress_WordPay();\n"
  },
  {
    "path": "presets/esports/csgo.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Counter-Strike: Global Offensive\",\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t\"Map Score\",\n\t\t\t\t\t\t{ \"name\" : \"Round Score\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t\"Kills\",\n\t\t\t\t\t\t\"Deaths\",\n\t\t\t\t\t\t\"Assists\"\n\t],\n\t\"metrics\": [\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"KDA Ratio\", \"equation\" : \"( $kills + $assists ) / $deaths\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Kills/deaths/assists ratio\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/esports/dota2.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Dota 2\",\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"Rating\", \"description\" : \"Rating adjustment\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"Rating\", \"description\" : \"Rating adjustment\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"priority\" : 2, \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"Rating\", \"equation\" : \"$rating\", \"priority\" : 1 }\n\t],\n\t\"metrics\": [\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Wins\", \"equation\" : \"$win\" },\n\t\t\t\t\t\t{ \"name\" : \"Losses\", \"equation\" : \"$loss\" },\n\t\t\t\t\t\t{ \"name\" : \"Winrate\", \"equation\" : \"$win / $eventsplayed * 100\", \"type\" : \"average\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/esports/lol.json",
    "content": "{\n\t\"name\":\t\t\t\t\"League of Legends\",\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t\"Kills\",\n\t\t\t\t\t\t\"Deaths\",\n\t\t\t\t\t\t\"Assists\",\n\t\t\t\t\t\t{ \"name\" : \"Gold\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t\"Kills\",\n\t\t\t\t\t\t\"Deaths\",\n\t\t\t\t\t\t\"Assists\",\n\t\t\t\t\t\t\"Gold\"\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"Wins\", \"equation\" : \"$win\", \"priority\" : 1, \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"Losses\", \"equation\" : \"$loss\", \"priority\" : 2, \"order\" : \"ASC\", \"description\" : \"Losses\" }\n\t],\n\t\"metrics\": [\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Avg. KDA Ratio\", \"equation\" : \"( $kills + $assists ) / $deaths\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average kills/deaths/assists ratio\" },\n\t\t\t\t\t\t{ \"name\" : \"Avg. Gold per Min\", \"equation\" : \"$gold / $eventminutes\", \"type\" : \"average\", \"description\" : \"Average gold per minute\" },\n\t\t\t\t\t\t{ \"name\" : \"Avg. Total Gold\", \"equation\" : \"$gold / $eventsplayed\", \"type\" : \"average\", \"description\" : \"Average total gold\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/other/custom.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Custom\",\n\t\"positions\": [\n\t],\n\t\"outcomes\": [\n\t],\n\t\"results\": [\n\t],\n\t\"performance\": [\n\t],\n\t\"columns\": [\n\t],\n\t\"metrics\": [\n\t],\n\t\"statistics\": [\n\t]\n}\n"
  },
  {
    "path": "presets/racket-sports/squash.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Squash\",\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"G1\", \"description\" : \"1st game\" },\n\t\t\t\t\t\t{ \"name\" : \"G2\", \"description\" : \"2nd game\" },\n\t\t\t\t\t\t{ \"name\" : \"G3\", \"description\" : \"3rd game\" },\n\t\t\t\t\t\t{ \"name\" : \"G4\", \"description\" : \"4th game\" },\n\t\t\t\t\t\t{ \"name\" : \"G5\", \"description\" : \"5th game\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"id\" : \"points\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"priority\" : 1, \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"F\", \"equation\" : \"$pointsfor\", \"priority\" : 3, \"description\" : \"Points for\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$pointsagainst\", \"description\" : \"Points against\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$pointsfor - $pointsagainst\", \"priority\" : 2, \"description\" : \"Total points\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t{ \"name\" : \"Height\", \"description\" : \"Player height\" },\n\t\t\t\t\t\t{ \"name\" : \"Weight\", \"description\" : \"Player weight\" }\n\t],\n\t\"statistics\": [\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"player\"\n\t}\n}\n"
  },
  {
    "path": "presets/racket-sports/table-tennis.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Table Tennis\",\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t\"Forfeit\"\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1\", \"description\" : \"1st set\" },\n\t\t\t\t\t\t{ \"name\" : \"2\", \"description\" : \"2nd set\" },\n\t\t\t\t\t\t{ \"name\" : \"3\", \"description\" : \"3rd set\" },\n\t\t\t\t\t\t{ \"name\" : \"4\", \"description\" : \"4th set\" },\n\t\t\t\t\t\t{ \"name\" : \"5\", \"description\" : \"5th set\" },\n\t\t\t\t\t\t{ \"name\" : \"Sets\", \"description\" : \"Sets won\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"F\", \"equation\" : \"$setsfor\", \"description\" : \"Sets for\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$setsagainst\", \"description\" : \"Sets against\" },\n\t\t\t\t\t\t{ \"name\" : \"%\", \"id\" : \"percent\", \"equation\" : \"$setsfor / $setsagainst * 100\", \"precision\" : 2, \"description\" : \"For/against ratio\", \"priority\" : 2 },\n\t\t\t\t\t\t{ \"name\" : \"Points\", \"equation\" : \"$win * 3 + $loss\", \"priority\" : 1 }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"player\"\n\t}\n}\n"
  },
  {
    "path": "presets/racket-sports/tennis.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Tennis\",\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t\"Unfinished\"\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"S1\", \"description\" : \"1st set\" },\n\t\t\t\t\t\t{ \"name\" : \"S2\", \"description\" : \"2nd set\" },\n\t\t\t\t\t\t{ \"name\" : \"S3\", \"description\" : \"3rd set\" },\n\t\t\t\t\t\t{ \"name\" : \"S4\", \"description\" : \"4th set\" },\n\t\t\t\t\t\t{ \"name\" : \"S5\", \"description\" : \"5th set\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"id\" : \"points\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"Wins\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"Losses\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"Win %\", \"id\" : \"winpct\", \"equation\" : \"$win / $eventsplayed * 100\", \"precision\" : 2, \"description\" : \"Win percentage\", \"priority\" : 2 },\n\t\t\t\t\t\t{ \"name\" : \"Points\", \"equation\" : \"$win * 2 + $loss - $unfinished\", \"priority\" : 1 }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"player\"\n\t}\n}\n"
  },
  {
    "path": "presets/target-sports/darts.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Darts\",\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t\"Legs\"\n\t],\n\t\"performance\": [\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"priority\" : 1, \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"Legs\", \"equation\" : \"$legs\", \"priority\" : 2 },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$win * 2 + $draw\", \"priority\" : 1, \"description\" : \"Total points\" }\n\t],\n\t\"metrics\": [\n\t],\n\t\"statistics\": [\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"player\"\n\t}\n}\n"
  },
  {
    "path": "presets/target-sports/golf.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Golf\",\n\t\"positions\": [\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \"<\", \"description\" : \"Won\" },\n\t\t\t\t\t\t{ \"name\" : \"Finish\", \"condition\" : \"else\", \"description\" : \"Finished\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"Par\", \"equation\" : \"$strokes - $par\", \"description\" : \"Reported score\", \"primary\" : 1 },\n\t\t\t\t\t\t{ \"name\" : \"FH\", \"description\" : \"Fairways hit\" },\n\t\t\t\t\t\t{ \"name\" : \"GIR\", \"description\" : \"Greens in regulation\" },\n\t\t\t\t\t\t{ \"name\" : \"Avg. Drive\", \"id\" : \"avgdrive\", \"description\" : \"Average drive (yards)\" },\n\t\t\t\t\t\t{ \"name\" : \"Putts\", \"description\" : \"Number of putts\" },\n\t\t\t\t\t\t{ \"name\" : \"Score\", \"equation\" : \"$strokes\", \"description\" : \"Total score\" }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{  \"name\" : \"1\", \"id\" : \"one\", \"description\" : \"Hole 1\" },\n\t\t\t\t\t\t{  \"name\" : \"2\", \"id\" : \"two\", \"description\" : \"Hole 2\" },\n\t\t\t\t\t\t{  \"name\" : \"3\", \"id\" : \"three\", \"description\" : \"Hole 3\" },\n\t\t\t\t\t\t{  \"name\" : \"4\", \"id\" : \"four\", \"description\" : \"Hole 4\" },\n\t\t\t\t\t\t{  \"name\" : \"5\", \"id\" : \"five\", \"description\" : \"Hole 5\" },\n\t\t\t\t\t\t{  \"name\" : \"6\", \"id\" : \"six\", \"description\" : \"Hole 6\" },\n\t\t\t\t\t\t{  \"name\" : \"7\", \"id\" : \"seven\", \"description\" : \"Hole 7\" },\n\t\t\t\t\t\t{  \"name\" : \"8\", \"id\" : \"eight\", \"description\" : \"Hole 8\" },\n\t\t\t\t\t\t{  \"name\" : \"9\", \"id\" : \"nine\", \"description\" : \"Hole 9\" },\n\t\t\t\t\t\t{  \"name\" : \"10\", \"id\" : \"ten\", \"description\" : \"Hole 10\" },\n\t\t\t\t\t\t{  \"name\" : \"11\", \"id\" : \"eleven\", \"description\" : \"Hole 11\" },\n\t\t\t\t\t\t{  \"name\" : \"12\", \"id\" : \"twelve\", \"description\" : \"Hole 12\" },\n\t\t\t\t\t\t{  \"name\" : \"13\", \"id\" : \"thirteen\", \"description\" : \"Hole 13\" },\n\t\t\t\t\t\t{  \"name\" : \"14\", \"id\" : \"fourteen\", \"description\" : \"Hole 14\" },\n\t\t\t\t\t\t{  \"name\" : \"15\", \"id\" : \"fifteen\", \"description\" : \"Hole 15\" },\n\t\t\t\t\t\t{  \"name\" : \"16\", \"id\" : \"sixteen\", \"description\" : \"Hole 16\" },\n\t\t\t\t\t\t{  \"name\" : \"17\", \"id\" : \"seventeen\", \"description\" : \"Hole 17\" },\n\t\t\t\t\t\t{  \"name\" : \"18\", \"id\" : \"eighteen\", \"description\" : \"Hole 18\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"Par\", \"equation\" : \"$parfor\", \"priority\" : 1, \"order\" : \"ASC\", \"description\" : \"Reported score\" },\n\t\t\t\t\t\t{ \"name\" : \"R1\", \"equation\" : \"$scorefor 1\", \"description\" : \"Round 1 Score\" },\n\t\t\t\t\t\t{ \"name\" : \"R2\", \"equation\" : \"$scorefor 2\", \"description\" : \"Round 2 Score\" },\n\t\t\t\t\t\t{ \"name\" : \"R3\", \"equation\" : \"$scorefor 3\", \"description\" : \"Round 3 Score\" },\n\t\t\t\t\t\t{ \"name\" : \"R4\", \"equation\" : \"$scorefor 4\", \"description\" : \"Round 4 Score\" },\n\t\t\t\t\t\t{ \"name\" : \"Total\", \"equation\" : \"$scorefor\", \"priority\" : 2, \"order\" : \"ASC\", \"description\" : \"Total Score\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t{ \"name\" : \"Height\", \"description\" : \"Player height\" },\n\t\t\t\t\t\t{ \"name\" : \"Weight\", \"description\" : \"Player weight\" }\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Events played\" },\n\t\t\t\t\t\t{ \"name\" : \"FH\", \"equation\" : \"$fhfor\", \"description\" : \"Fairways hit\" },\n\t\t\t\t\t\t{ \"name\" : \"GIR\", \"equation\" : \"$girfor\", \"description\" : \"Greens in regulation\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"player\",\n\t\t\t\t\t\t\"event_teams\" : \"0\",\n\t\t\t\t\t\t\"event_show_players\" : \"yes\",\n\t\t\t\t\t\t\"event_show_total\" : \"no\",\n\t\t\t\t\t\t\"event_performance_mode\" : \"values\",\n\t\t\t\t\t\t\"event_show_player_numbers\" : \"no\",\n\t\t\t\t\t\t\"event_split_players_by_team\" : \"no\",\n\t\t\t\t\t\t\"event_split_players_by_position\" : \"no\",\n\t\t\t\t\t\t\"event_performance_sections\" : -1\n\t}\n}"
  },
  {
    "path": "presets/target-sports/snooker.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Snooker\",\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"Score\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t\"1st Frame\",\n\t\t\t\t\t\t\"2nd Frame\"\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"priority\" : 2, \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"F\", \"equation\" : \"$scorefor\", \"description\" : \"Points for\", \"priority\" : 3 },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$scoreagainst\", \"description\" : \"Points against\" },\n\t\t\t\t\t\t{ \"name\" : \"+-\", \"equation\" : \"$win - $loss\", \"description\" : \"Point difference\", \"priority\" : 2 },\n\t\t\t\t\t\t{ \"name\" : \"PTS\", \"equation\" : \"$scorefor\", \"priority\" : 1, \"description\" : \"Points\", \"priority\" : 1 }\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Games Played\", \"equation\" : \"$eventsplayed\" },\n\t\t\t\t\t\t{ \"name\" : \"Games Won\", \"equation\" : \"$win\" },\n\t\t\t\t\t\t{ \"name\" : \"Win Percentage\", \"equation\" : \"$win / $eventsplayed * 100\", \"precision\" : 2, \"type\" : \"average\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"player\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/baseball.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Baseball\",\n\t\"positions\": [\n\t\t\t\t\t\t{ \"name\" : \"Pitcher\", \"sections\" : [ 0, 1 ] },\n\t\t\t\t\t\t{ \"name\" : \"Catcher\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"First base\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Second base\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Third base\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Shortstop\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Left field\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Center field\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Right field\", \"sections\" : [ 0 ] }\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Tie\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1\", \"description\" : \"1st inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"2\", \"description\" : \"2nd inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"3\", \"description\" : \"3rd inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"4\", \"description\" : \"4th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"5\", \"description\" : \"5th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"6\", \"description\" : \"6th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"7\", \"description\" : \"7th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"8\", \"description\" : \"8th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"9\", \"description\" : \"9th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"10\", \"description\" : \"10th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"description\" : \"Total runs\", \"primary\" : 1 },\n\t\t\t\t\t\t{ \"name\" : \"H\", \"description\" : \"Hits\" },\n\t\t\t\t\t\t{ \"name\" : \"E\", \"description\" : \"Errors\" }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"AB\", \"section\" : 0, \"description\" : \"At bat\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"section\" : 0, \"description\" : \"Runs\" },\n\t\t\t\t\t\t{ \"name\" : \"H\", \"section\" : 0, \"description\" : \"Hits\" },\n\t\t\t\t\t\t{ \"name\" : \"RBI\", \"section\" : 0, \"description\" : \"Runs batted in\" },\n\t\t\t\t\t\t{ \"name\" : \"2B\", \"id\" : \"doubles\", \"section\" : 0, \"description\" : \"Doubles\" },\n\t\t\t\t\t\t{ \"name\" : \"3B\", \"id\" : \"triples\", \"section\" : 0, \"description\" : \"Triples\" },\n\t\t\t\t\t\t{ \"name\" : \"HR\", \"section\" : 0, \"description\" : \"Home runs\" },\n\t\t\t\t\t\t{ \"name\" : \"SB\", \"section\" : 0, \"description\" : \"Stolen bases\" },\n\t\t\t\t\t\t{ \"name\" : \"BB\", \"section\" : 0, \"description\" : \"Base on balls\" },\n\t\t\t\t\t\t{ \"name\" : \"SO\", \"section\" : 0, \"description\" : \"Strike outs\" },\n\t\t\t\t\t\t{ \"name\" : \"LOB\", \"section\" : 0, \"description\" : \"Left on base\" },\n\t\t\t\t\t\t{ \"name\" : \"IP\", \"id\" : \"pitcher_ip\", \"section\" : 1, \"description\" : \"Innings pitched\" },\n\t\t\t\t\t\t{ \"name\" : \"H\", \"id\" : \"pitcher_h\", \"section\" : 1, \"description\" : \"Hits allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"id\" : \"pitcher_r\", \"section\" : 1, \"description\" : \"Runs allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"ER\", \"id\" : \"pitcher_er\", \"section\" : 1, \"description\" : \"Earned runs allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"BB\", \"id\" : \"pitcher_bb\", \"section\" : 1, \"description\" : \"Base on balls allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"SO\", \"id\" : \"pitcher_so\", \"section\" : 1, \"description\" : \"Strike outs pitched\" },\n\t\t\t\t\t\t{ \"name\" : \"HR\", \"id\" : \"pitcher_hr\", \"section\" : 1, \"description\" : \"Home runs allowed\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"Pct\", \"equation\" : \"$win / $eventsplayed\", \"precision\" : 3, \"priority\" : 1, \"description\" : \"Win percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"GB\", \"equation\" : \"$gamesback\", \"precision\" : 1, \"description\" : \"Games back\" },\n\t\t\t\t\t\t{ \"name\" : \"RS\", \"equation\" : \"$rfor\", \"description\" : \"Runs scored\" },\n\t\t\t\t\t\t{ \"name\" : \"RA\", \"equation\" : \"$ragainst\", \"description\" : \"Runs allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"Diff\", \"equation\" : \"$rfor - $ragainst\", \"description\" : \"Run differential\" },\n\t\t\t\t\t\t{ \"name\" : \"Home\", \"equation\" : \"$homerecord\", \"description\" : \"Home record\" },\n\t\t\t\t\t\t{ \"name\" : \"Road\", \"equation\" : \"$awayrecord\", \"description\" : \"Road record\" },\n\t\t\t\t\t\t{ \"name\" : \"L10\", \"equation\" : \"$last10\", \"description\" : \"Last 10 games\" },\n\t\t\t\t\t\t{ \"name\" : \"Strk\", \"equation\" : \"$streak\", \"description\" : \"Current streak\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t{ \"name\" : \"B/T\", \"description\": \"Bats / Throws\" },\n\t\t\t\t\t\t{ \"name\" : \"Ht\", \"description\": \"Height\" },\n\t\t\t\t\t\t{ \"name\" : \"Wt\", \"description\": \"Weight\" }\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"G\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"AVG\", \"equation\" : \"$h / $ab\", \"precision\" : 3, \"type\" : \"average\", \"description\" : \"Batting average\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\",\n\t\t\t\t\t\t\"event_teams\" : \"2\",\n\t\t\t\t\t\t\"event_hide_child_positions\" : \"yes\",\n\t\t\t\t\t\t\"event_show_players\" : \"yes\",\n\t\t\t\t\t\t\"event_show_total\" : \"yes\",\n\t\t\t\t\t\t\"event_reverse_teams\" : \"yes\",\n\t\t\t\t\t\t\"event_performance_mode\" : \"values\",\n\t\t\t\t\t\t\"event_show_player_numbers\" : \"yes\",\n\t\t\t\t\t\t\"event_show_position\" : \"no\",\n\t\t\t\t\t\t\"event_split_players_by_team\" : \"yes\",\n\t\t\t\t\t\t\"event_split_players_by_position\" : \"yes\",\n\t\t\t\t\t\t\"event_total_performance\" : \"all\",\n\t\t\t\t\t\t\"event_performance_sections\" : 0,\n\t\t\t\t\t\t\"player_performance_sections\" : 0,\n\t\t\t\t\t\t\"player_show_total\" : \"yes\"\n\t}\n}\n"
  },
  {
    "path": "presets/team-sports/basketball.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Basketball\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Guard\",\n\t\t\t\t\t\t\"Forward-Guard\",\n\t\t\t\t\t\t\"Forward\",\n\t\t\t\t\t\t\"Forward-Center\",\n\t\t\t\t\t\t\"Center\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1\", \"description\" : \"1st quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"2\", \"description\" : \"2nd quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"3\", \"description\" : \"3rd quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"4\", \"description\" : \"4th quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"OT\", \"id\" : \"ot\", \"description\" : \"Overtime points\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"id\" : \"points\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"PTS\", \"description\" : \"Points\" },\n\t\t\t\t\t\t{ \"name\" : \"REB\", \"format\" : \"equation\", \"equation\" : \"$off + $def\", \"description\" : \"Rebounds\" },\n\t\t\t\t\t\t{ \"name\" : \"AST\", \"description\" : \"Assists\" },\n\t\t\t\t\t\t{ \"name\" : \"STL\", \"description\" : \"Steals\" },\n\t\t\t\t\t\t{ \"name\" : \"BLK\", \"description\" : \"Blocks\" },\n\t\t\t\t\t\t{ \"name\" : \"FGM\", \"description\" : \"Field goals made\" },\n\t\t\t\t\t\t{ \"name\" : \"FGA\", \"description\" : \"Field goals attempted\" },\n\t\t\t\t\t\t{ \"name\" : \"FG%\", \"format\" : \"equation\", \"precision\" : 1, \"equation\" : \"( $fgm / $fga ) * 100\", \"description\" : \"Field goal percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"3PM\", \"description\" : \"3-pointers made\" },\n\t\t\t\t\t\t{ \"name\" : \"3PA\", \"description\" : \"3-pointers attempted\" },\n\t\t\t\t\t\t{ \"name\" : \"3P%\", \"format\" : \"equation\", \"precision\" : 1, \"equation\" : \"( $threepm / $threepa ) * 100\", \"description\" : \"3-pointer percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"FTM\", \"description\" : \"Free throws made\" },\n\t\t\t\t\t\t{ \"name\" : \"FTA\", \"description\" : \"Free throws attempted\" },\n\t\t\t\t\t\t{ \"name\" : \"FT%\", \"format\" : \"equation\", \"precision\" : 1, \"equation\" : \"( $ftm / $fta ) * 100\", \"description\" : \"Free throw percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"OFF\", \"description\" : \"Offensive rebounds\" },\n\t\t\t\t\t\t{ \"name\" : \"DEF\", \"description\" : \"Defensive rebounds\" },\n\t\t\t\t\t\t{ \"name\" : \"TO\", \"description\" : \"Turnovers\" },\n\t\t\t\t\t\t{ \"name\" : \"PF\", \"description\" : \"Personal fouls\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"PCT\", \"equation\" : \"$win / $eventsplayed\", \"precision\" : 3, \"priority\" : 1, \"description\" : \"Win percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"GB\", \"equation\" : \"$gamesback\", \"precision\" : 1, \"description\" : \"Games back\" },\n\t\t\t\t\t\t{ \"name\" : \"Home\", \"equation\" : \"$homerecord\", \"description\" : \"Home record\" },\n\t\t\t\t\t\t{ \"name\" : \"Road\", \"equation\" : \"$awayrecord\", \"description\" : \"Road record\" },\n\t\t\t\t\t\t{ \"name\" : \"L10\", \"equation\" : \"$last10\", \"description\" : \"Last 10 games\" },\n\t\t\t\t\t\t{ \"name\" : \"STRK\", \"equation\" : \"$streak\", \"description\" : \"Current streak\" },\n\t\t\t\t\t\t{ \"name\" : \"PF\", \"equation\" : \"$pointsfor / $eventsplayed\", \"priority\" : 3, \"description\" : \"Average points for\" },\n\t\t\t\t\t\t{ \"name\" : \"PA\", \"equation\" : \"$pointsagainst / $eventsplayed\", \"description\" : \"Average points against\" },\n\t\t\t\t\t\t{ \"name\" : \"DIFF\", \"equation\" : \"( $pointsfor - $pointsagainst ) / $eventsplayed\", \"priority\" : 2, \"description\" : \"Average point differential\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"G\", \"equation\" : \"$eventsattended\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"GS\", \"equation\" : \"$eventsstarted\", \"description\" : \"Games started\" },\n\t\t\t\t\t\t{ \"name\" : \"FG%\", \"equation\" : \"( $fgm / $fga ) * 100\", \"precision\" : 3, \"type\" : \"average\", \"description\" : \"Field goal percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"FT%\", \"equation\" : \"( $ftm / $fta ) * 100\", \"precision\" : 3, \"type\" : \"average\", \"description\" : \"Free throw percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"3P%\", \"equation\" : \"( $threepm / $threepa ) * 100\", \"precision\" : 3, \"type\" : \"average\", \"description\" : \"3-pointer percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"RPG\", \"equation\" : \"( $off + $def ) / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Rebounds per game\" },\n\t\t\t\t\t\t{ \"name\" : \"APG\", \"equation\" : \"$ast / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Assists per game\" },\n\t\t\t\t\t\t{ \"name\" : \"SPG\", \"equation\" : \"$stl / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Steals per game\" },\n\t\t\t\t\t\t{ \"name\" : \"BPG\", \"equation\" : \"$blk / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Blocks per game\" },\n\t\t\t\t\t\t{ \"name\" : \"PPG\", \"equation\" : \"$pts / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Points per game\" },\n\t\t\t\t\t\t{ \"name\" : \"EFF\", \"equation\" : \"$pts + $off + $def + $ast + $stl + $blk - $fga + $fgm - $fta + $ftm - $to\", \"type\" : \"average\", \"description\" : \"Efficiency rating\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}\n"
  },
  {
    "path": "presets/team-sports/cricket.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Cricket\",\n\t\"positions\": [\n\t\t\t\t\t\t{ \"name\" : \"Batsman\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Bowler\", \"sections\" : [ 0, 1 ] }\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t\"Draw\",\n\t\t\t\t\t\t{ \"name\" : \"Tie\", \"condition\" : \"=\" },\n\t\t\t\t\t\t\"No Result\"\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"Runs\", \"equation\" : \"$runs\", \"description\" : \"Runs\", \"primary\" : 1 },\n\t\t\t\t\t\t{ \"name\" : \"Wickets Lost\", \"description\" : \"Wickets lost\" },\n\t\t\t\t\t\t{ \"name\" : \"Overs\", \"equation\" : \"$o\", \"description\" : \"Overs\" },\n\t\t\t\t\t\t{ \"name\" : \"BP\", \"description\" : \"Bonus points\"}\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"&nbsp;\", \"id\" : \"notes\", \"section\" : 0, \"format\" : \"text\", \"description\" : \"Notes\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"id\" : \"runs\", \"section\" : 0, \"description\" : \"Runs\" },\n\t\t\t\t\t\t{ \"name\" : \"B\", \"section\" : 0, \"description\" : \"Balls\" },\n\t\t\t\t\t\t{ \"name\" : \"4s\", \"section\" : 0, \"description\" : \"Fours\" },\n\t\t\t\t\t\t{ \"name\" : \"6s\", \"section\" : 0, \"description\" : \"Sixes\" },\n\t\t\t\t\t\t{ \"name\" : \"O\", \"section\" : 1, \"description\" : \"Overs bowled\" },\n\t\t\t\t\t\t{ \"name\" : \"M\", \"section\" : 1, \"description\" : \"Maidens\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"section\" : 1, \"description\" : \"Runs\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"section\" : 1, \"description\" : \"Wickets taken\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"priority\" : 2, \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"equation\" : \"$tie\", \"description\" : \"Ties\" },\n\t\t\t\t\t\t{ \"name\" : \"NR\", \"equation\" : \"$noresult\", \"description\" : \"No results\" },\n\t\t\t\t\t\t{ \"name\" : \"BP\", \"equation\" : \"$bpfor\", \"description\" : \"Bonus points\" },\n\t\t\t\t\t\t{ \"name\" : \"Points\", \"equation\" : \"$win * 2 + $draw\", \"priority\" : 1, \"description\" : \"Total points\" },\n\t\t\t\t\t\t{ \"name\" : \"NRR\", \"equation\" : \"( $runsfor / $oversfor ) - ( $runsagainst / $oversagainst )\", \"priority\" : 3, \"precision\" : 3, \"description\" : \"Net run rate\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\",\n\t\t\t\t\t\t\"Bat Brand\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Mat\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"SR\", \"equation\" : \"( $runs / $b ) * 100\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Strike Rate\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\",\n\t\t\t\t\t\t\"event_teams\" : \"2\",\n\t\t\t\t\t\t\"event_logos_show_team_names\" : \"no\",\n\t\t\t\t\t\t\"event_logos_show_results\" : \"yes\",\n\t\t\t\t\t\t\"event_reverse_teams\" : \"no\",\n\t\t\t\t\t\t\"event_show_outcome\" : \"yes\",\n\t\t\t\t\t\t\"event_show_players\" : \"yes\",\n\t\t\t\t\t\t\"event_show_total\" : \"yes\",\n\t\t\t\t\t\t\"event_performance_mode\" : \"values\",\n\t\t\t\t\t\t\"event_show_player_numbers\" : \"no\",\n\t\t\t\t\t\t\"event_show_position\" : \"no\",\n\t\t\t\t\t\t\"event_total_performance\" : \"primary\",\n\t\t\t\t\t\t\"event_performance_sections\" : 0\n\t}\n}"
  },
  {
    "path": "presets/team-sports/floorball.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Floorball\",\n\t\"positions\": [\n\t\t\t\t\t\t{ \"name\" : \"Forward\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Defenseman\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Goalkeeper\", \"sections\" : [ 0, 1 ] }\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Tie\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1st\", \"description\" : \"1st period goals\" },\n\t\t\t\t\t\t{ \"name\" : \"2nd\", \"description\" : \"2nd period goals\" },\n\t\t\t\t\t\t{ \"name\" : \"3rd\", \"description\" : \"3rd period goals\" },\n\t\t\t\t\t\t{ \"name\" : \"OT\", \"description\" : \"Overtime goals\" },\n\t\t\t\t\t\t{ \"name\" : \"PPG\", \"description\" : \"Power play goals\" },\n\t\t\t\t\t\t{ \"name\" : \"PPO\", \"description\" : \"Power play opportunities\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"id\" : \"goals\", \"description\" : \"Total goals\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"G\", \"description\" : \"Goals\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"description\" : \"Assists\" },\n\t\t\t\t\t\t{ \"name\" : \"SOG\", \"id\" : \"s\", \"description\" : \"Shots on goal\" },\n\t\t\t\t\t\t{ \"name\" : \"PIM\", \"description\" : \"Penalty in minutes\" },\n\t\t\t\t\t\t{ \"name\" : \"SA\", \"description\" : \"Shots against\" },\n\t\t\t\t\t\t{ \"name\" : \"GA\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"SV\", \"description\" : \"Saves\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"GP\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"PTS\", \"equation\" : \"$win * 2 + $tie\", \"priority\" : 1, \"description\" : \"Points\" },\n\t\t\t\t\t\t{ \"name\" : \"GF\", \"equation\" : \"$goalsfor\", \"priority\" : 3, \"description\" : \"Goals for\" },\n\t\t\t\t\t\t{ \"name\" : \"GA\", \"equation\" : \"$goalsagainst\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"Diff\", \"equation\" : \"$goalsfor - $goalsagainst\", \"priority\" : 2, \"description\" : \"Goal differential\" },\n\t\t\t\t\t\t{ \"name\" : \"PPG\", \"equation\" : \"$ppgfor\", \"description\" : \"Power play goals\" },\n\t\t\t\t\t\t{ \"name\" : \"PPO\", \"equation\" : \"$ppofor\", \"description\" : \"Power play opportunities\" },\n\t\t\t\t\t\t{ \"name\" : \"PP%\", \"equation\" : \"$ppgfor / $ppofor * 100\", \"precision\" : 1, \"description\" : \"Power play percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"PPGA\", \"equation\" : \"$ppgagainst\", \"description\" : \"Power play goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"PPOA\", \"equation\" : \"$ppoagainst\", \"description\" : \"Power play opportunities against\" },\n\t\t\t\t\t\t{ \"name\" : \"PK%\", \"equation\" : \"( $ppoagainst - $ppgagainst ) / $ppoagainst * 100\", \"precision\" : 1, \"description\" : \"Penalty kill percentage\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"GP\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$g + $assists\", \"description\" : \"Points\" },\n\t\t\t\t\t\t{ \"name\" : \"GAA\", \"equation\" : \"$ga / $eventsplayed\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Goals against average\" },\n\t\t\t\t\t\t{ \"name\" : \"S%\", \"equation\" : \"$g / $s * 100\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Shot percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"SV%\", \"equation\" : \"$sv / $sa * 100\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Save percentage\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/football.json",
    "content": "{\n\t\"name\":\t\t\t\t\"American Football\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Quarterback\",\n\t\t\t\t\t\t\"Running back\",\n\t\t\t\t\t\t\"Wide receiver\",\n\t\t\t\t\t\t\"Tight end\",\n\t\t\t\t\t\t\"Center\",\n\t\t\t\t\t\t\"Offensive guard\",\n\t\t\t\t\t\t\"Offensive tackle\",\n\t\t\t\t\t\t\"Defensive tackle\",\n\t\t\t\t\t\t\"Defensive end\",\n\t\t\t\t\t\t\"Middle linebacker\",\n\t\t\t\t\t\t\"Outside linebacker\",\n\t\t\t\t\t\t\"Cornerback\",\n\t\t\t\t\t\t\"Safety\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Tie\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1\", \"description\" : \"1st quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"2\", \"description\" : \"2nd quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"3\", \"description\" : \"3rd quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"4\", \"description\" : \"4th quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"OT\", \"description\" : \"Overtime points\" },\n\t\t\t\t\t\t{ \"name\" : \"TD\", \"description\" : \"Touchdowns\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"id\" : \"points\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"Comp\", \"description\" : \"Completions\" },\n\t\t\t\t\t\t{ \"name\" : \"Att\", \"description\" : \"Attempts\" },\n\t\t\t\t\t\t{ \"name\" : \"Yds\", \"description\" : \"Rushing yards\" },\n\t\t\t\t\t\t{ \"name\" : \"Rec\", \"description\" : \"Total receptions\" },\n\t\t\t\t\t\t{ \"name\" : \"Rec Yds\", \"description\" : \"Receiving yards\" },\n\t\t\t\t\t\t{ \"name\" : \"TD\", \"description\" : \"Touchdowns\" },\n\t\t\t\t\t\t{ \"name\" : \"Int\", \"description\" : \"Interceptions thrown\" },\n\t\t\t\t\t\t{ \"name\" : \"Lng\", \"description\" : \"Longest\" },\n\t\t\t\t\t\t{ \"name\" : \"Fum\", \"description\" : \"Total fumbles\" },\n\t\t\t\t\t\t{ \"name\" : \"Lost\", \"description\" : \"Fumbles lost\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"priority\" : 1, \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"equation\" : \"$tie\", \"priority\" : 2, \"description\" : \"Ties\" },\n\t\t\t\t\t\t{ \"name\" : \"Pct\", \"equation\" : \"$win / $eventsplayed\", \"description\" : \"Win percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"PF\", \"equation\" : \"$pointsfor\", \"priority\" : 3, \"description\" : \"Points for\" },\n\t\t\t\t\t\t{ \"name\" : \"PA\", \"equation\" : \"$pointsagainst\", \"description\" : \"Points against\" },\n\t\t\t\t\t\t{ \"name\" : \"Net Pts\", \"equation\" : \"$pointsfor - $pointsagainst\", \"priority\" : 2, \"description\" : \"Net Points\" },\n\t\t\t\t\t\t{ \"name\" : \"TD\", \"equation\" : \"$td\", \"description\" : \"Touchdowns\" },\n\t\t\t\t\t\t{ \"name\" : \"Streak\", \"equation\" : \"$streak\", \"description\" : \"Current streak\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"G\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"GS\", \"equation\" : \"$eventsstarted\", \"description\" : \"Games started\" },\n\t\t\t\t\t\t{ \"name\" : \"Avg\", \"equation\" : \"$yds / $att\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average yards per carry\" },\n\t\t\t\t\t\t{ \"name\" : \"Rec Avg\", \"equation\" : \"$recyds / $rec\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average yards per reception\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/footy.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Australian Rules Football\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Defender\",\n\t\t\t\t\t\t\"Midfielder\",\n\t\t\t\t\t\t\"Forward\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"Q1\", \"description\" : \"First quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"Q2\", \"description\" : \"Second quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"Q3\", \"description\" : \"Third quarter points\" },\n\t\t\t\t\t\t{ \"name\" : \"Q4\", \"description\" : \"Fourth quarter points\" },\n\t\t\t\t\t\t\"Goals\",\n\t\t\t\t\t\t\"Behinds\",\n\t\t\t\t\t\t{ \"name\" : \"Total\", \"id\" : \"points\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t\"Kicks\",\n\t\t\t\t\t\t\"Handballs\",\n\t\t\t\t\t\t\"Disposals\",\n\t\t\t\t\t\t\"Marks\",\n\t\t\t\t\t\t\"Hitouts\",\n\t\t\t\t\t\t\"Tackles\",\n\t\t\t\t\t\t\"Goals\"\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"F\", \"equation\" : \"$pointsfor\", \"priority\" : 3, \"description\" : \"Points for\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$pointsagainst\", \"description\" : \"Points against\" },\n\t\t\t\t\t\t{ \"name\" : \"%\", \"id\" : \"pct\", \"equation\" : \"$win / $eventsplayed\", \"priority\" : 2, \"description\" : \"Season percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$win * 4 + $draw * 2\", \"priority\" : 1, \"description\" : \"Points\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Games played\", \"equation\" : \"$eventsplayed\" },\n\t\t\t\t\t\t{ \"name\" : \"K\", \"equation\" : \"$kicks / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average kicks per game\" },\n\t\t\t\t\t\t{ \"name\" : \"H\", \"equation\" : \"$handballs / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average handballs per game\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$disposals / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average disposals per game\" },\n\t\t\t\t\t\t{ \"name\" : \"M\", \"equation\" : \"$marks / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average marks per game\" },\n\t\t\t\t\t\t{ \"name\" : \"HO\", \"equation\" : \"$hitouts / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average hitouts per game\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"equation\" : \"$tackles / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average tackles per game\" },\n\t\t\t\t\t\t{ \"name\" : \"G\", \"equation\" : \"$goals / $eventsplayed\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Average goals per game\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/handball.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Handball\",\n\t\"positions\": [\n\t\t\t\t\t\t{ \"name\" : \"Goalkeeper\", \"sections\" : [ 0, 1 ] },\n\t\t\t\t\t\t{ \"name\" : \"Center back\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Left back\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Right back\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Pivot\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Left wing\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Right wing\", \"sections\" : [ 0 ] }\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1st Half\", \"description\" : \"1st half goals\" },\n\t\t\t\t\t\t{ \"name\" : \"2nd Half\", \"description\" : \"2nd half goals\" },\n\t\t\t\t\t\t{ \"name\" : \"Goals\", \"description\" : \"Total goals\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t\"Goals\",\n\t\t\t\t\t\t\"Interceptions\"\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"T\", \"equation\" : \"$eventsplayed\", \"description\" : \"Total matches\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"F\", \"equation\" : \"$goalsfor\", \"priority\" : 3, \"description\" : \"Goals for\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$goalsagainst\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"DIFF\", \"equation\" : \"$goalsfor - $goalsagainst\", \"priority\" : 2, \"description\" : \"Goal difference\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$win * 2 + $draw\", \"priority\" : 1, \"description\" : \"Team points\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Appearances\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/ice-hockey.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Ice Hockey\",\n\t\"positions\": [\n\t\t\t\t\t\t{ \"name\" : \"Skater\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Goalie\", \"sections\" : [ 0, 1 ] }\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Overtime loss\", \"abbreviation\" : \"OT\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1st\", \"description\" : \"1st period goals\" },\n\t\t\t\t\t\t{ \"name\" : \"2nd\", \"description\" : \"2nd period goals\" },\n\t\t\t\t\t\t{ \"name\" : \"3rd\", \"description\" : \"3rd period goals\" },\n\t\t\t\t\t\t{ \"name\" : \"OT\", \"description\" : \"Overtime goals\" },\n\t\t\t\t\t\t{ \"name\" : \"PPG\", \"description\" : \"Power play goals\" },\n\t\t\t\t\t\t{ \"name\" : \"PPO\", \"description\" : \"Power play opportunities\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"id\" : \"goals\", \"description\" : \"Total goals\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"G\", \"position\" : \"Skater\", \"description\" : \"Goals\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"position\" : \"Skater\", \"description\" : \"Assists\" },\n\t\t\t\t\t\t{ \"name\" : \"H\", \"position\" : \"Skater\", \"description\" : \"Hits\" },\n\t\t\t\t\t\t{ \"name\" : \"SOG\", \"position\" : \"Skater\", \"id\" : \"s\", \"description\" : \"Shots on goal\" },\n\t\t\t\t\t\t{ \"name\" : \"PIM\", \"position\" : \"Skater\", \"description\" : \"Penalty in minutes\" },\n\t\t\t\t\t\t{ \"name\" : \"SA\", \"position\" : \"Goalie\", \"description\" : \"Shots against\" },\n\t\t\t\t\t\t{ \"name\" : \"GA\", \"position\" : \"Goalie\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"SV\", \"position\" : \"Goalie\", \"description\" : \"Saves\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"GP\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"OT\", \"equation\" : \"$overtimeloss\", \"description\" : \"Overtime Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"PTS\", \"equation\" : \"$win * 2 + $overtimeloss\", \"priority\" : 1, \"description\" : \"Points\" },\n\t\t\t\t\t\t{ \"name\" : \"GF\", \"equation\" : \"$goalsfor\", \"priority\" : 3, \"description\" : \"Goals for\" },\n\t\t\t\t\t\t{ \"name\" : \"GA\", \"equation\" : \"$goalsagainst\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"Diff\", \"equation\" : \"$goalsfor - $goalsagainst\", \"priority\" : 2, \"description\" : \"Goal differential\" },\n\t\t\t\t\t\t{ \"name\" : \"PPG\", \"equation\" : \"$ppgfor\", \"description\" : \"Power play goals\" },\n\t\t\t\t\t\t{ \"name\" : \"PPO\", \"equation\" : \"$ppofor\", \"description\" : \"Power play opportunities\" },\n\t\t\t\t\t\t{ \"name\" : \"PP%\", \"equation\" : \"$ppgfor / $ppofor * 100\", \"precision\" : 1, \"description\" : \"Power play percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"PPGA\", \"equation\" : \"$ppgagainst\", \"description\" : \"Power play goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"PPOA\", \"equation\" : \"$ppoagainst\", \"description\" : \"Power play opportunities against\" },\n\t\t\t\t\t\t{ \"name\" : \"PK%\", \"equation\" : \"( $ppoagainst - $ppgagainst ) / $ppoagainst * 100\", \"precision\" : 1, \"description\" : \"Penalty kill percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"L10\", \"equation\" : \"$last10\", \"description\" : \"Last 10\" },\n\t\t\t\t\t\t{ \"name\" : \"Strk\", \"equation\" : \"$streak\", \"description\" : \"Current streak\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"GP\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$g + $assists\", \"description\" : \"Points\" },\n\t\t\t\t\t\t{ \"name\" : \"S%\", \"equation\" : \"$g / $s * 100\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Shot percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"SV%\", \"equation\" : \"$sv / $sa * 100\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Save percentage\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\",\n\t\t\t\t\t\t\"event_teams\" : \"2\",\n\t\t\t\t\t\t\"event_show_players\" : \"yes\",\n\t\t\t\t\t\t\"event_show_total\" : \"yes\",\n\t\t\t\t\t\t\"event_performance_mode\" : \"values\",\n\t\t\t\t\t\t\"event_show_player_numbers\" : \"yes\",\n\t\t\t\t\t\t\"event_split_players_by_team\" : \"yes\",\n\t\t\t\t\t\t\"event_split_players_by_position\" : \"yes\",\n\t\t\t\t\t\t\"event_total_performance\" : \"all\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/lacrosse.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Lacrosse\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Goalie\",\n\t\t\t\t\t\t\"Defense\",\n\t\t\t\t\t\t\"Midfield\",\n\t\t\t\t\t\t\"Attack\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Tie\", \"condition\" : \"=\" },\n\t\t\t\t\t\t\"Overtime\"\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1\", \"description\" : \"1st quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"2\", \"description\" : \"2nd quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"3\", \"description\" : \"3rd quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"4\", \"description\" : \"4th quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"OT\", \"id\" : \"ot\", \"description\" : \"Overtime goals\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"id\" : \"goals\", \"description\" : \"Total goals\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t\"Goals\",\n\t\t\t\t\t\t\"Assists\",\n\t\t\t\t\t\t\"Shots\",\n\t\t\t\t\t\t{ \"name\" : \"SoG\", \"description\" : \"Shots on goal\" },\n\t\t\t\t\t\t\"Penalties\"\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"equation\" : \"$tie\", \"description\" : \"Ties\" },\n\t\t\t\t\t\t{ \"name\" : \"F\", \"equation\" : \"$goalsfor\", \"priority\" : 3, \"description\" : \"Goals for\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$goalsagainst\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"+/-\", \"equation\" : \"$goalsfor - $goalsagainst\", \"priority\" : 2, \"description\" : \"Goal difference\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$win * 2 + $tie\", \"priority\" : 1, \"description\" : \"Team points\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Games\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"Shooting %\", \"equation\" : \"$goals / $shots\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Shooting percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"SoG %\", \"equation\" : \"$sog / $shots\", \"precision\" : 1, \"type\" : \"average\", \"description\" : \"Shots on goal percentage\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/netball.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Netball\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Goal Keeper\",\n\t\t\t\t\t\t\"Goal Defense\",\n\t\t\t\t\t\t\"Wing Defense\",\n\t\t\t\t\t\t\"Center\",\n\t\t\t\t\t\t\"Wing Attack\",\n\t\t\t\t\t\t\"Goal Attack\",\n\t\t\t\t\t\t\"Goal Shooter\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1st\", \"description\" : \"1st quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"2nd\", \"description\" : \"2nd quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"3rd\", \"description\" : \"3rd quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"4th\", \"description\" : \"4th quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"Total\", \"id\" : \"goals\", \"description\" : \"Total goals\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"G\", \"description\" : \"Goals\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"description\" : \"Attempts\" },\n\t\t\t\t\t\t{ \"name\" : \"GA\", \"description\" : \"Goal assists\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"description\" : \"Rebounds\" },\n\t\t\t\t\t\t{ \"name\" : \"CPR\", \"description\" : \"Centre pass receives\" },\n\t\t\t\t\t\t{ \"name\" : \"I\", \"description\" : \"Intercepts\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"description\" : \"Deflections\" },\n\t\t\t\t\t\t{ \"name\" : \"P\", \"description\" : \"Penalties\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"description\" : \"Turnovers\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"GF\", \"equation\" : \"$goalsfor\", \"description\" : \"Goals for\" },\n\t\t\t\t\t\t{ \"name\" : \"GA\", \"equation\" : \"$goalsagainst\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"GD\", \"equation\" : \"$goalsfor - $goalsagainst\", \"priority\" : 2, \"description\" : \"Goal difference\" },\n\t\t\t\t\t\t{ \"name\" : \"GF\", \"equation\" : \"$win / $eventsplayed * 100\", \"precision\" : 1, \"priority\" : 3, \"description\" : \"Win percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$win * 2\", \"priority\" : 1, \"description\" : \"Team points\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Appearances\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/rugby-league.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Rugby League\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Fullback\",\n\t\t\t\t\t\t\"Wing\",\n\t\t\t\t\t\t\"Centre\",\n\t\t\t\t\t\t\"Five-Eighth\",\n\t\t\t\t\t\t\"Halfback\",\n\t\t\t\t\t\t\"Hooker\",\n\t\t\t\t\t\t\"Prop\",\n\t\t\t\t\t\t\"Second-row\",\n\t\t\t\t\t\t\"Lock\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t\"Tries\",\n\t\t\t\t\t\t\"Conversions\",\n\t\t\t\t\t\t{ \"name\" : \"BP\", \"description\" : \"Bonus points\" },\n\t\t\t\t\t\t{ \"name\" : \"Points\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"T\", \"description\" : \"Tries\" },\n\t\t\t\t\t\t{ \"name\" : \"C\", \"description\" : \"Conversions\" },\n\t\t\t\t\t\t{ \"name\" : \"P\", \"description\" : \"Penalty goals\" },\n\t\t\t\t\t\t{ \"name\" : \"DG\", \"description\" : \"Drop goals\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Matches won\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Matches lost\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Matches drawn\" },\n\t\t\t\t\t\t{ \"name\" : \"PF\", \"equation\" : \"$pointsfor\", \"description\" : \"Points for\", \"priority\" : 3 },\n\t\t\t\t\t\t{ \"name\" : \"PA\", \"equation\" : \"$pointsagainst\", \"description\" : \"Points against\" },\n\t\t\t\t\t\t{ \"name\" : \"PD\", \"equation\" : \"$pointsfor - $pointsagainst\", \"description\" : \"Points difference\", \"priority\" : 2 },\n\t\t\t\t\t\t{ \"name\" : \"BP\", \"equation\" : \"$bp\", \"description\" : \"Bonus points\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$points\", \"description\" : \"Total points\", \"priority\" : 1 }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$eventsplayed\", \"description\" : \"Appearances\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$t * 5 + $c * 2 + $p * 3 + $dg * 3\", \"description\" : \"Points\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/rugby-union.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Rugby Union\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Full-back\",\n\t\t\t\t\t\t\"Wing\",\n\t\t\t\t\t\t\"Centre\",\n\t\t\t\t\t\t\"Fly-half\",\n\t\t\t\t\t\t\"Scrum-half\",\n\t\t\t\t\t\t\"Number Eight\",\n\t\t\t\t\t\t\"Flanker\",\n\t\t\t\t\t\t\"Lock\",\n\t\t\t\t\t\t\"Hooker\",\n\t\t\t\t\t\t\"Prop\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t\"Tries\",\n\t\t\t\t\t\t\"Conversions\",\n\t\t\t\t\t\t{ \"name\" : \"BP\", \"description\" : \"Bonus points\" },\n\t\t\t\t\t\t{ \"name\" : \"Points\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"T\", \"description\" : \"Tries\" },\n\t\t\t\t\t\t{ \"name\" : \"C\", \"description\" : \"Conversions\" },\n\t\t\t\t\t\t{ \"name\" : \"P\", \"description\" : \"Penalty goals\" },\n\t\t\t\t\t\t{ \"name\" : \"DG\", \"description\" : \"Drop goals\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Matches won\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Matches lost\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Matches drawn\" },\n\t\t\t\t\t\t{ \"name\" : \"PF\", \"equation\" : \"$pointsfor\", \"description\" : \"Points for\", \"priority\" : 3 },\n\t\t\t\t\t\t{ \"name\" : \"PA\", \"equation\" : \"$pointsagainst\", \"description\" : \"Points against\" },\n\t\t\t\t\t\t{ \"name\" : \"PD\", \"equation\" : \"$pointsfor - $pointsagainst\", \"description\" : \"Points difference\", \"priority\" : 2 },\n\t\t\t\t\t\t{ \"name\" : \"BP\", \"equation\" : \"$bp\", \"description\" : \"Bonus points\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$points\", \"description\" : \"Total points\", \"priority\" : 1 }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$eventsplayed\", \"description\" : \"Appearances\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$t * 5 + $c * 2 + $p * 3 + $dg * 3\", \"description\" : \"Points\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/soccer.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Football\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Goalkeeper\",\n\t\t\t\t\t\t\"Defender\",\n\t\t\t\t\t\t\"Midfielder\",\n\t\t\t\t\t\t\"Forward\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\", \"description\" : \"Losses\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1st Half\", \"description\" : \"1st half goals\" },\n\t\t\t\t\t\t{ \"name\" : \"2nd Half\", \"description\" : \"2nd half goals\" },\n\t\t\t\t\t\t{ \"name\" : \"Goals\", \"description\" : \"Total goals\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"Goals\", \"description\" : \"Goals\", \"singular\" : \"Goal\", \"icon\" : \"soccerball\", \"color\" : \"#222222\" },\n\t\t\t\t\t\t{ \"name\" : \"Assists\", \"description\" : \"Assists\", \"singular\" : \"Assist\", \"icon\" : \"shoe\", \"color\" : \"#222222\", \"timed\" : 0 },\n\t\t\t\t\t\t{ \"name\" : \"Yellow Cards\", \"description\" : \"Yellow cards\", \"singular\" : \"Yellow Card\", \"icon\" : \"card\", \"color\" : \"#f4d014\" },\n\t\t\t\t\t\t{ \"name\" : \"Red Cards\", \"description\" : \"Red cards\", \"singular\" : \"Red Card\", \"icon\" : \"card\", \"color\" : \"#d4000f\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"F\", \"equation\" : \"$goalsfor\", \"priority\" : 3, \"description\" : \"Goals for\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$goalsagainst\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"GD\", \"equation\" : \"$goalsfor - $goalsagainst\", \"priority\" : 2, \"description\" : \"Goal difference\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$win * 3 + $draw\", \"priority\" : 1, \"description\" : \"Team points\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t{ \"name\" : \"Height\", \"description\" : \"Player height\" },\n\t\t\t\t\t\t{ \"name\" : \"Weight\", \"description\" : \"Player weight\" }\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Appearances\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"Win Ratio\", \"equation\" : \"$win / $eventsplayed * 100\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Win ratio\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw Ratio\", \"equation\" : \"$draw / $eventsplayed * 100\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Draw ratio\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss Ratio\", \"equation\" : \"$loss / $eventsplayed * 100\", \"precision\" : 2, \"type\" : \"average\", \"description\" : \"Loss ratio\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\",\n\t\t\t\t\t\t\"event_teams\" : \"2\",\n\t\t\t\t\t\t\"event_show_players\" : \"yes\",\n\t\t\t\t\t\t\"event_show_total\" : \"no\",\n\t\t\t\t\t\t\"event_performance_mode\" : \"icons\",\n\t\t\t\t\t\t\"event_show_player_numbers\" : \"yes\",\n\t\t\t\t\t\t\"event_performance_show_minutes\": \"yes\",\n\t\t\t\t\t\t\"event_split_players_by_team\" : \"yes\",\n\t\t\t\t\t\t\"event_split_players_by_position\" : \"no\",\n\t\t\t\t\t\t\"event_total_performance\" : \"all\"\n\t}\n}"
  },
  {
    "path": "presets/team-sports/softball.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Softball\",\n\t\"positions\": [\n\t\t\t\t\t\t{ \"name\" : \"Pitcher\", \"sections\" : [ 0, 1 ] },\n\t\t\t\t\t\t{ \"name\" : \"Catcher\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"First base\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Second base\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Third base\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Shortstop\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Left field\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Center field\", \"sections\" : [ 0 ] },\n\t\t\t\t\t\t{ \"name\" : \"Right field\", \"sections\" : [ 0 ] }\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1\", \"description\" : \"1st inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"2\", \"description\" : \"2nd inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"3\", \"description\" : \"3rd inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"4\", \"description\" : \"4th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"5\", \"description\" : \"5th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"6\", \"description\" : \"6th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"7\", \"description\" : \"7th inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"&nbsp;\", \"id\" : \"extra\", \"description\" : \"Extra inning runs\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"description\" : \"Total runs\", \"primary\" : 1 },\n\t\t\t\t\t\t{ \"name\" : \"H\", \"description\" : \"Hits\" },\n\t\t\t\t\t\t{ \"name\" : \"E\", \"description\" : \"Errors\" }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"AB\", \"position\" : \"Batter\", \"description\" : \"At bat\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"position\" : \"Batter\", \"description\" : \"Runs\" },\n\t\t\t\t\t\t{ \"name\" : \"H\", \"position\" : \"Batter\", \"description\" : \"Hits\" },\n\t\t\t\t\t\t{ \"name\" : \"RBI\", \"position\" : \"Batter\", \"description\" : \"Runs batted in\" },\n\t\t\t\t\t\t{ \"name\" : \"2B\", \"id\" : \"doubles\", \"position\" : \"Batter\", \"description\" : \"Doubles\" },\n\t\t\t\t\t\t{ \"name\" : \"3B\", \"id\" : \"triples\", \"position\" : \"Batter\", \"description\" : \"Triples\" },\n\t\t\t\t\t\t{ \"name\" : \"HR\", \"position\" : \"Batter\", \"description\" : \"Home runs\" },\n\t\t\t\t\t\t{ \"name\" : \"SB\", \"position\" : \"Batter\", \"description\" : \"Stolen bases\" },\n\t\t\t\t\t\t{ \"name\" : \"BB\", \"position\" : \"Batter\", \"description\" : \"Base on balls\" },\n\t\t\t\t\t\t{ \"name\" : \"SO\", \"position\" : \"Batter\", \"description\" : \"Strike outs\" },\n\t\t\t\t\t\t{ \"name\" : \"LOB\", \"position\" : \"Batter\", \"description\" : \"Left on base\" },\n\t\t\t\t\t\t{ \"name\" : \"IP\", \"id\" : \"pitcher_ip\", \"position\" : \"Pitcher\", \"description\" : \"Innings pitched\" },\n\t\t\t\t\t\t{ \"name\" : \"H\", \"id\" : \"pitcher_h\", \"position\" : \"Pitcher\", \"description\" : \"Hits allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"R\", \"id\" : \"pitcher_r\", \"position\" : \"Pitcher\", \"description\" : \"Runs allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"ER\", \"id\" : \"pitcher_er\", \"position\" : \"Pitcher\", \"description\" : \"Earned runs allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"BB\", \"id\" : \"pitcher_bb\", \"position\" : \"Pitcher\", \"description\" : \"Base on balls allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"SO\", \"id\" : \"pitcher_so\", \"position\" : \"Pitcher\", \"description\" : \"Strike outs pitched\" },\n\t\t\t\t\t\t{ \"name\" : \"HR\", \"id\" : \"pitcher_hr\", \"position\" : \"Pitcher\", \"description\" : \"Home runs allowed\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"Pct\", \"equation\" : \"$win / $eventsplayed\", \"precision\" : 3, \"priority\" : 1, \"description\" : \"Win percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"GB\", \"equation\" : \"$gamesback\", \"precision\" : 1, \"description\" : \"Games back\" },\n\t\t\t\t\t\t{ \"name\" : \"RS\", \"equation\" : \"$rfor\", \"description\" : \"Runs scored\" },\n\t\t\t\t\t\t{ \"name\" : \"RA\", \"equation\" : \"$ragainst\", \"description\" : \"Runs allowed\" },\n\t\t\t\t\t\t{ \"name\" : \"Diff\", \"equation\" : \"$rfor - $ragainst\", \"description\" : \"Run differential\" },\n\t\t\t\t\t\t{ \"name\" : \"Home\", \"equation\" : \"$homerecord\", \"description\" : \"Home record\" },\n\t\t\t\t\t\t{ \"name\" : \"Road\", \"equation\" : \"$awayrecord\", \"description\" : \"Road record\" },\n\t\t\t\t\t\t{ \"name\" : \"L10\", \"equation\" : \"$last10\", \"description\" : \"Last 10 games\" },\n\t\t\t\t\t\t{ \"name\" : \"Strk\", \"equation\" : \"$streak\", \"description\" : \"Current streak\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t{ \"name\" : \"B/T\", \"description\": \"Bats / Throws\" },\n\t\t\t\t\t\t{ \"name\" : \"Ht\", \"description\": \"Height\" },\n\t\t\t\t\t\t{ \"name\" : \"Wt\", \"description\": \"Weight\" }\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"G\", \"equation\" : \"$eventsplayed\", \"description\" : \"Games played\" },\n\t\t\t\t\t\t{ \"name\" : \"AVG\", \"equation\" : \"$h / $ab\", \"precision\" : 3, \"type\" : \"average\", \"description\" : \"Batting average\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\",\n\t\t\t\t\t\t\"event_teams\" : \"2\",\n\t\t\t\t\t\t\"event_hide_child_positions\" : \"yes\",\n\t\t\t\t\t\t\"event_show_players\" : \"yes\",\n\t\t\t\t\t\t\"event_show_total\" : \"yes\",\n\t\t\t\t\t\t\"event_reverse_teams\" : \"yes\",\n\t\t\t\t\t\t\"event_performance_mode\" : \"values\",\n\t\t\t\t\t\t\"event_show_player_numbers\" : \"no\",\n\t\t\t\t\t\t\"event_split_players_by_team\" : \"yes\",\n\t\t\t\t\t\t\"event_split_players_by_position\" : \"yes\",\n\t\t\t\t\t\t\"event_total_performance\" : \"all\"\n\t}\n}\n"
  },
  {
    "path": "presets/team-sports/volleyball.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Volleyball\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Outside Hitter\",\n\t\t\t\t\t\t\"Middle Blocker\",\n\t\t\t\t\t\t\"Setter\",\n\t\t\t\t\t\t\"Opposite\",\n\t\t\t\t\t\t\"Defensive Specialist\",\n\t\t\t\t\t\t\"Libero\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Overtime win\", \"abbreviation\" : \"OTW\" },\n\t\t\t\t\t\t{ \"name\" : \"Overtime loss\", \"abbreviation\" : \"OTL\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1\", \"description\" : \"1st set points\" },\n\t\t\t\t\t\t{ \"name\" : \"2\", \"description\" : \"2nd set points\" },\n\t\t\t\t\t\t{ \"name\" : \"3\", \"description\" : \"3rd set points\" },\n\t\t\t\t\t\t{ \"name\" : \"4\", \"description\" : \"4th set points\" },\n\t\t\t\t\t\t{ \"name\" : \"5\", \"description\" : \"5th set points\" },\n\t\t\t\t\t\t{ \"name\" : \"T\", \"id\" : \"points\", \"description\" : \"Total points\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t{ \"name\" : \"1\", \"format\" : \"checkbox\", \"description\" : \"1st set\" },\n\t\t\t\t\t\t{ \"name\" : \"2\", \"format\" : \"checkbox\", \"description\" : \"2nd set\" },\n\t\t\t\t\t\t{ \"name\" : \"3\", \"format\" : \"checkbox\", \"description\" : \"3rd set\" },\n\t\t\t\t\t\t{ \"name\" : \"4\", \"format\" : \"checkbox\", \"description\" : \"4th set\" },\n\t\t\t\t\t\t{ \"name\" : \"5\", \"format\" : \"checkbox\", \"description\" : \"5th set\" },\n\t\t\t\t\t\t{ \"name\" : \"S\", \"id\" : \"sets\", \"description\" : \"Sets played\" },\n\t\t\t\t\t\t{ \"name\" : \"K\", \"description\" : \"Kills\" },\n\t\t\t\t\t\t{ \"name\" : \"E\", \"description\" : \"Attack errors\" },\n\t\t\t\t\t\t{ \"name\" : \"TA\", \"description\" : \"Total attacks\" },\n\t\t\t\t\t\t{ \"name\" : \"B\", \"description\" : \"Blocks\" },\n\t\t\t\t\t\t{ \"name\" : \"PTS\", \"id\" : \"points\", \"description\" : \"Points\" }\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$win * 3 + $overtimewin * 2 + $overtimeloss\", \"priority\" : 1, \"description\" : \"Total points\" },\n\t\t\t\t\t\t{ \"name\" : \"P\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win + $overtimewin\", \"priority\" : 2, \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss + $overtimeloss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"PW\", \"equation\" : \"$pointsfor\", \"description\" : \"Points won\" },\n\t\t\t\t\t\t{ \"name\" : \"PL\", \"equation\" : \"$pointsagainst\", \"description\" : \"Points lost\" },\n\t\t\t\t\t\t{ \"name\" : \"Ratio\", \"equation\" : \"$pointsfor / $pointsagainst\", \"precision\" : 3, \"priority\" : 2 }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Pct\", \"equation\" : \"( $k - $e ) / $ta\", \"type\" : \"average\", \"description\" : \"Hitting percentage\" },\n\t\t\t\t\t\t{ \"name\" : \"B/S\", \"equation\" : \"$b / $sets\", \"type\" : \"average\", \"description\" : \"Blocks per set\" },\n\t\t\t\t\t\t{ \"name\" : \"A/S\", \"equation\" : \"$a / $sets\", \"type\" : \"average\", \"description\" : \"Assists per set\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\",\n\t\t\t\t\t\t\"event_teams\" : \"2\",\n\t\t\t\t\t\t\"event_teams_delimiter\" : \"-\",\n\t\t\t\t\t\t\"event_show_full_time\" : \"no\",\n\t\t\t\t\t\t\"event_reverse_teams\" : \"no\",\n\t\t\t\t\t\t\"event_performance_mode\" : \"values\",\n\t\t\t\t\t\t\"event_show_player_numbers\" : \"yes\",\n\t\t\t\t\t\t\"event_show_position\" : \"no\"\n\t}\n}"
  },
  {
    "path": "presets/water-sports/water-polo.json",
    "content": "{\n\t\"name\":\t\t\t\t\"Water Polo\",\n\t\"positions\": [\n\t\t\t\t\t\t\"Offense\",\n\t\t\t\t\t\t\"Defense\",\n\t\t\t\t\t\t\"Goalie\"\n\t],\n\t\"positions\": [\n\t\t\t\t\t\t\"Goalkeeper\",\n\t\t\t\t\t\t\"Driver\",\n\t\t\t\t\t\t\"Hole Set\",\n\t\t\t\t\t\t\"Hole Guard\"\n\t],\n\t\"outcomes\": [\n\t\t\t\t\t\t{ \"name\" : \"Win\", \"condition\" : \">\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss\", \"condition\" : \"<\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw\", \"condition\" : \"=\" }\n\t],\n\t\"results\": [\n\t\t\t\t\t\t{ \"name\" : \"1st Quarter\", \"description\" : \"1st quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"2nd Quarter\", \"description\" : \"2nd quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"3rd Quarter\", \"description\" : \"3rd quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"4rd Quarter\", \"description\" : \"4th quarter goals\" },\n\t\t\t\t\t\t{ \"name\" : \"PS\", \"description\" : \"Five Meter Penalty\" },\n\t\t\t\t\t\t{ \"name\" : \"Goals\", \"description\" : \"Total goals\", \"primary\" : 1 }\n\t],\n\t\"performance\": [\n\t\t\t\t\t\t\"Goals\",\n\t\t\t\t\t\t\"Assists\",\n\t\t\t\t\t\t\"Exclusion Foul\",\n\t\t\t\t\t\t\"Brutality Foul\",\n\t\t\t\t\t\t\"Misconduct Foul\"\n\t],\n\t\"columns\": [\n\t\t\t\t\t\t{ \"name\" : \"T\", \"equation\" : \"$eventsplayed\", \"description\" : \"Total matches\" },\n\t\t\t\t\t\t{ \"name\" : \"W\", \"equation\" : \"$win\", \"description\" : \"Wins\" },\n\t\t\t\t\t\t{ \"name\" : \"D\", \"equation\" : \"$draw\", \"description\" : \"Draws\" },\n\t\t\t\t\t\t{ \"name\" : \"L\", \"equation\" : \"$loss\", \"description\" : \"Losses\" },\n\t\t\t\t\t\t{ \"name\" : \"F\", \"equation\" : \"$goalsfor\", \"priority\" : 3, \"description\" : \"Goals for\" },\n\t\t\t\t\t\t{ \"name\" : \"A\", \"equation\" : \"$goalsagainst\", \"description\" : \"Goals against\" },\n\t\t\t\t\t\t{ \"name\" : \"DIFF\", \"equation\" : \"$goalsfor - $goalsagainst\", \"priority\" : 2, \"description\" : \"Goal difference\" },\n\t\t\t\t\t\t{ \"name\" : \"Pts\", \"equation\" : \"$win * 2 + $draw\", \"priority\" : 1, \"description\" : \"Team points\" }\n\t],\n\t\"metrics\": [\n\t\t\t\t\t\t\"Height\",\n\t\t\t\t\t\t\"Weight\"\n\t],\n\t\"statistics\": [\n\t\t\t\t\t\t{ \"name\" : \"Appearances\", \"equation\" : \"$eventsplayed\", \"description\" : \"Matches played\" },\n\t\t\t\t\t\t{ \"name\" : \"Win Ratio\", \"equation\" : \"$win / $eventsplayed * 100\", \"precision\" : 2, \"type\" : \"average\" },\n\t\t\t\t\t\t{ \"name\" : \"Draw Ratio\", \"equation\" : \"$draw / $eventsplayed * 100\", \"precision\" : 2, \"type\" : \"average\" },\n\t\t\t\t\t\t{ \"name\" : \"Loss Ratio\", \"equation\" : \"$loss / $eventsplayed * 100\", \"precision\" : 2, \"type\" : \"average\" }\n\t],\n\t\"options\": {\n\t\t\t\t\t\t\"mode\" : \"team\"\n\t}\n}\n"
  },
  {
    "path": "readme.txt",
    "content": "=== SportsPress - Sports Club & League Manager ===\nContributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi\nTags: club, event, fixtures, league, sports\nDonate link: http://tboy.co/donate\nRequires at least: 5.0\nTested up to: 6.9\nStable tag: 2.7.29\nLicense: GPLv3\nLicense URI: http://www.gnu.org/licenses/gpl-3.0.html\n\nSportsPress is an extendable all-in-one sports data plugin that helps sports clubs set up and manage a league or club site quickly and easily.\n\n== Description ==\n\n= Create a Professional Sports Website =\nTransform your WordPress blog into a fully configurable team, club, or league website. Features a suite of sports tools including fixtures, results, automated standings, players rankings, and individual profiles for clubs, players, and staff.\n\n[youtube http://www.youtube.com/watch?v=KQyga_C5a6M]\n\n= Industry Reviews =\n> \"*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)\n>\n> \"*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)\n>\n> \"*SportsPress is probably one of the most complete WordPress sports plugins out there. If you have a sports website and you’re looking to showcase your team, or even your entire league, then give this plugin a try.*\" — [HostGator](https://www.hostgator.com/blog/best-wordpress-plugins-themes-sports-websites/)\n\n= Features =\n* Equation Builder\n* Club Profiles with Player List\n* Automated League Standings with Club Logos\n* Events (Fixtures & Results) with Player Performance\n* Events Calendar\n* Player Profiles & Statistics\n* Player Lists\n* Staff Profiles\n* Select Current Club and Previous Clubs\n* Season Archives\n* Venue Information & Maps\n* Statistics & League Table Columns Configuration\n* Sport Presets\n* Switch Between Club vs Club and Player vs Player Mode.\n* Import Events, Clubs, Players, and Staff from CSV Files\n* Easy Shortcodes Menu in Editor\n* Events Integrate with iCal\n* Certified compatibility with [WPML](http://wpml.org/plugin/sportspress/)\n\nMore details about each feature are available on the [SportsPress Website](http://tboy.co/pro).\n\n= Free Extensions =\n* [SportsPress for Baseball](https://wordpress.org/plugins/sportspress-for-baseball/)\n* [SportsPress for Basketball](https://wordpress.org/plugins/sportspress-for-basketball/)\n* [SportsPress for Cricket](https://wordpress.org/plugins/sportspress-for-cricket/)\n* [SportsPress for Football (Soccer)](https://wordpress.org/plugins/sportspress-for-soccer/)\n* [SportsPress for Golf](https://wordpress.org/plugins/sportspress-for-golf/)\n* [SportsPress for Volleyball](https://wordpress.org/plugins/sportspress-for-volleyball/)\n\n= SportsPress Pro =\n\nLooking for more advanced sports functionality? Upgrade to [SportsPress Pro](http://tboy.co/pro) to get access to more advanced features for your team, club, or league website.\n\n= Available Languages =\n* English – English ( en_US )\n* Arabic – العربية ( ar )\n* Armenian – Հայերեն ( hy )\n* Bulgarian – Български ( bg_BG )\n* Chinese (China) – 中文 ( zh_CN )\n* Croatian – Hrvatski ( hr )\n* Czech – Čeština ( cs_CZ )\n* Danish – Dansk ( da_DK )\n* Dutch – Nederlands ( nl_NL )\n* French – Français ( fr_FR )\n* Finnish – Suomi ( fi )\n* German – Deutsch ( de_DE )\n* Greek – Ελληνικά ( el_GR )\n* Hungarian – Magyar ( hu_HU )\n* Italian – Italiano ( it_IT )\n* Japanese – 日本語 ( ja )\n* Korean – 한국어 ( ko_KR )\n* Macedonian – македонски ( mk_MK )\n* Norwegian Bokmål – Norsk bokmål ( nb_NO )\n* Persian – فارسی ( fa_IR )\n* Polish – Polski ( pl_PL )\n* Portuguese (Brazil) – Português do Brasil ( pt_BR )\n* Portuguese (Portugal) – Português ( pt_PT )\n* Romanian – Română ( ro_RO )\n* Russian – Русский ( ru_RU )\n* Slovak – Slovenčina ( sk_SK )\n* Slovenian – Slovenija ( sl_SI )\n* Spanish – Español ( es_ES )\n* Swedish – Svenska ( sv_SE )\n* Tagalog - Tagalog ( tl )\n* Tamil – தமிழ் ( ta_IN )\n* Thai – ไทย ( th )\n* Turkish – Türkçe ( tr_TR )\n\n= Sport Presets Included =\n* American Football\n* Association Football (Soccer)\n* Australian Rules Football\n* Baseball\n* Basketball\n* Cricket\n* Darts\n* Golf\n* Handball\n* Ice Hockey\n* Lacrosse\n* Netball\n* Rugby League\n* Rugby Union\n* Snooker\n* Softball\n* Squash\n* Table Tennis\n* Tennis\n* Volleyball\n* Water Polo\n\n= Esports Presets =\n* Counter-Strike: Global Offensive\n* Dota 2\n* League of Legends\n\n= SportsPress Themes for Clubs =\n* [Courtside](http://tboy.co/courtside)\n* [Emblem](http://tboy.co/emblem)\n* [Football Club](http://tboy.co/fc)\n* [Marquee](http://tboy.co/marquee)\n* [Premier](http://tboy.co/premier)\n* [Rookie Plus](http://tboy.co/rp)\n* [Varsity](http://tboy.co/varsity)\n\n= Get Involved =\n\nFeel free to share your suggestions with us so we can continue to develop awesome sports club features for you guys!\n\nDevelopers can contribute via the [SportsPress GitHub Repository](https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md).\n\nTranslators can contribute to SportsPress translations through [GlotPress](https://translate.wordpress.org/projects/wp-plugins/sportspress).\n\n= Stay Current =\nTo keep up with the latest updates and new features, be sure to do the following:\n\n* Visit the [SportsPress Pro homepage](http://tboy.co/pro).\n* Subscribe to our [YouTube channel](http://tboy.co/youtube).\n* Follow ThemeBoy on [Facebook](http://tboy.co/facebook) & [Twitter](http://tboy.co/twitter).\n\n= Please Rate, Vote, and Enjoy! =\nYour feedback is much appreciated and makes all the difference in improving SportsPress.\n\n== Installation ==\n\n= Minimum Requirements =\n* WordPress 3.8 or greater\n* PHP version 5.2.4 or greater\n* MySQL version 5.0 or greater\n\n[youtube http://www.youtube.com/watch?v=nE8-RlbotmU]\n\n= Automatic Installation =\n\nAutomatic installation is the easiest option as WordPress handles the file transfers itself and you don't even need to leave your web browser. To do an automatic install of SportsPress, log in to your WordPress admin panel, navigate to the Plugins menu and click Add New.\n\nIn the search field type \"SportsPress\" and click Search Plugins. Once you've found our sports plugin you can view details about it such as the point release, rating and description. Most importantly of course, you can install it by simply clicking Install Now. After clicking that link you will be asked if you're sure you want to install the plugin. Click yes and WordPress will automatically complete the installation.\n\n= Manual Installation =\n\nThe manual installation method involves downloading our sports plugin and uploading it to your webserver via your favorite FTP application.\n\n1. Download the plugin file to your computer and unzip it\n2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation's wp-content/plugins/ directory.\n3. Activate the plugin from the Plugins menu within the WordPress admin.\n\n= Upgrading =\n\nAutomatic updates should work like a charm; as always though, ensure you backup your site just in case.\n\nIf on the off-chance you do encounter issues with the event/team/player/staff pages after an update you simply need to flush the permalinks by going to WordPress > Settings > Permalinks and hitting 'save'. That should return things to normal.\n\n== Screenshots ==\n\n1. Add a suite of widgets to your site to display your own sports data.\n2. Generate automated standings that update whenever results are published.\n3. Schedule matches and display details, results, box scores, and a map to the venue.\n4. Register teams and players on your site and create lineups for each team.\n5. Display player profiles with configurable details and career stats.\n6. Select your sport to automatically install presets and sample data.\n7. Each team has a unique logo and website URL. Optionally link teams from your blog to their official websites.\n8. The overview page provides a birds-eye view of your entire sports network.\n9. Configure variables used throughout the plugin to fit your sport. Presets are provided for some sports, and will automatically populate these options.\n10. Design your own points system using the custom drag-and-drop equation builder.\n\n== Frequently Asked Questions ==\n\n= Which sports does this plugin support? =\n\nThe plugin will support most team sports with a scoring system. You can customize the table columns and player statistics via SportsPress settings. We've included presets for commonly requested sports, and you can also add your own.\n\n= Will SportsPress work with my theme? =\n\nYes; SportsPress will work with any theme, but may require some styling to make it match nicely.\n\n= Where can I report bugs or contribute to the project? =\n\nBugs can be reported either in our support forum or preferably on the [SportsPress GitHub repository](https://github.com/ThemeBoy/SportsPress/issues).\n\n= Will SportsPress work with my sport? =\n\nThe plugin comes preinstalled with several different sports presets to help you get started quickly, but is also flexible enough to be customized to fit the need of any team or individual sport. Please [let us know](http://wordpress.org/support/plugin/sportspress) if you'd like to work with us to get your preset added the plugin.\n\n= Can I import teams/players/staff/matches? =\n\nYes, CSV importers are included with the plugin. Go to Tools > Import and choose from one of the SportsPress CSV importers. Supports CSV files generated by [LeagueLobster](http://tboy.co/leaguelobster).\n\n= What's the difference between the free and Pro plugin? =\n\nSportsPress is a free plugin developed to give sports organizations the functionality needed to run a team, club, or league website. The plugin allows you to schedule your upcoming matches and enter the results after you've played a game. Your league tables, team and player statistics will automatically update once you've published the result to reflect the new standings.\n\nLimitations? Don't worry, there are no limitations to the number of events, players, staff members, teams, clubs, or leagues you can add to the free plugin.\n\n[SportsPress Pro](http://tboy.co/pro) is a premium plugin made for serious teams who are looking for additional sports functionality in their website. By upgrading to SportsPress Pro, you will be given instant access to a suite of sports modules that will appear in your dashboard.\n\nThe current modules that are available exclusively to SportsPress Pro are:\n\n* Tournaments: Create and display tournaments in a bracket/knockout cup format.\n* Timelines: Display a visual timeline of player performance in events.\n* Scoreboard: Display multiple event results in a horizontal scoreboard.\n* Sponsors: Add your sponsors on your website and track each of their clicks and impressions.\n* Staff Directories: Show contact information of your key personnel so people know who to get in touch with.\n* Team Access: Assign users to a specific team and limit their access to data related to that team.\n* Team Colors: Make each team's profile page unique by displaying their team colors.\n* League Menu: Display a global navigation bar at the top of your website for easy navigation from one team to the next.\n* Twitter: Add a Twitter feed to team, player, and staff pages.\n* Branding: Instantly rebrands your admin panel to reflect your organization's brand.\n* Duplicator: Clone anything with just one click. Great for creating multiple events.\n\nThere are [3 different licenses](http://tboy.co/pro) that you can choose from: Club, League, and Agency.\n\nWhen you upgrade to one of the SportsPress Pro licenses, you can simply activate the Pro version without losing any of your data. Please note that we recommend that you do a complete backup whenever you make big changes to your website.\n\n== Changelog ==\n\n= 2.7.29 =\n* Fix - Error when extensions add null values.\n* Fix - Non-numeric metrics being converted to numeric values.\n\n= 2.7.27 =\n* Fix - Security issues.\n\n= 2.7.26 =\n* Tweak - Make SportsPress compatible with the Polylang plugin.\n* Fix - Non-numeric value error in player list.\n* Fix - Countdown widget null parameter deprecation.\n* Fix - Deprecated functiong get_page_by_title().\n\n= 2.7.24 =\n* Update - Leaflet version to 1.9.4.\n* Tweak - Refactor equation builder to support nested conditional equations.\n* Tweak - Add option to filter events by venue in admin.\n* Tweak - Include events with no status in countdown widget.\n* Fix - Errors related to PHP version 8.\n* Fix - Statistic format not saving.\n* Fix - Position stats in offense and defense not saving.\n* Fix - Google error: Date/time not in ISO 8601 format.\n* Fix - Minutes in league table.\n* Fix = Fatal error due to wrong type.\n\n= 2.7.23 =\n* Update - Version bump for SportsPress Pro.\n\n= 2.7.22 =\n* Fix - Security issues.\n\n= 2.7.21 =\n* Fix - Add nonce checks to hide notice links.\n\n= 2.7.20 =\n* Fix - Permalink access for non-admins.\n\n= 2.7.19 =\n* Fix - Games back showing as zero.\n\n= 2.7.18 =\n* Tweak - Only get staff template if enabled.\n* Tweak - Show visible option only when \"Auto\" mode is selected.\n* Fix - \"None\" option disappeared from dropdowns.\n* Fix - Minutes not shown when image used as icon.\n* Fix - Deprecated urlencode() notice.\n* Fix - Null parameter notice.\n* Fix - Undefined array key warnings.\n* Fix - Add user capability check and nonce check when updating permalinks.\n\n= 2.7.17 =\n* Fix - PHP 8.2.x deprecated code warnings.\n* Fix - Next team not working in shortcodes.\n* Fix - Links rendering in event specs.\n* Localization - Update translatable strings.\n\n= 2.7.16 =\n* Update - WP version tested up to 6.1.\n* Update - Leaflet version to 1.8.0.\n* Tweak - Datepicker support for event blocks, list, and calendar widgets.\n* Fix - Toggle between absolute and resltive dates in shortcodes.\n* Fix - Undefined variables showdob and showage.\n* Fix - Date range error in player lists.\n* Fix - Loss condition not applied on event results.\n* Fix - Can't set statistic variable for player positions.\n* Fix - API error when using _fields.\n* Fix - Event map and video not being displayed.\n* Fix - Escape functions in admin.\n\n= 2.7.15 =\n* Feature - Sports news widget in dashboard.\n* Fix - Fixture importer bug with extended characters in league and season name.\n* Fix - Player list not loading (too many resources).\n* Fix - Performance format not updating.\n* Fix - Trim whitespace on geo coordinates to avoid import error.\n\n= 2.7.14 =\n* Fix - Error when non-value added as adjustment.\n* Fix - Map links not escaped properly.\n* Fix - Event blocks missing attributes.\n* Fix - Player statistics meta escaping.\n\n= 2.7.13 =\n* Fix - Theme notice escaping.\n* Fix - Timezone dropdown selection now shown in general settings.\n* Fix - Double header when multiple player lists are displayed in team.\n* Fix - Dropdown options not saving in settings.\n* Fix - Setup page conflict with WooCommerce.\n\n= 2.7.12 =\n* Fix - OpenStreetMap not displaying map after update.\n\n= 2.7.11 =\n* Fix - Player status selector not reflecting changes in match edit screen.\n* Fix - Player dropdown template not displaying names.\n* Fix - Staff dropdown template not displaying names.\n\n= 2.7.10 =\n* Fix - Players not selectable in event edit page.\n* Fix - Videos embedded in post content not rendering.\n\n= 2.7.9 =\n* Tweak - Add support for event format in REST API.\n* Tweak - Add \"Order\" and \"Order by\" selection fields for countdown widget.\n* Tweak - Add option to display event status in countdown widget.\n* Tweak - Add ability to filter events by format in calendar template.\n* Tweak - Update TGM plugin activation library.\n* Fix - Remove plugin headers from modules for improved compatibility.\n* Fix - Reverse order not applying to teams in event lists.\n* Fix - Add validation to user inputs for improved security.\n* Fix - Sanitize all user inputs for improved security.\n* Fix - Escape all outputs in admin for improved security.\n* Fix - Filtering based on format for event blocks.\n* Fix - Last week and next week filter not applying to player lists.\n* Fix - Deselecting a selected team in settings.\n* Fix - PHP 8.0 deprecated warnings.\n* Localization - Add nationalities and flags for French Guiana, French Polynesia, Guadeloupe, Greenland, Martinique, Reunion, and Sint Maarten.\n\n= 2.7.8 =\n* Fix - Event results, box scores, and players stats not updating via REST API.\n\n= 2.7.7 =\n* Fix - Events not appearing due to filter malfunction.\n\n= 2.7.6 =\n* Feature - Add ability to bulk set events as on time.\n* Fix - Players in events not being filtered by team.\n\n= 2.7.5 =\n* Tweak - Add ability to filter events by team and match day in one query.\n* Tweak - Improve performance by updating leaflet script and only loading when required.\n* Tweak - Add overtime notation compatibility for minutes played.\n* Fix - Issue with event edit page where the scripts were not working.\n* Fix - No records when format is default in event list shortcode.\n\n= 2.7.4 =\n* Tweak - Add option to display birthday, age, or both in birthdays widget.\n* Fix - Player list data showing zeroes in some cases.\n\n= 2.7.3 =\n* Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary.\n* Tweak - Avoid showing minutes box for subs when not needed.\n* Tweak - Improve filtering speed for queries without leagues or seasons.\n* Tweak - Apply reverse order setting in event lists.\n* Tweak - Enable filtering a player's events played on a specific team.\n* Fix - Include future events in REST API for WordPress 5.5.\n* Fix - Enable updating player metrics using the REST API.\n* Fix - Deprecated code for PHP 7.4.\n* Fix - Elementor compatibility.\n* Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini.\n* Localization - Adjust RTL stylesheet for event performance icons.\n\n= 2.7.2 =\n* Tweak - Sanitize delimiter field in event settings.\n\n= 2.7.1 =\n* Feature - Enable player list filtering by nationality.\n* Feature - Add option to display date of birth in player lists.\n* Tweak - Exclude postponed and canceled events from countdowns.\n* Tweak - Apply reverse order option to event results.\n* Tweak - When a team has more than one home venue, separate with commas.\n* Fix - Venue address containing pluses in events.\n* Fix - Event blocks showing the wrong dates when embedded within other event pages.\n* Fix - Statistics not adding manual values when not based on equations.\n* Fix - Event lists ignoring the format parameter.\n* Fix - League table order when displaying multiple tables in team profiles.\n* Fix - Error when deleting configuration columns.\n* Fix - Player lists not including past players in some cases.\n* Fix - Prevent error when viewing event calendar in some cases.\n\n= 2.7 =\n* Feature - New bulk actions to postpone and cancel multiple events.\n* Feature - Add date of birth to player importer.\n* Feature - Automatically select the home team's venue as the default venue when importing fixtures.\n* Feature - Add ability to turn on comment for team profiles.\n* Feature - Filter league tables by event status.\n* Tweak - When an icon is used for player performance, display the icon in player lists and profiles.\n* Tweak - Add title attribute for player statistic icons.\n* Tweak - Default stylesheet sorting icon width.\n* Fix - Icon color picker rendering issue.\n* Fix - Image selector not working for player statistics.\n* Fix - Enqueue scripts and styles for OpenStreetMap when used in shortcodes.\n* Localization - Add translation options for countdown units.\n\n= Full Changelog =\n* For older versions, [view the full changelog](https://github.com/ThemeBoy/SportsPress/blob/master/changelog.txt).\n"
  },
  {
    "path": "sportspress.php",
    "content": "<?php\n/**\n * Plugin Name: SportsPress\n * Plugin URI: http://themeboy.com/sportspress/\n * Description: Manage your club and its players, staff, events, league tables, and player lists.\n * Version: 2.7.29\n * Author: ThemeBoy\n * Author URI: http://themeboy.com\n * Requires at least: 3.8\n * Tested up to: 6.9\n *\n * Text Domain: sportspress\n * Domain Path: /languages/\n *\n * @package SportsPress\n * @category Core\n * @author ThemeBoy\n */\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! class_exists( 'SportsPress' ) ) :\n\n\t/**\n\t * Main SportsPress Class\n\t *\n\t * @class SportsPress\n\t * @version 2.7.29\n\t */\n\tfinal class SportsPress {\n\n\t\t/**\n\t\t * @var string\n\t\t */\n\t\tpublic $version = '2.7.29';\n\n\t\t/**\n\t\t * @var SportsPress The single instance of the class\n\t\t * @since 0.7\n\t\t */\n\t\tprotected static $_instance = null;\n\n\t\t/**\n\t\t * @var SP_Modules $modules\n\t\t */\n\t\tpublic $modules = null;\n\n\t\t/**\n\t\t * @var SP_Countries $countries\n\t\t */\n\t\tpublic $countries = null;\n\n\t\t/**\n\t\t * @var SP_Formats $formats\n\t\t */\n\t\tpublic $formats = null;\n\n\t\t/**\n\t\t * @var SP_Templates $templates\n\t\t */\n\t\tpublic $templates = null;\n\t\t\n\t\t/**\n\t\t * @var SP_Feeds $feeds\n\t\t */\n\t\tpublic $feeds = null;\n\n\t\t/**\n\t\t * @var array\n\t\t */\n\t\tpublic $text = array();\n\n\t\t/**\n\t\t * Main SportsPress Instance\n\t\t *\n\t\t * Ensures only one instance of SportsPress is loaded or can be loaded.\n\t\t *\n\t\t * @since 0.7\n\t\t * @static\n\t\t * @see SP()\n\t\t * @return SportsPress - Main instance\n\t\t */\n\t\tpublic static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}\n\n\t\t/**\n\t\t * Cloning is forbidden.\n\t\t *\n\t\t * @since 0.7\n\t\t */\n\t\tpublic function __clone() {\n\t\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'sportspress' ), '0.7' );\n\t\t}\n\n\t\t/**\n\t\t * Unserializing instances of this class is forbidden.\n\t\t *\n\t\t * @since 0.7\n\t\t */\n\t\tpublic function __wakeup() {\n\t\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'sportspress' ), '0.7' );\n\t\t}\n\n\t\t/**\n\t\t * SportsPress Constructor.\n\t\t *\n\t\t * @access public\n\t\t * @return SportsPress\n\t\t */\n\t\tpublic function __construct() {\n\t\t\t// Auto-load classes on demand\n\t\t\tif ( function_exists( '__autoload' ) ) {\n\t\t\t\tspl_autoload_register( '__autoload' );\n\t\t\t}\n\n\t\t\tspl_autoload_register( array( $this, 'autoload' ) );\n\n\t\t\t// Define constants\n\t\t\t$this->define_constants();\n\n\t\t\t// Include required files\n\t\t\t$this->includes();\n\n\t\t\t// Hooks\n\t\t\tadd_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) );\n\t\t\tadd_action( 'init', array( $this, 'init' ), 0 );\n\t\t\tadd_action( 'init', array( 'SP_Shortcodes', 'init' ) );\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'setup_environment' ) );\n\t\t\tadd_action( 'tgmpa_register', array( $this, 'extension' ) );\n\n\t\t\t// Include core modules\n\t\t\t$this->include_modules();\n\n\t\t\t// Loaded action\n\t\t\tdo_action( 'sportspress_loaded' );\n\t\t}\n\n\t\t/**\n\t\t * Show action links on the plugin screen.\n\t\t *\n\t\t * @param mixed $links\n\t\t * @return array\n\t\t */\n\t\tpublic function action_links( $links ) {\n\t\t\treturn array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'<a href=\"' . admin_url( 'admin.php?page=sportspress' ) . '\">' . esc_attr__( 'Settings', 'sportspress' ) . '</a>',\n\t\t\t\t\t'<a href=\"' . apply_filters( 'sportspress_docs_url', 'http://tboy.co/docs' ) . '\">' . esc_attr__( 'Docs', 'sportspress' ) . '</a>',\n\t\t\t\t\t'<a href=\"' . apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) . '\">' . esc_attr__( 'Upgrade', 'sportspress' ) . '</a>',\n\t\t\t\t),\n\t\t\t\t$links\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Auto-load SP classes on demand to reduce memory consumption.\n\t\t *\n\t\t * @param mixed $class\n\t\t * @return void\n\t\t */\n\t\tpublic function autoload( $class ) {\n\t\t\t$path  = null;\n\t\t\t$class = strtolower( $class );\n\t\t\t$file  = 'class-' . str_replace( '_', '-', $class ) . '.php';\n\n\t\t\tif ( strpos( $class, 'sp_shortcode_' ) === 0 ) {\n\t\t\t\t$path = $this->plugin_path() . '/includes/shortcodes/';\n\t\t\t} elseif ( strpos( $class, 'sp_meta_box' ) === 0 ) {\n\t\t\t\t$path = $this->plugin_path() . '/includes/admin/post-types/meta-boxes/';\n\t\t\t} elseif ( strpos( $class, 'sp_admin' ) === 0 ) {\n\t\t\t\t$path = $this->plugin_path() . '/includes/admin/';\n\t\t\t}\n\n\t\t\tif ( $path && is_readable( $path . $file ) ) {\n\t\t\t\tinclude_once $path . $file;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Fallback\n\t\t\tif ( strpos( $class, 'sp_' ) === 0 ) {\n\t\t\t\t$path = $this->plugin_path() . '/includes/';\n\t\t\t}\n\n\t\t\tif ( $path && is_readable( $path . $file ) ) {\n\t\t\t\tinclude_once $path . $file;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Define SP Constants.\n\t\t */\n\t\tprivate function define_constants() {\n\t\t\tdefine( 'SP_PLUGIN_FILE', __FILE__ );\n\t\t\tdefine( 'SP_VERSION', $this->version );\n\n\t\t\tif ( ! defined( 'SP_TEMPLATE_PATH' ) ) {\n\t\t\t\tdefine( 'SP_TEMPLATE_PATH', $this->template_path() );\n\t\t\t}\n\n\t\t\tif ( ! defined( 'SP_DELIMITER' ) ) {\n\t\t\t\tdefine( 'SP_DELIMITER', '|' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Include required core files used in admin and on the frontend.\n\t\t */\n\t\tprivate function includes() {\n\t\t\tinclude_once 'includes/sp-core-functions.php';\n\t\t\tinclude_once 'includes/class-sp-install.php';\n\n\t\t\tif ( is_admin() ) {\n\t\t\t\tinclude_once 'includes/admin/class-sp-admin.php';\n\t\t\t}\n\n\t\t\tif ( defined( 'DOING_AJAX' ) ) {\n\t\t\t\t$this->ajax_includes();\n\t\t\t}\n\n\t\t\tif ( ! is_admin() || defined( 'DOING_AJAX' ) ) {\n\t\t\t\t$this->frontend_includes();\n\t\t\t}\n\n\t\t\t// Post types\n\t\t\tinclude_once 'includes/class-sp-post-types.php';                     // Registers post types\n\n\t\t\t// Include abstract classes\n\t\t\tinclude_once 'includes/abstracts/abstract-sp-custom-post.php';     // Custom posts\n\t\t\tinclude_once 'includes/abstracts/abstract-sp-secondary-post.php';  // Secondary posts\n\n\t\t\t// Classes (used on all pages)\n\t\t\tinclude_once 'includes/class-sp-modules.php';                        // Defines available modules\n\t\t\tinclude_once 'includes/class-sp-countries.php';                      // Defines continents and countries\n\t\t\tinclude_once 'includes/class-sp-formats.php';                        // Defines custom post type formats\n\t\t\tinclude_once 'includes/class-sp-templates.php';                      // Defines custom post type templates\n\t\t\tinclude_once 'includes/class-sp-feeds.php';                          // Adds feeds\n\n\t\t\t// Include template functions making them pluggable by plugins and themes.\n\t\t\tinclude_once 'includes/sp-template-functions.php';\n\n\t\t\t// Include template hooks in time for themes to remove/modify them\n\t\t\tinclude_once 'includes/sp-template-hooks.php';\n\n\t\t\t// WPML-related localization hooks\n\t\t\tinclude_once 'includes/class-sp-wpml.php';\n\n\t\t\t// REST API\n\t\t\tinclude_once 'includes/api/class-sp-rest-api.php';\n\n\t\t\t// TGMPA\n\t\t\tinclude_once 'includes/libraries/class-tgm-plugin-activation.php';\n\t\t}\n\n\t\t/**\n\t\t * Include required ajax files.\n\t\t */\n\t\tpublic function ajax_includes() {\n\t\t\tinclude_once 'includes/class-sp-ajax.php';                   // Ajax functions for admin and the front-end\n\t\t}\n\n\t\t/**\n\t\t * Include required frontend files.\n\t\t */\n\t\tpublic function frontend_includes() {\n\t\t\tinclude_once 'includes/class-sp-template-loader.php';        // Template Loader\n\t\t\tinclude_once 'includes/class-sp-frontend-scripts.php';       // Frontend Scripts\n\t\t\tinclude_once 'includes/class-sp-shortcodes.php';             // Shortcodes class\n\t\t}\n\n\t\t/**\n\t\t * Include core modules.\n\t\t */\n\t\tprivate function include_modules() {\n\t\t\t$dir = scandir( $this->plugin_path() . '/modules' );\n\t\t\tif ( $dir ) {\n\t\t\t\t$path = $this->plugin_path() . '/modules/';\n\t\t\t\tforeach ( $dir as $module ) {\n\t\t\t\t\tif ( $path && substr( $module, 0, 1 ) !== '.' ) {\n\t\t\t\t\t\tif ( is_readable( $path . $module ) ) {\n\t\t\t\t\t\t\tinclude_once $path . $module;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Init SportsPress when WordPress Initialises.\n\t\t */\n\t\tpublic function init() {\n\t\t\t// Before init action\n\t\t\tdo_action( 'before_sportspress_init' );\n\n\t\t\t// Set up localisation\n\t\t\t$this->load_plugin_textdomain();\n\n\t\t\t// Load class instances\n\t\t\t$this->modules   = new SP_Modules();      // Modules class\n\t\t\t$this->countries = new SP_Countries();  // Countries class\n\t\t\t$this->formats   = new SP_Formats();      // Formats class\n\t\t\t$this->templates = new SP_Templates();  // Templates class\n\t\t\t$this->feeds     = new SP_Feeds();          // Feeds class\n\n\t\t\t// Load string options\n\t\t\t$this->text = get_option( 'sportspress_text', array() );\n\n\t\t\t// Init action\n\t\t\tdo_action( 'sportspress_init' );\n\t\t}\n\n\t\t/**\n\t\t * Load Localisation files.\n\t\t *\n\t\t * Note: the first-loaded translation file overrides any following ones if the same translation is present\n\t\t */\n\t\tpublic function load_plugin_textdomain() {\n\t\t\t$locale = apply_filters( 'plugin_locale', get_locale(), 'sportspress' );\n\n\t\t\t// Global + Frontend Locale\n\t\t\tload_textdomain( 'sportspress', WP_LANG_DIR . \"/sportspress/sportspress-$locale.mo\" );\n\t\t\tload_plugin_textdomain( 'sportspress', false, plugin_basename( dirname( __FILE__ ) . '/languages' ) );\n\t\t}\n\n\t\t/**\n\t\t * Ensure theme and server variable compatibility and setup image sizes.\n\t\t */\n\t\tpublic function setup_environment() {\n\t\t\tif ( ! current_theme_supports( 'post-thumbnails' ) ) {\n\t\t\t\tadd_theme_support( 'post-thumbnails' );\n\t\t\t}\n\n\t\t\t// Add image sizes\n\t\t\tadd_image_size( 'sportspress-crop-medium', 300, 300, true );\n\t\t\tadd_image_size( 'sportspress-fit-medium', 300, 300, false );\n\t\t\tadd_image_size( 'sportspress-fit-icon', 128, 128, false );\n\t\t\tadd_image_size( 'sportspress-fit-mini', 32, 32, false );\n\t\t}\n\n\t\t/**\n\t\t * Recommend SportsPress extension for available sports.\n\t\t */\n\t\tpublic static function extension() {\n\t\t\t$sport = sp_array_value( $_POST, 'sportspress_sport', get_option( 'sportspress_sport', null ), 'key' );\n\t\t\tif ( ! $sport ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$plugins = array();\n\n\t\t\tswitch ( $sport ) :\n\t\t\t\tcase 'baseball':\n\t\t\t\t\t$plugins[] = array(\n\t\t\t\t\t\t'name'     => 'SportsPress for Baseball',\n\t\t\t\t\t\t'slug'     => 'sportspress-for-baseball',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'version'  => '1.0',\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'basketball':\n\t\t\t\t\t$plugins[] = array(\n\t\t\t\t\t\t'name'     => 'SportsPress for Basketball',\n\t\t\t\t\t\t'slug'     => 'sportspress-for-basketball',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'version'  => '0.9.1',\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cricket':\n\t\t\t\t\t$plugins[] = array(\n\t\t\t\t\t\t'name'     => 'SportsPress for Cricket',\n\t\t\t\t\t\t'slug'     => 'sportspress-for-cricket',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'version'  => '1.1.1',\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'golf':\n\t\t\t\t\t$plugins[] = array(\n\t\t\t\t\t\t'name'     => 'SportsPress for Golf',\n\t\t\t\t\t\t'slug'     => 'sportspress-for-golf',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'version'  => '0.9.1',\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'soccer':\n\t\t\t\t\t$plugins[] = array(\n\t\t\t\t\t\t'name'     => 'SportsPress for Football (Soccer)',\n\t\t\t\t\t\t'slug'     => 'sportspress-for-soccer',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'version'  => '0.9.6',\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'volleyball':\n\t\t\t\t\t$plugins[] = array(\n\t\t\t\t\t\t'name'     => 'SportsPress for Volleyball',\n\t\t\t\t\t\t'slug'     => 'sportspress-for-volleyball',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'version'  => '0.9',\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\tendswitch;\n\n\t\t\t$config = array(\n\t\t\t\t'id'           => 'sportspress',\n\t\t\t\t'default_path' => '',\n\t\t\t\t'menu'         => 'tgmpa-install-plugins',\n\t\t\t\t'parent_slug'  => 'plugins.php',\n\t\t\t\t'capability'   => 'manage_options',\n\t\t\t\t'has_notices'  => true,\n\t\t\t\t'dismissable'  => true,\n\t\t\t\t'is_automatic' => true,\n\t\t\t\t'message'      => '',\n\t\t\t\t'strings'      => array(\n\t\t\t\t\t'nag_type' => 'updated',\n\t\t\t\t),\n\t\t\t);\n\n\t\t\ttgmpa( $plugins, $config );\n\t\t}\n\n\t\t/** Helper functions ******************************************************/\n\n\t\t/**\n\t\t * Get the plugin url.\n\t\t *\n\t\t * @return string\n\t\t */\n\t\tpublic function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}\n\n\t\t/**\n\t\t * Get the plugin path.\n\t\t *\n\t\t * @return string\n\t\t */\n\t\tpublic function plugin_path() {\n\t\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t\t}\n\n\t\t/**\n\t\t * Get the template path.\n\t\t *\n\t\t * @return string\n\t\t */\n\t\tpublic function template_path() {\n\t\t\treturn apply_filters( 'SP_TEMPLATE_PATH', 'sportspress/' );\n\t\t}\n\t}\n\nendif;\n\nif ( ! function_exists( 'SP' ) ) :\n\n\t/**\n\t * Returns the main instance of SP to prevent the need to use globals.\n\t *\n\t * @since  0.7\n\t * @return SportsPress\n\t */\n\tfunction SP() {\n\t\treturn SportsPress::instance();\n\t}\n\nendif;\n\nSP();\n\n/**\n * Want to work with us?\n *\n * @link https://www.themeboy.com/jobs/\n */\n"
  },
  {
    "path": "templates/birthdays.php",
    "content": "<?php\n/**\n * Birthdays\n *\n * @author      ThemeBoy\n * @package     SportsPress_Birthdays\n * @version   2.7.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$html5    = current_theme_supports( 'html5', 'gallery' );\n$defaults = array(\n\t'date'                 => 'day',\n\t'itemtag'              => 'dl',\n\t'icontag'              => 'dt',\n\t'captiontag'           => 'dd',\n\t'size'                 => 'sportspress-fit-medium',\n\t'birthday_format'      => 'birthday',\n\t'show_player_birthday' => get_option( 'sportspress_player_show_birthday', 'no' ) == 'yes' ? true : false,\n\t'show_staff_birthday'  => get_option( 'sportspress_staff_show_birthday', 'no' ) == 'yes' ? true : false,\n\t'link_players'         => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,\n\t'link_staff'           => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n$args = array(\n\t'post_type'      => array( 'sp_player', 'sp_staff' ),\n\t'numberposts'    => -1,\n\t'posts_per_page' => -1,\n\t'orderby'        => 'date',\n\t'order'          => 'ASC',\n\t'monthnum'       => date( 'n' ),\n);\n\nif ( $date == 'day' ) {\n\t$args['day'] = date( 'j' );\n}\n\nif ( $date == 'week' ) {\n\tunset( $args['monthnum'] );\n\t$args['date_query'] = array(\n\t\tarray(\n\t\t\t'month' => date( 'n' ),\n\t\t\t'day'   => date( 'j' ),\n\t\t),\n\t\tarray(\n\t\t\t'month' => date( 'n', strtotime( '+1 day' ) ),\n\t\t\t'day'   => date( 'j', strtotime( '+1 day' ) ),\n\t\t),\n\t\tarray(\n\t\t\t'month' => date( 'n', strtotime( '+2 days' ) ),\n\t\t\t'day'   => date( 'j', strtotime( '+2 days' ) ),\n\t\t),\n\t\tarray(\n\t\t\t'month' => date( 'n', strtotime( '+3 days' ) ),\n\t\t\t'day'   => date( 'j', strtotime( '+3 days' ) ),\n\t\t),\n\t\tarray(\n\t\t\t'month' => date( 'n', strtotime( '+4 days' ) ),\n\t\t\t'day'   => date( 'j', strtotime( '+4 days' ) ),\n\t\t),\n\t\tarray(\n\t\t\t'month' => date( 'n', strtotime( '+5 days' ) ),\n\t\t\t'day'   => date( 'j', strtotime( '+5 days' ) ),\n\t\t),\n\t\tarray(\n\t\t\t'month' => date( 'n', strtotime( '+6 days' ) ),\n\t\t\t'day'   => date( 'j', strtotime( '+6 days' ) ),\n\t\t),\n\t\tarray(\n\t\t\t'month' => date( 'n', strtotime( '+1 week' ) ),\n\t\t\t'day'   => date( 'j', strtotime( '+1 week' ) ),\n\t\t),\n\t\t'relation' => 'OR',\n\t);\n}\n\n$posts = get_posts( $args );\n\nforeach ( $posts as $post ) {\n\techo '<div class=\"sp-template sp-template-birthdays sp-template-birthday-gallery sp-template-gallery\">';\n\n\tif ( 'sp_staff' == $post->post_type ) {\n\t\t$link_posts    = $link_staff;\n\t\t$show_birthday = $show_staff_birthday;\n\t} else {\n\t\t$link_posts    = $link_players;\n\t\t$show_birthday = $show_player_birthday;\n\t}\n\n\t$birthday = get_the_date( get_option( 'date_format' ), $post->ID );\n\n\t$heading = null;\n\tif ( ( $show_birthday || 'birthday' == $birthday_format ) && $birthday && 'hide' != $birthday_format ) {\n\t\t$heading = '<h4 class=\"sp-table-caption\">' . $birthday . '</h4>';\n\t}\n\tif ( 'age' == $birthday_format && $birthday ) {\n\t\t$sp_birthdays = new SportsPress_Birthdays();\n\t\t$age          = $sp_birthdays->get_age( get_the_date( 'm-d-Y', $post->ID ) );\n\t\t$heading      = '<h4 class=\"sp-table-caption\">' . $age . '</h4>';\n\t}\n\tif ( 'birthdayage' == $birthday_format && $birthday ) {\n\t\t$sp_birthdays = new SportsPress_Birthdays();\n\t\t$age          = $sp_birthdays->get_age( get_the_date( 'm-d-Y', $post->ID ) );\n\t\t$heading      = '<h4 class=\"sp-table-caption\">' . $birthday . ' (' . $age . ')</h4>';\n\t}\n\techo wp_kses_post( $heading );\n\n\techo '<div class=\"gallery\">';\n\n\t$caption = $post->post_title;\n\t$caption = trim( $caption );\n\n\tsp_get_template(\n\t\t'player-gallery-thumbnail.php',\n\t\tarray(\n\t\t\t'id'         => $post->ID,\n\t\t\t'itemtag'    => $itemtag,\n\t\t\t'icontag'    => $icontag,\n\t\t\t'captiontag' => $captiontag,\n\t\t\t'caption'    => $caption,\n\t\t\t'size'       => $size,\n\t\t\t'link_posts' => $link_posts,\n\t\t)\n\t);\n\n\techo '<br style=\"clear: both;\" />';\n\techo \"</div></div>\\n\";\n}\n"
  },
  {
    "path": "templates/countdown.php",
    "content": "<?php\n/**\n * Countdown\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'team'           => null,\n\t'calendar'       => null,\n\t'order'          => null,\n\t'orderby'        => null,\n\t'league'         => null,\n\t'season'         => null,\n\t'id'             => null,\n\t'title'          => null,\n\t'live'           => get_option( 'sportspress_enable_live_countdowns', 'yes' ) == 'yes' ? true : false,\n\t'link_events'    => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false,\n\t'link_teams'     => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,\n\t'link_venues'    => get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false,\n\t'show_logos'     => get_option( 'sportspress_countdown_show_logos', 'no' ) == 'yes' ? true : false,\n\t'show_thumbnail' => get_option( 'sportspress_countdown_show_thumbnail', 'no' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\nif ( isset( $show_excluded ) && $show_excluded ) {\n\t$excluded_statuses = array();\n} else {\n\t$excluded_statuses = apply_filters(\n\t\t'sp_countdown_excluded_statuses',\n\t\tarray(\n\t\t\t'postponed',\n\t\t\t'cancelled',\n\t\t)\n\t);\n}\n\nif ( isset( $id ) ) :\n\t$post = get_post( $id );\nelseif ( $calendar ) :\n\t$calendar = new SP_Calendar( $calendar );\n\tif ( $team ) {\n\t\t$calendar->team = $team;\n\t}\n\t$calendar->status = 'future';\n\tif ( $order ) {\n\t\t$calendar->order = $order;\n\t} else {\n\t\t$calendar->order = 'ASC';\n\t}\n\tif ( $orderby ) {\n\t\t$calendar->orderby = $orderby;\n\t}\n\t$data = $calendar->data();\n\n\t/**\n\t * Exclude postponed or cancelled events.\n\t */\n\twhile ( $post = array_shift( $data ) ) {\n\t\t$sp_status = get_post_meta( $post->ID, 'sp_status', true );\n\t\tif ( ! in_array( $sp_status, $excluded_statuses ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\nelse :\n\t$args = array();\n\tif ( isset( $team ) ) {\n\t\t$args['meta_query'] = array(\n\t\t\tarray(\n\t\t\t\t'key'   => 'sp_team',\n\t\t\t\t'value' => $team,\n\t\t\t),\n\t\t);\n\t}\n\tif ( isset( $league ) || isset( $season ) ) {\n\t\t$args['tax_query'] = array( 'relation' => 'AND' );\n\n\t\tif ( isset( $league ) ) {\n\t\t\t$args['tax_query'][] = array(\n\t\t\t\t'taxonomy' => 'sp_league',\n\t\t\t\t'terms'    => $league,\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $season ) ) {\n\t\t\t$args['tax_query'][] = array(\n\t\t\t\t'taxonomy' => 'sp_season',\n\t\t\t\t'terms'    => $season,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Exclude postponed or cancelled events.\n\t */\n\t$args['meta_query'][] = array(\n\t\t'relation' => 'OR',\n\t\tarray(\n\t\t\t'key'     => 'sp_status',\n\t\t\t'compare' => 'NOT IN',\n\t\t\t'value'   => $excluded_statuses,\n\t\t),\n\t\tarray(\n\t\t\t'key'     => 'sp_status',\n\t\t\t'compare' => 'NOT EXISTS',\n\t\t),\n\t);\n\n\t$post = sp_get_next_event( $args );\nendif;\n\nif ( ! isset( $post ) || ! $post ) {\n\treturn;\n}\n\nif ( $title ) {\n\techo '<h4 class=\"sp-table-caption\">' . wp_kses_post( $title ) . '</h4>';\n}\n\n$title = $post->post_title;\nif ( $link_events ) {\n\t$title = '<a href=\"' . get_post_permalink( $post->ID, false, true ) . '\">' . $title . '</a>';\n}\nif ( isset( $show_status ) && $show_status ) {\n\t$sp_status = get_post_meta( $post->ID, 'sp_status', true );\n\t// Avoid Undefined index warnings if no status is set (i.e. during import)\n\tif ( $sp_status == '' ) {\n\t\t$sp_status = 'ok';\n\t}\n\t$statuses = apply_filters(\n\t\t'sportspress_event_statuses',\n\t\tarray(\n\t\t\t'ok'        => esc_attr__( 'On time', 'sportspress' ),\n\t\t\t'tbd'       => esc_attr__( 'TBD', 'sportspress' ),\n\t\t\t'postponed' => esc_attr__( 'Postponed', 'sportspress' ),\n\t\t\t'cancelled' => esc_attr__( 'Canceled', 'sportspress' ),\n\t\t)\n\t);\n\t$title    = $title . ' (' . $statuses[ $sp_status ] . ')';\n}\n\n?>\n<div class=\"sp-template sp-template-countdown\">\n\t<div class=\"sp-countdown-wrapper\">\n\t<?php\n\tif ( $show_thumbnail && has_post_thumbnail( $post ) ) {\n\t\t?>\n\t<div class=\"event-image sp-event-image\">\n\t\t<?php echo get_the_post_thumbnail( $post ); ?>\n\t</div>\n\t<?php } ?>\n\t\t<h3 class=\"event-name sp-event-name\">\n\t\t\t<?php\n\t\t\tif ( $show_logos ) {\n\t\t\t\t$teams = array_unique( (array) get_post_meta( $post->ID, 'sp_team' ) );\n\t\t\t\t$i     = 0;\n\n\t\t\t\tif ( is_array( $teams ) ) {\n\t\t\t\t\tforeach ( $teams as $team ) {\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tif ( has_post_thumbnail( $team ) ) {\n\t\t\t\t\t\t\tif ( $link_teams ) {\n\t\t\t\t\t\t\t\techo '<a class=\"team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) . '\" href=\"' . esc_url( get_post_permalink( $team ) ) . '\" title=\"' . esc_attr( get_the_title( $team ) ) . '\">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon' ) . '</a>';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t\t<?php echo wp_kses_post( $title ); ?>\n\t\t</h3>\n\t\t<?php\n\t\tif ( isset( $show_date ) && $show_date ) :\n\t\t\t?>\n\t\t\t<h5 class=\"event-venue sp-event-venue event-date sp-event-date\">\n\t\t\t\t<?php\n\t\t\t\techo wp_kses_post( get_the_time( get_option( 'date_format' ), $post ) );\n\t\t\t\t?>\n\t\t\t</h5>\n\t\t\t<?php\n\t\tendif;\n\n\t\tif ( isset( $show_venue ) && $show_venue ) :\n\t\t\t$venues = get_the_terms( $post->ID, 'sp_venue' );\n\t\t\tif ( $venues ) :\n\t\t\t\t?>\n\t\t\t\t<h5 class=\"event-venue sp-event-venue\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( $link_venues ) {\n\t\t\t\t\t\tthe_terms( $post->ID, 'sp_venue' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$venue_names = array();\n\t\t\t\t\t\tforeach ( $venues as $venue ) {\n\t\t\t\t\t\t\t$venue_names[] = $venue->name;\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo wp_kses_post( implode( '/', $venue_names ) );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</h5>\n\t\t\t\t<?php\n\t\t\tendif;\n\t\tendif;\n\n\t\tif ( isset( $show_league ) && $show_league ) :\n\t\t\t$leagues = get_the_terms( $post->ID, 'sp_league' );\n\t\t\tif ( $leagues ) :\n\t\t\t\tforeach ( $leagues as $league ) :\n\t\t\t\t\t$term = get_term( $league->term_id, 'sp_league' );\n\t\t\t\t\t?>\n\t\t\t\t\t<h5 class=\"event-league sp-event-league\"><?php echo wp_kses_post( $term->name ); ?></h5>\n\t\t\t\t\t<?php\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\tendif;\n\n\t\t$now      = new DateTime( current_time( 'mysql', 0 ) );\n\t\t$date     = new DateTime( $post->post_date );\n\t\t$interval = date_diff( $now, $date );\n\n\t\t$days = $interval->invert ? 0 : $interval->days;\n\t\t$h    = $interval->invert ? 0 : $interval->h;\n\t\t$i    = $interval->invert ? 0 : $interval->i;\n\t\t$s    = $interval->invert ? 0 : $interval->s;\n\t\t?>\n\t\t<p class=\"countdown sp-countdown\n\t\t<?php\n\t\tif ( $days >= 10 ) :\n\t\t\t?>\n\t\t\t long-countdown<?php endif; ?>\">\n\t\t\t<time datetime=\"<?php echo esc_attr( $post->post_date ); ?>\"\n\t\t\t\t\t\t\t\t\t   <?php\n\t\t\t\t\t\t\t\t\t\tif ( $live ) :\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t data-countdown=\"<?php echo esc_attr( str_replace( '-', '/', get_gmt_from_date( $post->post_date ) ) ); ?>\"<?php endif; ?>>\n\t\t\t\t<span><?php echo wp_kses_post( sprintf( '%02s', $days ) ); ?> <small><?php esc_attr_e( 'days', 'sportspress' ); ?></small></span>\n\t\t\t\t<span><?php echo wp_kses_post( sprintf( '%02s', $h ) ); ?> <small><?php esc_attr_e( 'hrs', 'sportspress' ); ?></small></span>\n\t\t\t\t<span><?php echo wp_kses_post( sprintf( '%02s', $i ) ); ?> <small><?php esc_attr_e( 'mins', 'sportspress' ); ?></small></span>\n\t\t\t\t<span><?php echo wp_kses_post( sprintf( '%02s', $s ) ); ?> <small><?php esc_attr_e( 'secs', 'sportspress' ); ?></small></span>\n\t\t\t</time>\n\t\t</p>\n\t</div>\n</div>\n"
  },
  {
    "path": "templates/event-blocks.php",
    "content": "<?php\n/**\n * Event Blocks\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'id'                   => null,\n\t'event'                => null,\n\t'title'                => false,\n\t'status'               => 'default',\n\t'format'               => 'default',\n\t'date'                 => 'default',\n\t'date_from'            => 'default',\n\t'date_to'              => 'default',\n\t'date_past'            => 'default',\n\t'date_future'          => 'default',\n\t'date_relative'        => 'default',\n\t'day'                  => 'default',\n\t'league'               => null,\n\t'season'               => null,\n\t'venue'                => null,\n\t'team'                 => null,\n\t'teams_past'           => null,\n\t'date_before'          => null,\n\t'player'               => null,\n\t'number'               => -1,\n\t'show_team_logo'       => get_option( 'sportspress_event_blocks_show_logos', 'yes' ) == 'yes' ? true : false,\n\t'link_teams'           => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,\n\t'link_events'          => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false,\n\t'paginated'            => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false,\n\t'rows'                 => get_option( 'sportspress_event_blocks_rows', 5 ),\n\t'orderby'              => 'default',\n\t'order'                => 'default',\n\t'columns'              => null,\n\t'show_all_events_link' => false,\n\t'show_title'           => get_option( 'sportspress_event_blocks_show_title', 'no' ) == 'yes' ? true : false,\n\t'show_league'          => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false,\n\t'show_season'          => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false,\n\t'show_matchday'        => get_option( 'sportspress_event_blocks_show_matchday', 'no' ) == 'yes' ? true : false,\n\t'show_venue'           => get_option( 'sportspress_event_blocks_show_venue', 'no' ) == 'yes' ? true : false,\n\t'hide_if_empty'        => false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n$calendar = new SP_Calendar( $id );\n\nif ( $status != 'default' ) {\n\t$calendar->status = $status;\n}\nif ( $format != 'default' ) {\n\t$calendar->event_format = $format;\n}\nif ( $date != 'default' ) {\n\t$calendar->date = $date;\n}\nif ( $date_from != 'default' ) {\n\t$calendar->from = $date_from;\n}\nif ( $date_to != 'default' ) {\n\t$calendar->to = $date_to;\n}\nif ( $date_past != 'default' ) {\n\t$calendar->past = $date_past;\n}\nif ( $date_future != 'default' ) {\n\t$calendar->future = $date_future;\n}\nif ( $date_relative != 'default' ) {\n\t$calendar->relative = $date_relative;\n}\nif ( $event ) {\n\t$calendar->event = $event;\n}\nif ( $league ) {\n\t$calendar->league = $league;\n}\nif ( $season ) {\n\t$calendar->season = $season;\n}\nif ( $venue ) {\n\t$calendar->venue = $venue;\n}\nif ( $team ) {\n\t$calendar->team = $team;\n}\nif ( $teams_past ) {\n\t$calendar->teams_past = $teams_past;\n}\nif ( $date_before ) {\n\t$calendar->date_before = $date_before;\n}\nif ( $player ) {\n\t$calendar->player = $player;\n}\nif ( $order != 'default' ) {\n\t$calendar->order = $order;\n}\nif ( $orderby != 'default' ) {\n\t$calendar->orderby = $orderby;\n}\nif ( $day != 'default' ) {\n\t$calendar->day = $day;\n}\n$data       = $calendar->data();\n$usecolumns = $calendar->columns;\n\nif ( isset( $columns ) ) :\n\tif ( is_array( $columns ) ) {\n\t\t$usecolumns = $columns;\n\t} else {\n\t\t$usecolumns = explode( ',', $columns );\n\t}\nendif;\n\nif ( $hide_if_empty && empty( $data ) ) {\n\treturn false;\n}\n\nif ( $show_title && false === $title && $id ) :\n\t$caption = $calendar->caption;\n\tif ( $caption ) {\n\t\t$title = $caption;\n\t} else {\n\t\t$title = get_the_title( $id );\n\t}\nendif;\n\nif ( $title ) {\n\techo '<h4 class=\"sp-table-caption\">' . wp_kses_post( $title ) . '</h4>';\n}\n?>\n<div class=\"sp-template sp-template-event-blocks\">\n\t<div class=\"sp-table-wrapper\">\n\t\t<table class=\"sp-event-blocks sp-data-table\n\t\t<?php\n\t\tif ( $paginated ) {\n\t\t\t?>\n\t\t\t sp-paginated-table<?php } ?>\" data-sp-rows=\"<?php echo esc_attr( $rows ); ?>\">\n\t\t\t<thead><tr><th></th></tr></thead> <?php // Required for DataTables ?>\n\t\t\t<tbody>\n\t\t\t\t<?php\n\t\t\t\t$i = 0;\n\n\t\t\t\tif ( intval( $number ) > 0 ) {\n\t\t\t\t\t$limit = $number;\n\t\t\t\t}\n\n\t\t\t\tforeach ( $data as $event ) :\n\t\t\t\t\tif ( isset( $limit ) && $i >= $limit ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$permalink = get_post_permalink( $event, false, true );\n\t\t\t\t\t$results   = sp_get_main_results_or_time( $event );\n\n\t\t\t\t\t$teams        = array_unique( get_post_meta( $event->ID, 'sp_team' ) );\n\t\t\t\t\t$teams        = array_filter( $teams, 'sp_filter_positive' );\n\t\t\t\t\t$logos        = array();\n\t\t\t\t\t$event_status = get_post_meta( $event->ID, 'sp_status', true );\n\n\t\t\t\t\tif ( get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ) {\n\t\t\t\t\t\t$teams   = array_reverse( $teams, true );\n\t\t\t\t\t\t$results = array_reverse( $results, true );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $show_team_logo ) :\n\t\t\t\t\t\t$j = 0;\n\t\t\t\t\t\tforeach ( $teams as $team ) :\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t\t$team_name = get_the_title( $team );\n\t\t\t\t\t\t\tif ( has_post_thumbnail( $team ) ) :\n\t\t\t\t\t\t\t\t$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'itemprop' => 'logo' ) );\n\n\t\t\t\t\t\t\t\tif ( $link_teams ) :\n\t\t\t\t\t\t\t\t\t$team_permalink = get_permalink( $team, false, true );\n\t\t\t\t\t\t\t\t\t$logo           = '<a href=\"' . $team_permalink . '\" itemprop=\"url\" content=\"' . $team_permalink . '\">' . $logo . '</a>';\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t$logo = '<span class=\"team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) . '\" title=\"' . $team_name . '\" itemprop=\"competitor\" itemscope itemtype=\"http://schema.org/SportsTeam\"><meta itemprop=\"name\" content=\"' . $team_name . '\">' . $logo . '</span>';\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$logo = '<span itemprop=\"competitor\" itemscope itemtype=\"http://schema.org/SportsTeam\"><meta itemprop=\"name\" content=\"' . $team_name . '\"></span>';\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t$logos[] = $logo;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendif;\n\n\t\t\t\t\tif ( 'day' === $calendar->orderby ) :\n\t\t\t\t\t\t$event_group = get_post_meta( $event->ID, 'sp_day', true );\n\t\t\t\t\t\tif ( ! isset( $group ) || $event_group !== $group ) :\n\t\t\t\t\t\t\t$group = $event_group;\n\t\t\t\t\t\t\techo '<tr><th><strong class=\"sp-event-group-name\">', esc_attr__( 'Match Day', 'sportspress' ), ' ', wp_kses_post( $group ), '</strong></th></tr>';\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n\t\t\t\t\t<tr class=\"sp-row sp-post<?php echo ( $i % 2 == 0 ? ' alternate' : '' ); ?>\" itemscope itemtype=\"http://schema.org/SportsEvent\">\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php do_action( 'sportspress_event_blocks_before', $event, $usecolumns ); ?>\n\t\t\t\t\t\t\t<?php echo wp_kses_post( implode( ' ', $logos ) ); ?>\n\t\t\t\t\t\t\t<time class=\"sp-event-date\" datetime=\"<?php echo esc_attr( $event->post_date ); ?>\" itemprop=\"startDate\" content=\"<?php echo esc_attr( mysql2date( 'Y-m-d\\TH:i:sP', $event->post_date ) ); ?>\">\n\t\t\t\t\t\t\t\t<?php echo wp_kses_post( sp_add_link( get_the_time( get_option( 'date_format' ), $event ), $permalink, $link_events ) ); ?>\n\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $show_matchday ) :\n\t\t\t\t\t\t\t\t$matchday = get_post_meta( $event->ID, 'sp_day', true ); if ( $matchday != '' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"sp-event-matchday\">(<?php echo wp_kses_post( $matchday ); ?>)</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tendif;\nendif;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<h5 class=\"sp-event-results\">\n\t\t\t\t\t\t\t\t<?php echo wp_kses_post( sp_add_link( '<span class=\"sp-result ' . $event_status . '\">' . implode( '</span> - <span class=\"sp-result\">', apply_filters( 'sportspress_event_blocks_team_result_or_time', $results, $event->ID ) ) . '</span>', $permalink, $link_events ) ); ?>\n\t\t\t\t\t\t\t</h5>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $show_league ) :\n\t\t\t\t\t\t\t\t$leagues = get_the_terms( $event, 'sp_league' );\n\t\t\t\t\t\t\t\tif ( $leagues ) :\n\t\t\t\t\t\t\t\t\t$league = array_shift( $leagues );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"sp-event-league\"><?php echo wp_kses_post( $league->name ); ?></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendif;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $show_season ) :\n\t\t\t\t\t\t\t\t$seasons = get_the_terms( $event, 'sp_season' );\n\t\t\t\t\t\t\t\tif ( $seasons ) :\n\t\t\t\t\t\t\t\t\t$season = array_shift( $seasons );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"sp-event-season\"><?php echo wp_kses_post( $season->name ); ?></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendif;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $show_venue ) :\n\t\t\t\t\t\t\t\t$venues = get_the_terms( $event, 'sp_venue' );\n\t\t\t\t\t\t\t\tif ( $venues ) :\n\t\t\t\t\t\t\t\t\t$venue = array_shift( $venues );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"sp-event-venue\" itemprop=\"location\" itemscope itemtype=\"http://schema.org/Place\"><div itemprop=\"address\" itemscope itemtype=\"http://schema.org/PostalAddress\"><?php echo wp_kses_post( $venue->name ); ?></div></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendif;\nendif;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php if ( ! $show_venue || ! $venues ) : ?>\n\t\t\t\t\t\t\t\t<div style=\"display:none;\" class=\"sp-event-venue\" itemprop=\"location\" itemscope itemtype=\"http://schema.org/Place\"><div itemprop=\"address\" itemscope itemtype=\"http://schema.org/PostalAddress\"><?php esc_attr_e( 'N/A', 'sportspress' ); ?></div></div>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<h4 class=\"sp-event-title\" itemprop=\"name\">\n\t\t\t\t\t\t\t\t<?php echo wp_kses_post( sp_add_link( $event->post_title, $permalink, $link_events ) ); ?>\n\t\t\t\t\t\t\t</h4>\n\t\t\t\t\t\t\t<?php do_action( 'sportspress_event_blocks_after', $event, $usecolumns ); ?>\n\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<?php\n\t\t\t\t\t$i++;\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\t<?php\n\tif ( $id && $show_all_events_link ) {\n\t\techo '<div class=\"sp-calendar-link sp-view-all-link\"><a href=\"' . esc_url( get_permalink( $id ) ) . '\">' . esc_attr__( 'View all events', 'sportspress' ) . '</a></div>';\n\t}\n\t?>\n</div>\n"
  },
  {
    "path": "templates/event-calendar.php",
    "content": "<?php\n/**\n * Event Calendar\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nglobal $wpdb, $m, $monthnum, $year, $wp_locale;\n\n$defaults = array(\n\t'id'                   => null,\n\t'status'               => 'default',\n\t'format'               => 'default',\n\t'date'                 => 'default',\n\t'date_from'            => 'default',\n\t'date_to'              => 'default',\n\t'date_past'            => 'default',\n\t'date_future'          => 'default',\n\t'date_relative'        => 'default',\n\t'day'                  => 'default',\n\t'league'               => null,\n\t'season'               => null,\n\t'venue'                => null,\n\t'team'                 => null,\n\t'player'               => null,\n\t'initial'              => true,\n\t'caption_tag'          => 'caption',\n\t'show_all_events_link' => false,\n\t'override_global_date' => false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n$calendar = new SP_Calendar( $id );\nif ( $status != 'default' ) {\n\t$calendar->status = $status;\n}\nif ( $format != 'default' ) {\n\t$calendar->event_format = $format;\n}\nif ( $date != 'default' ) {\n\t$calendar->date = $date;\n}\nif ( $date_from != 'default' ) {\n\t$calendar->from = $date_from;\n}\nif ( $date_to != 'default' ) {\n\t$calendar->to = $date_to;\n}\nif ( $date_past != 'default' ) {\n\t$calendar->past = $date_past;\n}\nif ( $date_future != 'default' ) {\n\t$calendar->future = $date_future;\n}\nif ( $date_relative != 'default' ) {\n\t$calendar->relative = $date_relative;\n}\nif ( $day != 'default' ) {\n\t$calendar->day = $day;\n}\nif ( $league ) {\n\t$calendar->league = $league;\n}\nif ( $season ) {\n\t$calendar->season = $season;\n}\nif ( $venue ) {\n\t$calendar->venue = $venue;\n}\nif ( $team ) {\n\t$calendar->team = $team;\n}\nif ( $player ) {\n\t$calendar->player = $player;\n}\nif ( $override_global_date ) {\n\t$year     = gmdate( 'Y', current_time( 'timestamp' ) );\n\t$monthnum = gmdate( 'm', current_time( 'timestamp' ) );\n}\n$events = $calendar->data();\n\nif ( empty( $events ) ) {\n\t$in = 'AND 1 = 0'; // False logic to prevent SQL error\n} else {\n\t$event_ids = wp_list_pluck( $events, 'ID' );\n\t$in        = 'AND ID IN (' . implode( ', ', $event_ids ) . ')';\n}\n\n// week_begins = 0 stands for Sunday\n$week_begins = intval( get_option( 'start_of_week' ) );\n\n// Get year and month from query vars\n$year     = isset( $_GET['sp_year'] ) ? sanitize_text_field( wp_unslash( $_GET['sp_year'] ) ) : $year;\n$monthnum = isset( $_GET['sp_month'] ) ? sanitize_text_field( wp_unslash( $_GET['sp_month'] ) ) : $monthnum;\n\n// Let's figure out when we are\nif ( ! empty( $monthnum ) && ! empty( $year ) ) {\n\t$thismonth = '' . zeroise( intval( $monthnum ), 2 );\n\t$thisyear  = '' . intval( $year );\n} elseif ( ! empty( $w ) ) {\n\t// We need to get the month from MySQL\n\t$thisyear  = '' . intval( substr( $m, 0, 4 ) );\n\t$d         = ( ( $w - 1 ) * 7 ) + 6; // it seems MySQL's weeks disagree with PHP's\n\t$thismonth = $wpdb->get_var( \"SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')\" );\n} elseif ( ! empty( $m ) ) {\n\t$thisyear = '' . intval( substr( $m, 0, 4 ) );\n\tif ( strlen( $m ) < 6 ) {\n\t\t\t$thismonth = '01';\n\t} else {\n\t\t$thismonth = '' . zeroise( intval( substr( $m, 4, 2 ) ), 2 );\n\t}\n} else {\n\t$thisyear  = gmdate( 'Y', current_time( 'timestamp' ) );\n\t$thismonth = gmdate( 'm', current_time( 'timestamp' ) );\n}\n\n$unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear );\n$last_day  = date( 't', $unixmonth );\n\n// Get the next and previous month and year with at least one post\n$previous = $wpdb->get_row(\n\t\"SELECT MONTH(post_date) AS month, YEAR(post_date) AS year\n\tFROM $wpdb->posts\n\tWHERE post_date < '$thisyear-$thismonth-01'\n\tAND post_type = 'sp_event' AND ( post_status = 'publish' OR post_status = 'future' )\n\t$in\n\t\tORDER BY post_date DESC\n\t\tLIMIT 1\"\n);\n$next     = $wpdb->get_row(\n\t\"SELECT MONTH(post_date) AS month, YEAR(post_date) AS year\n\tFROM $wpdb->posts\n\tWHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59'\n\tAND post_type = 'sp_event' AND ( post_status = 'publish' OR post_status = 'future' )\n\t$in\n\t\tORDER BY post_date ASC\n\t\tLIMIT 1\"\n);\n\n/* translators: Calendar caption: 1: month name, 2: 4-digit year */\n$calendar_caption = _x( '%1$s %2$s', 'calendar caption', 'sportspress' );\n$calendar_output  = '\n<div class=\"sp-calendar-wrapper\">\n<table id=\"wp-calendar\" class=\"sp-calendar sp-event-calendar sp-data-table\">\n<caption class=\"sp-table-caption\">' . ( $caption_tag == 'caption' ? '' : '<' . $caption_tag . '>' ) . sprintf( $calendar_caption, $wp_locale->get_month( $thismonth ), date( 'Y', $unixmonth ) ) . ( $caption_tag == 'caption' ? '' : '</' . $caption_tag . '>' ) . '</caption>\n<thead>\n<tr>';\n\n$myweek = array();\n\nfor ( $wdcount = 0; $wdcount <= 6; $wdcount++ ) {\n\t$myweek[] = $wp_locale->get_weekday( ( $wdcount + $week_begins ) % 7 );\n}\n\nforeach ( $myweek as $wd ) {\n\t$day_name         = ( true == $initial ) ? $wp_locale->get_weekday_initial( $wd ) : $wp_locale->get_weekday_abbrev( $wd );\n\t$wd               = esc_attr( $wd );\n\t$calendar_output .= \"\\n\\t\\t<th scope=\\\"col\\\" title=\\\"$wd\\\">$day_name</th>\";\n}\n\n$calendar_output .= '\n</tr>\n</thead>\n\n<tfoot>\n<tr>';\n\nif ( $previous ) {\n\t$calendar_output .= \"\\n\\t\\t\" . '<td colspan=\"3\" id=\"prev\" class=\"sp-previous-month\"><a data-tooltip data-options=\"disable_for_touch:true\" class=\"has-tooltip tip-right\" href=\"' . add_query_arg(\n\t\tarray(\n\t\t\t'sp_year'  => $previous->year,\n\t\t\t'sp_month' => $previous->month,\n\t\t)\n\t) . '\" title=\"' . esc_attr( sprintf( _x( '%1$s %2$s', 'calendar caption', 'sportspress' ), $wp_locale->get_month( $previous->month ), date( 'Y', mktime( 0, 0, 0, $previous->month, 1, $previous->year ) ) ) ) . '\">&laquo; ' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $previous->month ) ) . '</a></td>';\n} else {\n\t$calendar_output .= \"\\n\\t\\t\" . '<td colspan=\"3\" id=\"prev\" class=\"pad\">&nbsp;</td>';\n}\n\n$calendar_output .= \"\\n\\t\\t\" . '<td class=\"pad\">&nbsp;</td>';\n\nif ( $next ) {\n\t$calendar_output .= \"\\n\\t\\t\" . '<td colspan=\"3\" id=\"next\" class=\"sp-next-month\"><a data-tooltip data-options=\"disable_for_touch:true\" class=\"has-tooltip tip-left\" href=\"' . add_query_arg(\n\t\tarray(\n\t\t\t'sp_year'  => $next->year,\n\t\t\t'sp_month' => $next->month,\n\t\t)\n\t) . '\" title=\"' . esc_attr( sprintf( _x( '%1$s %2$s', 'calendar caption', 'sportspress' ), $wp_locale->get_month( $next->month ), date( 'Y', mktime( 0, 0, 0, $next->month, 1, $next->year ) ) ) ) . '\">' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $next->month ) ) . ' &raquo;</a></td>';\n} else {\n\t$calendar_output .= \"\\n\\t\\t\" . '<td colspan=\"3\" id=\"next\" class=\"pad\">&nbsp;</td>';\n}\n\n$calendar_output .= '\n</tr>\n</tfoot>\n\n<tbody>\n<tr>';\n\n// Get days with posts\n$dayswithposts = $wpdb->get_results(\n\t\"SELECT DAYOFMONTH(post_date), ID\n\tFROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'\n\tAND post_type = 'sp_event' AND ( post_status = 'publish' OR post_status = 'future' )\n\t$in\n\tAND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'\",\n\tARRAY_N\n);\nif ( $dayswithposts ) {\n\tforeach ( (array) $dayswithposts as $daywith ) {\n\t\t$daywithpost[ $daywith[0] ][] = $daywith[1];\n\t}\n} else {\n\t$daywithpost = array();\n}\n\nif ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) && preg_match( '/(MSIE|camino|safari)/', wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized\n\t$ak_title_separator = \"\\n\";\n} else {\n\t$ak_title_separator = ', ';\n}\n\n$ak_titles_for_day = array();\n$ak_post_titles    = $wpdb->get_results(\n\t'SELECT ID, post_title, post_date, DAYOFMONTH(post_date) as dom '\n\t. \"FROM $wpdb->posts \"\n\t. \"WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' \"\n\t. \"AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' \"\n\t. \"AND post_type = 'sp_event' AND ( post_status = 'publish' OR post_status = 'future' ) \"\n\t. \"$in\"\n);\nif ( $ak_post_titles ) {\n\tforeach ( (array) $ak_post_titles as $ak_post_title ) {\n\n\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t$post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title, $ak_post_title->ID ) . ' @ ' . apply_filters( 'sportspress_event_time', date_i18n( get_option( 'time_format' ), strtotime( $ak_post_title->post_date ) ), $ak_post_title->ID ) );\n\n\t\tif ( empty( $ak_titles_for_day[ 'day_' . $ak_post_title->dom ] ) ) {\n\t\t\t$ak_titles_for_day[ 'day_' . $ak_post_title->dom ] = '';\n\t\t}\n\t\tif ( empty( $ak_titles_for_day[ \"$ak_post_title->dom\" ] ) ) { // first one\n\t\t\t$ak_titles_for_day[ \"$ak_post_title->dom\" ] = $post_title;\n\t\t} else {\n\t\t\t$ak_titles_for_day[ \"$ak_post_title->dom\" ] .= $ak_title_separator . $post_title;\n\t\t}\n\t}\n}\n\n// See how much we should pad in the beginning\n$pad = calendar_week_mod( date( 'w', $unixmonth ) - $week_begins );\nif ( 0 != $pad ) {\n\t$calendar_output .= \"\\n\\t\\t\" . '<td colspan=\"' . esc_attr( $pad ) . '\" class=\"pad\">&nbsp;</td>';\n}\n\n$daysinmonth = intval( date( 't', $unixmonth ) );\nfor ( $day = 1; $day <= $daysinmonth; ++$day ) {\n\tif ( isset( $newrow ) && $newrow ) {\n\t\t$calendar_output .= \"\\n\\t</tr>\\n\\t<tr>\\n\\t\\t\";\n\t}\n\t$newrow = false;\n\n\t$day_has_posts = array_key_exists( $day, $daywithpost );\n\t$td_properties = '';\n\n\tif ( $day == gmdate( 'j', current_time( 'timestamp' ) ) && $thismonth == gmdate( 'm', current_time( 'timestamp' ) ) && $thisyear == gmdate( 'Y', current_time( 'timestamp' ) ) ) {\n\t\t$td_properties .= ' id=\"today\" class=\"sp-highlight\"';\n\t}\n\n\tif ( $day_has_posts ) {\n\t\t$td_properties .= ' itemscope itemtype=\"http://schema.org/SportsEvent\"';\n\t}\n\n\t$calendar_output .= '<td' . $td_properties . '>';\n\n\tif ( $day_has_posts ) { // any posts today?\n\t\t$calendar_output .= '<a data-tooltip data-options=\"disable_for_touch:true\" class=\"has-tip\" href=\"' . ( sizeof( $daywithpost[ $day ] ) > 1 ? add_query_arg( array( 'post_type' => 'sp_event' ), get_day_link( $thisyear, $thismonth, $day ) ) . '\" title=\"' . sprintf( esc_attr__( '%s events', 'sportspress' ), ( sizeof( $daywithpost[ $day ] ) ) ) : get_post_permalink( $daywithpost[ $day ][0], false, true ) . '\" title=\"' . esc_attr( $ak_titles_for_day[ $day ] ) ) . \"\\\" itemprop=\\\"url\\\">$day</a>\";\n\t} else {\n\t\t$calendar_output .= $day;\n\t}\n\t$calendar_output .= '</td>';\n\n\tif ( 6 == calendar_week_mod( date( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {\n\t\t$newrow = true;\n\t}\n}\n\n$pad = 7 - calendar_week_mod( date( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins );\nif ( $pad != 0 && $pad != 7 ) {\n\t$calendar_output .= \"\\n\\t\\t\" . '<td class=\"pad\" colspan=\"' . esc_attr( $pad ) . '\">&nbsp;</td>';\n}\n\n$calendar_output .= \"\\n\\t</tr>\\n\\t</tbody>\\n\\t</table>\\n\\t</div>\";\n\nif ( $id && $show_all_events_link ) {\n\t$calendar_output .= '<div class=\"sp-calendar-link sp-view-all-link\"><a href=\"' . get_permalink( $id ) . '\">' . esc_attr__( 'View all events', 'sportspress' ) . '</a></div>';\n}\n?>\n<div class=\"sp-template sp-template-event-calendar\">\n\t<?php echo wp_kses_post( $calendar_output ); ?>\n</div>\n"
  },
  {
    "path": "templates/event-details.php",
    "content": "<?php\n/**\n * Event Details\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_event_show_details', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;\n\n$data = array();\n\nif ( 'yes' === get_option( 'sportspress_event_show_date', 'yes' ) ) {\n\t$date                                = get_the_time( get_option( 'date_format' ), $id );\n\t$data[ esc_attr__( 'Date', 'sportspress' ) ] = $date;\n}\n\nif ( 'yes' === get_option( 'sportspress_event_show_time', 'yes' ) ) {\n\t$time                                = get_the_time( get_option( 'time_format' ), $id );\n\t$data[ esc_attr__( 'Time', 'sportspress' ) ] = apply_filters( 'sportspress_event_time', $time, $id );\n}\n\n$taxonomies = apply_filters(\n\t'sportspress_event_taxonomies',\n\tarray(\n\t\t'sp_league' => null,\n\t\t'sp_season' => null,\n\t)\n);\n\nforeach ( $taxonomies as $taxonomy => $post_type ) :\n\t$terms = get_the_terms( $id, $taxonomy );\n\tif ( $terms ) :\n\t\t$obj                                 = get_taxonomy( $taxonomy );\n\t\t$term                                = array_shift( $terms );\n\t\t$data[ $obj->labels->singular_name ] = $term->name;\n\tendif;\nendforeach;\n\nif ( 'yes' === get_option( 'sportspress_event_show_day', 'yes' ) ) {\n\t$day = get_post_meta( $id, 'sp_day', true );\n\tif ( '' !== $day ) {\n\t\t$data[ esc_attr__( 'Match Day', 'sportspress' ) ] = $day;\n\t}\n}\n\nif ( 'yes' === get_option( 'sportspress_event_show_full_time', 'yes' ) ) {\n\t$full_time = get_post_meta( $id, 'sp_minutes', true );\n\tif ( '' === $full_time ) {\n\t\t$full_time = get_option( 'sportspress_event_minutes', 90 );\n\t}\n\t$data[ esc_attr__( 'Full Time', 'sportspress' ) ] = $full_time . '\\'';\n}\n\n$data = apply_filters( 'sportspress_event_details', $data, $id );\n\nif ( ! sizeof( $data ) ) {\n\treturn;\n}\n?>\n<div class=\"sp-template sp-template-event-details\">\n\t<h4 class=\"sp-table-caption\"><?php esc_attr_e( 'Details', 'sportspress' ); ?></h4>\n\t<div class=\"sp-table-wrapper\">\n\t\t<table class=\"sp-event-details sp-data-table\n\t\t<?php\n\t\tif ( $scrollable ) {\n\t\t\t?>\n\t\t\t sp-scrollable-table<?php } ?>\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<?php $i = 0; foreach ( $data as $label => $value ) : ?>\n\t\t\t\t\t\t<th><?php echo wp_kses_post( $label ); ?></th>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$i++;\nendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr class=\"odd\">\n\t\t\t\t\t<?php $i = 0; foreach ( $data as $value ) : ?>\n\t\t\t\t\t\t<td><?php echo wp_kses_post( $value ); ?></td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$i++;\nendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n"
  },
  {
    "path": "templates/event-fixtures-results.php",
    "content": "<?php\n/**\n * Event Blocks\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.14\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'id'          => null,\n\t'date'        => 'default',\n\t'date_from'   => 'default',\n\t'date_to'     => 'default',\n\t'league'      => null,\n\t'season'      => null,\n\t'team'        => null,\n\t'player'      => null,\n\t'number'      => -1,\n\t'link_teams'  => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,\n\t'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false,\n\t'paginated'   => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false,\n\t'rows'        => get_option( 'sportspress_event_blocks_rows', 5 ),\n\t'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false,\n\t'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false,\n\t'show_venue'  => get_option( 'sportspress_event_blocks_show_venue', 'no' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n$calendar = new SP_Calendar( $id );\nif ( $date != 'default' ) {\n\t$calendar->date = $date;\n}\nif ( $date_from != 'default' ) {\n\t$calendar->from = $date_from;\n}\nif ( $date_to != 'default' ) {\n\t$calendar->to = $date_to;\n}\nif ( $league ) {\n\t$calendar->league = $league;\n}\nif ( $season ) {\n\t$calendar->season = $season;\n}\nif ( $team ) {\n\t$calendar->team = $team;\n}\nif ( $player ) {\n\t$calendar->player = $player;\n}\n\n$args = array(\n\t'id'                   => $id,\n\t'title'                => esc_attr__( 'Fixtures', 'sportspress' ),\n\t'status'               => 'future',\n\t'date'                 => $date,\n\t'date_from'            => $date_from,\n\t'date_to'              => $date_to,\n\t'league'               => $league,\n\t'season'               => $season,\n\t'team'                 => $team,\n\t'player'               => $player,\n\t'number'               => $number,\n\t'link_teams'           => $link_teams,\n\t'link_events'          => $link_events,\n\t'paginated'            => $paginated,\n\t'rows'                 => $rows,\n\t'order'                => 'ASC',\n\t'show_all_events_link' => false,\n\t'show_title'           => true,\n\t'show_league'          => $show_league,\n\t'show_season'          => $show_season,\n\t'show_venue'           => $show_venue,\n\t'hide_if_empty'        => true,\n);\n\necho '<div class=\"sp-fixtures-results\">';\n\nob_start();\nsp_get_template( 'event-blocks.php', $args );\n$fixtures = ob_get_clean();\n\n$args['title']  = esc_attr__( 'Results', 'sportspress' );\n$args['status'] = 'publish';\n$args['order']  = 'DESC';\n\nob_start();\nsp_get_template( 'event-blocks.php', $args );\n$results = ob_get_clean();\n\nif ( false == $fixtures || false == $results ) {\n\n\techo $fixtures; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\techo $results; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\n} else {\n\n\techo '<div class=\"sp-widget-align-left\">';\n\techo $fixtures; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\techo '</div>';\n\n\techo '<div class=\"sp-widget-align-right\">';\n\techo $results; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\techo '</div>';\n}\n\necho '</div>';\n"
  },
  {
    "path": "templates/event-list.php",
    "content": "<?php\n/**\n * Event List\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'id'                   => null,\n\t'title'                => false,\n\t'status'               => 'default',\n\t'format'               => 'default',\n\t'date'                 => 'default',\n\t'date_from'            => 'default',\n\t'date_to'              => 'default',\n\t'date_past'            => 'default',\n\t'date_future'          => 'default',\n\t'date_relative'        => 'default',\n\t'day'                  => 'default',\n\t'league'               => null,\n\t'season'               => null,\n\t'venue'                => null,\n\t'team'                 => null,\n\t'teams_past'           => null,\n\t'date_before'          => null,\n\t'player'               => null,\n\t'number'               => -1,\n\t'show_team_logo'       => get_option( 'sportspress_event_list_show_logos', 'no' ) == 'yes' ? true : false,\n\t'link_events'          => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false,\n\t'link_teams'           => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,\n\t'link_venues'          => get_option( 'sportspress_link_venues', 'yes' ) == 'yes' ? true : false,\n\t'responsive'           => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false,\n\t'sortable'             => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,\n\t'scrollable'           => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,\n\t'paginated'            => get_option( 'sportspress_event_list_paginated', 'yes' ) == 'yes' ? true : false,\n\t'rows'                 => get_option( 'sportspress_event_list_rows', 10 ),\n\t'order'                => 'default',\n\t'columns'              => null,\n\t'show_all_events_link' => false,\n\t'show_title'           => get_option( 'sportspress_event_list_show_title', 'yes' ) == 'yes' ? true : false,\n\t'title_format'         => get_option( 'sportspress_event_list_title_format', 'title' ),\n\t'time_format'          => get_option( 'sportspress_event_list_time_format', 'combined' ),\n);\n\nextract( $defaults, EXTR_SKIP );\n\n$calendar = new SP_Calendar( $id );\nif ( $status != 'default' ) {\n\t$calendar->status = $status;\n}\nif ( $format != 'default' ) {\n\t$calendar->event_format = $format;\n}\nif ( $date != 'default' ) {\n\t$calendar->date = $date;\n}\nif ( $date_from != 'default' ) {\n\t$calendar->from = $date_from;\n}\nif ( $date_to != 'default' ) {\n\t$calendar->to = $date_to;\n}\nif ( $date_past != 'default' ) {\n\t$calendar->past = $date_past;\n}\nif ( $date_future != 'default' ) {\n\t$calendar->future = $date_future;\n}\nif ( $date_relative != 'default' ) {\n\t$calendar->relative = $date_relative;\n}\nif ( $league ) {\n\t$calendar->league = $league;\n}\nif ( $season ) {\n\t$calendar->season = $season;\n}\nif ( $venue ) {\n\t$calendar->venue = $venue;\n}\nif ( $team ) {\n\t$calendar->team = $team;\n}\nif ( $teams_past ) {\n\t$calendar->teams_past = $teams_past;\n}\nif ( $date_before ) {\n\t$calendar->date_before = $date_before;\n}\nif ( $player ) {\n\t$calendar->player = $player;\n}\nif ( $order != 'default' ) {\n\t$calendar->order = $order;\n}\nif ( $day != 'default' ) {\n\t$calendar->day = $day;\n}\n$data       = $calendar->data();\n$usecolumns = $calendar->columns;\n\nif ( isset( $columns ) ) :\n\tif ( is_array( $columns ) ) {\n\t\t$usecolumns = $columns;\n\t} else {\n\t\t$usecolumns = explode( ',', $columns );\n\t}\nendif;\n\nif ( $show_title && false === $title && $id ) :\n\t$caption = $calendar->caption;\n\tif ( $caption ) {\n\t\t$title = $caption;\n\t} else {\n\t\t$title = get_the_title( $id );\n\t}\nendif;\n$labels = array();\n// Create a unique identifier based on the current time in microseconds\n$identifier = uniqid( 'eventlist_' );\n?>\n<div class=\"sp-template sp-template-event-list\">\n\t<?php if ( $title ) { ?>\n\t\t<h4 class=\"sp-table-caption\"><?php echo wp_kses_post( $title ); ?></h4>\n\t<?php } ?>\n\t<div class=\"sp-table-wrapper\">\n\t\t<table class=\"sp-event-list sp-event-list-format-<?php echo esc_attr( $title_format ); ?> sp-data-table\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $paginated ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t sp-paginated-table\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} if ( $sortable ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t sp-sortable-table\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} if ( $responsive ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo ' sp-responsive-table ' . esc_attr( $identifier ); } if ( $scrollable ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t sp-scrollable-table <?php } ?>\" data-sp-rows=\"<?php echo esc_attr( $rows ); ?>\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<?php\n\t\t\t\t\techo '<th class=\"data-date\">' . esc_attr__( 'Date', 'sportspress' ) . '</th>';\n\n\t\t\t\t\tswitch ( $title_format ) {\n\t\t\t\t\t\tcase 'homeaway':\n\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'event' ) ) {\n\t\t\t\t\t\t\t\techo '<th class=\"data-home\">' . esc_attr__( 'Home', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\techo '<th class=\"data-time\">' . esc_attr__( 'Time/Results', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t\t$labels[] = esc_attr__( 'Time/Results', 'sportspress' );\n\t\t\t\t\t\t\t} elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {\n\t\t\t\t\t\t\t\techo '<th class=\"data-results\">' . esc_attr__( 'Results', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'event' ) ) {\n\t\t\t\t\t\t\t\techo '<th class=\"data-away\">' . esc_attr__( 'Away', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\techo '<th class=\"data-time\">' . esc_attr__( 'Time', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'event' ) ) {\n\t\t\t\t\t\t\t\tif ( $title_format == 'teams' ) {\n\t\t\t\t\t\t\t\t\techo '<th class=\"data-teams\">' . esc_attr__( 'Teams', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\techo '<th class=\"data-event\">' . esc_attr__( 'Event', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch ( $time_format ) {\n\t\t\t\t\t\t\t\tcase 'separate':\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<th class=\"data-time\">' . esc_attr__( 'Time', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'results' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<th class=\"data-results\">' . esc_attr__( 'Results', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'time':\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<th class=\"data-time\">' . esc_attr__( 'Time', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'results':\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'results' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<th class=\"data-results\">' . esc_attr__( 'Results', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<th class=\"data-time\">' . esc_attr__( 'Time/Results', 'sportspress' ) . '</th>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( sp_column_active( $usecolumns, 'league' ) ) {\n\t\t\t\t\t\techo '<th class=\"data-league\">' . esc_attr__( 'League', 'sportspress' ) . '</th>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( sp_column_active( $usecolumns, 'season' ) ) {\n\t\t\t\t\t\techo '<th class=\"data-season\">' . esc_attr__( 'Season', 'sportspress' ) . '</th>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( sp_column_active( $usecolumns, 'venue' ) ) {\n\t\t\t\t\t\techo '<th class=\"data-venue\">' . esc_attr__( 'Venue', 'sportspress' ) . '</th>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '<th style=\"display:none;\" class=\"data-venue\">' . esc_attr__( 'Venue', 'sportspress' ) . '</th>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( sp_column_active( $usecolumns, 'article' ) ) {\n\t\t\t\t\t\techo '<th class=\"data-article\">' . esc_attr__( 'Article', 'sportspress' ) . '</th>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( sp_column_active( $usecolumns, 'day' ) ) {\n\t\t\t\t\t\techo '<th class=\"data-day\">' . esc_attr__( 'Match Day', 'sportspress' ) . '</th>';\n\t\t\t\t\t}\n\n\t\t\t\t\tdo_action( 'sportspress_event_list_head_row', $usecolumns );\n\t\t\t\t\t?>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<?php\n\t\t\t\t$i = 0;\n\n\t\t\t\tif ( is_numeric( $number ) && $number > 0 ) {\n\t\t\t\t\t$limit = $number;\n\t\t\t\t}\n\n\t\t\t\tforeach ( $data as $event ) :\n\t\t\t\t\tif ( isset( $limit ) && $i >= $limit ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$teams  = get_post_meta( $event->ID, 'sp_team' );\n\t\t\t\t\t$video  = get_post_meta( $event->ID, 'sp_video', true );\n\t\t\t\t\t$status = get_post_meta( $event->ID, 'sp_status', true );\n\n\t\t\t\t\t$main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID );\n\n\t\t\t\t\t$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;\n\t\t\t\t\tif ( $reverse_teams ) {\n\t\t\t\t\t\t$main_results = array_reverse( $main_results, true );\n\t\t\t\t\t}\n\n\t\t\t\t\t$teams_output = '';\n\t\t\t\t\t$team_class   = '';\n\t\t\t\t\t$teams_array  = array();\n\t\t\t\t\t$team_logos   = array();\n\n\t\t\t\t\tif ( $teams ) :\n\t\t\t\t\t\tforeach ( $teams as $t => $team ) :\n\t\t\t\t\t\t\t$name = sp_team_short_name( $team );\n\t\t\t\t\t\t\tif ( $name ) :\n\n\t\t\t\t\t\t\t\t$name = '<meta itemprop=\"name\" content=\"' . $name . '\">' . $name;\n\n\t\t\t\t\t\t\t\tif ( $show_team_logo ) :\n\t\t\t\t\t\t\t\t\tif ( has_post_thumbnail( $team ) ) :\n\t\t\t\t\t\t\t\t\t\t$logo         = '<span class=\"team-logo\">' . sp_get_logo( $team, 'mini', array( 'itemprop' => 'url' ) ) . '</span>';\n\t\t\t\t\t\t\t\t\t\t$team_logos[] = $logo;\n\t\t\t\t\t\t\t\t\t\t$team_class  .= ' has-logo';\n\n\t\t\t\t\t\t\t\t\t\tif ( $t ) :\n\t\t\t\t\t\t\t\t\t\t\t$name = $logo . ' ' . $name;\n\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t$name .= ' ' . $logo;\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\tif ( $link_teams ) :\n\t\t\t\t\t\t\t\t\t$team_output = '<a href=\"' . get_post_permalink( $team ) . '\" itemprop=\"url\">' . $name . '</a>';\n\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t$team_output = $name;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t$team_result = sp_array_value( $main_results, $team, null );\n\n\t\t\t\t\t\t\t\tif ( $team_result != null ) :\n\t\t\t\t\t\t\t\t\tif ( $usecolumns != null && ! in_array( 'time', $usecolumns ) ) :\n\t\t\t\t\t\t\t\t\t\t$team_output .= ' (' . $team_result . ')';\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t$teams_array[] = $team_output;\n\n\t\t\t\t\t\t\t\t$teams_output .= $team_output . '<br>';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\telse :\n\t\t\t\t\t\t$teams_output .= '&mdash;';\n\t\t\t\t\tendif;\n\n\t\t\t\t\techo '<tr class=\"sp-row sp-post' . ( $i % 2 == 0 ? ' alternate' : '' ) . ' sp-row-no-' . esc_attr( $i ) . '\" itemscope itemtype=\"http://schema.org/SportsEvent\">';\n\n\t\t\t\t\t\t$date_html = '<date>' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_date', get_post_time( get_option( 'date_format' ), false, $event, true ), $event->ID );\n\n\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t$date_html = '<a href=\"' . get_post_permalink( $event->ID, false, true ) . '\" itemprop=\"url\">' . $date_html . '</a>';\n\t\t\t\t\t}\n\n\t\t\t\t\t\techo '<td class=\"data-date\" itemprop=\"startDate\" content=\"' . esc_attr( mysql2date( 'Y-m-d\\TH:i:sP', $event->post_date ) ) . '\" data-label=\"' . esc_attr__( 'Date', 'sportspress' ) . '\">' . wp_kses( $date_html, array( 'a' => array( 'href' => array(), 'itemprop' => array() ), 'date' => array() ) ) . '</td>';\n\n\t\t\t\t\t\t// Check if the reverse_teams option is selected and alter the teams order\n\t\t\t\t\tif ( $reverse_teams ) {\n\t\t\t\t\t\t$teams_array = array_reverse( $teams_array, true );\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ( $title_format ) {\n\t\t\t\t\t\tcase 'homeaway':\n\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'event' ) ) {\n\t\t\t\t\t\t\t\t$team = array_shift( $teams_array );\n\t\t\t\t\t\t\t\techo '<td class=\"data-home' . esc_attr( $team_class ) . '\" itemprop=\"competitor\" itemscope itemtype=\"http://schema.org/SportsTeam\" data-label=\"' . esc_attr__( 'Home', 'sportspress' ) . '\">' . wp_kses_post( $team ) . '</td>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\techo '<td class=\"data-time ' . esc_attr( $status ) . '\" data-label=\"' . esc_attr__( 'Time/Results', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( ! empty( $main_results ) ) :\n\t\t\t\t\t\t\t\t\techo wp_kses_post( implode( ' - ', $main_results ) );\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\techo '<date>&nbsp;' . wp_kses_post( get_post_time( 'H:i:s', false, $event ) ) . '</date>' . wp_kses_post( apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID ) );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t} elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {\n\t\t\t\t\t\t\t\techo '<td class=\"data-results\" data-label=\"' . esc_attr__( 'Results', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( ! empty( $main_results ) ) :\n\t\t\t\t\t\t\t\t\techo wp_kses_post( implode( ' - ', $main_results ) );\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\techo '-';\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'event' ) ) {\n\t\t\t\t\t\t\t\t$team = array_shift( $teams_array );\n\t\t\t\t\t\t\t\techo '<td class=\"data-away' . esc_attr( $team_class ) . '\" itemprop=\"competitor\" itemscope itemtype=\"http://schema.org/SportsTeam\" data-label=\"' . esc_attr__( 'Away', 'sportspress' ) . '\">' . wp_kses_post( $team ) . '</td>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\techo '<td class=\"data-time ' . esc_attr( $status ) . '\" data-label=\"' . esc_attr__( 'Time', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '<date>&nbsp;' . wp_kses_post( get_post_time( 'H:i:s', false, $event ) ) . '</date>' . wp_kses_post( apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID ) );\n\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'event' ) ) {\n\t\t\t\t\t\t\t\tif ( $title_format == 'teams' ) {\n\t\t\t\t\t\t\t\t\techo '<td class=\"data-event data-teams\" data-label=\"' . esc_attr__( 'Teams', 'sportspress' ) . '\">' . wp_kses_post( $teams_output ) . '</td>';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$title_html = implode( ' ', $team_logos ) . ' ' . $event->post_title;\n\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t$title_html = '<a href=\"' . get_post_permalink( $event->ID, false, true ) . '\" itemprop=\"url name\">' . $title_html . '</a>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\techo '<td class=\"data-event\" data-label=\"' . esc_attr__( 'Event', 'sportspress' ) . '\">' . wp_kses_post( $title_html ) . '</td>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch ( $time_format ) {\n\t\t\t\t\t\t\t\tcase 'separate':\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<td class=\"data-time ' . esc_attr( $status ) . '\" data-label=\"' . esc_attr__( 'Time', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '<date>&nbsp;' . wp_kses_post( get_post_time( 'H:i:s', false, $event ) ) . '</date>' . wp_kses_post( apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID ) );\n\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'results' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<td class=\"data-results\" data-label=\"' . esc_attr__( 'Results', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( ! empty( $main_results ) ) :\n\t\t\t\t\t\t\t\t\t\t\techo wp_kses_post( implode( ' - ', $main_results ) );\n\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\techo '-';\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'time':\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<td class=\"data-time ' . esc_attr( $status ) . '\" data-label=\"' . esc_attr__( 'Time', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '<date>&nbsp;' . wp_kses_post( get_post_time( 'H:i:s', false, $event ) ) . '</date>' . wp_kses_post( apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID ) );\n\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'results':\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'results' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<td class=\"data-results\" data-label=\"' . esc_attr__( 'Results', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( ! empty( $main_results ) ) :\n\t\t\t\t\t\t\t\t\t\t\techo wp_kses_post( implode( ' - ', $main_results ) );\n\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\techo '-';\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'time' ) ) {\n\t\t\t\t\t\t\t\t\t\techo '<td class=\"data-time ' . esc_attr( $status ) . '\" data-label=\"' . esc_attr__( 'Time/Results', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( ! empty( $main_results ) ) :\n\t\t\t\t\t\t\t\t\t\t\techo wp_kses_post( implode( ' - ', $main_results ) );\n\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\techo '<date>&nbsp;' . wp_kses_post( get_post_time( 'H:i:s', false, $event ) ) . '</date>' . wp_kses_post( apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID ) );\n\t\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( sp_column_active( $usecolumns, 'league' ) ) :\n\t\t\t\t\t\techo '<td class=\"data-league\" data-label=\"' . esc_attr__( 'League', 'sportspress' ) . '\">';\n\t\t\t\t\t\t$leagues = get_the_terms( $event->ID, 'sp_league' );\n\t\t\t\t\t\tif ( $leagues ) :\n\t\t\t\t\t\t\techo wp_kses_post( implode( ', ', wp_list_pluck( $leagues, 'name' ) ) );\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\tif ( sp_column_active( $usecolumns, 'season' ) ) :\n\t\t\t\t\t\techo '<td class=\"data-season\" data-label=\"' . esc_attr__( 'Season', 'sportspress' ) . '\">';\n\t\t\t\t\t\t$seasons = get_the_terms( $event->ID, 'sp_season' );\n\t\t\t\t\t\tif ( $seasons ) :\n\t\t\t\t\t\t\techo wp_kses_post( implode( ', ', wp_list_pluck( $seasons, 'name' ) ) );\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\tif ( sp_column_active( $usecolumns, 'venue' ) ) :\n\t\t\t\t\t\techo '<td class=\"data-venue\" data-label=\"' . esc_attr__( 'Venue', 'sportspress' ) . '\" itemprop=\"location\" itemscope itemtype=\"http://schema.org/Place\">';\n\t\t\t\t\t\techo '<div itemprop=\"address\" itemscope itemtype=\"http://schema.org/PostalAddress\">';\n\t\t\t\t\t\tif ( $link_venues ) :\n\t\t\t\t\t\t\tthe_terms( $event->ID, 'sp_venue' );\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$venues = get_the_terms( $event->ID, 'sp_venue' );\n\t\t\t\t\t\t\t\tif ( $venues ) :\n\t\t\t\t\t\t\t\t\techo wp_kses_post( implode( ', ', wp_list_pluck( $venues, 'name' ) ) );\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\techo '<td style=\"display:none;\" class=\"data-venue\" data-label=\"' . esc_attr__( 'Venue', 'sportspress' ) . '\" itemprop=\"location\" itemscope itemtype=\"http://schema.org/Place\">';\n\t\t\t\t\t\t\techo '<div itemprop=\"address\" itemscope itemtype=\"http://schema.org/PostalAddress\">';\n\t\t\t\t\t\t\tesc_attr_e( 'N/A', 'sportspress' );\n\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'article' ) ) :\n\t\t\t\t\t\t\techo '<td class=\"data-article\" data-label=\"' . esc_attr__( 'Article', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\techo '<a href=\"' . esc_url( get_post_permalink( $event->ID, false, true ) ) . '\" itemprop=\"url\">';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( $video ) :\n\t\t\t\t\t\t\t\techo '<div class=\"dashicons dashicons-video-alt\"></div>';\n\t\t\t\t\t\t\t\telseif ( has_post_thumbnail( $event->ID ) ) :\n\t\t\t\t\t\t\t\t\techo '<div class=\"dashicons dashicons-camera\"></div>';\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tif ( $event->post_content !== null ) :\n\t\t\t\t\t\t\t\t\tif ( $event->post_status == 'publish' ) :\n\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Recap', 'sportspress' );\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\tesc_attr_e( 'Preview', 'sportspress' );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\tif ( $link_events ) {\n\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tif ( sp_column_active( $usecolumns, 'day' ) ) :\n\t\t\t\t\t\t\techo '<td class=\"data-day\" data-label=\"' . esc_attr__( 'Match Day', 'sportspress' ) . '\">';\n\t\t\t\t\t\t\t$day = get_post_meta( $event->ID, 'sp_day', true );\n\t\t\t\t\t\t\tif ( '' == $day ) {\n\t\t\t\t\t\t\t\techo '-';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo wp_kses_post( $day );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tdo_action( 'sportspress_event_list_row', $event, $usecolumns );\n\n\t\t\t\t\t\techo '</tr>';\n\n\t\t\t\t\t\t$i++;\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\t<?php\n\t// If responsive tables are enabled then load the inline css code\n\tif ( $responsive ) {\n\t\t// sportspress_responsive_tables_css( $identifier );\n\t}\n\tif ( $id && $show_all_events_link ) {\n\t\techo '<div class=\"sp-calendar-link sp-view-all-link\"><a href=\"' . esc_url( get_permalink( $id ) ) . '\">' . esc_attr__( 'View all events', 'sportspress' ) . '</a></div>';\n\t}\n\t?>\n</div>\n"
  },
  {
    "path": "templates/event-logos-block.php",
    "content": "<?php\n/**\n * Event Logos Block\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.1\n */\n?>\n<div class=\"sp-template sp-template-event-logos sp-template-event-blocks sp-template-event-logos-block\">\n\t<div class=\"sp-table-wrapper\">\n\t\t<table class=\"sp-event-blocks sp-data-table\" data-sp-rows=\"1\">\n\t\t\t<thead><tr><th></th></tr></thead> <?php // Required for DataTables ?>\n\t\t\t<tbody>\n\t\t\t\t<tr class=\"sp-row sp-post alternate\">\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$j = 0;\n\t\t\t\t\t\tforeach ( $teams as $team ) :\n\t\t\t\t\t\t\t$j++;\n\n\t\t\t\t\t\t\tif ( has_post_thumbnail( $team ) ) {\n\t\t\t\t\t\t\t\t$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$logo = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( $show_team_names ) {\n\t\t\t\t\t\t\t\tif ( $j % 2 ) {\n\t\t\t\t\t\t\t\t\t$logo .= ' <strong class=\"sp-team-name\">' . sp_team_short_name( $team ) . '</strong>';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$logo = '<strong class=\"sp-team-name\">' . sp_team_short_name( $team ) . '</strong> ' . $logo;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( $link_teams ) :\n\t\t\t\t\t\t\t\t$logo = '<a class=\"team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) . '\" href=\"' . get_permalink( $team, false, true ) . '\" title=\"' . get_the_title( $team ) . '\">' . $logo . '</a>';\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$logo = '<span class=\"team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) . '\" title=\"' . get_the_title( $team ) . '\">' . $logo . '</span>';\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\techo wp_kses_post( $logo );\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<time class=\"sp-event-date\" datetime=\"<?php echo esc_attr( get_the_time( 'Y-m-d H:i:s', $id ) ); ?>\">\n\t\t\t\t\t\t\t<?php echo wp_kses_post( get_the_time( get_option( 'date_format' ), $id ) ); ?>\n\t\t\t\t\t\t</time>\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t$status = esc_attr__( 'Preview', 'sportspress' );\n\n\t\t\t\t\t\tif ( $show_time ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<h5 class=\"sp-event-results\">\n\t\t\t\t\t\t\t\t<?php echo '<span class=\"sp-result\">' . wp_kses_post( apply_filters( 'sportspress_event_time', sp_get_time( $id ), $id ) ) . '</span>'; ?>\n\t\t\t\t\t\t\t</h5>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $show_results && ! empty( $results ) ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<h5 class=\"sp-event-results\">\n\t\t\t\t\t\t\t\t<?php echo '<span class=\"sp-result\">' . wp_kses_post( implode( '</span> - <span class=\"sp-result\">', apply_filters( 'sportspress_event_blocks_team_result_or_time', $results, $id ) ) ) . '</span>'; ?>\n\t\t\t\t\t\t\t</h5>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$status = esc_attr__( 'Full Time', 'sportspress' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<span class=\"sp-event-status\">\n\t\t\t\t\t\t\t<?php echo wp_kses_post( apply_filters( 'sportspress_event_logos_status', $status, $id ) ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n"
  },
  {
    "path": "templates/event-logos-inline.php",
    "content": "<?php\n/**\n * Event Logos Inline\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.6\n */\n\n$team_logos = array();\n$i          = 0;\nforeach ( $teams as $team ) :\n\tif ( ! has_post_thumbnail( $team ) ) {\n\t\t$logo = '';\n\t} else {\n\t\t$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );\n\t}\n\n\t$alt = sizeof( $teams ) == 2 && $i % 2;\n\n\t// Add team name\n\tif ( $show_team_names ) {\n\t\tif ( $alt ) {\n\t\t\t$logo .= ' <strong class=\"sp-team-name\">' . sp_team_short_name( $team ) . '</strong>';\n\t\t} else {\n\t\t\t$logo = '<strong class=\"sp-team-name\">' . sp_team_short_name( $team ) . '</strong> ' . $logo;\n\t\t}\n\t}\n\n\t// Add link\n\tif ( $link_teams ) {\n\t\t$logo = '<a href=\"' . get_post_permalink( $team ) . '\">' . $logo . '</a>';\n\t}\n\n\t// Add result\n\tif ( $show_results && ! empty( $results ) ) {\n\t\t$team_result = array_shift( $results );\n\t\t$team_result = apply_filters( 'sportspress_event_logos_team_result', $team_result, $id, $team );\n\t\tif ( $alt ) {\n\t\t\t$logo = '<strong class=\"sp-team-result\">' . $team_result . '</strong> ' . $logo;\n\t\t} else {\n\t\t\t$logo .= ' <strong class=\"sp-team-result\">' . $team_result . '</strong>';\n\t\t}\n\t}\n\n\t// Add logo to array\n\tif ( '' !== $logo ) {\n\t\t$team_logos[] = '<span class=\"sp-team-logo\">' . $logo . '</span>';\n\t\t$i++;\n\t}\nendforeach;\n$team_logos = array_filter( $team_logos );\nif ( ! empty( $team_logos ) ) :\n\techo '<div class=\"sp-template sp-template-event-logos sp-template-event-logos-inline\"><div class=\"sp-event-logos sp-event-logos-' . esc_attr( sizeof( $teams ) ) . '\">';\n\n\t// Assign delimiter\n\tif ( $show_time && sizeof( $teams ) <= 2 ) {\n\t\t$delimiter = '<strong class=\"sp-event-logos-time sp-team-result\">' . apply_filters( 'sportspress_event_time', get_the_time( get_option( 'time_format' ), $id ), $id ) . '</strong>';\n\t} else {\n\t\t$delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' );\n\t}\n\n\techo wp_kses_post( implode( ' ' . $delimiter . ' ', $team_logos ) );\n\techo '</div></div>';\nendif;\n"
  },
  {
    "path": "templates/event-logos.php",
    "content": "<?php\n/**\n * Event Logos\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.6.10\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_event_show_logos', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$teams         = (array) get_post_meta( $id, 'sp_team' );\n$teams         = array_filter( $teams, 'sp_filter_positive' );\n$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;\nif ( $reverse_teams ) {\n\t$teams = array_reverse( $teams );\n}\n\nif ( ! $teams ) {\n\treturn;\n}\n\n$layout = get_option( 'sportspress_event_logos_format', 'inline' );\n\n$show_team_names = get_option( 'sportspress_event_logos_show_team_names', 'yes' ) === 'yes' ? true : false;\n$show_time       = get_option( 'sportspress_event_logos_show_time', 'no' ) === 'yes' ? true : false;\n$show_results    = get_option( 'sportspress_event_logos_show_results', 'no' ) === 'yes' ? true : false;\n$link_teams      = get_option( 'sportspress_link_teams', 'no' ) === 'yes' ? true : false;\n\nif ( $show_results ) {\n\t$results = sp_get_main_results( $id );\n\tif ( empty( $results ) ) {\n\t\t$show_results = false;\n\t} else {\n\t\t$show_time = false;\n\t\tif ( $reverse_teams ) {\n\t\t\t$results = array_reverse( $results );\n\t\t}\n\t}\n} else {\n\t$results = array();\n}\n\nsp_get_template(\n\t'event-logos-' . $layout . '.php',\n\tarray(\n\t\t'id'              => $id,\n\t\t'teams'           => $teams,\n\t\t'results'         => $results,\n\t\t'show_team_names' => $show_team_names,\n\t\t'show_time'       => $show_time,\n\t\t'show_results'    => $show_results,\n\t\t'link_teams'      => $link_teams,\n\t)\n);\n\ndo_action( 'sportspress_after_event_logos', $id );\n"
  },
  {
    "path": "templates/event-officials-list.php",
    "content": "<?php\n/**\n * Event Officials List\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;\n?>\n<div class=\"sp-template sp-template-event-officials sp-template-details\">\n\t<h4 class=\"sp-table-caption\"><?php esc_attr_e( 'Officials', 'sportspress' ); ?></h4>\n\t<div class=\"sp-list-wrapper\">\n\t\t<dl class=\"sp-event-officials\">\n\t\t\t<?php\n\t\t\tforeach ( $labels as $key => $label ) {\n\t\t\t\t$appointed_officials = (array) sp_array_value( $data, $key, array() );\n\t\t\t\tif ( empty( $appointed_officials ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\techo '<dt>' . wp_kses_post( $label ) . '</dt>';\n\n\t\t\t\tforeach ( $appointed_officials as $official_id => $official_name ) {\n\t\t\t\t\tif ( $link_officials && sp_post_exists( $official_id ) ) {\n\t\t\t\t\t\t$official_name = '<a href=\"' . get_post_permalink( $official_id ) . '\">' . $official_name . '</a>';\n\t\t\t\t\t}\n\t\t\t\t\techo '<dd>' . wp_kses_post( $official_name ) . '</dd>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t</dl>\n\t</div>\n</div>\n"
  },
  {
    "path": "templates/event-officials-table.php",
    "content": "<?php\n/**\n * Event Officials Table\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;\n?>\n<div class=\"sp-template sp-template-event-officials\">\n\t<h4 class=\"sp-table-caption\"><?php esc_attr_e( 'Officials', 'sportspress' ); ?></h4>\n\t<div class=\"sp-table-wrapper\">\n\t\t<table class=\"sp-event-officials sp-data-table<?php echo $scrollable ? ' sp-scrollable-table' : ''; ?>\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $labels as $label ) {\n\t\t\t\t\t\techo '<th class=\"data-name\">' . wp_kses_post( $label ) . '</th>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $data as $appointed_officials ) {\n\t\t\t\t\t\tforeach ( $appointed_officials as $official_id => $official_name ) {\n\t\t\t\t\t\t\tif ( $link_officials && sp_post_exists( $official_id ) ) {\n\t\t\t\t\t\t\t\t$appointed_officials[ $official_id ] = '<a href=\"' . get_post_permalink( $official_id ) . '\">' . $official_name . '</a>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '<td class=\"data-name\">' . wp_kses_post( implode( '<br>', $appointed_officials ) ) . '</td>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n"
  },
  {
    "path": "templates/event-officials.php",
    "content": "<?php\n/**\n * Event Officials\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$event = new SP_Event( $id );\n\n// Get appointed officials from event\n$data = $event->appointments();\n\n// Return if no officials are in event\nif ( empty( $data ) ) {\n\treturn;\n}\n\n// The first row should be column labels\n$labels = $data[0];\nunset( $data[0] );\n\n$link_officials = get_option( 'sportspress_link_officials', 'no' ) == 'yes' ? true : false;\n$format         = get_option( 'sportspress_event_officials_format', 'table' );\n\nswitch ( $format ) :\n\tcase 'list':\n\t\tsp_get_template(\n\t\t\t'event-officials-list.php',\n\t\t\tarray(\n\t\t\t\t'labels'         => $labels,\n\t\t\t\t'data'           => $data,\n\t\t\t\t'link_officials' => $link_officials,\n\t\t\t)\n\t\t);\n\t\tbreak;\n\tdefault:\n\t\tsp_get_template(\n\t\t\t'event-officials-table.php',\n\t\t\tarray(\n\t\t\t\t'labels'         => $labels,\n\t\t\t\t'data'           => $data,\n\t\t\t\t'link_officials' => $link_officials,\n\t\t\t)\n\t\t);\nendswitch;\n"
  },
  {
    "path": "templates/event-overview.php",
    "content": "<?php\n/**\n * Event Results/Details\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     1.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n?>\n<div class=\"sp-event-overview\">\n\t<?php do_action( 'sportspress_event_overview_content' ); ?>\n</div>\n"
  },
  {
    "path": "templates/event-performance-table.php",
    "content": "<?php\n/**\n * Event Performance Table\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.18\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n// Initialize totals\n$totals = array();\n\n// Set null\nif ( ! isset( $section ) ) {\n\t$section = -1;\n}\nif ( ! isset( $section_label ) ) {\n\t$section_label = null;\n}\nif ( ! isset( $class ) ) {\n\t$class = null;\n}\n\n// Initialize arrays\nif ( ! isset( $lineups ) ) {\n\t$lineups = array();\n}\nif ( ! isset( $subs ) ) {\n\t$subs = array();\n}\n\n$responsive = get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false;\n// Create a unique identifier based on the current time in microseconds\n$identifier = uniqid( 'performance_' );\n// If responsive tables are enabled then load the inline css code\nif ( true == $responsive && $mode == 'values' ) {\n\t// sportspress_responsive_tables_css( $identifier );\n}\n$i = 0;\n?>\n<div class=\"sp-template sp-template-event-performance sp-template-event-performance-<?php echo esc_attr( $mode ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( isset( $class ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo ' ' . esc_attr( $class ); }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\">\n\t<?php if ( $caption ) : ?>\n\t\t<h4 class=\"sp-table-caption\"><?php echo wp_kses_post( $caption ); ?></h4>\n\t<?php endif; ?>\n\t<div class=\"sp-table-wrapper\">\n\t\t<table class=\"sp-event-performance sp-data-table\n\t\t<?php\n\t\tif ( $mode == 'values' ) {\n\t\t\t?>\n\t\t\t\n\t\t\t<?php\n\t\t\tif ( $scrollable ) {\n\t\t\t\t?>\n\t\t\t sp-scrollable-table\n\t\t\t\t\t\t<?php\n\t\t\t}if ( $responsive ) {\n\t\t\t\techo ' sp-responsive-table ' . esc_attr( $identifier ); } if ( $sortable ) {\n\t\t\t\t?>\n\t sp-sortable-table<?php } ?><?php } ?>\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<?php if ( $mode == 'values' ) : ?>\n\t\t\t\t\t\t<?php if ( $show_players ) : ?>\n\t\t\t\t\t\t\t<?php if ( apply_filters( 'sportspress_event_performance_show_numbers', $show_numbers, $section ) ) { ?>\n\t\t\t\t\t\t\t\t<th class=\"data-number\">#</th>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t<th class=\"data-name\">\n\t\t\t\t\t\t\t\t<?php if ( isset( $section_label ) ) { ?>\n\t\t\t\t\t\t\t\t\t<?php echo wp_kses_post( $section_label ); ?>\n\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t<?php esc_attr_e( 'Player', 'sportspress' ); ?>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<?php foreach ( $labels as $key => $label ) : ?>\n\t\t\t\t\t\t\t<th class=\"data-<?php echo esc_attr( $key ); ?>\"><?php echo wp_kses_post( $label ); ?></th>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<?php if ( $show_players ) : ?>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\n\t\t\t\t\t$lineups = array_filter( $data, array( $event, 'lineup_filter' ) );\n\t\t\t\t\t$subs    = array_filter( $data, array( $event, 'sub_filter' ) );\n\n\t\t\t\t\t$lineup_sub_relation = array();\n\t\t\t\t\tforeach ( $subs as $sub_id => $sub ) :\n\t\t\t\t\t\tif ( ! $sub_id ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i                         = sp_array_value( $sub, 'sub', 0 );\n\t\t\t\t\t\t$lineup_sub_relation[ $i ] = $sub_id;\n\t\t\t\t\tendforeach;\n\n\t\t\t\t\t$data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode );\n\n\t\t\t\t\t$stars_type = get_option( 'sportspress_event_performance_stars_type', 0 );\n\n\t\t\t\t\tforeach ( $data as $player_id => $row ) :\n\n\t\t\t\t\t\tif ( ! $player_id ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$name = get_the_title( $player_id );\n\n\t\t\t\t\t\tif ( ! $name ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\techo '<tr class=\"' . esc_attr( sp_array_value( $row, 'status', 'lineup' ) ) . ' ' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '\">';\n\n\t\t\t\t\t\tif ( apply_filters( 'sportspress_event_performance_show_numbers', $show_numbers, $section ) ) {\n\t\t\t\t\t\t\t$number = sp_array_value( $row, 'number', '&nbsp;' );\n\n\t\t\t\t\t\t\t// Player number\n\t\t\t\t\t\t\techo '<td class=\"data-number\" data-label=\"#\">' . wp_kses_post( $number ) . '</td>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $link_posts ) :\n\t\t\t\t\t\t\t$permalink = get_post_permalink( $player_id );\n\t\t\t\t\t\t\t$name      = '<a href=\"' . esc_url( $permalink ) . '\">' . wp_kses_post( $name ) . '</a>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tif ( $stars_type ) :\n\t\t\t\t\t\t\t$player_stars = sp_array_value( $stars, $player_id, 0 );\n\t\t\t\t\t\t\tif ( $player_stars ) :\n\t\t\t\t\t\t\t\tswitch ( $stars_type ) :\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t$name .= ' <span class=\"sp-event-stars\"><i class=\"sp-event-star dashicons dashicons-star-filled\" title=\"' . esc_attr__( 'Player of the Match', 'sportspress' ) . '\"></i></span>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t$name .= ' <span class=\"sp-event-stars\">' . str_repeat( '<i class=\"sp-event-star dashicons dashicons-star-filled\" title=\"' . esc_attr__( 'Stars', 'sportspress' ) . '\"></i>', $player_stars ) . '</span>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t$name .= ' <span class=\"sp-event-stars\"><i class=\"sp-event-star sp-event-star-' . $player_stars . '  dashicons dashicons-star-filled\" title=\"' . esc_attr__( 'Stars', 'sportspress' ) . '\"></i><span class=\"sp-event-star-number\">' . $player_stars . '</span></span>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tendswitch;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tif ( array_key_exists( $player_id, $lineup_sub_relation ) ) :\n\t\t\t\t\t\t\t$name .= ' <span class=\"sub-in\" title=\"' . get_the_title( $lineup_sub_relation[ $player_id ] ) . '\">' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . '</span>';\n\t\t\t\t\t\telseif ( isset( $row['sub'] ) && $row['sub'] ) :\n\t\t\t\t\t\t\t$subbed = (int) $row['sub'];\n\t\t\t\t\t\t\t$name  .= ' <span class=\"sub-out\" title=\"' . get_the_title( $row['sub'] ) . '\">' . sp_array_value( sp_array_value( $data, $subbed, array() ), 'number', null ) . '</span>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t$content  = '';\n\t\t\t\t\t\t$position = null;\n\n\t\t\t\t\t\tforeach ( $labels as $key => $label ) :\n\t\t\t\t\t\t\tif ( 'name' == $key ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$format      = sp_array_value( $formats, $key, 'number' );\n\t\t\t\t\t\t\t$placeholder = sp_get_format_placeholder( $format );\n\n\t\t\t\t\t\t\tif ( ! array_key_exists( $key, $totals ) ) :\n\t\t\t\t\t\t\t\t$totals[ $key ] = $placeholder;\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\tif ( 'time' === $format ) :\n\t\t\t\t\t\t\t\t$totals[ $key ] = '&nbsp;';\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t$value = '-';\n\t\t\t\t\t\t\tif ( $key == 'position' ) :\n\t\t\t\t\t\t\t\t$positions = array();\n\t\t\t\t\t\t\t\tif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ) :\n\t\t\t\t\t\t\t\t\t$position_ids = (array) $row[ $key ];\n\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t$position_ids = (array) sp_get_the_term_id( $player_id, 'sp_position' );\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\tforeach ( $position_ids as $position_id ) {\n\t\t\t\t\t\t\t\t\t$player_position = get_term_by( 'id', $position_id, 'sp_position' );\n\t\t\t\t\t\t\t\t\tif ( $player_position ) {\n\t\t\t\t\t\t\t\t\t\t$positions[] = $player_position->name;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$positions = array_unique( $positions );\n\n\t\t\t\t\t\t\t\tif ( sizeof( $positions ) ) :\n\t\t\t\t\t\t\t\t\t$value = $position = implode( ', ', $positions );\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\tif ( array_key_exists( $key, $row ) && $row[ $key ] !== '' ) :\n\t\t\t\t\t\t\t\t\tif ( 'checkbox' === $format ) :\n\t\t\t\t\t\t\t\t\t\t$value = '<span class=\"sp-checkbox\">' . $row[ $key ] . '</span>';\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$value = $row[ $key ];\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t$value = $placeholder;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\tif ( 'number' === $format ) :\n\t\t\t\t\t\t\t\t\t$add             = apply_filters( 'sportspress_event_performance_add_value', floatval( $value ), $key );\n\t\t\t\t\t\t\t\t\t$totals[ $key ] += $add;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\tif ( $mode == 'values' ) :\n\t\t\t\t\t\t\t\t$content .= '<td class=\"data-' . $key . '\" data-label=\"' . $labels[ $key ] . '\">' . $value . '</td>';\n\t\t\t\t\t\t\telseif ( intval( $value ) && $mode == 'icons' ) :\n\t\t\t\t\t\t\t\t$performance_id = sp_array_value( $performance_ids, $key, null );\n\t\t\t\t\t\t\t\t$icons          = '';\n\t\t\t\t\t\t\t\tif ( $performance_id && has_post_thumbnail( $performance_id ) ) :\n\t\t\t\t\t\t\t\t\tpreg_match( '#\\((.*?)\\)#', $value, $match );\n\t\t\t\t\t\t\t\t\tif ( ! empty( $match ) && isset( $match[1] ) ) {\n\t\t\t\t\t\t\t\t\t\t$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ' . $match[1] . ' ', intval( $value ) );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', intval( $value ) );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$content .= apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\tif ( isset( $position ) && $mode == 'icons' ) :\n\t\t\t\t\t\t\t$name .= ' <small class=\"sp-player-position\">' . $position . '</small>';\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\techo '<td class=\"data-name\" data-label=\"' . ( isset( $section_label ) ? esc_attr( $section_label ) : esc_attr__( 'Player', 'sportspress' ) ) . '\">' . wp_kses_post( $name ) . '</td>';\n\n\t\t\t\t\t\tif ( $mode == 'icons' ) :\n\t\t\t\t\t\t\techo '<td class=\"sp-performance-icons\">' . wp_kses_post( $content ) . '</td>';\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\techo wp_kses_post( $content );\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\techo '</tr>';\n\n\t\t\t\t\t\t$i++;\n\n\t\t\t\t\tendforeach;\n\n\t\t\t\t\tforeach ( $labels as $key => $label ) :\n\t\t\t\t\t\t$format = sp_array_value( $formats, $key, 'number' );\n\t\t\t\t\t\tif ( 'equation' === $format ) :\n\t\t\t\t\t\t\t$post = get_page_by_path( $key, OBJECT, 'sp_performance' );\n\t\t\t\t\t\t\tif ( $post ) {\n\t\t\t\t\t\t\t\t$totals[ $key ] = sp_solve( get_post_meta( $post->ID, 'sp_equation', true ), $totals, get_post_meta( $post->ID, 'sp_precision', true ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t<?php endif; ?>\n\t\t\t<?php if ( apply_filters( 'sportspress_event_performance_show_footer', $show_total ) ) : ?>\n\t\t\t\t<<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tdo_action( 'sportspress_event_performance_table_footer', $data, $labels, $section, $performance_ids );\n\t\t\t\t\tif ( $show_total && ( ! $primary || sizeof( array_intersect_key( $totals, array_flip( (array) $primary ) ) ) ) ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<tr class=\"sp-total-row <?php echo ( $i % 2 == 0 ? 'odd' : 'even' ); ?>\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $show_players ) :\n\t\t\t\t\t\t\t\tif ( apply_filters( 'sportspress_event_performance_show_numbers', $show_numbers, $section ) ) {\n\t\t\t\t\t\t\t\t\techo '<td class=\"data-number\" data-label=\"&nbsp;\">&nbsp;</td>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( $mode == 'values' ) :\n\t\t\t\t\t\t\t\t\techo '<td class=\"data-name\" data-label=\"&nbsp;\">' . esc_attr__( 'Total', 'sportspress' ) . '</td>';\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t$row = sp_array_value( $data, 0, array() );\n\n\t\t\t\t\t\t\tif ( $mode == 'icons' ) {\n\t\t\t\t\t\t\t\techo '<td class=\"sp-performance-icons\" colspan=\"2\">';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach ( $labels as $key => $label ) :\n\t\t\t\t\t\t\t\t$format = sp_array_value( $formats, $key, 'number' );\n\t\t\t\t\t\t\t\tif ( 'name' == $key ) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( $key == 'position' ) :\n\t\t\t\t\t\t\t\t\t$value = '&nbsp;';\n\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\tif ( $primary && $key !== $primary ) :\n\t\t\t\t\t\t\t\t\t\t$value = '&nbsp;';\n\t\t\t\t\t\t\t\t\telseif ( 'equation' !== $format && array_key_exists( $key, $row ) && $row[ $key ] != '' ) :\n\t\t\t\t\t\t\t\t\t\t$value = $row[ $key ];\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$value = apply_filters( 'sportspress_event_performance_table_total_value', sp_array_value( $totals, $key, 0 ), $data, $key );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\tif ( $mode == 'values' ) :\n\t\t\t\t\t\t\t\t\tif ( $key == 'position' ) {\n\t\t\t\t\t\t\t\t\t\techo '<td class=\"data-' . esc_attr( $key ) . '\" data-label=\"&nbsp;\">' . wp_kses_post( $value ) . '</td>';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\techo '<td class=\"data-' . esc_attr( $key ) . '\" data-label=\"' . esc_attr( $labels[ $key ] ) . '\">' . wp_kses_post( $value ) . '</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif ( intval( $value ) && $mode == 'icons' ) :\n\t\t\t\t\t\t\t\t\t$performance_id = sp_array_value( $performance_ids, $key, null );\n\t\t\t\t\t\t\t\t\t$icons          = '';\n\t\t\t\t\t\t\t\t\tif ( $performance_id && has_post_thumbnail( $performance_id ) ) :\n\t\t\t\t\t\t\t\t\t\t$icons = get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\techo wp_kses_post( apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, 1 ) . $value . ' ' );\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\t\tif ( $mode == 'icons' ) {\n\t\t\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>\n\t\t\t<?php endif; ?>\n\t\t</table>\n\t\t<?php\n\t\tif ( isset( $show_staff ) && $show_staff ) {\n\t\t\t$template_content = sp_get_template(\n\t\t\t\t\t\t'event-staff.php',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id'    => $id,\n\t\t\t\t\t\t\t'index' => $index,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\tif ( $template_content !== null ) {\n\t\t\t\techo wp_kses_post( $template_content );\n\t\t\t}\n\t\t}\n\t\t?>\n\t</div>\n\t<?php do_action( 'sportspress_after_event_performance_table', $data, $lineups, $subs, $class ); ?>\n</div>\n"
  },
  {
    "path": "templates/event-performance.php",
    "content": "<?php\n/**\n * Event Performance\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.6.16\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$show_players  = get_option( 'sportspress_event_show_players', 'yes' ) === 'yes' ? true : false;\n$show_staff    = get_option( 'sportspress_event_show_staff', 'yes' ) === 'yes' ? true : false;\n$show_total    = get_option( 'sportspress_event_show_total', 'yes' ) === 'yes' ? true : false;\n$show_numbers  = get_option( 'sportspress_event_show_player_numbers', 'yes' ) === 'yes' ? true : false;\n$show_position = get_option( 'sportspress_event_show_position', 'yes' ) === 'yes' ? true : false;\n$show_minutes  = get_option( 'sportspress_event_performance_show_minutes', 'no' ) === 'yes' ? true : false;\n$sections      = get_option( 'sportspress_event_performance_sections', -1 );\n$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;\n$primary       = sp_get_main_performance_option();\n$total         = get_option( 'sportspress_event_total_performance', 'all' );\n\nif ( ! $show_players && ! $show_staff && ! $show_total ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$teams = get_post_meta( $id, 'sp_team', false );\n\n$is_individual = sp_get_post_mode( $id ) === 'player' ? true : false;\n\nif ( is_array( $teams ) ) :\n\tob_start();\n\n\t$event       = new SP_Event( $id );\n\t$performance = $event->performance();\n\t$stars       = $event->stars();\n\n\t$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;\n\t$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;\n\t$sortable   = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;\n\t$mode       = get_option( 'sportspress_event_performance_mode', 'values' );\n\n\t// The first row should be column labels\n\t$labels = apply_filters( 'sportspress_event_box_score_labels', $performance[0], $event, $mode );\n\n\t// Add position to labels if selected\n\tif ( $show_position ) {\n\t\t$labels = array_merge( array( 'position' => esc_attr__( 'Position', 'sportspress' ) ), $labels );\n\t}\n\n\t// Remove the first row to leave us with the actual data\n\tunset( $performance[0] );\n\n\t$performance = array_filter( $performance );\n\n\t$status = $event->status();\n\n\tif ( 'future' == $status ) {\n\t\t$show_total = false;\n\t}\n\n\t// Get performance ids for icons\n\tif ( $mode == 'icons' ) :\n\t\t$performance_ids   = array();\n\t\t$performance_posts = get_posts(\n\t\t\tarray(\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'post_type'      => 'sp_performance',\n\t\t\t)\n\t\t);\n\t\tforeach ( $performance_posts as $post ) :\n\t\t\t$performance_ids[ $post->post_name ] = $post->ID;\n\t\tendforeach;\n\tendif;\n\n\tif ( $reverse_teams ) {\n\t\t$teams = array_reverse( $teams, true );\n\t}\n\n\t// Get performance columns\n\t$args = array(\n\t\t'post_type'      => 'sp_performance',\n\t\t'numberposts'    => 100,\n\t\t'posts_per_page' => 100,\n\t\t'orderby'        => 'menu_order',\n\t\t'order'          => 'ASC',\n\t);\n\n\t$columns = get_posts( $args );\n\n\t// Get formats\n\t$formats = array();\n\n\t// Add to formats\n\tforeach ( $columns as $column ) {\n\t\t$format = get_post_meta( $column->ID, 'sp_format', true );\n\t\tif ( '' === $format ) {\n\t\t\t$format = 'number';\n\t\t}\n\t\t$formats[ $column->post_name ] = $format;\n\t}\n\n\tdo_action( 'sportspress_before_event_performance', $columns );\n\n\tif ( $is_individual ) {\n\t\t// Combined table\n\t\t$data = array();\n\t\tforeach ( $performance as $players ) {\n\t\t\tforeach ( $players as $player_id => $player ) {\n\t\t\t\tif ( $player_id == 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$data[ $player_id ] = $player;\n\t\t\t}\n\t\t}\n\n\t\tsp_get_template(\n\t\t\t'event-performance-table.php',\n\t\t\tarray(\n\t\t\t\t'scrollable'      => $scrollable,\n\t\t\t\t'sortable'        => $sortable,\n\t\t\t\t'show_players'    => $show_players,\n\t\t\t\t'show_numbers'    => $show_numbers,\n\t\t\t\t'show_minutes'    => $show_minutes,\n\t\t\t\t'show_total'      => $show_total,\n\t\t\t\t'caption'         => esc_attr__( 'Box Score', 'sportspress' ),\n\t\t\t\t'labels'          => $labels,\n\t\t\t\t'formats'         => $formats,\n\t\t\t\t'mode'            => $mode,\n\t\t\t\t'data'            => $data,\n\t\t\t\t'event'           => $event,\n\t\t\t\t'stars'           => $stars,\n\t\t\t\t'link_posts'      => $link_posts,\n\t\t\t\t'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,\n\t\t\t\t'primary'         => 'primary' == $total ? $primary : null,\n\t\t\t)\n\t\t);\n\t} else {\n\t\t// Prepare for offense and defense sections\n\t\tif ( -1 != $sections ) {\n\n\t\t\t// Determine order of sections\n\t\t\tif ( 1 == $sections ) {\n\t\t\t\t$section_order = array(\n\t\t\t\t\t1 => esc_attr__( 'Defense', 'sportspress' ),\n\t\t\t\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$section_order = array( esc_attr__( 'Offense', 'sportspress' ), esc_attr__( 'Defense', 'sportspress' ) );\n\t\t\t}\n\n\t\t\t// Initialize labels\n\t\t\t$selected = $labels;\n\t\t\t$labels   = array( array(), array() );\n\n\t\t\t// Add positions if applicable\n\t\t\tif ( $show_position ) {\n\t\t\t\t$labels[0]['position'] = $labels[1]['position'] = esc_attr__( 'Position', 'sportspress' );\n\t\t\t}\n\n\t\t\t// Get labels by section\n\t\t\tforeach ( $columns as $column ) :\n\t\t\t\tif ( ! array_key_exists( $column->post_name, $selected ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$section = get_post_meta( $column->ID, 'sp_section', true );\n\t\t\t\tif ( '' === $section ) {\n\t\t\t\t\t$section = -1;\n\t\t\t\t}\n\t\t\t\tswitch ( $section ) :\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$labels[1][ $column->post_name ] = $column->post_title;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t$labels[0][ $column->post_name ] = $column->post_title;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$labels[0][ $column->post_name ] = $column->post_title;\n\t\t\t\t\t\t$labels[1][ $column->post_name ] = $column->post_title;\n\t\t\t\tendswitch;\n\t\t\tendforeach;\n\t\t}\n\n\t\tforeach ( $teams as $index => $team_id ) {\n\t\t\tif ( -1 == $team_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get results for players in the team\n\t\t\t$players     = sp_array_between( (array) get_post_meta( $id, 'sp_player', false ), 0, $index );\n\t\t\t$has_players = sizeof( $players ) > 1;\n\n\t\t\t$players = apply_filters( 'sportspress_event_performance_split_team_players', $players );\n\n\t\t\t$show_team_players = $show_players && $has_players;\n\n\t\t\tif ( ! $show_team_players && ! $show_staff && ! $show_total ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $show_team_players || $show_total ) {\n\t\t\t\tif ( -1 != $sections ) {\n\n\t\t\t\t\t$data = array();\n\n\t\t\t\t\t$offense = (array) get_post_meta( $id, 'sp_offense', false );\n\t\t\t\t\t$defense = (array) get_post_meta( $id, 'sp_defense', false );\n\n\t\t\t\t\tif ( sizeof( $offense ) || sizeof( $defense ) ) {\n\t\t\t\t\t\t// Get results for offensive players in the team\n\t\t\t\t\t\t$offense = sp_array_between( $offense, 0, $index );\n\t\t\t\t\t\t$data[0] = sp_array_combine( $offense, sp_array_value( $performance, $team_id, array() ) );\n\n\t\t\t\t\t\t// Get results for defensive players in the team\n\t\t\t\t\t\t$defense = sp_array_between( $defense, 0, $index );\n\t\t\t\t\t\t$data[1] = sp_array_combine( $defense, sp_array_value( $performance, $team_id, array() ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Get results for all players in the team\n\t\t\t\t\t\t$players = sp_array_between( (array) get_post_meta( $id, 'sp_player', false ), 0, $index );\n\t\t\t\t\t\t$data[0] = $data[1] = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$s = 0;\n\n\t\t\t\t\tforeach ( $section_order as $section_id => $section_label ) {\n\t\t\t\t\t\tif ( sizeof( $data[ $section_id ] ) ) {\n\t\t\t\t\t\t\tif ( 1 == $section_id ) {\n\t\t\t\t\t\t\t\t$order = (array) get_post_meta( $id, 'sp_order', true );\n\t\t\t\t\t\t\t\tif ( is_array( $order ) && sizeof( $order ) ) {\n\t\t\t\t\t\t\t\t\t$player_order = sp_array_value( $order, $team_id, array() );\n\t\t\t\t\t\t\t\t\tif ( is_array( $player_order ) && sizeof( $player_order ) ) {\n\t\t\t\t\t\t\t\t\t\t$data[1] = sp_array_combine( $player_order, $data[1], true );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsp_get_template(\n\t\t\t\t\t\t\t\t'event-performance-table.php',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'              => $id,\n\t\t\t\t\t\t\t\t\t'index'           => $index,\n\t\t\t\t\t\t\t\t\t'section'         => $section_id,\n\t\t\t\t\t\t\t\t\t'section_label'   => $section_label,\n\t\t\t\t\t\t\t\t\t'scrollable'      => $scrollable,\n\t\t\t\t\t\t\t\t\t'sortable'        => $sortable,\n\t\t\t\t\t\t\t\t\t'show_players'    => $show_team_players,\n\t\t\t\t\t\t\t\t\t'show_numbers'    => $show_numbers,\n\t\t\t\t\t\t\t\t\t'show_minutes'    => $show_minutes,\n\t\t\t\t\t\t\t\t\t'show_total'      => $show_total,\n\t\t\t\t\t\t\t\t\t'caption'         => 0 == $s && $team_id ? sp_team_short_name( $team_id ) : null,\n\t\t\t\t\t\t\t\t\t'labels'          => $labels[ $section_id ],\n\t\t\t\t\t\t\t\t\t'formats'         => $formats,\n\t\t\t\t\t\t\t\t\t'mode'            => $mode,\n\t\t\t\t\t\t\t\t\t'data'            => $data[ $section_id ],\n\t\t\t\t\t\t\t\t\t'event'           => $event,\n\t\t\t\t\t\t\t\t\t'stars'           => $stars,\n\t\t\t\t\t\t\t\t\t'link_posts'      => $link_posts,\n\t\t\t\t\t\t\t\t\t'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,\n\t\t\t\t\t\t\t\t\t'primary'         => 'primary' == $total ? $primary : null,\n\t\t\t\t\t\t\t\t\t'class'           => 'sp-template-event-performance-team-' . $index . ' sp-template-event-performance-section sp-template-event-performance-section-' . $section_id . ' sp-template-event-performance-team-' . $index . '-section-' . $section_id,\n\t\t\t\t\t\t\t\t\t'show_staff'      => $show_staff,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$s++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( 0 < $team_id ) {\n\t\t\t\t\t\t$data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );\n\t\t\t\t\t} elseif ( 0 == $team_id ) {\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\tforeach ( $players as $player_id ) {\n\t\t\t\t\t\t\tif ( isset( $performance[ $player_id ][ $player_id ] ) ) {\n\t\t\t\t\t\t\t\t$data[ $player_id ] = $performance[ $player_id ][ $player_id ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$data = sp_array_value( array_values( $performance ), $index );\n\t\t\t\t\t}\n\n\t\t\t\t\tsp_get_template(\n\t\t\t\t\t\t'event-performance-table.php',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id'              => $id,\n\t\t\t\t\t\t\t'index'           => $index,\n\t\t\t\t\t\t\t'scrollable'      => $scrollable,\n\t\t\t\t\t\t\t'sortable'        => $sortable,\n\t\t\t\t\t\t\t'show_players'    => $show_team_players,\n\t\t\t\t\t\t\t'show_staff'      => $show_staff,\n\t\t\t\t\t\t\t'show_numbers'    => $show_numbers,\n\t\t\t\t\t\t\t'show_minutes'    => $show_minutes,\n\t\t\t\t\t\t\t'show_total'      => $show_total,\n\t\t\t\t\t\t\t'caption'         => $team_id ? sp_team_short_name( $team_id ) : null,\n\t\t\t\t\t\t\t'labels'          => $labels,\n\t\t\t\t\t\t\t'formats'         => $formats,\n\t\t\t\t\t\t\t'mode'            => $mode,\n\t\t\t\t\t\t\t'data'            => $data,\n\t\t\t\t\t\t\t'event'           => $event,\n\t\t\t\t\t\t\t'stars'           => $stars,\n\t\t\t\t\t\t\t'link_posts'      => $link_posts,\n\t\t\t\t\t\t\t'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,\n\t\t\t\t\t\t\t'primary'         => 'primary' == $total ? $primary : null,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t?>\n\t\t<?php\n\t}\n\n\tdo_action( 'sportspress_event_performance' );\n\n\t$content = ob_get_clean();\n\n\t$content = trim( $content );\n\n\tif ( ! empty( $content ) ) :\n\t\t?>\n\t\t<div class=\"sp-event-performance-tables sp-event-performance-teams\">\n\t\t\t<?php echo wp_kses_post( $content ); ?>\n\t\t</div><!-- .sp-event-performance-tables -->\n\t\t<?php\n\tendif;\nendif;\n"
  },
  {
    "path": "templates/event-results.php",
    "content": "<?php\n/**\n * Event Results\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.1\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_event_show_results', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$event  = new SP_Event( $id );\n$status = $event->status();\n\nif ( 'results' != $status ) {\n\treturn;\n}\n\nif ( ! isset( $caption ) ) {\n\t$caption = esc_attr__( 'Results', 'sportspress' );\n}\n\n// Get event result data\n$data = $event->results();\n\n// The first row should be column labels\n$labels = $data[0];\n\n// Remove the first row to leave us with the actual data\nunset( $data[0] );\n\n$data = array_filter( $data );\n\nif ( empty( $data ) ) {\n\treturn false;\n}\n\n$scrollable    = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;\n$link_teams    = get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false;\n$show_outcomes = array_key_exists( 'outcome', $labels );\n\n// Initialize\n$output     = '';\n$table_rows = '';\n$i          = 0;\n\n// Reverse teams order if the option \"Events > Teams > Order > Reverse order\" is enabled.\n$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;\nif ( $reverse_teams ) {\n\t$data = array_reverse( $data, true );\n}\n\nforeach ( $data as $team_id => $result ) :\n\tif ( $show_outcomes ) :\n\t\t$outcomes       = array();\n\t\t$result_outcome = sp_array_value( $result, 'outcome' );\n\t\tif ( ! is_array( $result_outcome ) ) :\n\t\t\t$outcomes = array( '&mdash;' );\n\t\telse :\n\t\t\tforeach ( $result_outcome as $outcome ) :\n\t\t\t\t$the_outcome = get_page_by_path( $outcome, OBJECT, 'sp_outcome' );\n\t\t\t\tif ( is_object( $the_outcome ) ) :\n\t\t\t\t\t$outcomes[] = $the_outcome->post_title;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\tendif;\n\tendif;\n\n\tunset( $result['outcome'] );\n\n\t$table_rows .= '<tr class=\"' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '\">';\n\n\t$team_name = sp_team_short_name( $team_id );\n\n\tif ( $link_teams && sp_post_exists( $team_id ) ) :\n\t\t$team_name = '<a href=\"' . get_post_permalink( $team_id ) . '\">' . $team_name . '</a>';\n\tendif;\n\n\t$table_rows .= '<td class=\"data-name\">' . $team_name . '</td>';\n\n\tforeach ( $labels as $key => $label ) :\n\t\tif ( in_array( $key, array( 'name', 'outcome' ) ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( array_key_exists( $key, $result ) && $result[ $key ] != '' ) :\n\t\t\t$value = $result[ $key ];\n\t\telse :\n\t\t\t$value = apply_filters( 'sportspress_event_empty_result_string', '&mdash;' );\n\t\tendif;\n\t\t$table_rows .= '<td class=\"data-' . $key . '\">' . $value . '</td>';\n\tendforeach;\n\n\tif ( $show_outcomes ) :\n\t\t$table_rows .= '<td class=\"data-outcome\">' . implode( ', ', $outcomes ) . '</td>';\n\tendif;\n\n\t$table_rows .= '</tr>';\n\n\t$i++;\nendforeach;\n\nif ( empty( $table_rows ) ) :\n\n\treturn false;\n\nelse :\n\n\t$output .= '<h4 class=\"sp-table-caption\">' . $caption . '</h4>';\n\n\t$output .= '<div class=\"sp-table-wrapper\">' .\n\t\t'<table class=\"sp-event-results sp-data-table' . ( $scrollable ? ' sp-scrollable-table' : '' ) . '\"><thead>' .\n\t\t'<th class=\"data-name\">' . esc_attr__( 'Team', 'sportspress' ) . '</th>';\n\tforeach ( $labels as $key => $label ) :\n\t\t$output .= '<th class=\"data-' . $key . '\">' . $label . '</th>';\n\tendforeach;\n\t$output .= '</tr>' . '</thead>' . '<tbody>';\n\t$output .= $table_rows;\n\t$output .= '</tbody>' . '</table>' . '</div>';\n\nendif;\n?>\n<div class=\"sp-template sp-template-event-results\">\n\t<?php echo wp_kses_post( $output ); ?>\n</div>\n"
  },
  {
    "path": "templates/event-staff.php",
    "content": "<?php\n/**\n * Event Staff\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'id'         => get_the_ID(),\n\t'index'      => 0,\n\t'link_posts' => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false,\n);\n\n$staffs = array_filter( sp_array_between( (array) get_post_meta( $id, 'sp_staff', false ), 0, $index ) );\n\nif ( ! $staffs ) {\n\treturn;\n}\n\nextract( $defaults, EXTR_SKIP );\n?>\n<div class=\"sp-template sp-template-event-staff\">\n\t<p class=\"sp-event-staff\">\n\t<?php\n\tforeach ( $staffs as $staff_id ) :\n\n\t\tif ( ! $staff_id ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$name = get_the_title( $staff_id );\n\n\t\tif ( ! $name ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$staff = new SP_Staff( $staff_id );\n\n\t\t$roles = $staff->roles();\n\t\tif ( ! empty( $roles ) ) :\n\t\t\t$roles = wp_list_pluck( $roles, 'name' );\n\t\t\techo wp_kses_post( implode( '<span class=\"sp-staff-role-delimiter\">/</span>', $roles ) );\n\t\telse :\n\t\t\tesc_attr_e( 'Staff', 'sportspress' );\n\t\tendif;\n\n\t\techo ': ';\n\n\t\tif ( $link_posts ) :\n\t\t\t$permalink = get_post_permalink( $staff_id );\n\t\t\t$name      = '<a href=\"' . $permalink . '\">' . $name . '</a>';\n\t\tendif;\n\n\t\techo wp_kses_post( $name ) . '<br>';\n\n\tendforeach;\n\t?>\n\t</p>\n</div>\n"
  },
  {
    "path": "templates/event-venue.php",
    "content": "<?php\n/**\n * Event Venue\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.22\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_event_show_venue', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$venues = get_the_terms( $id, 'sp_venue' );\n\nif ( ! $venues ) {\n\treturn;\n}\n\n$show_maps   = get_option( 'sportspress_event_show_maps', 'yes' ) == 'yes' ? true : false;\n$link_venues = get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false;\n\nforeach ( $venues as $venue ) :\n\t$t_id = $venue->term_id;\n\t$meta = get_option( \"taxonomy_$t_id\" );\n\n\t$name = $venue->name;\n\tif ( $link_venues ) {\n\t\t$name = '<a href=\"' . get_term_link( $t_id, 'sp_venue' ) . '\">' . $name . '</a>';\n\t}\n\n\t$address = sp_array_value( $meta, 'sp_address', null );\n\tif ( !is_null( $address ) ) {\n\t\t$address = urlencode( $address );\n\t}\n\t?>\n\t<div class=\"sp-template sp-template-event-venue\">\n\t\t<h4 class=\"sp-table-caption\"><?php esc_attr_e( 'Venue', 'sportspress' ); ?></h4>\n\t\t<table class=\"sp-data-table sp-event-venue\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th><?php echo wp_kses_post( $name ); ?></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<?php if ( $show_maps ) : ?>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr class=\"sp-event-venue-map-row\">\n\t\t\t\t\t\t<td><?php sp_get_template( 'venue-map.php', array( 'meta' => $meta ) ); ?></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<?php if ( $address != null ) { ?>\n\t\t\t\t\t\t<tr class=\"sp-event-venue-address-row\">\n\t\t\t\t\t\t\t<td><?php echo wp_kses_post( urldecode( $address ) ); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</tbody>\n\t\t\t<?php endif; ?>\n\t\t</table>\n\t</div>\n\t<?php\nendforeach;\n?>\n"
  },
  {
    "path": "templates/event-video.php",
    "content": "<?php\n/**\n * Event Video\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     1.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$video_url = esc_url( get_post_meta( $id, 'sp_video', true ) );\nif ( $video_url ) :\n\t?>\n\t<div class=\"sp-template sp-template-event-video sp-event-video\">\n\t\t<h4 class=\"sp-table-caption\"><?php esc_attr_e( 'Video', 'sportspress' ); ?></h4>\n\t\t<?php\n\t\tglobal $wp_embed;\n\t\techo $wp_embed->autoembed( $video_url ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t?>\n\t</div>\n\t<?php\nendif;\n?>\n"
  },
  {
    "path": "templates/league-table.php",
    "content": "<?php\n/**\n * League Table\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'id'                   => get_the_ID(),\n\t'number'               => -1,\n\t'columns'              => null,\n\t'highlight'            => null,\n\t'show_full_table_link' => false,\n\t'title'                => false,\n\t'show_title'           => get_option( 'sportspress_table_show_title', 'yes' ) == 'yes' ? true : false,\n\t'show_team_logo'       => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,\n\t'link_posts'           => null,\n\t'responsive'           => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false,\n\t'sortable'             => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,\n\t'scrollable'           => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,\n\t'paginated'            => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false,\n\t'rows'                 => get_option( 'sportspress_table_rows', 10 ),\n);\n\nextract( $defaults, EXTR_SKIP );\n\nif ( ! isset( $link_posts ) ) {\n\tif ( 'player' === sp_get_post_mode( $id ) ) {\n\t\t$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;\n\t} else {\n\t\t$link_posts = get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false;\n\t}\n}\n\nif ( ! isset( $highlight ) ) {\n\t$highlight = get_post_meta( $id, 'sp_highlight', true );\n}\n\n$table = new SP_League_Table( $id );\n\nif ( $show_title && false === $title && $id ) :\n\t$caption = $table->caption;\n\tif ( $caption ) {\n\t\t$title = $caption;\n\t} else {\n\t\t$title = get_the_title( $id );\n\t}\nendif;\n\n// Check if we have event status sent from shortcode\nif ( isset( $show_published_events ) ) {\n\t$table->show_published_events = $show_published_events;\n}\n\nif ( isset( $show_future_events ) ) {\n\t$table->show_future_events = $show_future_events;\n}\n\n// Create a unique identifier based on the current time in microseconds\n$identifier = uniqid( 'table_' );\n\n$output = '';\n\nif ( $title ) {\n\t$output .= '<h4 class=\"sp-table-caption\">' . $title . '</h4>';\n}\n\n$output .= '<div class=\"sp-table-wrapper\">';\n\n$output .= '<table class=\"sp-league-table sp-league-table-' . ( $id ) . ' sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ) . ( $responsive ? ' sp-responsive-table ' . $identifier : '' ) . ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '\" data-sp-rows=\"' . $rows . '\">' . '<thead>' . '<tr>';\n\n$data = $table->data();\n\n// The first row should be column labels\n$labels = $data[0];\n// If responsive tables are enabled then load the inline css code\nif ( true == $responsive ) {\n\t// sportspress_responsive_tables_css( $identifier );\n}\n// Remove the first row to leave us with the actual data\nunset( $data[0] );\n\nif ( $columns === null ) {\n\t$columns = get_post_meta( $id, 'sp_columns', true );\n}\n\nif ( null !== $columns && ! is_array( $columns ) ) {\n\t$columns = explode( ',', $columns );\n}\n\n$output .= '<th class=\"data-rank\">' . esc_attr__( 'Pos', 'sportspress' ) . '</th>';\n\nforeach ( $labels as $key => $label ) :\n\tif ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) {\n\t\t$output .= '<th class=\"data-' . $key . '\">' . $label . '</th>';\n\t}\nendforeach;\n\n$output .= '</tr>' . '</thead>' . '<tbody>';\n\n$i     = 0;\n$start = 0;\n\nif ( intval( $number ) > 0 ) :\n\t$limit = $number;\n\n\t// Trim table to center around highlighted team\n\tif ( $highlight && sizeof( $data ) > $limit && array_key_exists( $highlight, $data ) ) :\n\n\t\t// Number of teams in the table\n\t\t$size = sizeof( $data );\n\n\t\t// Position of highlighted team in the table\n\t\t$key = array_search( $highlight, array_keys( $data ) );\n\n\t\t// Get starting position\n\t\t$start = $key - ceil( $limit / 2 ) + 1;\n\t\tif ( $start < 0 ) {\n\t\t\t$start = 0;\n\t\t}\n\n\t\t// Trim table using starting position\n\t\t$trimmed = array_slice( $data, $start, $limit, true );\n\n\t\t// Move starting position if we are too far down the table\n\t\tif ( sizeof( $trimmed ) < $limit && sizeof( $trimmed ) < $size ) :\n\t\t\t$offset = $limit - sizeof( $trimmed );\n\t\t\t$start -= $offset;\n\t\t\tif ( $start < 0 ) {\n\t\t\t\t$start = 0;\n\t\t\t}\n\t\t\t$trimmed = array_slice( $data, $start, $limit, true );\n\t\tendif;\n\n\t\t// Replace data\n\t\t$data = $trimmed;\n\tendif;\nendif;\n\n// Loop through the teams\nforeach ( $data as $team_id => $row ) :\n\n\tif ( isset( $limit ) && $i >= $limit ) {\n\t\tcontinue;\n\t}\n\n\t$name = sp_array_value( $row, 'name', null );\n\tif ( ! $name ) {\n\t\tcontinue;\n\t}\n\n\t// Generate tags for highlighted team\n\t$tr_class = $td_class = '';\n\tif ( $highlight == $team_id ) :\n\t\t$tr_class = ' highlighted';\n\t\t$td_class = ' sp-highlight';\n\tendif;\n\n\t$output .= '<tr class=\"' . ( $i % 2 == 0 ? 'odd' : 'even' ) . $tr_class . ' sp-row-no-' . $i . '\">';\n\n\t// Rank\n\t$output .= '<td class=\"data-rank' . $td_class . '\" data-label=\"' . $labels['pos'] . '\">' . sp_array_value( $row, 'pos' ) . '</td>';\n\n\t$name_class = '';\n\n\tif ( $show_team_logo ) :\n\t\tif ( has_post_thumbnail( $team_id ) ) :\n\t\t\t$logo        = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon' );\n\t\t\t$name        = '<span class=\"team-logo\">' . $logo . '</span>' . $name;\n\t\t\t$name_class .= ' has-logo';\n\t\tendif;\n\tendif;\n\n\tif ( $link_posts ) :\n\t\t$permalink = get_post_permalink( $team_id );\n\t\t$name      = '<a href=\"' . $permalink . '\">' . $name . '</a>';\n\tendif;\n\n\t$output .= '<td class=\"data-name' . $name_class . $td_class . '\" data-label=\"' . $labels['name'] . '\">' . $name . '</td>';\n\n\tforeach ( $labels as $key => $value ) :\n\t\tif ( in_array( $key, array( 'pos', 'name' ) ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( ! is_array( $columns ) || in_array( $key, $columns ) ) {\n\t\t\t$output .= '<td class=\"data-' . $key . $td_class . '\" data-label=\"' . $labels[ $key ] . '\">' . sp_array_value( $row, $key, '&mdash;' ) . '</td>';\n\t\t}\n\tendforeach;\n\n\t$output .= '</tr>';\n\n\t$i++;\n\t$start++;\n\nendforeach;\n\n$output .= '</tbody>' . '</table>';\n\n$output .= '</div>';\n\nif ( $show_full_table_link ) {\n\t$output .= '<div class=\"sp-league-table-link sp-view-all-link\"><a href=\"' . get_permalink( $id ) . '\">' . esc_attr__( 'View full table', 'sportspress' ) . '</a></div>';\n}\n?>\n<div class=\"sp-template sp-template-league-table\">\n\t<?php echo wp_kses_post( $output ); ?>\n</div>\n"
  },
  {
    "path": "templates/official-details.php",
    "content": "<?php\n/**\n * Official Details\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_official_show_details', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$defaults = array(\n\t'show_number'            => get_option( 'sportspress_official_show_number', 'no' ) == 'yes' ? true : false,\n\t'show_name'              => get_option( 'sportspress_official_show_name', 'no' ) == 'yes' ? true : false,\n\t'show_nationality'       => get_option( 'sportspress_official_show_nationality', 'yes' ) == 'yes' ? true : false,\n\t'show_positions'         => get_option( 'sportspress_official_show_positions', 'yes' ) == 'yes' ? true : false,\n\t'show_current_teams'     => get_option( 'sportspress_official_show_current_teams', 'yes' ) == 'yes' ? true : false,\n\t'show_past_teams'        => get_option( 'sportspress_official_show_past_teams', 'yes' ) == 'yes' ? true : false,\n\t'show_leagues'           => get_option( 'sportspress_official_show_leagues', 'no' ) == 'yes' ? true : false,\n\t'show_seasons'           => get_option( 'sportspress_official_show_seasons', 'no' ) == 'yes' ? true : false,\n\t'show_nationality_flags' => get_option( 'sportspress_official_show_flags', 'yes' ) == 'yes' ? true : false,\n\t'link_teams'             => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n$countries = SP()->countries->countries;\n\n$official = new SP_Official( $id );\n\n$metrics_before = $official->metrics( true );\n$metrics_after  = $official->metrics( false );\n\n$common = array();\n\nif ( $show_number ) :\n\t$common['#'] = $official->number;\nendif;\n\nif ( $show_name ) :\n\t$common[ esc_attr__( 'Name', 'sportspress' ) ] = $official->post->post_title;\nendif;\n\nif ( $show_nationality ) :\n\t$nationalities = $official->nationalities();\n\tif ( $nationalities && is_array( $nationalities ) ) :\n\t\t$values = array();\n\t\tforeach ( $nationalities as $nationality ) :\n\t\t\t$country_name = sp_array_value( $countries, $nationality, null );\n\t\t\t$values[]     = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '&mdash;';\n\t\tendforeach;\n\t\t$common[ esc_attr__( 'Nationality', 'sportspress' ) ] = implode( '<br>', $values );\n\tendif;\nendif;\n\nif ( $show_positions ) :\n\t$positions = $official->positions();\n\tif ( $positions && is_array( $positions ) ) :\n\t\t$position_names = array();\n\t\tforeach ( $positions as $position ) :\n\t\t\t$position_names[] = $position->name;\n\t\tendforeach;\n\t\t$common[ esc_attr__( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );\n\tendif;\nendif;\n\n$data = array_merge( $metrics_before, $common, $metrics_after );\n\nif ( $show_current_teams ) :\n\t$current_teams = $official->current_teams();\n\tif ( $current_teams ) :\n\t\t$teams = array();\n\t\tforeach ( $current_teams as $team ) :\n\t\t\t$team_name = sp_team_short_name( $team );\n\t\t\tif ( $link_teams ) {\n\t\t\t\t$team_name = '<a href=\"' . get_post_permalink( $team ) . '\">' . $team_name . '</a>';\n\t\t\t}\n\t\t\t$teams[] = $team_name;\n\t\tendforeach;\n\t\t$data[ esc_attr__( 'Current Team', 'sportspress' ) ] = implode( ', ', $teams );\n\tendif;\nendif;\n\nif ( $show_past_teams ) :\n\t$past_teams = $official->past_teams();\n\tif ( $past_teams ) :\n\t\t$teams = array();\n\t\tforeach ( $past_teams as $team ) :\n\t\t\t$team_name = sp_team_short_name( $team );\n\t\t\tif ( $link_teams ) {\n\t\t\t\t$team_name = '<a href=\"' . get_post_permalink( $team ) . '\">' . $team_name . '</a>';\n\t\t\t}\n\t\t\t$teams[] = $team_name;\n\t\tendforeach;\n\t\t$data[ esc_attr__( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );\n\tendif;\nendif;\n\nif ( $show_leagues ) :\n\t$leagues = $official->leagues();\n\tif ( $leagues && ! is_wp_error( $leagues ) ) :\n\t\t$terms = array();\n\t\tforeach ( $leagues as $league ) {\n\t\t\t$terms[] = $league->name;\n\t\t}\n\t\t$data[ esc_attr__( 'Leagues', 'sportspress' ) ] = implode( ', ', $terms );\n\tendif;\nendif;\n\nif ( $show_seasons ) :\n\t$seasons = $official->seasons();\n\tif ( $seasons && ! is_wp_error( $seasons ) ) :\n\t\t$terms = array();\n\t\tforeach ( $seasons as $season ) {\n\t\t\t$terms[] = $season->name;\n\t\t}\n\t\t$data[ esc_attr__( 'Seasons', 'sportspress' ) ] = implode( ', ', $terms );\n\tendif;\nendif;\n\n$data = apply_filters( 'sportspress_official_details', $data, $id );\n\nif ( empty( $data ) ) {\n\treturn;\n}\n\n$output = '<div class=\"sp-template sp-template-official-details sp-template-details\"><div class=\"sp-list-wrapper\"><dl class=\"sp-official-details\">';\n\nforeach ( $data as $label => $value ) :\n\n\t$output .= '<dt>' . $label . '</dt><dd>' . $value . '</dd>';\n\nendforeach;\n\n$output .= '</dl></div></div>';\n\necho wp_kses_post( $output );\n"
  },
  {
    "path": "templates/player-details.php",
    "content": "<?php\n/**\n * Player Details\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_player_show_details', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$defaults = array(\n\t'show_number'            => get_option( 'sportspress_player_show_number', 'no' ) == 'yes' ? true : false,\n\t'show_name'              => get_option( 'sportspress_player_show_name', 'no' ) == 'yes' ? true : false,\n\t'show_nationality'       => get_option( 'sportspress_player_show_nationality', 'yes' ) == 'yes' ? true : false,\n\t'show_positions'         => get_option( 'sportspress_player_show_positions', 'yes' ) == 'yes' ? true : false,\n\t'show_current_teams'     => get_option( 'sportspress_player_show_current_teams', 'yes' ) == 'yes' ? true : false,\n\t'show_past_teams'        => get_option( 'sportspress_player_show_past_teams', 'yes' ) == 'yes' ? true : false,\n\t'show_leagues'           => get_option( 'sportspress_player_show_leagues', 'no' ) == 'yes' ? true : false,\n\t'show_seasons'           => get_option( 'sportspress_player_show_seasons', 'no' ) == 'yes' ? true : false,\n\t'show_nationality_flags' => get_option( 'sportspress_player_show_flags', 'yes' ) == 'yes' ? true : false,\n\t'link_teams'             => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n$countries = SP()->countries->countries;\n\n$player = new SP_Player( $id );\n\n$metrics_before = $player->metrics( true );\n$metrics_after  = $player->metrics( false );\n\n$common = array();\n\nif ( $show_number ) :\n\t$common['#'] = $player->number;\nendif;\n\nif ( $show_name ) :\n\t$common[ esc_attr__( 'Name', 'sportspress' ) ] = $player->post->post_title;\nendif;\n\nif ( $show_nationality ) :\n\t$nationalities = $player->nationalities();\n\tif ( $nationalities && is_array( $nationalities ) ) :\n\t\t$values = array();\n\t\tforeach ( $nationalities as $nationality ) :\n\t\t\t$country_name = sp_array_value( $countries, $nationality, null );\n\t\t\t$values[]     = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '&mdash;';\n\t\tendforeach;\n\t\t$common[ esc_attr__( 'Nationality', 'sportspress' ) ] = implode( '<br>', $values );\n\tendif;\nendif;\n\nif ( $show_positions ) :\n\t$positions = $player->positions();\n\tif ( $positions && is_array( $positions ) ) :\n\t\t$position_names = array();\n\t\tforeach ( $positions as $position ) :\n\t\t\t$position_names[] = $position->name;\n\t\tendforeach;\n\t\t$common[ esc_attr__( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );\n\tendif;\nendif;\n\n$data = array_merge( $metrics_before, $common, $metrics_after );\n\nif ( $show_current_teams ) :\n\t$current_teams = array_filter( $player->current_teams() );\n\tif ( $current_teams ) :\n\t\t$teams = array();\n\t\tforeach ( $current_teams as $team ) :\n\t\t\t$team_name = sp_team_short_name( $team );\n\t\t\tif ( $link_teams ) {\n\t\t\t\t$team_name = '<a href=\"' . get_post_permalink( $team ) . '\">' . $team_name . '</a>';\n\t\t\t}\n\t\t\t$teams[] = $team_name;\n\t\tendforeach;\n\t\t$data[ esc_attr__( 'Current Team', 'sportspress' ) ] = implode( ', ', $teams );\n\tendif;\nendif;\n\nif ( $show_past_teams ) :\n\t$past_teams = array_filter( $player->past_teams() );\n\tif ( $past_teams ) :\n\t\t$teams = array();\n\t\tforeach ( $past_teams as $team ) :\n\t\t\t$team_name = sp_team_short_name( $team );\n\t\t\tif ( $link_teams ) {\n\t\t\t\t$team_name = '<a href=\"' . get_post_permalink( $team ) . '\">' . $team_name . '</a>';\n\t\t\t}\n\t\t\t$teams[] = $team_name;\n\t\tendforeach;\n\t\t$data[ esc_attr__( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );\n\tendif;\nendif;\n\nif ( $show_leagues ) :\n\t$leagues = $player->leagues();\n\tif ( $leagues && ! is_wp_error( $leagues ) ) :\n\t\t$terms = array();\n\t\tforeach ( $leagues as $league ) {\n\t\t\t$terms[] = $league->name;\n\t\t}\n\t\t$data[ esc_attr__( 'Leagues', 'sportspress' ) ] = implode( ', ', $terms );\n\tendif;\nendif;\n\nif ( $show_seasons ) :\n\t$seasons = $player->seasons();\n\tif ( $seasons && ! is_wp_error( $seasons ) ) :\n\t\t$terms = array();\n\t\tforeach ( $seasons as $season ) {\n\t\t\t$terms[] = $season->name;\n\t\t}\n\t\t$data[ esc_attr__( 'Seasons', 'sportspress' ) ] = implode( ', ', $terms );\n\tendif;\nendif;\n\n$data = apply_filters( 'sportspress_player_details', $data, $id );\n\nif ( empty( $data ) ) {\n\treturn;\n}\n\n$output = '<div class=\"sp-template sp-template-player-details sp-template-details\"><div class=\"sp-list-wrapper\"><dl class=\"sp-player-details\">';\n\nforeach ( $data as $label => $value ) :\n\n\t$output .= '<dt>' . $label . '</dt><dd>' . $value . '</dd>';\n\nendforeach;\n\n$output .= '</dl></div></div>';\n\necho wp_kses_post( $output );\n"
  },
  {
    "path": "templates/player-events.php",
    "content": "<?php\n/**\n * Player Events\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.2\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$format = get_option( 'sportspress_player_events_format', 'blocks' );\nif ( 'calendar' === $format ) {\n\tsp_get_template( 'event-calendar.php', array( 'player' => $id ) );\n} elseif ( 'list' === $format ) {\n\t$args = array(\n\t\t'player'       => $id,\n\t\t'title_format' => 'homeaway',\n\t\t'time_format'  => 'separate',\n\t\t'columns'      => array( 'event', 'time', 'results' ),\n\t\t'order'        => 'DESC',\n\t);\n\t$args = apply_filters( 'sp_player_events_list_args', $args );\n\tsp_get_template( 'event-list.php', $args );\n} else {\n\tsp_get_template( 'event-fixtures-results.php', array( 'player' => $id ) );\n}\n"
  },
  {
    "path": "templates/player-gallery-thumbnail.php",
    "content": "<?php\n/**\n * Player Gallery Thumbnail\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.2\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'id'         => null,\n\t'icontag'    => 'dt',\n\t'captiontag' => 'dd',\n\t'caption'    => null,\n\t'size'       => 'sportspress-crop-medium',\n\t'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n// Add player number to caption if available\n$player_number = get_post_meta( $id, 'sp_number', true );\nif ( '' !== $player_number ) {\n\t$caption = '<strong>' . $player_number . '</strong> ' . $caption;\n}\n\n// Add caption tag if has caption\nif ( $captiontag && $caption ) {\n\t$caption = '<' . $captiontag . ' class=\"wp-caption-text gallery-caption small-3 columns' . ( '' !== $player_number ? ' has-number' : '' ) . '\">' . wptexturize( $caption ) . '</' . $captiontag . '>';\n}\n\nif ( $link_posts ) {\n\t$caption = '<a href=\"' . get_permalink( $id ) . '\">' . $caption . '</a>';\n}\n\nif ( has_post_thumbnail( $id ) ) {\n\t$thumbnail = get_the_post_thumbnail( $id, $size );\n} else {\n\t$thumbnail = '<img width=\"150\" height=\"150\" src=\"//www.gravatar.com/avatar/?s=150&d=mm&f=y\" class=\"attachment-thumbnail wp-post-image\">';\n}\n\necho wp_kses_post( \"<{$itemtag} class='gallery-item'>\" );\necho wp_kses_post( \"\n\t<{$icontag} class='gallery-icon portrait'>\"\n\t\t. '<a href=\"' . get_permalink( $id ) . '\">' . $thumbnail . '</a>'\n\t. \"</{$icontag}>\" );\necho wp_kses_post( $caption );\necho wp_kses_post( \"</{$itemtag}>\" );\n"
  },
  {
    "path": "templates/player-gallery.php",
    "content": "<?php\n/**\n * Player Gallery\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$html5    = current_theme_supports( 'html5', 'gallery' );\n$defaults = array(\n\t'id'                    => get_the_ID(),\n\t'title'                 => false,\n\t'number'                => -1,\n\t'grouping'              => null,\n\t'orderby'               => 'default',\n\t'order'                 => 'ASC',\n\t'itemtag'               => 'dl',\n\t'icontag'               => 'dt',\n\t'captiontag'            => 'dd',\n\t'grouptag'              => 'h4',\n\t'columns'               => 3,\n\t'size'                  => 'sportspress-crop-medium',\n\t'show_all_players_link' => false,\n\t'link_posts'            => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n// Determine number of players to display\nif ( -1 === $number ) :\n\t$number = (int) get_post_meta( $id, 'sp_number', true );\n\tif ( $number <= 0 ) {\n\t\t$number = -1;\n\t}\nendif;\n\n$itemtag    = tag_escape( $itemtag );\n$captiontag = tag_escape( $captiontag );\n$icontag    = tag_escape( $icontag );\n$valid_tags = wp_kses_allowed_html( 'post' );\nif ( ! isset( $valid_tags[ $itemtag ] ) ) {\n\t$itemtag = 'dl';\n}\nif ( ! isset( $valid_tags[ $captiontag ] ) ) {\n\t$captiontag = 'dd';\n}\nif ( ! isset( $valid_tags[ $icontag ] ) ) {\n\t$icontag = 'dt';\n}\n\n$columns   = intval( $columns );\n$itemwidth = $columns > 0 ? floor( 100 / $columns ) : 100;\n$size      = $size;\n$float     = is_rtl() ? 'right' : 'left';\n\n$selector = 'sp-player-gallery-' . $id;\n\n$list = new SP_Player_List( $id );\n$data = $list->data();\n\n// Remove the first row to leave us with the actual data\nunset( $data[0] );\n\nif ( $grouping === null || $grouping === 'default' ) :\n\t$grouping = $list->grouping;\nendif;\n\nif ( $orderby == 'default' ) :\n\t$orderby = $list->orderby;\n\t$order   = $list->order;\nelseif ( $orderby == 'rand' ) :\n\tuasort( $data, 'sp_sort_random' );\nelse :\n\t$list->priorities = array(\n\t\tarray(\n\t\t\t'key'   => $orderby,\n\t\t\t'order' => $order,\n\t\t),\n\t);\n\tuasort( $data, array( $list, 'sort' ) );\nendif;\n\nif ( $title ) {\n\techo '<h4 class=\"sp-table-caption\">' . wp_kses_post( $title ) . '</h4>';\n}\n\n$gallery_style = $gallery_div = '';\nif ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {\n\t$gallery_style = \"\n\t<style type='text/css'>\n\t\t#{$selector} {\n\t\t\tmargin: auto;\n\t\t}\n\t\t#{$selector} .gallery-item {\n\t\t\tfloat: {$float};\n\t\t\tmargin-top: 10px;\n\t\t\ttext-align: center;\n\t\t\twidth: {$itemwidth}%;\n\t\t}\n\t\t#{$selector} img {\n\t\t\tborder: 2px solid #cfcfcf;\n\t\t}\n\t\t#{$selector} .gallery-caption {\n\t\t\tmargin-left: 0;\n\t\t}\n\t\t/* see gallery_shortcode() in wp-includes/media.php */\n\t</style>\";\n}\n$size_class  = sanitize_html_class( $size );\n$gallery_div = \"<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>\";\necho wp_kses_post( apply_filters( 'gallery_style', $gallery_style . \"\\n\\t\\t\" ) );\n?>\n<?php echo wp_kses_post( $gallery_div ); ?>\n\t<?php\n\tif ( intval( $number ) > 0 ) {\n\t\t$limit = $number;\n\t}\n\n\tif ( $grouping === 'position' ) :\n\t\t$groups = get_terms(\n\t\t\t'sp_position',\n\t\t\tarray(\n\t\t\t\t'orderby'    => 'meta_value_num',\n\t\t\t\t'meta_query' => array(\n\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\telse :\n\t\t$group          = new stdClass();\n\t\t$group->term_id = null;\n\t\t$group->name    = null;\n\t\t$group->slug    = null;\n\t\t$groups         = array( $group );\n\tendif;\n\n\t$j = 0;\n\n\tforeach ( $groups as $group ) :\n\t\t$i = 0;\n\n\t\t$gallery = '';\n\n\t\tif ( ! empty( $group->name ) ) :\n\t\t\t$gallery .= '<a name=\"group-' . $group->slug . '\" id=\"group-' . $group->slug . '\"></a>';\n\t\t\t$gallery .= '<' . $grouptag . ' class=\"sp-gallery-group-name player-group-name player-gallery-group-name\">' . $group->name . '</' . $grouptag . '>';\n\t\tendif;\n\n\t\tforeach ( $data as $player_id => $performance ) :\n\t\t\tif ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ) :\n\n\t\t\t\tif ( isset( $limit ) && $i >= $limit ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$caption = get_the_title( $player_id );\n\t\t\t\t$caption = trim( $caption );\n\n\t\t\t\tob_start();\n\n\t\t\t\tsp_get_template(\n\t\t\t\t\t'player-gallery-thumbnail.php',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'         => $player_id,\n\t\t\t\t\t\t'itemtag'    => $itemtag,\n\t\t\t\t\t\t'icontag'    => $icontag,\n\t\t\t\t\t\t'captiontag' => $captiontag,\n\t\t\t\t\t\t'caption'    => $caption,\n\t\t\t\t\t\t'size'       => $size,\n\t\t\t\t\t\t'link_posts' => $link_posts,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t\t\t\t$gallery .= ob_get_clean();\n\n\t\t\t\t\t\t\t$i++;\n\n\t\tendif;\nendforeach;\n\n\t\t$j++;\n\n\t\tif ( $i === 0 ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\techo '<div class=\"sp-template sp-template-player-gallery sp-template-gallery\">';\n\n\t\techo '<div class=\"sp-player-gallery-wrapper sp-gallery-wrapper\">';\n\n\t\techo wp_kses_post( $gallery );\n\n\t\tif ( ! $html5 && $columns > 0 && ++$i % $columns == 0 ) {\n\t\t\techo '<br style=\"clear: both\" />';\n\t\t}\n\n\t\techo '</div>';\n\n\t\tif ( $show_all_players_link && ( 'position' !== $grouping || $j == count( $groups ) ) ) {\n\t\t\techo '<div class=\"sp-player-gallery-link sp-gallery-link sp-view-all-link\"><a href=\"' . esc_url( get_permalink( $id ) ) . '\">' . esc_attr__( 'View all players', 'sportspress' ) . '</a></div>';\n\t\t}\n\n\t\techo '</div>';\n\n\tendforeach;\n\n\tif ( ! $html5 && $columns > 0 && ++$i % $columns == 0 ) {\n\t\techo '<br style=\"clear: both\" />';\n\t}\n\n\techo \"</div>\\n\";\n\n"
  },
  {
    "path": "templates/player-list.php",
    "content": "<?php\n/**\n * Player List\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'id'                    => get_the_ID(),\n\t'title'                 => false,\n\t'number'                => -1,\n\t'grouptag'              => 'h4',\n\t'columns'               => null,\n\t'grouping'              => null,\n\t'orderby'               => 'default',\n\t'order'                 => 'ASC',\n\t'show_all_players_link' => false,\n\t'show_title'            => get_option( 'sportspress_list_show_title', 'yes' ) == 'yes' ? true : false,\n\t'show_player_photo'     => get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false,\n\t'show_player_flag'      => get_option( 'sportspress_list_show_flags', 'no' ) == 'yes' ? true : false,\n\t'team_format'           => get_option( 'sportspress_list_team_format', 'name' ),\n\t'link_posts'            => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,\n\t'link_teams'            => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,\n\t'responsive'            => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false,\n\t'sortable'              => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,\n\t'scrollable'            => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,\n\t'paginated'             => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false,\n\t'rows'                  => get_option( 'sportspress_list_rows', 10 ),\n\t'leagues'               => null,\n\t'seasons'               => null,\n\t'team'                  => null,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n// Backward compatibility\nif ( isset( $performance ) ) {\n\t$columns = $performance;\n}\n\n// Determine number of players to display\nif ( -1 === $number ) :\n\t$number = (int) get_post_meta( $id, 'sp_number', true );\n\tif ( $number <= 0 ) {\n\t\t$number = -1;\n\t}\nendif;\n\n// Explode into array\nif ( null !== $columns && ! is_array( $columns ) ) {\n\t$columns = explode( ',', $columns );\n}\n\n$list = new SP_Player_List( $id );\nif ( isset( $columns ) && null !== $columns ) :\n\t$list->columns = $columns;\nendif;\n\n$data = apply_filters( 'sportspress_player_list_data', $list->data( false, $leagues, $seasons, $team ), $id );\n\n// The first row should be labels\n$labels = $data[0];\n\n// Create a unique identifier based on the current time in microseconds\n$identifier = uniqid( 'playerlist_' );\n// If responsive tables are enabled then load the inline css code\nif ( true == $responsive ) {\n\t// sportspress_responsive_tables_css( $identifier );\n}\n// Remove the first row and 'head' row to leave us with the actual data\nunset( $data[0] );\n\nif ( $grouping === null || $grouping === 'default' ) :\n\t$grouping = $list->grouping;\nendif;\n\nif ( $orderby == 'default' ) :\n\t$orderby = $list->orderby;\n\t$order   = $list->order;\nelse :\n\t$list->priorities = array(\n\t\tarray(\n\t\t\t'key'   => $orderby,\n\t\t\t'order' => $order,\n\t\t),\n\t);\n\tuasort( $data, array( $list, 'sort' ) );\nendif;\n\n$output = '';\n\nif ( $grouping === 'position' ) :\n\t$groups = get_terms(\n\t\t'sp_position',\n\t\tarray(\n\t\t\t'orderby'    => 'meta_value_num',\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => 'sp_order',\n\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\nelse :\n\tif ( $show_title && false === $title && $id ) :\n\t\t$caption = $list->caption;\n\t\tif ( $caption ) {\n\t\t\t$title = $caption;\n\t\t} else {\n\t\t\t$title = get_the_title( $id );\n\t\t}\n\tendif;\n\tif ( $title ) {\n\t\t$output .= '<' . $grouptag . ' class=\"sp-table-caption\">' . $title . '</' . $grouptag . '>';\n\t}\n\t$group          = new stdClass();\n\t$group->term_id = null;\n\t$group->name    = null;\n\t$group->slug    = null;\n\t$groups         = array( $group );\nendif;\n\nforeach ( $groups as $group ) :\n\t$i = 0;\n\n\tif ( intval( $number ) > 0 ) {\n\t\t$limit = $number;\n\t}\n\n\t$thead = '<thead>' . '<tr>';\n\n\tif ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ) :\n\t\tif ( in_array( $orderby, array( 'number', 'name' ) ) ) :\n\t\t\t$thead .= '<th class=\"data-number\">#</th>';\n\t\telse :\n\t\t\t$thead .= '<th class=\"data-rank\">' . esc_attr__( 'Rank', 'sportspress' ) . '</th>';\n\t\tendif;\n\tendif;\n\n\tforeach ( $labels as $key => $label ) :\n\t\tif ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) ) {\n\t\t\t$thead .= '<th class=\"data-' . $key . '\">' . $label . '</th>';\n\t\t}\n\tendforeach;\n\n\t$thead .= '</tr>' . '</thead>';\n\n\t$tbody = '';\n\n\tforeach ( $data as $player_id => $row ) :\n\t\tif ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ) :\n\n\t\t\tif ( isset( $limit ) && $i >= $limit ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$name = sp_array_value( $row, 'name', null );\n\t\t\tif ( ! $name ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$tbody .= '<tr class=\"' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '\">';\n\n\t\t\t// Rank or number\n\t\t\tif ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ) :\n\t\t\t\tif ( isset( $orderby ) && $orderby != 'number' ) :\n\t\t\t\t\t$tbody .= '<td class=\"data-rank\" data-label=\"' . $labels['number'] . '\">' . ( $i + 1 ) . '</td>';\n\t\t\t\telse :\n\t\t\t\t\t$tbody .= '<td class=\"data-number\" data-label=\"' . $labels['number'] . '\">' . sp_array_value( $row, 'number', '&nbsp;' ) . '</td>';\n\t\t\t\tendif;\n\t\t\t\tendif;\n\n\t\t\t$name_class = '';\n\n\t\t\tif ( $show_player_photo ) :\n\t\t\t\tif ( has_post_thumbnail( $player_id ) ) :\n\t\t\t\t\t$logo        = get_the_post_thumbnail( $player_id, 'sportspress-fit-icon' );\n\t\t\t\t\t$name        = '<span class=\"player-photo\">' . $logo . '</span>' . $name;\n\t\t\t\t\t$name_class .= ' has-photo';\n\t\t\t\tendif;\n\t\t\t\tendif;\n\n\t\t\tif ( $show_player_flag ) :\n\t\t\t\t$player        = new SP_Player( $player_id );\n\t\t\t\t$nationalities = $player->nationalities();\n\t\t\t\tif ( ! empty( $nationalities ) ) :\n\t\t\t\t\tforeach ( $nationalities as $nationality ) :\n\t\t\t\t\t\t$name = '<span class=\"player-flag\">' . sp_flags( $nationality ) . '</span>' . $name;\n\t\t\t\t\tendforeach;\n\t\t\t\t\t$name_class .= ' has-photo';\n\t\t\t\tendif;\n\t\t\t\tendif;\n\n\t\t\tif ( $link_posts ) :\n\t\t\t\t$permalink = get_post_permalink( $player_id );\n\t\t\t\t$name      = '<a href=\"' . $permalink . '\">' . $name . '</a>';\n\t\t\t\tendif;\n\n\t\t\t$tbody .= '<td class=\"data-name' . $name_class . '\" data-label=\"' . $labels['name'] . '\">' . $name . '</td>';\n\n\t\t\tif ( array_key_exists( 'team', $labels ) ) :\n\t\t\t\t$team      = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_current_team', true ) );\n\t\t\t\t$team_name = $team ? sp_team_short_name( $team ) : '-';\n\t\t\t\tif ( $team_format == 'logo' && has_post_thumbnail( $team ) ) {\n\t\t\t\t\t$logo      = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'title' => '' . $team_name . '' ) );\n\t\t\t\t\t$team_name = '<span class=\"team-logo\">' . $logo . '</span>';\n\t\t\t\t}\n\t\t\t\tif ( $link_teams && false !== get_post_status( $team ) ) :\n\t\t\t\t\t$team_name = '<a href=\"' . get_post_permalink( $team ) . '\">' . $team_name . '</a>';\n\t\t\t\tendif;\n\t\t\t\t$tbody .= '<td class=\"data-team\" data-label=\"' . $labels['team'] . '\">' . $team_name . '</td>';\n\t\t\t\tendif;\n\n\t\t\tif ( array_key_exists( 'position', $labels ) ) :\n\t\t\t\t$position = sp_array_value( $row, 'position', null );\n\t\t\t\tif ( null === $position || ! $position ) :\n\t\t\t\t\t$positions = wp_strip_all_tags( get_the_term_list( $player_id, 'sp_position', '', ', ' ) );\n\t\t\t\telse :\n\t\t\t\t\t$position_term = get_term_by( 'id', $position, 'sp_position', ARRAY_A );\n\t\t\t\t\t$positions     = sp_array_value( $position_term, 'name', '&mdash;' );\n\t\t\t\tendif;\n\t\t\t\t$tbody .= '<td class=\"data-position\" data-label=\"' . $labels['position'] . '\">' . $positions . '</td>';\n\t\t\t\tendif;\n\n\t\t\tforeach ( $labels as $key => $value ) :\n\t\t\t\tif ( in_array( $key, array( 'number', 'name', 'team', 'position' ) ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! is_array( $columns ) || in_array( $key, $columns ) ) {\n\t\t\t\t\t$label = $labels[ $key ];\n\t\t\t\t\tif ( preg_match( '/title=\"(.*?)\"/', $value, $new_label ) ) {\n\t\t\t\t\t\t$label = $new_label[1];\n\t\t\t\t\t}\n\t\t\t\t\t$tbody .= '<td class=\"data-' . $key . '\" data-label=\"' . $label . '\">' . sp_array_value( $row, $key, '&mdash;' ) . '</td>';\n\t\t\t\t}\n\t\t\t\tendforeach;\n\n\t\t\t$tbody .= '</tr>';\n\n\t\t\t$i++;\n\n\tendif;\nendforeach;\n\n\tif ( $i === 0 ) {\n\t\tcontinue;\n\t}\n\n\t$output .= '<div class=\"sp-template sp-template-player-list\">';\n\n\tif ( ! empty( $group->name ) ) :\n\t\t$output .= '<a name=\"group-' . $group->slug . '\" id=\"group-' . $group->slug . '\"></a>';\n\t\t$output .= '<' . $grouptag . ' class=\"sp-table-caption player-group-name player-list-group-name\">' . $group->name . '</' . $grouptag . '>';\n\tendif;\n\n\t$output .= '<div class=\"sp-table-wrapper\">' .\n\t\t'<table class=\"sp-player-list sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ) . ( $responsive ? ' sp-responsive-table ' . $identifier : '' ) . ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '\" data-sp-rows=\"' . $rows . '\">';\n\n\t$output .= $thead . '<tbody>';\n\n\t$output .= $tbody;\n\n\t$output .= '</tbody>' . '</table>' . '</div>';\n\n\tif ( $show_all_players_link ) :\n\t\t$output .= '<div class=\"sp-player-list-link sp-view-all-link\"><a href=\"' . get_permalink( $id ) . '\">' . esc_attr__( 'View all players', 'sportspress' ) . '</a></div>';\n\tendif;\n\n\t$output .= '</div>';\nendforeach;\n?>\n<?php\necho wp_kses_post( $output );\n"
  },
  {
    "path": "templates/player-photo.php",
    "content": "<?php\n/**\n * Player Photo\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     1.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_player_show_photo', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\nif ( has_post_thumbnail( $id ) ) :\n\t?>\n\t<div class=\"sp-template sp-template-player-photo sp-template-photo sp-player-photo\">\n\t\t<?php echo get_the_post_thumbnail( $id, 'sportspress-fit-medium' ); ?>\n\t</div>\n\t<?php\nendif;\n"
  },
  {
    "path": "templates/player-selector.php",
    "content": "<?php\n/**\n * Player Dropdown\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.11\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_player_show_selector', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$league_ids = sp_get_the_term_ids( $id, 'sp_league' );\n$season_ids = sp_get_the_term_ids( $id, 'sp_season' );\n$team       = get_post_meta( $id, 'sp_current_team', true );\n\n$args = array(\n\t'post_type'      => 'sp_player',\n\t'numberposts'    => 500,\n\t'posts_per_page' => 500,\n\t'meta_key'       => 'sp_number',\n\t'orderby'        => 'meta_value_num',\n\t'order'          => 'ASC',\n\t'tax_query'      => array(\n\t\t'relation' => 'AND',\n\t),\n);\n\nif ( $league_ids ) :\n\t$args['tax_query'][] = array(\n\t\t'taxonomy' => 'sp_league',\n\t\t'field'    => 'term_id',\n\t\t'terms'    => $league_ids,\n\t);\nendif;\n\nif ( $season_ids ) :\n\t$args['tax_query'][] = array(\n\t\t'taxonomy' => 'sp_season',\n\t\t'field'    => 'term_id',\n\t\t'terms'    => $season_ids,\n\t);\nendif;\n\nif ( $team ) :\n\t$args['meta_query'] = array(\n\t\tarray(\n\t\t\t'key'   => 'sp_current_team',\n\t\t\t'value' => $team,\n\t\t),\n\t);\nendif;\n\n$args = apply_filters( 'sportspress_players_selector_args', $args );\n\n$players = get_posts( $args );\n\n$options = array();\n\nif ( $players && is_array( $players ) ) :\n\tforeach ( $players as $player ) :\n\t\t$name   = $player->post_title;\n\t\t$number = get_post_meta( $player->ID, 'sp_number', true );\n\t\tif ( isset( $number ) && '' !== $number ) :\n\t\t\t$name = $number . '. ' . $name;\n\t\tendif;\n\t\t$options[] = '<option value=\"' . get_post_permalink( $player->ID ) . '\" ' . selected( $player->ID, $id, false ) . '>' . $name . '</option>';\n\tendforeach;\nendif;\n\nif ( sizeof( $options ) > 1 ) :\n\t?>\n\t<div class=\"sp-template sp-template-player-selector sp-template-profile-selector\">\n\t\t<select class=\"sp-profile-selector sp-player-selector sp-selector-redirect\">\n\t\t\t<?php echo wp_kses( implode( $options ), array( 'option' => array( 'value' => array(), 'selected' => array() ) ) ); ?>\n\t\t</select>\n\t</div>\n\t<?php\nendif;\n"
  },
  {
    "path": "templates/player-statistics-league.php",
    "content": "<?php\n/**\n * Player Statistics for Single League\n *\n * @author      ThemeBoy\n * @category    Admin\n * @package     SportsPress/Admin/Meta_Boxes\n * @version   2.5\n */\n\n// The first row should be column labels\n$labels = $data[0];\n\n// Remove the first row to leave us with the actual data\nunset( $data[0] );\n\n// Skip if there are no rows in the table\nif ( empty( $data ) ) {\n\treturn;\n}\n\n$output = '<h4 class=\"sp-table-caption\">' . $caption . '</h4>' .\n\t'<div class=\"sp-table-wrapper\">' .\n\t'<table class=\"sp-player-statistics sp-data-table' . ( $scrollable ? ' sp-scrollable-table' : '' ) . '\">' . '<thead>' . '<tr>';\n\nforeach ( $labels as $key => $label ) :\n\tif ( isset( $hide_teams ) && 'team' == $key ) {\n\t\tcontinue;\n\t}\n\t$output .= '<th class=\"data-' . $key . '\">' . $label . '</th>';\nendforeach;\n\n$output .= '</tr>' . '</thead>' . '<tbody>';\n\n$i = 0;\n\nforeach ( $data as $season_id => $row ) :\n\n\t$output .= '<tr class=\"' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '\">';\n\n\tforeach ( $labels as $key => $value ) :\n\t\tif ( isset( $hide_teams ) && 'team' == $key ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$output .= '<td class=\"data-' . $key . ( -1 === $season_id ? ' sp-highlight' : '' ) . '\">' . sp_array_value( $row, $key, '' ) . '</td>';\n\tendforeach;\n\n\t$output .= '</tr>';\n\n\t$i++;\n\nendforeach;\n\n$output .= '</tbody>' . '</table>' . '</div>';\n?>\n<div class=\"sp-template sp-template-player-statistics\">\n\t<?php echo wp_kses_post( $output ); ?>\n</div>\n"
  },
  {
    "path": "templates/player-statistics.php",
    "content": "<?php\n/**\n * Player Statistics\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.23\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( 'no' === get_option( 'sportspress_player_show_statistics', 'yes' ) && 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$player = new SP_Player( $id );\n\n$scrollable         = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;\n$show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;\n$sections           = get_option( 'sportspress_player_performance_sections', -1 );\n$show_teams         = apply_filters( 'sportspress_player_team_statistics', true );\n$leagues            = array_filter( (array) get_the_terms( $id, 'sp_league' ) );\n\n// Sort Leagues by User Defined Order (PHP5.2 supported)\nforeach ( $leagues as $key => $league ) {\n\t$leagues[ $key ]->sp_order = get_term_meta( $league->term_id, 'sp_order', true );\n}\nif ( ! function_exists( 'sortByOrder' ) ) {\n\tfunction sortByOrder( $a, $b ) {\n\t\treturn (int) $a->sp_order - (int) $b->sp_order;\n\t}\n}\nusort( $leagues, 'sortByOrder' );\n\n$positions       = $player->positions();\n$player_sections = array();\nif ( $positions ) {\n\tforeach ( $positions as $position ) {\n\t\t$player_sections = array_merge( $player_sections, sp_get_term_sections( $position->term_id ) );\n\t}\n}\n\n// Determine order of sections\nif ( 1 == $sections ) {\n\t$section_order = array(\n\t\t1 => esc_attr__( 'Defense', 'sportspress' ),\n\t\t0 => esc_attr__( 'Offense', 'sportspress' ),\n\t);\n} elseif ( 0 == $sections ) {\n\t$section_order = array( esc_attr__( 'Offense', 'sportspress' ), esc_attr__( 'Defense', 'sportspress' ) );\n} else {\n\t$section_order = array( -1 => null );\n}\n\n// Loop through statistics for each league\nif ( is_array( $leagues ) ) :\n\tforeach ( $section_order as $section_id => $section_label ) {\n\t\tif ( -1 !== $section_id && ! empty( $player_sections ) && ! in_array( $section_id, $player_sections ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( sizeof( $leagues ) > 1 ) {\n\t\t\tif ( null !== $section_label ) {\n\t\t\t\tprintf( '<h3 class=\"sp-post-caption sp-player-statistics-section\">%s</h3>', wp_kses_post( $section_label ) );\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $leagues as $league ) :\n\t\t\t$caption = $league->name;\n\n\t\t\tif ( null !== $section_label ) {\n\t\t\t\tif ( sizeof( $leagues ) === 1 ) {\n\t\t\t\t\t$caption = $section_label;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'data'       => $player->data( $league->term_id, false, $section_id ),\n\t\t\t\t'caption'    => $caption,\n\t\t\t\t'scrollable' => $scrollable,\n\t\t\t\t'league_id'  => $league->term_id,\n\t\t\t);\n\t\t\tif ( ! $show_teams ) {\n\t\t\t\t$args['hide_teams'] = true;\n\t\t\t}\n\t\t\tsp_get_template( 'player-statistics-league.php', $args );\n\t\tendforeach;\n\n\t\tif ( $show_career_totals ) {\n\t\t\tsp_get_template(\n\t\t\t\t'player-statistics-league.php',\n\t\t\t\tarray(\n\t\t\t\t\t'data'       => $player->data( 0, false, $section_id ),\n\t\t\t\t\t'caption'    => esc_attr__( 'Career Total', 'sportspress' ),\n\t\t\t\t\t'scrollable' => $scrollable,\n\t\t\t\t\t'hide_teams' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\nendif;\n"
  },
  {
    "path": "templates/post-excerpt.php",
    "content": "<?php\n/**\n * Post Excerpt\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.6.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$post    = get_post( $id );\n$excerpt = $post->post_excerpt;\nif ( $excerpt ) {\n\t?>\n\t<p class=\"sp-excerpt\"><?php echo wp_kses_post( $excerpt ); ?></p>\n\t<?php\n}\n"
  },
  {
    "path": "templates/staff-content.php",
    "content": "<?php\n/**\n * Staff Content\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.5.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_staff_show_content', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$post    = get_post( $id );\n$content = $post->post_content;\nif ( $content ) {\n\t?>\n\t<div class=\"sp-post-content\">\n\t  <?php echo wp_kses_post( apply_filters( 'the_content', $content ) ); ?>\n\t</div>\n\t<?php\n}\n"
  },
  {
    "path": "templates/staff-details.php",
    "content": "<?php\n/**\n * Staff Details\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_staff_show_details', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$defaults = array(\n\t'show_nationality'       => get_option( 'sportspress_staff_show_nationality', 'yes' ) == 'yes' ? true : false,\n\t'show_current_teams'     => get_option( 'sportspress_staff_show_current_teams', 'yes' ) == 'yes' ? true : false,\n\t'show_past_teams'        => get_option( 'sportspress_staff_show_past_teams', 'yes' ) == 'yes' ? true : false,\n\t'show_nationality_flags' => get_option( 'sportspress_staff_show_flags', 'yes' ) == 'yes' ? true : false,\n\t'link_teams'             => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n$countries = SP()->countries->countries;\n\n$staff = new SP_Staff( $id );\n\n$nationalities = $staff->nationalities();\n$current_teams = $staff->current_teams();\n$past_teams    = $staff->past_teams();\n\n$data = array();\nif ( $show_nationality && $nationalities && is_array( $nationalities ) ) :\n\t$values = array();\n\tforeach ( $nationalities as $nationality ) :\n\t\tif ( 2 == strlen( $nationality ) ) :\n\t\t\t$legacy      = SP()->countries->legacy;\n\t\t\t$nationality = strtolower( $nationality );\n\t\t\t$nationality = sp_array_value( $legacy, $nationality, null );\n\t\tendif;\n\t\t$country_name = sp_array_value( $countries, $nationality, null );\n\t\t$values[]     = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '&mdash;';\n\tendforeach;\n\t$data[ esc_attr__( 'Nationality', 'sportspress' ) ] = implode( '<br>', $values );\nendif;\n\nif ( $show_current_teams && $current_teams ) :\n\t$teams = array();\n\tforeach ( $current_teams as $team ) :\n\t\t$team_name = sp_team_short_name( $team );\n\t\tif ( $link_teams ) {\n\t\t\t$team_name = '<a href=\"' . get_post_permalink( $team ) . '\">' . $team_name . '</a>';\n\t\t}\n\t\t$teams[] = $team_name;\n\tendforeach;\n\t$data[ esc_attr__( 'Current Team', 'sportspress' ) ] = implode( ', ', $teams );\nendif;\n\nif ( $show_past_teams && $past_teams ) :\n\t$teams = array();\n\tforeach ( $past_teams as $team ) :\n\t\t$team_name = sp_team_short_name( $team );\n\t\tif ( $link_teams ) {\n\t\t\t$team_name = '<a href=\"' . get_post_permalink( $team ) . '\">' . $team_name . '</a>';\n\t\t}\n\t\t$teams[] = $team_name;\n\tendforeach;\n\t$data[ esc_attr__( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );\nendif;\n\n$data = apply_filters( 'sportspress_staff_details', $data, $id );\n\nif ( empty( $data ) ) {\n\treturn;\n}\n\n$output = '<div class=\"sp-list-wrapper\">' .\n\t'<dl class=\"sp-staff-details\">';\n\nforeach ( $data as $label => $value ) :\n\n\t$output .= '<dt>' . $label . '</dt><dd>' . $value . '</dd>';\n\nendforeach;\n\n$output .= '</dl></div>';\n?>\n<div class=\"sp-template sp-template-staff-details sp-template-details\">\n\t<?php echo wp_kses_post( $output ); ?>\n</div>\n"
  },
  {
    "path": "templates/staff-excerpt.php",
    "content": "<?php\n/**\n * Staff Excerpt\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.5.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_staff_show_excerpt', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$post    = get_post( $id );\n$excerpt = $post->post_excerpt;\nif ( $excerpt ) {\n\t?>\n\t<p class=\"sp-excerpt\">\n\t  <?php echo wp_kses_post( $excerpt ); ?>\n\t</p>\n\t<?php\n}\n"
  },
  {
    "path": "templates/staff-header.php",
    "content": "<?php\n/**\n * Staff Header\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.6\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$post  = function_exists( 'icl_object_id' ) ? get_post( icl_object_id( $id, 'sp_staff', true ) ) : get_post( $id );\n$title = $post->post_title;\nif ( $title ) {\n\t$staff = new SP_Staff( $id );\n\t$role  = $staff->role();\n\tif ( $role ) {\n\t\t$title = '<strong class=\"sp-staff-role\">' . $role->name . '</strong> ' . $title;\n\t}\n\t?>\n\t<h3 class=\"sp-staff-name\"><?php echo wp_kses_post( $title ); ?></h3>\n\t<?php\n}\n"
  },
  {
    "path": "templates/staff-photo.php",
    "content": "<?php\n/**\n * Staff Photo\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     1.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_staff_show_photo', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\nif ( has_post_thumbnail( $id ) ) :\n\t?>\n\t<div class=\"sp-template sp-template-staff-photo sp-template-photo sp-staff-photo\">\n\t\t<?php echo get_the_post_thumbnail( $id, 'sportspress-fit-medium' ); ?>\n\t</div>\n\t<?php\nendif;\n"
  },
  {
    "path": "templates/staff-selector.php",
    "content": "<?php\n/**\n * Staff Dropdown\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.11\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_staff_show_selector', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$league_ids = sp_get_the_term_ids( $id, 'sp_league' );\n$season_ids = sp_get_the_term_ids( $id, 'sp_season' );\n$team       = get_post_meta( $id, 'sp_current_team', true );\n\n$args = array(\n\t'post_type'      => 'sp_staff',\n\t'numberposts'    => 500,\n\t'posts_per_page' => 500,\n\t'orderby'        => 'title',\n\t'order'          => 'ASC',\n\t'tax_query'      => array(\n\t\t'relation' => 'AND',\n\t),\n);\n\nif ( $league_ids ) :\n\t$args['tax_query'][] = array(\n\t\t'taxonomy' => 'sp_league',\n\t\t'field'    => 'term_id',\n\t\t'terms'    => $league_ids,\n\t);\nendif;\n\nif ( $season_ids ) :\n\t$args['tax_query'][] = array(\n\t\t'taxonomy' => 'sp_season',\n\t\t'field'    => 'term_id',\n\t\t'terms'    => $season_ids,\n\t);\nendif;\n\nif ( $team ) :\n\t$args['meta_query'] = array(\n\t\tarray(\n\t\t\t'key'   => 'sp_team',\n\t\t\t'value' => $team,\n\t\t),\n\t);\nendif;\n\n$staffs = get_posts( $args );\n\n$options = array();\n\nif ( $staffs && is_array( $staffs ) ) :\n\tforeach ( $staffs as $staff ) :\n\t\t$options[] = '<option value=\"' . get_post_permalink( $staff->ID ) . '\" ' . selected( $staff->ID, $id, false ) . '>' . $staff->post_title . '</option>';\n\tendforeach;\nendif;\n\nif ( sizeof( $options ) > 1 ) :\n\t?>\n\t<div class=\"sp-template sp-template-staff-selector sp-template-profile-selector\">\n\t\t<select class=\"sp-profile-selector sp-staff-selector sp-selector-redirect\">\n\t\t\t<?php echo wp_kses( implode( $options ), array( 'option' => array( 'value' => array(), 'selected' => array() ) ) ); ?>\n\t\t</select>\n\t</div>\n\t<?php\nendif;\n"
  },
  {
    "path": "templates/team-details.php",
    "content": "<?php\n/**\n * Team Details\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.7.1\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_team_show_details', 'no' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$data = array();\n\n$terms = get_the_terms( $id, 'sp_league' );\nif ( $terms ) :\n\t$leagues = array();\n\tforeach ( $terms as $term ) :\n\t\t$leagues[] = $term->name;\n\tendforeach;\n\t$data[ esc_attr__( 'Leagues', 'sportspress' ) ] = implode( ', ', $leagues );\nendif;\n\n$terms = get_the_terms( $id, 'sp_season' );\nif ( $terms ) :\n\t$seasons = array();\n\tforeach ( $terms as $term ) :\n\t\t$seasons[] = $term->name;\n\tendforeach;\n\t$data[ esc_attr__( 'Seasons', 'sportspress' ) ] = implode( ', ', $seasons );\nendif;\n\n$terms = get_the_terms( $id, 'sp_venue' );\nif ( $terms ) :\n\tif ( get_option( 'sportspress_team_link_venues', 'no' ) === 'yes' ) :\n\t\t$data[ esc_attr__( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue', '', ', ' );\n\telse :\n\t\t$venues = array();\n\t\tforeach ( $terms as $term ) :\n\t\t\t$venues[] = $term->name;\n\t\tendforeach;\n\t\t$data[ esc_attr__( 'Home', 'sportspress' ) ] = implode( ', ', $venues );\n\tendif;\nendif;\n\n$output = '<div class=\"sp-list-wrapper\">' .\n\t'<dl class=\"sp-team-details\">';\n\nforeach ( $data as $label => $value ) :\n\n\t$output .= '<dt>' . $label . '</dt><dd>' . $value . '</dd>';\n\nendforeach;\n\n$output .= '</dl></div>';\n?>\n<div class=\"sp-template sp-template-team-details sp-template-details\">\n\t<?php echo wp_kses_post( $output ); ?>\n</div>\n"
  },
  {
    "path": "templates/team-events.php",
    "content": "<?php\n/**\n * Team Events\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.6.9\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$format = get_option( 'sportspress_team_events_format', 'blocks' );\nif ( 'calendar' === $format ) {\n\tsp_get_template( 'event-calendar.php', array( 'team' => $id ) );\n} elseif ( 'list' === $format ) {\n\t$args = array(\n\t\t'team'         => $id,\n\t\t'league'       => apply_filters( 'sp_team_events_league', 0 ),\n\t\t'season'       => apply_filters( 'sp_team_events_season', 0 ),\n\t\t'title_format' => 'homeaway',\n\t\t'time_format'  => 'separate',\n\t\t'columns'      => array( 'event', 'time', 'results' ),\n\t\t'order'        => 'DESC',\n\t);\n\t$args = apply_filters( 'sp_team_events_list_args', $args );\n\tsp_get_template( 'event-list.php', $args );\n} else {\n\tsp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) );\n}\n"
  },
  {
    "path": "templates/team-gallery-thumbnail.php",
    "content": "<?php\n/**\n * Team Gallery Thumbnail\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$defaults = array(\n\t'id'         => null,\n\t'icontag'    => 'dt',\n\t'captiontag' => 'dd',\n\t'caption'    => null,\n\t'size'       => 'sportspress-crop-medium',\n\t'link_posts' => get_option( 'sportspress_link_teams', 'yes' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n// Add caption tag if has caption\nif ( $captiontag && $caption ) {\n\t$caption = '<' . $captiontag . ' class=\"wp-caption-text gallery-caption small-3 columns\">' . wptexturize( $caption ) . '</' . $captiontag . '>';\n}\n\nif ( $link_posts ) {\n\t$caption = '<a href=\"' . get_permalink( $id ) . '\">' . $caption . '</a>';\n}\n\nif ( has_post_thumbnail( $id ) ) {\n\t$thumbnail = get_the_post_thumbnail( $id, $size );\n} else {\n\t$thumbnail = '<img width=\"150\" height=\"150\" src=\"//www.gravatar.com/avatar/?s=150&d=blank&f=y\" class=\"attachment-thumbnail wp-post-image\">';\n}\n\necho wp_kses_post( \"<{$itemtag} class='gallery-item'>\" );\necho wp_kses_post( \"\n\t<{$icontag} class='gallery-icon portrait'>\"\n\t\t. '<a href=\"' . get_permalink( $id ) . '\">' . $thumbnail . '</a>'\n\t. \"</{$icontag}>\" );\necho wp_kses_post( $caption );\necho wp_kses_post( \"</{$itemtag}>\" );\n"
  },
  {
    "path": "templates/team-gallery.php",
    "content": "<?php\n/**\n * Team Gallery\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\n$html5    = current_theme_supports( 'html5', 'gallery' );\n$defaults = array(\n\t'id'                  => get_the_ID(),\n\t'title'               => false,\n\t'number'              => -1,\n\t'orderby'             => 'default',\n\t'itemtag'             => 'dl',\n\t'icontag'             => 'dt',\n\t'captiontag'          => 'dd',\n\t'columns'             => 3,\n\t'size'                => 'sportspress-crop-medium',\n\t'show_all_teams_link' => false,\n\t'link_posts'          => get_option( 'sportspress_link_teams', 'yes' ) == 'yes' ? true : false,\n);\n\nextract( $defaults, EXTR_SKIP );\n\n// Determine number of teams to display\nif ( -1 === $number ) :\n\t$number = (int) get_post_meta( $id, 'sp_number', true );\n\tif ( $number <= 0 ) {\n\t\t$number = -1;\n\t}\nendif;\n\n$itemtag    = tag_escape( $itemtag );\n$captiontag = tag_escape( $captiontag );\n$icontag    = tag_escape( $icontag );\n$valid_tags = wp_kses_allowed_html( 'post' );\nif ( ! isset( $valid_tags[ $itemtag ] ) ) {\n\t$itemtag = 'dl';\n}\nif ( ! isset( $valid_tags[ $captiontag ] ) ) {\n\t$captiontag = 'dd';\n}\nif ( ! isset( $valid_tags[ $icontag ] ) ) {\n\t$icontag = 'dt';\n}\n\n$columns   = intval( $columns );\n$itemwidth = $columns > 0 ? floor( 100 / $columns ) : 100;\n$size      = $size;\n$float     = is_rtl() ? 'right' : 'left';\n\n$selector = 'sp-team-gallery-' . $id;\n\n$table = new SP_League_Table( $id );\n$data  = $table->data();\n\n// Remove the first row to leave us with the actual data\nunset( $data[0] );\n\nif ( $orderby == 'name' ) :\n\tuasort( $data, 'sp_sort_by_name' );\nelseif ( $orderby == 'rand' ) :\n\tuasort( $data, 'sp_sort_random' );\nendif;\n\nif ( $title ) {\n\techo '<h4 class=\"sp-table-caption\">' . wp_kses_post( $title ) . '</h4>';\n}\n\n$gallery_style = $gallery_div = '';\nif ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {\n\t$gallery_style = \"\n\t<style type='text/css'>\n\t\t#{$selector} {\n\t\t\tmargin: auto;\n\t\t}\n\t\t#{$selector} .gallery-item {\n\t\t\tfloat: {$float};\n\t\t\tmargin-top: 10px;\n\t\t\ttext-align: center;\n\t\t\twidth: {$itemwidth}%;\n\t\t}\n\t\t#{$selector} img {\n\t\t\tborder: 2px solid #cfcfcf;\n\t\t}\n\t\t#{$selector} .gallery-caption {\n\t\t\tmargin-left: 0;\n\t\t}\n\t\t/* see gallery_shortcode() in wp-includes/media.php */\n\t</style>\";\n}\n$size_class  = sanitize_html_class( $size );\n$gallery_div = \"<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>\";\necho wp_kses_post( apply_filters( 'gallery_style', $gallery_style . \"\\n\\t\\t\" ) );\n?>\n<?php echo wp_kses_post( $gallery_div ); ?>\n\t<?php\n\tif ( intval( $number ) > 0 ) {\n\t\t$limit = $number;\n\t}\n\n\t$i = 0;\n\n\t$gallery = '';\n\n\tforeach ( $data as $team_id => $row ) :\n\n\t\tif ( isset( $limit ) && $i >= $limit ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$caption = get_the_title( $team_id );\n\t\t$caption = trim( $caption );\n\n\t\tob_start();\n\n\t\tsp_get_template(\n\t\t\t'team-gallery-thumbnail.php',\n\t\t\tarray(\n\t\t\t\t'id'         => $team_id,\n\t\t\t\t'itemtag'    => $itemtag,\n\t\t\t\t'icontag'    => $icontag,\n\t\t\t\t'captiontag' => $captiontag,\n\t\t\t\t'caption'    => $caption,\n\t\t\t\t'size'       => $size,\n\t\t\t\t'link_posts' => $link_posts,\n\t\t\t)\n\t\t);\n\n\t\t$gallery .= ob_get_clean();\n\n\t\t$i++;\n\n\tendforeach;\n\n\techo '<div class=\"sp-template sp-template-team-gallery sp-template-gallery\">';\n\n\techo '<div class=\"sp-team-gallery-wrapper sp-gallery-wrapper\">';\n\n\techo wp_kses_post( $gallery );\n\n\tif ( ! $html5 && $columns > 0 && ++$i % $columns == 0 ) {\n\t\techo '<br style=\"clear: both\" />';\n\t}\n\n\techo '</div>';\n\n\tif ( $show_all_teams_link ) {\n\t\techo '<div class=\"sp-team-gallery-link sp-gallery-link sp-view-all-link\"><a href=\"' . esc_url( get_permalink( $id ) ) . '\">' . esc_attr__( 'View all teams', 'sportspress' ) . '</a></div>';\n\t}\n\n\techo '</div>';\n\n\tif ( ! $html5 && $columns > 0 && ++$i % $columns == 0 ) {\n\t\techo '<br style=\"clear: both\" />';\n\t}\n\n\techo \"</div>\\n\";\n\n"
  },
  {
    "path": "templates/team-link.php",
    "content": "<?php\n/**\n * Team Link\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     1.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_team_show_link', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$url = get_post_meta( $id, 'sp_url', true );\n\nif ( empty( $url ) ) {\n\treturn false;\n}\n?>\n<form action=\"<?php echo esc_url( $url ); ?>\"\n\t\t\t\t\t\t <?php\n\t\t\t\t\t\t\tif ( get_option( 'sportspress_team_site_target_blank', 'no' ) == 'yes' ) {\n\t\t\t\t\t\t\t\t?>\n\t target=\"_blank\"<?php } ?>>\n\t<input type=\"submit\" class=\"button sp-button sp-team-button\" value=\"<?php esc_attr_e( 'Visit Site', 'sportspress' ); ?>\">\n</form>\n<br>\n"
  },
  {
    "path": "templates/team-lists.php",
    "content": "<?php\n/**\n * Team Player Lists\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.13\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$team  = new SP_Team( $id );\n$lists = $team->lists();\n\nforeach ( $lists as $list ) :\n\t$id       = $list->ID;\n\t$grouping = get_post_meta( $id, 'sp_grouping', true );\n\n\tif ( $grouping == 'position' && sizeof( $lists ) > 1 ) :\n\t\t?>\n\t\t<h4 class=\"sp-table-caption\"><?php echo wp_kses_post( $list->post_title ); ?></h4>\n\t\t<?php\n\tendif;\n\n\t$format = get_post_meta( $id, 'sp_format', true );\n\tif ( array_key_exists( $format, SP()->formats->list ) ) {\n\t\tsp_get_template( 'player-' . $format . '.php', array( 'id' => $id ) );\n\t} else {\n\t\tsp_get_template( 'player-list.php', array( 'id' => $id ) );\n\t}\nendforeach;\n"
  },
  {
    "path": "templates/team-logo.php",
    "content": "<?php\n/**\n * Team Logo\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     1.4\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\nif ( get_option( 'sportspress_team_show_logo', 'yes' ) === 'no' ) {\n\treturn;\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\nif ( has_post_thumbnail( $id ) ) :\n\t?>\n\t<div class=\"sp-template sp-template-team-logo sp-template-logo sp-team-logo\">\n\t\t<?php echo get_the_post_thumbnail( $id, 'sportspress-fit-icon' ); ?>\n\t</div>\n\t<?php\nendif;\n"
  },
  {
    "path": "templates/team-staff.php",
    "content": "<?php\n/**\n * Team Staff\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version   2.5.5\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$team       = new SP_Team( $id );\n$members    = $team->staff();\n$link_staff = get_option( 'sportspress_team_link_staff', 'no' ) === 'yes' ? true : false;\n\nforeach ( $members as $staff ) :\n\t$id   = $staff->ID;\n\t$name = $staff->post_title;\n\n\t$staff = new SP_Staff( $id );\n\t$roles = $staff->roles();\n\n\tif ( ! empty( $roles ) ) :\n\t\t$roles = wp_list_pluck( $roles, 'name' );\n\t\t$name  = '<span class=\"sp-staff-role\">' . implode( '<span class=\"sp-staff-role-delimiter\">/</span>', $roles ) . '</span> ' . $name;\n\tendif;\n\t?>\n\t<h4 class=\"sp-staff-name\"><?php echo $link_staff ? '<a href=\"' . esc_url( get_permalink( $id ) ) . '\">' . wp_kses_post( $name ) . '</a>' : wp_kses_post( $name ); ?></h4>\n\t<?php\n\tsp_get_template( 'staff-photo.php', array( 'id' => $id ) );\n\tsp_get_template( 'staff-details.php', array( 'id' => $id ) );\nendforeach;\n"
  },
  {
    "path": "templates/team-tables.php",
    "content": "<?php\n/**\n * Team League Tables\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     1.8.7\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $id ) ) {\n\t$id = get_the_ID();\n}\n\n$team   = new SP_Team( $id );\n$tables = $team->tables();\n\nforeach ( $tables as $table ) :\n\tif ( ! $table ) {\n\t\tcontinue;\n\t}\n\n\tsp_get_template(\n\t\t'league-table.php',\n\t\tarray(\n\t\t\t'id'        => $table->ID,\n\t\t\t'highlight' => $id,\n\t\t)\n\t);\nendforeach;\n"
  },
  {
    "path": "templates/venue-map.php",
    "content": "<?php\n/**\n * Venue Map\n *\n * @author      ThemeBoy\n * @package     SportsPress/Templates\n * @version     2.7.18\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly\n}\n\nif ( ! isset( $meta ) ) {\n\treturn;\n}\n\nif ( is_tax( 'sp_venue' ) ) {\n\tdo_action( 'sportspress_before_venue_map' );\n}\n\n$address   = sp_array_value( $meta, 'sp_address', null );\nif ( !is_null( $address ) ) {\n\t$address = urlencode( $address );\n}\n$latitude  = sp_array_value( $meta, 'sp_latitude', null );\n$longitude = sp_array_value( $meta, 'sp_longitude', null );\n$zoom      = get_option( 'sportspress_map_zoom', 15 );\n$maptype   = get_option( 'sportspress_map_type', 'roadmap' );\n$maptype   = strtolower( $maptype );\n\nif ( '' === $address ) {\n\t$address = '+';\n}\nif ( 'satellite' !== $maptype ) {\n\t$maptype = 'roadmap';\n}\n\nif ( $latitude != null && $longitude != null ) {\n\tdo_action( 'sp_venue_show_map', $latitude, $longitude, $address, $zoom, $maptype );\n}\nif ( is_tax( 'sp_venue' ) ) {\n\tdo_action( 'sportspress_after_venue_map' );\n}\n"
  },
  {
    "path": "wpml-config.xml",
    "content": "<wpml-config>\n  <admin-texts>\n    <key name=\"sportspress_footer_sponsors_title\"></key>\n    <key name=\"sportspress_text\">\n      <key name=\"Age\"/>\n      <key name=\"Article\"/>\n      <key name=\"Birthday\"/>\n      <key name=\"Box Score\"/>\n      <key name=\"Canceled\"/>\n      <key name=\"Career Total\"/>\n      <key name=\"Current Team\"/>\n      <key name=\"Current Teams\"/>\n      <key name=\"Date\"/>\n      <key name=\"Details\"/>\n      <key name=\"Event\"/>\n      <key name=\"Events\"/>\n      <key name=\"Event Results\"/>\n      <key name=\"Excerpt\"/>\n      <key name=\"Fixtures\"/>\n      <key name=\"Full Time\"/>\n      <key name=\"League\"/>\n      <key name=\"League Tables\"/>\n      <key name=\"Logos\"/>\n      <key name=\"Match Day\"/>\n      <key name=\"Nationality\"/>\n      <key name=\"Officials\"/>\n      <key name=\"Outcome\"/>\n      <key name=\"Past Teams\"/>\n      <key name=\"Performance\"/>\n      <key name=\"Photo\"/>\n      <key name=\"Played\"/>\n      <key name=\"Player\"/>\n      <key name=\"Player Lists\"/>\n      <key name=\"Pos\"/>\n      <key name=\"Position\"/>\n      <key name=\"Postponed\"/>\n      <key name=\"Preview\"/>\n      <key name=\"Profile\"/>\n      <key name=\"Rank\"/>\n      <key name=\"Recap\"/>\n      <key name=\"Season\"/>\n      <key name=\"Staff\"/>\n      <key name=\"Statistics\"/>\n      <key name=\"Substitutes\"/>\n      <key name=\"TBD\"/>\n      <key name=\"Team\"/>\n      <key name=\"Teams\"/>\n      <key name=\"Time\"/>\n      <key name=\"Time/Results\"/>\n      <key name=\"Total\"/>\n      <key name=\"Venue\"/>\n      <key name=\"Video\"/>\n      <key name=\"View all events\"/>\n      <key name=\"View all players\"/>\n      <key name=\"View full table\"/>\n      <key name=\"Visit Site\"/>\n    </key>\n  </admin-texts>\n</wpml-config>\n"
  }
]