Repository: ThemeBoy/SportsPress Branch: master Commit: f78d28ba2fa2 Files: 391 Total size: 2.4 MB Directory structure: gitextract_k2bxc7bm/ ├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── assets/ │ ├── css/ │ │ ├── Control.Geocoder.css │ │ ├── activation.css │ │ ├── admin.css │ │ ├── chosen.css │ │ ├── customize.css │ │ ├── dashboard.css │ │ ├── datepicker.css │ │ ├── equation.css │ │ ├── icons.css │ │ ├── leaflet.css │ │ ├── menu.css │ │ ├── setup.css │ │ ├── slickmap.css │ │ ├── sportspress-rtl.css │ │ ├── sportspress-style-ltr.css │ │ ├── sportspress-style-rtl.css │ │ ├── sportspress-style.css │ │ ├── sportspress.css │ │ └── themes/ │ │ └── twentyfourteen.css │ └── js/ │ ├── admin/ │ │ ├── colorpicker.js │ │ ├── dashboard.js │ │ ├── editor-lang.php │ │ ├── editor.js │ │ ├── equationbuilder.js │ │ ├── iconpicker.js │ │ ├── quickeditor.js │ │ ├── settings.js │ │ ├── sp-geocoder.js │ │ ├── sp-setup-geocoder.js │ │ ├── sportspress-admin.js │ │ ├── sportspress-setup.js │ │ └── widgets.js │ ├── blocks/ │ │ └── event-calendar.js │ ├── jquery.fitvids.js │ ├── leaflet.js │ └── sportspress.js ├── changelog.txt ├── dummy-data/ │ ├── event-performance-sample.csv │ ├── events-sample.csv │ ├── fixtures-sample.csv │ ├── officials-sample.csv │ ├── players-sample.csv │ ├── staff-sample.csv │ └── teams-sample.csv ├── feeds/ │ └── ical.php ├── includes/ │ ├── abstracts/ │ │ ├── abstract-sp-custom-post.php │ │ └── abstract-sp-secondary-post.php │ ├── admin/ │ │ ├── class-sp-admin-ajax.php │ │ ├── class-sp-admin-assets.php │ │ ├── class-sp-admin-dashboard.php │ │ ├── class-sp-admin-editor.php │ │ ├── class-sp-admin-importers.php │ │ ├── class-sp-admin-menus.php │ │ ├── class-sp-admin-notices.php │ │ ├── class-sp-admin-permalink-settings.php │ │ ├── class-sp-admin-post-types.php │ │ ├── class-sp-admin-sample-data.php │ │ ├── class-sp-admin-settings.php │ │ ├── class-sp-admin-setup-wizard.php │ │ ├── class-sp-admin-sports.php │ │ ├── class-sp-admin-status.php │ │ ├── class-sp-admin-taxonomies.php │ │ ├── class-sp-admin-welcome.php │ │ ├── class-sp-admin.php │ │ ├── importers/ │ │ │ ├── class-sp-event-importer.php │ │ │ ├── class-sp-event-performance-importer.php │ │ │ ├── class-sp-fixture-importer.php │ │ │ ├── class-sp-importer.php │ │ │ ├── class-sp-official-importer.php │ │ │ ├── class-sp-player-importer.php │ │ │ ├── class-sp-staff-importer.php │ │ │ └── class-sp-team-importer.php │ │ ├── post-types/ │ │ │ ├── class-sp-admin-cpt-calendar.php │ │ │ ├── class-sp-admin-cpt-column.php │ │ │ ├── class-sp-admin-cpt-event.php │ │ │ ├── class-sp-admin-cpt-list.php │ │ │ ├── class-sp-admin-cpt-metric.php │ │ │ ├── class-sp-admin-cpt-official.php │ │ │ ├── class-sp-admin-cpt-outcome.php │ │ │ ├── class-sp-admin-cpt-performance.php │ │ │ ├── class-sp-admin-cpt-player.php │ │ │ ├── class-sp-admin-cpt-result.php │ │ │ ├── class-sp-admin-cpt-spec.php │ │ │ ├── class-sp-admin-cpt-staff.php │ │ │ ├── class-sp-admin-cpt-statistic.php │ │ │ ├── class-sp-admin-cpt-table.php │ │ │ ├── class-sp-admin-cpt-team.php │ │ │ ├── class-sp-admin-cpt.php │ │ │ ├── class-sp-admin-meta-boxes.php │ │ │ └── meta-boxes/ │ │ │ ├── class-sp-meta-box-calendar-columns.php │ │ │ ├── class-sp-meta-box-calendar-data.php │ │ │ ├── class-sp-meta-box-calendar-details.php │ │ │ ├── class-sp-meta-box-calendar-feeds.php │ │ │ ├── class-sp-meta-box-calendar-format.php │ │ │ ├── class-sp-meta-box-calendar-shortcode.php │ │ │ ├── class-sp-meta-box-column-details.php │ │ │ ├── class-sp-meta-box-column-equation.php │ │ │ ├── class-sp-meta-box-config.php │ │ │ ├── class-sp-meta-box-equation.php │ │ │ ├── class-sp-meta-box-event-details.php │ │ │ ├── class-sp-meta-box-event-format.php │ │ │ ├── class-sp-meta-box-event-mode.php │ │ │ ├── class-sp-meta-box-event-officials.php │ │ │ ├── class-sp-meta-box-event-performance.php │ │ │ ├── class-sp-meta-box-event-results.php │ │ │ ├── class-sp-meta-box-event-shortcode.php │ │ │ ├── class-sp-meta-box-event-specs.php │ │ │ ├── class-sp-meta-box-event-teams.php │ │ │ ├── class-sp-meta-box-event-video.php │ │ │ ├── class-sp-meta-box-list-columns.php │ │ │ ├── class-sp-meta-box-list-data.php │ │ │ ├── class-sp-meta-box-list-details.php │ │ │ ├── class-sp-meta-box-list-format.php │ │ │ ├── class-sp-meta-box-list-shortcode.php │ │ │ ├── class-sp-meta-box-metric-details.php │ │ │ ├── class-sp-meta-box-outcome-details.php │ │ │ ├── class-sp-meta-box-performance-details.php │ │ │ ├── class-sp-meta-box-performance-equation.php │ │ │ ├── class-sp-meta-box-player-columns.php │ │ │ ├── class-sp-meta-box-player-details.php │ │ │ ├── class-sp-meta-box-player-metrics.php │ │ │ ├── class-sp-meta-box-player-shortcode.php │ │ │ ├── class-sp-meta-box-player-statistics.php │ │ │ ├── class-sp-meta-box-result-details.php │ │ │ ├── class-sp-meta-box-result-equation.php │ │ │ ├── class-sp-meta-box-spec-details.php │ │ │ ├── class-sp-meta-box-staff-details.php │ │ │ ├── class-sp-meta-box-staff-shortcode.php │ │ │ ├── class-sp-meta-box-statistic-details.php │ │ │ ├── class-sp-meta-box-statistic-equation.php │ │ │ ├── class-sp-meta-box-table-data.php │ │ │ ├── class-sp-meta-box-table-details.php │ │ │ ├── class-sp-meta-box-table-format.php │ │ │ ├── class-sp-meta-box-table-mode.php │ │ │ ├── class-sp-meta-box-table-shortcode.php │ │ │ ├── class-sp-meta-box-team-columns.php │ │ │ ├── class-sp-meta-box-team-details.php │ │ │ ├── class-sp-meta-box-team-lists.php │ │ │ ├── class-sp-meta-box-team-staff.php │ │ │ └── class-sp-meta-box-team-tables.php │ │ ├── settings/ │ │ │ ├── class-sp-settings-events.php │ │ │ ├── class-sp-settings-general.php │ │ │ ├── class-sp-settings-licenses.php │ │ │ ├── class-sp-settings-modules.php │ │ │ ├── class-sp-settings-page.php │ │ │ ├── class-sp-settings-players.php │ │ │ ├── class-sp-settings-staff.php │ │ │ ├── class-sp-settings-status.php │ │ │ ├── class-sp-settings-teams.php │ │ │ └── class-sp-settings-text.php │ │ ├── sp-admin-functions.php │ │ └── views/ │ │ ├── html-admin-config.php │ │ ├── html-admin-page-status.php │ │ ├── html-admin-settings.php │ │ ├── html-notice-install.php │ │ ├── html-notice-no-access.php │ │ ├── html-notice-template-check.php │ │ └── html-notice-theme-support.php │ ├── api/ │ │ ├── class-sp-rest-api.php │ │ ├── class-sp-rest-posts-controller.php │ │ └── class-sp-rest-terms-controller.php │ ├── class-sp-ajax.php │ ├── class-sp-calendar.php │ ├── class-sp-countries.php │ ├── class-sp-event.php │ ├── class-sp-feeds.php │ ├── class-sp-formats.php │ ├── class-sp-frontend-scripts.php │ ├── class-sp-install.php │ ├── class-sp-league-table.php │ ├── class-sp-modules.php │ ├── class-sp-player-list.php │ ├── class-sp-player.php │ ├── class-sp-post-types.php │ ├── class-sp-shortcodes.php │ ├── class-sp-staff.php │ ├── class-sp-team.php │ ├── class-sp-template-loader.php │ ├── class-sp-templates.php │ ├── class-sp-wpml.php │ ├── libraries/ │ │ ├── class-eqeos.php │ │ ├── class-phpstack.php │ │ └── class-tgm-plugin-activation.php │ ├── shortcodes/ │ │ ├── class-sp-shortcode-countdown.php │ │ ├── class-sp-shortcode-event-blocks.php │ │ ├── class-sp-shortcode-event-calendar.php │ │ ├── class-sp-shortcode-event-details.php │ │ ├── class-sp-shortcode-event-full.php │ │ ├── class-sp-shortcode-event-list.php │ │ ├── class-sp-shortcode-event-officials.php │ │ ├── class-sp-shortcode-event-performance.php │ │ ├── class-sp-shortcode-event-results.php │ │ ├── class-sp-shortcode-event-teams.php │ │ ├── class-sp-shortcode-event-venue.php │ │ ├── class-sp-shortcode-league-table.php │ │ ├── class-sp-shortcode-player-details.php │ │ ├── class-sp-shortcode-player-gallery.php │ │ ├── class-sp-shortcode-player-list.php │ │ ├── class-sp-shortcode-player-statistics.php │ │ ├── class-sp-shortcode-staff-profile.php │ │ ├── class-sp-shortcode-staff.php │ │ └── class-sp-shortcode-team-gallery.php │ ├── sp-api-functions.php │ ├── sp-conditional-functions.php │ ├── sp-core-functions.php │ ├── sp-deprecated-functions.php │ ├── sp-formatting-functions.php │ ├── sp-option-filters.php │ ├── sp-template-functions.php │ ├── sp-template-hooks.php │ └── widgets/ │ ├── class-sp-widget-birthdays.php │ ├── class-sp-widget-countdown.php │ ├── class-sp-widget-event-blocks.php │ ├── class-sp-widget-event-calendar.php │ ├── class-sp-widget-event-list.php │ ├── class-sp-widget-league-table.php │ ├── class-sp-widget-player-gallery.php │ ├── class-sp-widget-player-list.php │ ├── class-sp-widget-staff.php │ └── class-sp-widget-team-gallery.php ├── index.php ├── languages/ │ ├── sportspress-ar.mo │ ├── sportspress-az.mo │ ├── sportspress-be_BY.mo │ ├── sportspress-bg_BG.mo │ ├── sportspress-bn_BD.mo │ ├── sportspress-bs_BA.mo │ ├── sportspress-ca.mo │ ├── sportspress-cs_CZ.mo │ ├── sportspress-cy.mo │ ├── sportspress-da_DK.mo │ ├── sportspress-de_DE.mo │ ├── sportspress-el.mo │ ├── sportspress-es_CL.mo │ ├── sportspress-es_ES.mo │ ├── sportspress-et.mo │ ├── sportspress-eu.mo │ ├── sportspress-fa_IR.mo │ ├── sportspress-fi.mo │ ├── sportspress-fr_FR.mo │ ├── sportspress-gl_ES.mo │ ├── sportspress-he_IL.mo │ ├── sportspress-hi_IN.mo │ ├── sportspress-hr.mo │ ├── sportspress-hu_HU.mo │ ├── sportspress-hy.mo │ ├── sportspress-id_ID.mo │ ├── sportspress-is_IS.mo │ ├── sportspress-it_IT.mo │ ├── sportspress-ja.mo │ ├── sportspress-kk.mo │ ├── sportspress-kn.mo │ ├── sportspress-ko_KR.mo │ ├── sportspress-lt_LT.mo │ ├── sportspress-mk_MK.mo │ ├── sportspress-ms_MY.mo │ ├── sportspress-nb_NO.mo │ ├── sportspress-nl_NL.mo │ ├── sportspress-nn_NO.mo │ ├── sportspress-pl_PL.mo │ ├── sportspress-pt_BR.mo │ ├── sportspress-pt_PT.mo │ ├── sportspress-ro_RO.mo │ ├── sportspress-ru_RU.mo │ ├── sportspress-sk_SK.mo │ ├── sportspress-sl_SI.mo │ ├── sportspress-sq.mo │ ├── sportspress-sr_RS.mo │ ├── sportspress-sv_SE.mo │ ├── sportspress-ta_IN.mo │ ├── sportspress-te.mo │ ├── sportspress-th.mo │ ├── sportspress-tl.mo │ ├── sportspress-tr_TR.mo │ ├── sportspress-uk.mo │ ├── sportspress-ur.mo │ ├── sportspress-vi.mo │ ├── sportspress-zh_CN.mo │ ├── sportspress-zh_HK.mo │ ├── sportspress-zh_TW.mo │ └── sportspress.pot ├── license.txt ├── modules/ │ ├── sportspress-admin-bar.php │ ├── sportspress-birthdays.php │ ├── sportspress-bulk-actions.php │ ├── sportspress-calendars.php │ ├── sportspress-comments-scheduled-events.php │ ├── sportspress-conditional-equations.php │ ├── sportspress-countdowns.php │ ├── sportspress-default-nationality.php │ ├── sportspress-event-specs.php │ ├── sportspress-event-status.php │ ├── sportspress-event-videos.php │ ├── sportspress-gutenberg.php │ ├── sportspress-icons.php │ ├── sportspress-importers.php │ ├── sportspress-lazy-loading.php │ ├── sportspress-league-tables.php │ ├── sportspress-next-team-preset.php │ ├── sportspress-officials.php │ ├── sportspress-openstreetmap.php │ ├── sportspress-overview.php │ ├── sportspress-player-assignments.php │ ├── sportspress-player-lists.php │ ├── sportspress-styles.php │ ├── sportspress-template-selector.php │ ├── sportspress-tutorials.php │ ├── sportspress-user-registration.php │ ├── sportspress-widget-alignment.php │ ├── sportspress-widgets.php │ └── sportspress-wordpay.php ├── presets/ │ ├── esports/ │ │ ├── csgo.json │ │ ├── dota2.json │ │ └── lol.json │ ├── other/ │ │ └── custom.json │ ├── racket-sports/ │ │ ├── squash.json │ │ ├── table-tennis.json │ │ └── tennis.json │ ├── target-sports/ │ │ ├── darts.json │ │ ├── golf.json │ │ └── snooker.json │ ├── team-sports/ │ │ ├── baseball.json │ │ ├── basketball.json │ │ ├── cricket.json │ │ ├── floorball.json │ │ ├── football.json │ │ ├── footy.json │ │ ├── handball.json │ │ ├── ice-hockey.json │ │ ├── lacrosse.json │ │ ├── netball.json │ │ ├── rugby-league.json │ │ ├── rugby-union.json │ │ ├── soccer.json │ │ ├── softball.json │ │ └── volleyball.json │ └── water-sports/ │ └── water-polo.json ├── readme.txt ├── sportspress.php ├── templates/ │ ├── birthdays.php │ ├── countdown.php │ ├── event-blocks.php │ ├── event-calendar.php │ ├── event-details.php │ ├── event-fixtures-results.php │ ├── event-list.php │ ├── event-logos-block.php │ ├── event-logos-inline.php │ ├── event-logos.php │ ├── event-officials-list.php │ ├── event-officials-table.php │ ├── event-officials.php │ ├── event-overview.php │ ├── event-performance-table.php │ ├── event-performance.php │ ├── event-results.php │ ├── event-staff.php │ ├── event-venue.php │ ├── event-video.php │ ├── league-table.php │ ├── official-details.php │ ├── player-details.php │ ├── player-events.php │ ├── player-gallery-thumbnail.php │ ├── player-gallery.php │ ├── player-list.php │ ├── player-photo.php │ ├── player-selector.php │ ├── player-statistics-league.php │ ├── player-statistics.php │ ├── post-excerpt.php │ ├── staff-content.php │ ├── staff-details.php │ ├── staff-excerpt.php │ ├── staff-header.php │ ├── staff-photo.php │ ├── staff-selector.php │ ├── team-details.php │ ├── team-events.php │ ├── team-gallery-thumbnail.php │ ├── team-gallery.php │ ├── team-link.php │ ├── team-lists.php │ ├── team-logo.php │ ├── team-staff.php │ ├── team-tables.php │ └── venue-map.php └── wpml-config.xml ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .htaccess *.log .DS_STORE .idea/ ================================================ FILE: CONTRIBUTING.md ================================================ # How to contribute Community made patches, bug reports, contributions, and translations are always welcome. When contributing please ensure you follow the guidelines below so that we can keep on top of things. __Note:__ GitHub 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: - [Elto](https://www.elto.com/) - [Codeable](https://codeable.io/ambassadors/themeboy/) ## Getting Started * Make sure you have a [GitHub account](https://github.com/signup/free) * Submit a ticket for your issue, assuming one does not already exist. * Clearly describe the issue including steps to reproduce when it is a bug. * Make sure you fill in the earliest version that you know has the issue. ## Making Changes * Fork the repository on GitHub. * Make the changes to your forked repository. * **Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards).** * Ensure you use LF line endings - no crazy windows line endings. :) * When committing, reference your issue (#1234) and include a note about the fix. * 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. * Please don't modify the changelog, this will be maintained by ThemeBoy. At 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. # Additional Resources * [General GitHub documentation](http://help.github.com/) * [GitHub pull request documentation](http://help.github.com/send-pull-requests/) * [SportsPress plugin page on WordPress.org](http://wordpress.org/plugins/sportspress/) ================================================ FILE: README.md ================================================ # SportsPress - WP league management Welcome to the SportsPress repository on GitHub. Here you can browse the source, look at open issues and keep track of development. If you are not a developer, please use the [SportsPress plugin page](http://wordpress.org/plugins/sportspress/) on WordPress.org. ## Support This 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: * The [public support forums](http://wordpress.org/support/plugin/sportspress) on WordPress.org, where the community can help each other out. * The [ThemeBoy premium support portal](http://tboy.co/support) for customers who have purchased themes or extensions. ## Contributing to SportsPress If 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. Translators can contribute new languages to SportsPress through [Transifex](https://www.transifex.com/projects/p/sportspress/). ================================================ FILE: assets/css/Control.Geocoder.css ================================================ .leaflet-control-geocoder { border-radius: 4px; background: white; min-width: 26px; min-height: 26px; } .leaflet-touch .leaflet-control-geocoder { min-width: 30px; min-height: 30px; } .leaflet-control-geocoder a, .leaflet-control-geocoder .leaflet-control-geocoder-icon { border-bottom: none; display: inline-block; } .leaflet-control-geocoder .leaflet-control-geocoder-alternatives a { width: inherit; height: inherit; line-height: inherit; } .leaflet-control-geocoder a:hover, .leaflet-control-geocoder .leaflet-control-geocoder-icon:hover { border-bottom: none; display: inline-block; } .leaflet-control-geocoder-form { display: none; vertical-align: middle; } .leaflet-control-geocoder-expanded .leaflet-control-geocoder-form { display: inline-block; } .leaflet-control-geocoder-form input { font-size: 120%; border: 0; background-color: transparent; width: 246px; } .leaflet-control-geocoder-icon { border-radius: 4px; width: 26px; height: 26px; border: none; background-color: white; background-image: url(images/geocoder.png); background-repeat: no-repeat; background-position: center; cursor: pointer; } .leaflet-touch .leaflet-control-geocoder-icon { width: 30px; height: 30px; } .leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon { background-image: url(images/throbber.gif); } .leaflet-control-geocoder-form-no-error { display: none; } .leaflet-control-geocoder-form input:focus { outline: none; } .leaflet-control-geocoder-form button { display: none; } .leaflet-control-geocoder-error { margin-top: 8px; margin-left: 8px; display: block; color: #444; } .leaflet-control-geocoder-alternatives { display: block; width: 272px; list-style: none; padding: 0; margin: 0; } .leaflet-control-geocoder-alternatives-minimized { display: none; height: 0; } .leaflet-control-geocoder-alternatives li { white-space: nowrap; display: block; overflow: hidden; padding: 5px 8px; text-overflow: ellipsis; border-bottom: 1px solid #ccc; cursor: pointer; } .leaflet-control-geocoder-alternatives li a, .leaflet-control-geocoder-alternatives li a:hover { width: inherit; height: inherit; line-height: inherit; background: inherit; border-radius: inherit; text-align: left; } .leaflet-control-geocoder-alternatives li:last-child { border-bottom: none; } .leaflet-control-geocoder-alternatives li:hover, .leaflet-control-geocoder-selected { background-color: #f5f5f5; } .leaflet-control-geocoder-address-detail { } .leaflet-control-geocoder-address-context { color: #666; } ================================================ FILE: assets/css/activation.css ================================================ /* Messages */ div.sportspress-message { border-left-color: #00a69c !important; } div.sportspress-message a.button-primary, p.sportspress-actions input.button-primary, p.sportspress-actions input.button-primary:active, p.sportspress-actions a.button-primary, p.sportspress-actions a.button-primary:active { background: #3bbab3; border-color: #15a29a; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1); color: #fff; text-decoration: none; text-shadow: 0 -1px 1px #15a29a,1px 0 1px #15a29a,0 1px 1px #15a29a,-1px 0 1px #15a29a; } div.sportspress-message a.button-primary:hover, p.sportspress-actions input.button-primary:hover, p.sportspress-actions input.button-primary:focus, p.sportspress-actions a.button-primary:hover, p.sportspress-actions a.button-primary:focus { background: #00a69c; border-color: #009187; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1); color: #fff; text-decoration: none; } .sp-feature a { text-decoration: none; } .sp-feature p.sportspress-actions { margin-top: 16px; } .about-sportspress-wrap div.updated { display: block!important; } .about-sportspress-wrap .changelog .sportspress-steps { margin-top: 24px; } .about-sportspress-wrap .changelog .sportspress-steps li { line-height: 16px; list-style-type: none; margin-left: 0; } .about-sportspress-wrap .changelog .sportspress-steps li a { display: block; padding: 0 0 8px; background: transparent!important; } .sportspress-steps:before, .sportspress-steps:after { content: " "; display: table; } .sportspress-steps:after { clear: both; } .sportspress-steps { *zoom: 1; } .sportspress-steps .welcome-icon i:before { color: #888; } ================================================ FILE: assets/css/admin.css ================================================ /* SportsPress admin styles */ #sp_formatdiv .post-format-icon { margin-left: 0.5px; } .post-state-format.post-format-calendar:before, .post-format-icon.post-format-calendar:before, a.post-state-format.format-calendar:before { content: "\f145"; } .post-state-format.post-format-league:before, .post-format-icon.post-format-league:before, a.post-state-format.format-league:before { content: "\f332"; } .post-state-format.post-format-friendly:before, .post-format-icon.post-format-friendly:before, a.post-state-format.format-friendly:before { content: "\f328"; } .post-state-format.post-format-player:before, .post-format-icon.post-format-player:before, a.post-state-format.format-player:before, .post-state-format.post-format-roster:before, .post-format-icon.post-format-roster:before, a.post-state-format.format-roster:before { content: "\f307"; } .post-state-format.post-format-team:before, .post-format-icon.post-format-team:before, a.post-state-format.format-team:before { content: "\f334"; } .post-state-format.post-format-standings:before, .post-format-icon.post-format-standings:before, a.post-state-format.format-standings:before { content: "\f185"; } .post-state-format.post-format-list:before, .post-format-icon.post-format-list:before, a.post-state-format.format-list:before { content: "\f163"; } .post-state-format.post-format-blocks:before, .post-format-icon.post-format-blocks:before, a.post-state-format.format-blocks:before { content: "\f164"; } .sp-dummy { display: none; } .sp-add-new-h2 { top: 0; float: right; } .sp-tablenav-input { height: 28px; margin: 0 4px 0 0; } #sp_videodiv .inside > fieldset > p:first-child { margin-top: 7px !important; } #sp_videodiv .inside > fieldset > p:last-child { margin-bottom: 1px !important; } #sp_editordiv #wp-content-editor-tools { background: transparent; } #sp_editordiv .tmce-active .switch-html, #sp_editordiv .html-active .switch-tmce { background: #fdfdfd; } .post-type-sp_player .curtime #timestamp:before { font-family: sportspress, dashicons; content: "\f453"; } .post-type-sp_event .sp-event-status:before { color: #82878c; font: 400 20px/1 dashicons; speak: none; display: inline-block; padding: 0 2px 0 0; top: 0; left: -1px; position: relative; vertical-align: top; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-decoration: none!important; content: "\f469"; } .post-type-sp_event .sp-event-status-select { line-height: 1.5em; margin-top: 3px; } .sp-link:before { font: normal 20px/1 dashicons; speak: none; display: inline-block; position: relative; vertical-align: top; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-decoration: none !important; content: "\f504"; } .fixed .column-sp_team .sp-result, .sp-calendar-table .sp-result { background: #888; color: #fff; font-size: 11px; font-weight: 600; text-align: center; height: 1.4em; line-height: 1.4em; min-width: .7em; padding: 0 6px; display: inline-block; -webkit-border-radius: 2px; border-radius: 2px; cursor: pointer; } .fixed .column-sp_team .sp-result:hover, .sp-calendar-table .sp-result:hover { background: #2ea2cc; } .fixed .column-sp_team .sp-edit-result { font-size: 11px; line-height: 1.4em; } .fixed .column-sp_team .sp-results { margin-bottom: .2em; } .fixed .column-sp_format, .fixed .column-sp_icon, .fixed .column-sp_number { width: 2.3em; text-align: center; } .fixed tbody .column-sp_icon { padding-top: 12px; } .fixed .column-sp_time { width: 6%; } .post-type-sp_event .fixed .column-sp_time, .post-type-sp_event .fixed .column-sp_league, .post-type-sp_calendar .fixed .column-sp_league, .post-type-sp_event .fixed .column-sp_season, .post-type-sp_calendar .fixed .column-sp_season, .post-type-sp_event .fixed .column-sp_venue, .post-type-sp_calendar .fixed .column-sp_venue, .post-type-sp_event .fixed .column-sp_day, .post-type-sp_player .fixed .column-sp_position { width: 10%; } .fixed td.column-sp_format .dashicons:before { color: #888; } .form-table td input.sp-number-input { width: auto; } /* Settings */ .sportspress table.form-table, .sportspress table.form-table .forminp-radio ul { margin: 0; } .sportspress table.form-table .forminp-radio ul li { display: inline; margin-right: 20px; } .sportspress table.form-table .forminp-radio ul li label.post-format-icon { margin-top: 0 !important; } .sportspress table.form-table fieldset { margin-top: 4px; } .sportspress table.form-table fieldset:first-child { margin-top: 0; } .sportspress table.form-table fieldset p.description { margin-bottom: 8px; } .sp-admin-config-table .edit { text-align: right; } .sportspress table.form-table .sp-color-option { max-width: 225px; } .sportspress table.form-table .sp-color-option table { outline: 1px solid #ddd; } .sportspress table.form-table .sp-custom-colors { padding: 5px 15px 15px; } .sportspress table.form-table .sp-color-box { border: 1px solid #ccc; box-shadow: 1px 1px 3px rgba(0,0,0,.2); -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.2); -moz-box-shadow: 1px 1px 3px rgba(0,0,0,.2); -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; padding: 4px 6px; float: left; width: 90px; margin: 0 10px 10px 0; } .sportspress table.form-table .sp-color-box strong { text-align: left; display: block; padding: 0 0 2px; font-size: .92em; word-wrap: break-word; } .sportspress table.form-table .sp-color-box input.colorpick { width: 100%; margin: 0; font-family: monospace; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .sportspress table.form-table .sp-color-box .iris-picker { z-index: 100; position: absolute; display: none; border: 1px solid #ccc; box-shadow: 1px 1px 3px rgba(0,0,0,.2); -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.2); -moz-box-shadow: 1px 1px 3px rgba(0,0,0,.2); -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; margin: 15px 0 0 -7px; } .sportspress table.form-table #sportspress_custom_css { font-family: monospace; } .sportspress .submit, .sp-data-table-container { clear: both; } .sp-data-table-container::-webkit-scrollbar { height:12px; } .sp-data-table-container::-webkit-scrollbar-track { box-shadow:0 0 2px rgba(0,0,0,0.15) inset; background:#f0f0f0; } .sp-data-table-container::-webkit-scrollbar-thumb { border-radius:6px; background:#ccc; } table.widefat.sp-data-table img { vertical-align: top; } table.widefat.sp-data-table th.column-outcome, table.widefat.sp-data-table th.column-position { width: 10em; } table.widefat.sp-data-table th, table.widefat.sp-data-table td { padding-right: 0; } table.widefat.sp-data-table th:last-child, table.widefat.sp-data-table td:last-child { padding-right: 10px; } table.widefat.sp-data-table td { line-height: 2; overflow: visible; white-space: nowrap; } table.widefat.sp-data-table th.icon, table.widefat.sp-data-table td.icon { width: 1px; } table.widefat.sp-data-table th.icon span, table.widefat.sp-data-table td.icon span { margin-right: 0; } table.widefat.sp-data-table input[type="text"], table.widefat.sp-data-table input[type="number"] { min-width: 1.25em; width: 100%; margin: 1px; padding: 3px 5px; } table.widefat.sp-data-table input[type="text"]::placeholder, table.widefat.sp-data-table input[type="number"]::placeholder { color: silver; } table.widefat.sp-data-table input.small-text { width: 50px; min-width: 0; } table.widefat.sp-data-table input.tiny-text { width: 25px; min-width: 0; } table.widefat.sp-data-table input.name { min-width: 0; width: auto; } table.widefat.sp-data-table a.dashicons { cursor: pointer; height: 27px; line-height: 27px; } table.widefat.sp-data-table a.sp-edit { -moz-opacity: 0; opacity: 0; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; } table.widefat.sp-data-table tr:hover a.sp-edit { -moz-opacity: 1; opacity: 1; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; } table.widefat.sp-data-table th.check-column { padding: 10px 0 6px 2px; } table.widefat.sp-data-table th:not(.check-column) input[type=checkbox] { margin: -4px 1px 0; vertical-align: middle; } table.widefat.sp-data-table tfoot th, table.widefat.sp-data-table tfoot td { border-top: 1px solid #e1e1e1; } table.widefat.sp-data-table tfoot tr.sp-total { background: #f9f9f9; } table.widefat select.sp-outcome, table.widefat select.sp-position { width: 100%; } table.widefat.sp-sortable-table tbody tr { background-color: #fff; } table.widefat.sp-sortable-table tbody tr:nth-child(2n-1) { background-color: #f9f9f9; } table.widefat.sp-sortable-table tbody tr .icon { cursor: move; } .sp-not-found-container { display: none; } .sp-settings-bar { float: none; clear: both; } .sp-settings-section { margin-top: 20px; position: relative; max-width: 1050px; border: 1px solid #e5e5e5; -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04); box-shadow: 0 1px 1px rgba(0,0,0,.04); background: #fff; } .sp-settings-section h3 { font-size: 14px; padding: 8px 12px; margin: 0; line-height: 1.4; border-bottom: 1px solid #e1e1e1; } .sp-settings-section > .form-table > tbody > tr > th { padding: 13px 15px; font-size: 13px; line-height: 1.4em; background: #f9f9f9; width: 24%; border-top: 1px solid #e1e1e1; } .sp-settings-section > .form-table > tbody > tr > td { border-left: 1px solid #e1e1e1; border-top: 1px solid #e1e1e1; padding: 10px 15px; font-size: 13px; line-height: 1.4em; } .sp-settings-section > .form-table > tbody > tr:first-child > th, .sp-settings-section > .form-table > tbody > tr:first-child > td { border-top: none; } .sp-settings-section > p { border-bottom: 1px solid #e1e1e1; padding: 13px 15px; font-size: 13px; background: #f9f9f9; margin: 0; } .sp-admin-config-table th, .sp-admin-config-table td { padding: 8px 10px; } .sp-admin-config-table th.radio, .sp-admin-config-table td.radio, .sp-admin-config-table th.icon, .sp-admin-config-table td.icon { width: 1%; text-align: center; } .sp-admin-config-table th.radio input[type=radio], .sp-admin-config-table td.radio input[type=radio] { margin: 0; vertical-align: middle; } #sp_venue-adder h4, #sp_team-adder h4, #sp_season-adder h4, #sp_player-adder h4, #sp_position-adder h4 { margin: 10px 0; } .form-field .sp-location-picker { width: 95%; height: 320px; } /* Chosen */ .chosen-container-single .chosen-single { -webkit-border-radius: 3px; border-radius: 3px; color: #555; border-color: #ccc; background: #f7f7f7; -webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08); box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08); } .chosen-container-active .chosen-single { border-color: #999; background: #fff; } .chosen-container-active.chosen-with-drop .chosen-single { background: #fff; } .chosen-container-single .chosen-drop { -webkit-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; } .chosen-container-multi .chosen-choices { background: #fff; color: #333; padding: 3px 0; border-color: #ddd; box-shadow: inset 0 1px 2px rgba(0,0,0,.07); line-height: 2; } .chosen-container-multi .chosen-choices li.search-field input[type="text"] { color: #a9a9a9; height: auto; } .chosen-container-multi .chosen-choices li.search-choice { color: #555; border-color: #ccc; background: #f7f7f7; -webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08); box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08); vertical-align: top; } .chosen-container-multi .chosen-choices li.search-choice:hover { background: #fafafa; border-color: #999; color: #222; } .chosen-container-multi .chosen-choices li.search-choice .search-choice-close { transition: none; -webkit-transition: none; } /* CodeMirror */ .sp-settings-section .CodeMirror { border: 1px solid #ddd; box-shadow: inset 0 1px 2px rgba(0,0,0,.07); } .sp-settings-section .CodeMirror-gutters { background: #f9f9f9; border-color: #e1e1e1; } /* Paragraph */ .sp-para { margin: 1em 0; } /* TipTip */ .sp-tip, .sp-desc-tip { cursor: help; } .sp-desc-tip:before { color: #aaa; } .sp-desc-active:before { color: #7ad03a; } #tiptip_holder { display: none; position: absolute; top: 0; left: 0; z-index: 99999; } #tiptip_holder.tip_top { padding-bottom: 5px; } #tiptip_holder.tip_bottom { padding-top: 5px; } #tiptip_holder.tip_right { padding-left: 5px; } #tiptip_holder.tip_left { padding-right: 5px; } #tiptip_content { font-size: 11px; color: #fff; padding: .5em; background: #464646; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.1); -moz-box-shadow: 1px 1px 3px rgba(0,0,0,.1); box-shadow: 1px 1px 3px rgba(0,0,0,.1); text-align: center; } #tiptip_arrow, #tiptip_arrow_inner { position: absolute; border-color: transparent; border-style: solid; border-width: 6px; height: 0; width: 0; } #tiptip_holder.tip_top #tiptip_arrow { border-top-color: #fff; border-top-color: rgba(255,255,255,0.25); } #tiptip_holder.tip_bottom #tiptip_arrow { border-bottom-color: #fff; border-bottom-color: rgba(255,255,255,0.25); } #tiptip_holder.tip_right #tiptip_arrow { border-right-color: #fff; border-right-color: rgba(255,255,255,0.25); } #tiptip_holder.tip_left #tiptip_arrow { border-left-color: #fff; border-left-color: rgba(255,255,255,0.25); } #tiptip_holder.tip_top #tiptip_arrow_inner { margin-top: -7px; margin-left: -6px; border-top-color: #464646; } #tiptip_holder.tip_bottom #tiptip_arrow_inner { margin-top: -5px; margin-left: -6px; border-bottom-color: #464646; } #tiptip_holder.tip_right #tiptip_arrow_inner { margin-top: -6px; margin-left: -5px; border-right-color: #464646; } #tiptip_holder.tip_left #tiptip_arrow_inner { margin-top: -6px; margin-left: -7px; border-left-color: #464646; } /* Toggle switches */ .sp-toggle-switch { display: none !important; } .sp-toggle-switch + label { width: 32px; height: 16px; border-radius: 16px; position: absolute; right: 12px; top: 13px; } .sp-toggle-switch + label:before, .sp-toggle-switch + label:after { display: block; position: absolute; top: 0; left: 0; bottom: 0; content: ""; } .sp-toggle-switch + label:before { right: 1px; background-color: #e4e4e4; border-radius: 16px; transition: background 0.4s; } .sp-toggle-switch + label:after { width: 16px; background-color: #fff; border-radius: 100%; -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: margin 0.4s; } .sp-toggle-switch:checked + label:before { background-color: #00a0d2; } .sp-toggle-switch:checked + label:after { margin-left: 16px; } .sp-toggle-switch:checked + label:hover:before { background-color: #00b9eb; } /* Tab panels */ .sp-tab-panel { max-height: 500px; } /* Sortable lists */ .sp-sortable-list { margin: 0; overflow: hidden; padding-top: 5px; min-height: 50px; } .sp-sortable-list li { float: left; clear: both; max-width: 382px; width: 100%; box-sizing: border-box; } .sp-sortable-list .sp-item-float + .sp-item-float { padding-right: 0; } .sp-item-bar { clear: both; line-height: 1.5em; position: relative; margin: 9px 0 0; } .sp-item-bar .sp-item-handle { background: #fafafa; color: #23282d; border: 1px solid #dfdfdf; position: relative; padding: 10px 15px; height: auto; min-height: 20px; line-height: 30px; overflow: hidden; word-wrap: break-word; } .sp-item-bar .sp-item-handle:hover { border-color: #999; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.1); box-shadow: 0 1px 2px rgba(0,0,0,.1); } .sp-item-bar .sp-item-title { font-size: 13px; font-weight: 600; line-height: 20px; display: block; margin-right: 13em; } .sp-item-settings { display: block; padding: 10px 0 10px 15px; position: relative; z-index: 10; background: #fff; border: 1px solid #e5e5e5; border-top: none; -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04); box-shadow: 0 1px 1px rgba(0,0,0,.04); } .js .sp-item-handle { cursor: move; } .sp-sortable-list .sp-item-placeholder { border: 1px dashed #b4b9be; margin: 9px auto 6px; height: 42px; } /* Logo */ .sp-settings-logo { width: auto; height: auto; max-width: 100%; max-height: 35px; } /* Modules */ .sp-modules-wrapper { margin-right: 300px; max-width: 750px; } .sp-modules-main { width: 100%; float: left; } .sp-modules-sidebar { float: right; margin-right: -300px; width: 280px; } .sp-modules-sidebar table th, .sp-modules-sidebar table td { padding: 10px 14px; } .sp-modules-sidebar table th img { display: block; } .sp-modules-sidebar table td p { margin-top: 0; } .sp-modules-sidebar table td .sp-module-actions { padding: 10px; clear: both; border-top: 1px solid #ddd; background: #f9f9f9; margin: 0 -14px; text-align: right; } .sp-modules-sidebar table td .sp-module-actions:last-child { margin-bottom: -10px; } .sp-modules-sidebar table td .sp-module-actions span { line-height: 28px; vertical-align: middle; text-align: left; float: left; margin-left: 4px; color: #999; } .sp-modules-sidebar table td ul { margin: 2px 0 0.8em; } .sp-modules-sidebar table td ul:last-child { margin-bottom: 0; } .sp-modules-sidebar table td ol { margin: 2px 0 0.8em; list-style-position: inside; } .sp-modules-sidebar table td span { color: #aaa; } .sp-modules-sidebar table td .sp-theme-screenshot { margin: 4px 0; } .sp-modules-wrapper img { max-width: 100%; } .sp-modules-wrapper table { margin-top: 20px; } table.sp-modules-table th { font-weight: 600; } table.sp-modules-table td { padding: 10px 14px; line-height: 25px; border-bottom: 1px solid #e1e1e1; position: relative; } table.sp-modules-table tr:last-child td { border-bottom: none; } table.sp-modules-table td > input[type=checkbox] { margin-top: -4px; } table.sp-modules-table td > input[type=checkbox][disabled=disabled] { cursor: default; } table.sp-modules-table td .button { position: absolute; right: 9px; top: 9px; } table.sp-modules-table .sp-desc { color: #aaa; float: right; } table.sp-modules-table [class^="sp-icon-"], table.sp-modules-table [class*=" sp-icon-"], table.sp-modules-table .dashicons { position: relative; top: 2px; left: -0.5px; line-height: 1; } table.sp-modules-table .sp-module-unavailable .sp-desc-tip { vertical-align: middle; color: #aaa; } table.sp-modules-table .sp-module-unavailable span [class^="sp-icon-"], table.sp-modules-table .sp-module-unavailable span [class*=" sp-icon-"], table.sp-modules-table .sp-module-unavailable span .dashicons { -moz-opacity: 0.8; opacity: 0.8; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; } /* Licenses */ .sp-licenses-wrapper { max-width: 750px; } .sp-licenses-table th, .sp-licenses-table input { vertical-align: middle; } #debug-report { display: none; margin: 10px 0; padding: 0; position: relative; } #debug-report textarea { font-family: monospace; width: 100%; margin: 0; height: 300px; padding: 20px; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; resize: none; font-size: 12px; line-height: 20px; outline: 0; } table.sp-status-table td mark { background: transparent none; } table.sp-status-table td mark.yes { color: #7ad03a; } /* Importers */ #import-upload-form table.form-table th, #import-upload-form table.form-table td { padding-bottom: 0; } #import-upload-form table.form-table tbody tr:last-child td { padding-bottom: 20px; } .sp-import-table th, .sp-import-table td { padding-right: 0; } .sp-import-table th:last-child, .sp-import-table td:last-child { padding-right: 10px; } .sp-import-table tbody tr:nth-child(2n-1) { background: #f9f9f9; } .sp-import-table select { max-width: 100%; } .sp-import-table .sp-actions-column { width: 40px; text-align: right; } .sp-import-table .sp-add-row { line-height: 1.5; } .sp-import-table .sp-delete-row { color: #a00; } .sp-import-table .sp-delete-row:hover { color: #f00; } /* Welcome Screen */ .about-sportspress-wrap .sp-welcome-logo { display: inline; } .about-sportspress-wrap .sp-welcome-logo img { width: auto; border: none; } .about-sportspress-wrap .sp-about-text { min-height: 0; margin-right: 165px; } .about-sportspress-wrap .sp-badge { float: right; background: #00cac4 url(../images/welcome/sp-badge.png) no-repeat center top; text-rendering: optimizeLegibility; padding-top: 10px; height: 150px; width: 150px; font-size: 14px; line-height: 1.75; text-align: center; font-weight: 600; color: #c4fffc; margin: 5px 0 0 0; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.2); box-shadow: 0 1px 3px rgba(0,0,0,.2); } .about-sportspress-wrap .sportspress-actions .twitter-share-button { margin-top: -3px; margin-left: 3px; vertical-align: middle; } .about-sportspress-wrap .nav-tab-wrapper { clear: both; } .about-sportspress-wrap .sp-feature { overflow: visible !important; *zoom:1; } .about-sportspress-wrap .sp-feature > div { float: left; width: 50%; } .about-sportspress-wrap .sp-feature > div.last-feature { float: right; } .about-sportspress-wrap .sp-feature:before, .about-sportspress-wrap .sp-feature:after { content: " "; display: table; } .about-sportspress-wrap .sp-feature:after { clear: both; } .about-sportspress-wrap div.icon { width: 0 !important; padding: 0; margin: 0; } .about-sportspress-wrap .sp-feature div.icon:before { font-family: sportspress !important; font-weight: normal; width: 100%; font-size: 170px; line-height: 125px; color: #9c5d90; display: inline-block; position: relative; text-align: center; speak: none; margin: ; content: "\f111"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .about-sportspress-wrap .sp-theme-screenshot { float: left; margin-right: 15px; } .about-sportspress-wrap .form-table th { width: auto; } .about-sportspress-wrap .sp-top-translations { float: right; margin-left: 20px; } .about-sportspress-wrap .sp-top-translations .hndle { font-size: 14px; padding: 8px 12px; margin: 0; line-height: 1.4; cursor: auto; } .about-sportspress-wrap .sp-transifex-chart { padding: 0 12px; text-align: center; } .about-sportspress-wrap .sp-transifex-chart a { display: inline-block; } /* Tutorials */ .sp-tutorials-list { margin: -6px; width: 100%; } .sp-tutorials-list li { display: inline-block; width: 342px; max-width: 100%; margin: 6px; } .sp-tutorials-list li th { font-weight: 600; } .sp-tutorials-list li strong { background: #aaa; display: inline-block; color: #ffffff; padding: 0 6px; border-radius: 3px; text-align: center; font-size: 12px; margin-right: 3px; } .sp-tutorials-list li:hover strong { background: #00a69c; } .sp-tutorials-list li .sp-popup { float: right; color: #aaa; } .sp-tutorials-list li:hover .sp-popup { color: #00a69c; } .sp-tutorials-list li iframe { display: block; } /* Media Queries */ @media only screen and (max-width: 960px) { .sportspress_page_sportspress-more iframe { /*padding-left: 36px;*/ } } @media only screen and (max-width: 850px) { .sp-modules-wrapper { margin-right: 0; } .sp-modules-main, .sp-modules-sidebar { margin-right: 0; width: 100%; } .sp-tab-panel { max-height: 200px; } } @media only screen and (max-width: 782px) { .fixed .column-sp_time, .fixed .column-sp_team, .fixed .column-sp_league, .fixed .column-sp_season, .fixed .column-sp_venue, .fixed .column-sp_position, .fixed .column-sp_player { display: none; } .form-field .sp-location-picker { width: 99%; } .form-field td .sp-location-picker { width: 100%; } .sp-settings-section > .form-table > tbody > tr > th { width: auto; } .sp-settings-section > .form-table > tbody > tr > td, .sp-settings-section > .form-table > tbody > tr:first-child > td { border-left: none; border-top: 1px solid #e1e1e1; } .sp-settings-section .sp-configure-sport { margin-top: 10px; } table.sp-modules-table td .button { margin: -3px -7px -3px 10px; } .about-sportspress-wrap .sp-top-translations { float: none; margin-left: 0; } .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-sp_format, .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-sp_icon, .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-sp_number { display: table-cell!important; } } @media only screen and (max-width: 600px) { .about-sportspress-wrap .sp-welcome-logo, .about-sportspress-wrap .sp-about-text { display: block; text-align: center; margin-right: 0; padding-right: 0; } .about-sportspress-wrap .sp-badge { float: none; margin: 20px auto 10px; } } ================================================ FILE: assets/css/chosen.css ================================================ /*! Chosen, a Select Box Enhancer for jQuery and Prototype by Patrick Filler for Harvest, http://getharvest.com Version 1.1.0 Full source at https://github.com/harvesthq/chosen Copyright (c) 2011 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md This file is generated by `grunt build`, do not edit it by hand. */ /* @group Base */ .chosen-container { position: relative; display: inline-block; vertical-align: middle; font-size: 13px; zoom: 1; *display: inline; -webkit-user-select: none; -moz-user-select: none; user-select: none; } .chosen-container .chosen-drop { position: absolute; top: 100%; left: -9999px; z-index: 1010; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; border: 1px solid #aaa; border-top: 0; background: #fff; box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15); } .chosen-container.chosen-with-drop .chosen-drop { left: 0; } .chosen-container a { cursor: pointer; } /* @end */ /* @group Single Chosen */ .chosen-container-single .chosen-single { position: relative; display: block; overflow: hidden; padding: 0 0 0 8px; height: 23px; border: 1px solid #aaa; border-radius: 5px; background-color: #fff; background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4)); background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background-clip: padding-box; box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1); color: #444; text-decoration: none; white-space: nowrap; line-height: 24px; } .chosen-container-single .chosen-default { color: #999; } .chosen-container-single .chosen-single span { display: block; overflow: hidden; margin-right: 26px; text-overflow: ellipsis; white-space: nowrap; } .chosen-container-single .chosen-single-with-deselect span { margin-right: 38px; } .chosen-container-single .chosen-single abbr { position: absolute; top: 6px; right: 26px; display: block; width: 12px; height: 12px; background: url('../images/chosen/chosen-sprite.png') -42px 1px no-repeat; font-size: 1px; } .chosen-container-single .chosen-single abbr:hover { background-position: -42px -10px; } .chosen-container-single.chosen-disabled .chosen-single abbr:hover { background-position: -42px -10px; } .chosen-container-single .chosen-single div { position: absolute; top: 0; right: 0; display: block; width: 18px; height: 100%; } .chosen-container-single .chosen-single div b { display: block; width: 100%; height: 100%; background: url('../images/chosen/chosen-sprite.png') no-repeat 0px 2px; } .chosen-container-single .chosen-search { position: relative; z-index: 1010; margin: 0; padding: 3px 4px; white-space: nowrap; } .chosen-container-single .chosen-search input[type="text"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin: 1px 0; padding: 4px 20px 4px 5px; width: 100%; height: auto; outline: 0; border: 1px solid #aaa; background: white url('../images/chosen/chosen-sprite.png') no-repeat 100% -20px; background: url('../images/chosen/chosen-sprite.png') no-repeat 100% -20px; font-size: 1em; font-family: sans-serif; line-height: normal; border-radius: 0; } .chosen-container-single .chosen-drop { margin-top: -1px; border-radius: 0 0 4px 4px; background-clip: padding-box; } .chosen-container-single.chosen-container-single-nosearch .chosen-search { position: absolute; left: -9999px; } /* @end */ /* @group Results */ .chosen-container .chosen-results { position: relative; overflow-x: hidden; overflow-y: auto; margin: 0 4px 4px 0; padding: 0 0 0 4px; max-height: 240px; -webkit-overflow-scrolling: touch; } .chosen-container .chosen-results li { display: none; margin: 0; padding: 5px 6px; list-style: none; line-height: 15px; -webkit-touch-callout: none; } .chosen-container .chosen-results li.active-result { display: list-item; cursor: pointer; } .chosen-container .chosen-results li.disabled-result { display: list-item; color: #ccc; cursor: default; } .chosen-container .chosen-results li.highlighted { background-color: #3875d7; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc)); background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%); background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%); background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%); background-image: linear-gradient(#3875d7 20%, #2a62bc 90%); color: #fff; } .chosen-container .chosen-results li.no-results { display: list-item; background: #f4f4f4; } .chosen-container .chosen-results li.group-result { display: list-item; font-weight: bold; cursor: default; } .chosen-container .chosen-results li.group-option { padding-left: 15px; } .chosen-container .chosen-results li em { font-style: normal; text-decoration: underline; } /* @end */ /* @group Multi Chosen */ .chosen-container-multi .chosen-choices { position: relative; overflow: hidden; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin: 0; padding: 0; width: 100%; height: auto !important; height: 1%; border: 1px solid #aaa; background-color: #fff; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%); background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%); background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%); background-image: linear-gradient(#eeeeee 1%, #ffffff 15%); cursor: text; } .chosen-container-multi .chosen-choices li { float: left; list-style: none; } .chosen-container-multi .chosen-choices li.search-field { margin: 0; padding: 0; white-space: nowrap; } .chosen-container-multi .chosen-choices li.search-field input[type="text"] { margin: 1px 0; padding: 5px; height: 15px; outline: 0; border: 0 !important; background: transparent !important; box-shadow: none; color: #666; font-size: 100%; font-family: sans-serif; line-height: normal; border-radius: 0; } .chosen-container-multi .chosen-choices li.search-field .default { color: #999; } .chosen-container-multi .chosen-choices li.search-choice { position: relative; margin: 3px 0 3px 5px; padding: 3px 20px 3px 5px; border: 1px solid #aaa; border-radius: 3px; background-color: #e4e4e4; 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)); background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-clip: padding-box; box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05); color: #333; line-height: 13px; cursor: default; } .chosen-container-multi .chosen-choices li.search-choice .search-choice-close { position: absolute; top: 4px; right: 3px; display: block; width: 12px; height: 12px; background: url('../images/chosen/chosen-sprite.png') -42px 1px no-repeat; font-size: 1px; } .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover { background-position: -42px -10px; } .chosen-container-multi .chosen-choices li.search-choice-disabled { padding-right: 5px; border: 1px solid #ccc; background-color: #e4e4e4; 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)); background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); color: #666; } .chosen-container-multi .chosen-choices li.search-choice-focus { background: #d4d4d4; } .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close { background-position: -42px -10px; } .chosen-container-multi .chosen-results { margin: 0; padding: 0; } .chosen-container-multi .chosen-drop .result-selected { display: list-item; color: #ccc; cursor: default; } /* @end */ /* @group Active */ .chosen-container-active .chosen-single { border: 1px solid #5897fb; box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); } .chosen-container-active.chosen-with-drop .chosen-single { border: 1px solid #aaa; -moz-border-radius-bottomright: 0; border-bottom-right-radius: 0; -moz-border-radius-bottomleft: 0; border-bottom-left-radius: 0; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff)); background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%); background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%); background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%); background-image: linear-gradient(#eeeeee 20%, #ffffff 80%); box-shadow: 0 1px 0 #fff inset; } .chosen-container-active.chosen-with-drop .chosen-single div { border-left: none; background: transparent; } .chosen-container-active.chosen-with-drop .chosen-single div b { background-position: -18px 2px; } .chosen-container-active .chosen-choices { border: 1px solid #5897fb; box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); } .chosen-container-active .chosen-choices li.search-field input[type="text"] { color: #111 !important; } /* @end */ /* @group Disabled Support */ .chosen-disabled { opacity: 0.5 !important; cursor: default; } .chosen-disabled .chosen-single { cursor: default; } .chosen-disabled .chosen-choices .search-choice .search-choice-close { cursor: default; } /* @end */ /* @group Right to Left */ .chosen-rtl { text-align: right; } .chosen-rtl .chosen-single { overflow: visible; padding: 0 8px 0 0; } .chosen-rtl .chosen-single span { margin-right: 0; margin-left: 26px; direction: rtl; } .chosen-rtl .chosen-single-with-deselect span { margin-left: 38px; } .chosen-rtl .chosen-single div { right: auto; left: 3px; } .chosen-rtl .chosen-single abbr { right: auto; left: 26px; } .chosen-rtl .chosen-choices li { float: right; } .chosen-rtl .chosen-choices li.search-field input[type="text"] { direction: rtl; } .chosen-rtl .chosen-choices li.search-choice { margin: 3px 5px 3px 0; padding: 3px 5px 3px 19px; } .chosen-rtl .chosen-choices li.search-choice .search-choice-close { right: auto; left: 4px; } .chosen-rtl.chosen-container-single-nosearch .chosen-search, .chosen-rtl .chosen-drop { left: 9999px; } .chosen-rtl.chosen-container-single .chosen-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; } .chosen-rtl .chosen-results li.group-option { padding-right: 15px; padding-left: 0; } .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div { border-right: none; } .chosen-rtl .chosen-search input[type="text"] { padding: 4px 5px 4px 20px; background: white url('../images/chosen/chosen-sprite.png') no-repeat -30px -20px; background: url('../images/chosen/chosen-sprite.png') no-repeat -30px -20px; direction: rtl; } .chosen-rtl.chosen-container-single .chosen-single div b { background-position: 6px 2px; } .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b { background-position: -12px 2px; } /* @end */ /* @group Retina compatibility */ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) { .chosen-rtl .chosen-search input[type="text"], .chosen-container-single .chosen-single abbr, .chosen-container-single .chosen-single div b, .chosen-container-single .chosen-search input[type="text"], .chosen-container-multi .chosen-choices .search-choice .search-choice-close, .chosen-container .chosen-results-scroll-down span, .chosen-container .chosen-results-scroll-up span { background-image: url('../images/chosen/chosen-sprite@2x.png') !important; background-size: 52px 37px !important; background-repeat: no-repeat !important; } } /* @end */ ================================================ FILE: assets/css/customize.css ================================================ #available-widgets [class*=sp_] .widget-title:before { font-family: 'sportspress'; } #available-widgets [class*=sp_countdown] .widget-title:before { content: "\f469"; } #available-widgets [class*=sp_event_calendar] .widget-title:before, #available-widgets [class*=sp_event_list] .widget-title:before { content: "\f145"; } #available-widgets [class*=sp_league_table] .widget-title:before { content: "\f334"; } #available-widgets [class*=sp_player_list] .widget-title:before, #available-widgets [class*=sp_player_gallery] .widget-title:before { content: "\f307"; } #available-widgets [class*=sp_countdown] .widget-title:before { content: "\f469"; } ================================================ FILE: assets/css/dashboard.css ================================================ /* SportsPress dashboard styles */ #sportspress_dashboard_status .inside { padding: 0; margin: 0; } #dashboard_right_now .sp_event-count a:before, #dashboard_right_now .sp_event-count span:before, #dashboard_right_now .sp_team-count a:before, #dashboard_right_now .sp_team-count span:before, #dashboard_right_now .sp_player-count a:before, #dashboard_right_now .sp_player-count span:before, #dashboard_right_now .sp_staff-count a:before, #dashboard_right_now .sp_staff-count span:before, #dashboard_right_now .sp_official-count a:before, #dashboard_right_now .sp_official-count span:before { font-family: 'sportspress'; } #dashboard_right_now .sp_event-count a:before, #dashboard_right_now .sp_event-count span:before { content: "\f145"; } #dashboard_right_now .sp_team-count a:before, #dashboard_right_now .sp_team-count span:before { content: "\f334"; } #dashboard_right_now .sp_player-count a:before, #dashboard_right_now .sp_player-count span:before { content: "\f307"; } #dashboard_right_now .sp_staff-count a:before, #dashboard_right_now .sp_staff-count span:before { content: "\f338"; } #dashboard_right_now .sp_official-count a:before, #dashboard_right_now .sp_official-count span:before { content: "\f227"; } #sportspress_dashboard_status .sp_status_list { overflow: hidden; margin: 0; } #sportspress_dashboard_status .sp_status_list li { width: 50%; float: left; padding: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin: 0; color: #aaa; } #sportspress_dashboard_status .sp_status_list li.countdown { width: 100%; border-bottom: 1px solid #ececec; } #sportspress_dashboard_status .sp_status_list li.events-scheduled { border-right: 1px solid #ececec; } #sportspress_dashboard_status .sp_status_list li a { display: block; color: #aaa; padding: 9px 12px; -webkit-transition: all ease .5s; position: relative; font-size: 12px; } #sportspress_dashboard_status .sp_status_list li a:before { font-family: sportspress, dashicons; speak: none; font-weight: 400; font-variant: normal; text-transform: none; -webkit-font-smoothing: antialiased; margin: 0; text-indent: 0; top: 0; left: 0; height: 100%; text-align: center; content: "\f145"; font-size: 2em; position: relative; width: auto; line-height: 1.2em; color: #464646; float: left; margin-right: 12px; margin-bottom: 12px; } #sportspress_dashboard_status .sp_status_list li.countdown a:before { content: "\f469"; } #sportspress_dashboard_status .sp_status_list li.events-scheduled a:before, #sportspress_dashboard_status .sp_status_list li.events-published a:before { color: #999; font-size: 2.5em; line-height: 1em; margin-left: -3px; margin-right: 9px; } #sportspress_dashboard_status .sp_status_list li.events-scheduled a:before { color: #f9af4b; } #sportspress_dashboard_status .sp_status_list li.events-published a:before { color: #00a69c; } #sportspress_dashboard_status .sp_status_list li strong { font-size: 18px; line-height: 1.2em; font-weight: 400; display: block; color: #21759b; } #sportspress_dashboard_status .sp_status_list li a:hover, #sportspress_dashboard_status .sp_status_list li a:hover strong, #sportspress_dashboard_status .sp_status_list li a:hover:before { color: #2ea2cc; } ================================================ FILE: assets/css/datepicker.css ================================================ /*! jQuery UI Datepicker Skins for WordPress Developed for the WordPress Community by the Superheroes X-Team. Updated on 2014-08-20 Full source at https://github.com/x-team/wp-jquery-ui-datepicker-skins Released under the GPLv2 */ /* Date Picker Default Styles */ .ui-datepicker { padding: 0; border: 1px solid #ddd; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .ui-datepicker * { padding: 0; font-family: "Open Sans", sans-serif; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .ui-datepicker table { font-size: 13px; margin: 0; } .ui-datepicker .ui-datepicker-header { border: none; background: #222; color: #fff; font-weight: normal; } .ui-datepicker .ui-datepicker-header .ui-state-hover { background: #222; border-color: transparent; cursor: pointer; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .ui-datepicker thead { background: #222; color: #fff; } .ui-datepicker .ui-datepicker-title { margin-top: .4em; margin-bottom: .3em; color: #fff; font-size: 14px; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover, .ui-datepicker .ui-datepicker-next, .ui-datepicker .ui-datepicker-prev { height: 1em; top: .9em; border: none; } .ui-datepicker .ui-datepicker-prev-hover { left: 2px; } .ui-datepicker .ui-datepicker-next-hover { right: 2px; } .ui-datepicker .ui-datepicker-next span, .ui-datepicker .ui-datepicker-prev span { background-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='); background-position: -32px 0; margin-top: 0; top: 0; font-weight: normal; } .ui-datepicker .ui-datepicker-prev span { background-position: -96px 0; } .ui-datepicker th { padding: 0.75em 0; color: #fff; font-weight: normal; border: none; border-top: 1px solid #333; } .ui-datepicker td { background: #f1f1f1; border: none; padding: 0; } .ui-datepicker td .ui-state-default { background: transparent; border: none; text-align: center; padding: .5em; margin: 0; font-weight: normal; color: #333; } .ui-datepicker td .ui-state-active, .ui-datepicker td .ui-state-hover { background: #0074a2; color: #fff; } .ui-datepicker td.ui-state-disabled, .ui-datepicker td.ui-state-disabled .ui-state-default { opacity: 1; color: #999; } /* Other Datepicker Color Schemes */ /* Blue */ .admin-color-blue .ui-datepicker .ui-datepicker-header, .admin-color-blue .ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-blue .ui-datepicker thead { background: #4796b3; } .admin-color-blue .ui-datepicker th { border-color: #52accc; } .admin-color-blue .ui-datepicker td .ui-state-active, .admin-color-blue .ui-datepicker td .ui-state-hover { background: #096484; } /* Coffee */ .admin-color-coffee .ui-datepicker .ui-datepicker-header, .admin-color-coffee .ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-coffee .ui-datepicker thead { background: #46403c; } .admin-color-coffee .ui-datepicker th { border-color: #59524c; } .admin-color-coffee .ui-datepicker td .ui-state-active, .admin-color-coffee .ui-datepicker td .ui-state-hover { background: #c7a589; } /* Ectoplasm */ .admin-color-ectoplasm .ui-datepicker .ui-datepicker-header, .admin-color-ectoplasm .ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-ectoplasm .ui-datepicker thead { background: #413256; } .admin-color-ectoplasm .ui-datepicker th { border-color: #523f6d; } .admin-color-ectoplasm .ui-datepicker td .ui-state-active, .admin-color-ectoplasm .ui-datepicker td .ui-state-hover { background: #a3b745; } /* Midnight */ .admin-color-midnight .ui-datepicker .ui-datepicker-header, .admin-color-midnight .ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-midnight .ui-datepicker thead { background: #26292c; } .admin-color-midnight .ui-datepicker th { border-color: #363b3f; } .admin-color-midnight .ui-datepicker td .ui-state-active, .admin-color-midnight .ui-datepicker td .ui-state-hover { background: #e14d43; } /* Ocean */ .admin-color-ocean .ui-datepicker .ui-datepicker-header, .admin-color-ocean .ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-ocean .ui-datepicker thead { background: #627c83; } .admin-color-ocean .ui-datepicker th { border-color: #738e96; } .admin-color-ocean .ui-datepicker td .ui-state-active, .admin-color-ocean .ui-datepicker td .ui-state-hover { background: #9ebaa0; } /* Sunrise */ .admin-color-sunrise .ui-datepicker .ui-datepicker-header, .admin-color-sunrise .ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-sunrise .ui-datepicker thead { background: #be3631; } .admin-color-sunrise .ui-datepicker th { border-color: #cf4944; } .admin-color-sunrise .ui-datepicker td .ui-state-active, .admin-color-sunrise .ui-datepicker td .ui-state-hover { background: #dd823b; } /* Light */ .admin-color-light .ui-datepicker .ui-datepicker-header, .admin-color-light .ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-light .ui-datepicker thead { background: #e5e5e5; } .admin-color-light .ui-datepicker td { background: #fff; } .admin-color-light .ui-datepicker .ui-datepicker-next span, .admin-color-light .ui-datepicker .ui-datepicker-prev span { background-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=='); } .admin-color-light .ui-datepicker th { border-color: #fff; } .admin-color-light .ui-datepicker .ui-datepicker-title, .admin-color-light .ui-datepicker td .ui-state-default, .admin-color-light .ui-datepicker th { color: #555; } .admin-color-light .ui-datepicker td .ui-state-active, .admin-color-light .ui-datepicker td .ui-state-hover { color: #fff; background: #888; } .admin-color-light .ui-datepicker td.ui-state-disabled, .admin-color-light .ui-datepicker td.ui-state-disabled .ui-state-default { color: #ccc; } ================================================ FILE: assets/css/equation.css ================================================ .sp-equation-builder .button { margin: 2px; padding: 0 10px 1px; } .sp-equation { background: #f9f9f9; border: 1px solid #ddd; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.07); box-shadow: inset 0 1px 2px rgba(0,0,0,0.07); transition: .05s border-color ease-in-out; margin-top: 6px; padding: 23px; } .sp-equation:hover, .sp-equation.ui-state-active { background: #fff; } .sp-equation.ui-state-hover { border-color: #5b9dd9; -webkit-box-shadow: 0 0 2px rgba(30,140,190,0.8); box-shadow: 0 0 2px rgba(30,140,190,0.8); } .sp-equation-variable { font-weight: bold; font-size: 14px; line-height: 32px; } .sp-equation-formula .ui-sortable-placeholder { visibility: visible !important; margin: 2px; padding: 1 10px 1px; border: 1px dashed #bbb; background: transparent; height: 28px; } .sp-equation-formula .button { position: relative; margin: 2px 4px; } .sp-equation-formula .button .remove { font-weight: bold; font-size: 14px; position: absolute; top: -10px; right: -8px; color: #999; border: 1px solid #ccc; background: #f7f7f7; display: block; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; display: none; } .sp-equation-formula .button:hover .remove { display: block; } .sp-equation-formula .button.ui-sortable-helper .remove, .sp-equation-formula .button.ui-sortable-helper:hover .remove { display: none; } .sp-equation-formula .button .remove:hover { color: #d00; } ================================================ FILE: assets/css/icons.css ================================================ /* SportsPress icons */ @font-face { font-family: 'sportspress'; src:url('../fonts/sportspress.eot?ddphik2'); src:url('../fonts/sportspress.eot?#iefixddphik2') format('embedded-opentype'), url('../fonts/sportspress.woff2?ddphik2') format('woff2'), url('../fonts/sportspress.ttf?ddphik2') format('truetype'), url('../fonts/sportspress.woff?ddphik2') format('woff'), url('../fonts/sportspress.svg?ddphik2#sportspress') format('svg'); font-weight: normal; font-style: normal; } [class^="sp-icon-"], [class*=" sp-icon-"] { font-family: sportspress, dashicons; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; display: inline-block; width: 20px; height: 20px; font-size: 20px; vertical-align: top; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } /* Performance Icons */ .sp-icon-sub:before { content: "\f503"; } .sp-icon-star-filled:before { content: "\f155"; } .sp-icon-update:before { content: "\f113"; } .sp-icon-undo:before { content: "\f171"; } .sp-icon-redo:before { content: "\f172"; } .sp-icon-marker:before { content: "\f159"; } .sp-icon-no:before { content: "\f158"; } .sp-icon-heart:before { content: "\f487"; } /* Performance Icons - Sports */ .sp-icon-soccerball:before { content: "\e700"; } .sp-icon-baseball:before { content: "\e701"; } .sp-icon-basketball:before { content: "\e602"; } .sp-icon-golfball:before { content: "\e603"; } .sp-icon-cricketball:before { content: "\e604"; } .sp-icon-bowling:before { content: "\e605"; } .sp-icon-ice-hockey:before { content: "\e606"; } .sp-icon-football:before { content: "\e607"; } .sp-icon-poolball:before { content: "\e608"; } .sp-icon-table-tennis:before { content: "\e609"; } .sp-icon-tennis:before { content: "\e610"; } .sp-icon-racing-flag:before { content: "\e611"; } .sp-icon-volleyball:before { content: "\e612"; } /* Performance Icons - Sports (Alt) */ .sp-icon-soccerball-alt:before { content: "\e600"; } .sp-icon-baseball-alt:before { content: "\e601"; } /* Performance Icons - Misc */ .sp-icon-shoe:before { content: "\e800"; } .sp-icon-card:before { content: "\e801"; } .sp-icon-league:before { content: "\f332"; } .sp-icon-shield:before { content: "\f334"; } .sp-icon-tshirt:before, .sp-icon-sp_player:before { content: "\f307"; } .sp-icon-whistle:before { content: "\f227"; } .sp-icon-time:before { content: "\f469"; } .sp-icon-friendly:before { content: "\f328"; } ================================================ FILE: assets/css/leaflet.css ================================================ /* required styles */ .leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-tile-container, .leaflet-pane > svg, .leaflet-pane > canvas, .leaflet-zoom-box, .leaflet-image-layer, .leaflet-layer { position: absolute; left: 0; top: 0; } .leaflet-container { overflow: hidden; } .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-user-drag: none; } /* Prevents IE11 from highlighting tiles in blue */ .leaflet-tile::selection { background: transparent; } /* Safari renders non-retina tile on retina better with this, but Chrome is worse */ .leaflet-safari .leaflet-tile { image-rendering: -webkit-optimize-contrast; } /* hack that prevents hw layers "stretching" when loading new tiles */ .leaflet-safari .leaflet-tile-container { width: 1600px; height: 1600px; -webkit-transform-origin: 0 0; } .leaflet-marker-icon, .leaflet-marker-shadow { display: block; } /* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ .leaflet-container .leaflet-overlay-pane svg { max-width: none !important; max-height: none !important; } .leaflet-container .leaflet-marker-pane img, .leaflet-container .leaflet-shadow-pane img, .leaflet-container .leaflet-tile-pane img, .leaflet-container img.leaflet-image-layer, .leaflet-container .leaflet-tile { max-width: none !important; max-height: none !important; width: auto; padding: 0; } .leaflet-container img.leaflet-tile { /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */ mix-blend-mode: plus-lighter; } .leaflet-container.leaflet-touch-zoom { -ms-touch-action: pan-x pan-y; touch-action: pan-x pan-y; } .leaflet-container.leaflet-touch-drag { -ms-touch-action: pinch-zoom; /* Fallback for FF which doesn't support pinch-zoom */ touch-action: none; touch-action: pinch-zoom; } .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { -ms-touch-action: none; touch-action: none; } .leaflet-container { -webkit-tap-highlight-color: transparent; } .leaflet-container a { -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); } .leaflet-tile { filter: inherit; visibility: hidden; } .leaflet-tile-loaded { visibility: inherit; } .leaflet-zoom-box { width: 0; height: 0; -moz-box-sizing: border-box; box-sizing: border-box; z-index: 800; } /* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ .leaflet-overlay-pane svg { -moz-user-select: none; } .leaflet-pane { z-index: 400; } .leaflet-tile-pane { z-index: 200; } .leaflet-overlay-pane { z-index: 400; } .leaflet-shadow-pane { z-index: 500; } .leaflet-marker-pane { z-index: 600; } .leaflet-tooltip-pane { z-index: 650; } .leaflet-popup-pane { z-index: 700; } .leaflet-map-pane canvas { z-index: 100; } .leaflet-map-pane svg { z-index: 200; } .leaflet-vml-shape { width: 1px; height: 1px; } .lvml { behavior: url(#default#VML); display: inline-block; position: absolute; } /* control positioning */ .leaflet-control { position: relative; z-index: 800; pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ pointer-events: auto; } .leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; } .leaflet-top { top: 0; } .leaflet-right { right: 0; } .leaflet-bottom { bottom: 0; } .leaflet-left { left: 0; } .leaflet-control { float: left; clear: both; } .leaflet-right .leaflet-control { float: right; } .leaflet-top .leaflet-control { margin-top: 10px; } .leaflet-bottom .leaflet-control { margin-bottom: 10px; } .leaflet-left .leaflet-control { margin-left: 10px; } .leaflet-right .leaflet-control { margin-right: 10px; } /* zoom and fade animations */ .leaflet-fade-anim .leaflet-popup { opacity: 0; -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; transition: opacity 0.2s linear; } .leaflet-fade-anim .leaflet-map-pane .leaflet-popup { opacity: 1; } .leaflet-zoom-animated { -webkit-transform-origin: 0 0; -ms-transform-origin: 0 0; transform-origin: 0 0; } svg.leaflet-zoom-animated { will-change: transform; } .leaflet-zoom-anim .leaflet-zoom-animated { -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); transition: transform 0.25s cubic-bezier(0,0,0.25,1); } .leaflet-zoom-anim .leaflet-tile, .leaflet-pan-anim .leaflet-tile { -webkit-transition: none; -moz-transition: none; transition: none; } .leaflet-zoom-anim .leaflet-zoom-hide { visibility: hidden; } /* cursors */ .leaflet-interactive { cursor: pointer; } .leaflet-grab { cursor: -webkit-grab; cursor: -moz-grab; cursor: grab; } .leaflet-crosshair, .leaflet-crosshair .leaflet-interactive { cursor: crosshair; } .leaflet-popup-pane, .leaflet-control { cursor: auto; } .leaflet-dragging .leaflet-grab, .leaflet-dragging .leaflet-grab .leaflet-interactive, .leaflet-dragging .leaflet-marker-draggable { cursor: move; cursor: -webkit-grabbing; cursor: -moz-grabbing; cursor: grabbing; } /* marker & overlays interactivity */ .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-image-layer, .leaflet-pane > svg path, .leaflet-tile-container { pointer-events: none; } .leaflet-marker-icon.leaflet-interactive, .leaflet-image-layer.leaflet-interactive, .leaflet-pane > svg path.leaflet-interactive, svg.leaflet-image-layer.leaflet-interactive path { pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ pointer-events: auto; } /* visual tweaks */ .leaflet-container { background: #ddd; outline-offset: 1px; } .leaflet-container a { color: #0078A8; } .leaflet-zoom-box { border: 2px dotted #38f; background: rgba(255,255,255,0.5); } /* general typography */ .leaflet-container { font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; font-size: 12px; font-size: 0.75rem; line-height: 1.5; } /* general toolbar styles */ .leaflet-bar { box-shadow: 0 1px 5px rgba(0,0,0,0.65); border-radius: 4px; } .leaflet-bar a { background-color: #fff; border-bottom: 1px solid #ccc; width: 26px; height: 26px; line-height: 26px; display: block; text-align: center; text-decoration: none; color: black; } .leaflet-bar a, .leaflet-control-layers-toggle { background-position: 50% 50%; background-repeat: no-repeat; display: block; } .leaflet-bar a:hover, .leaflet-bar a:focus { background-color: #f4f4f4; } .leaflet-bar a:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; } .leaflet-bar a:last-child { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-bottom: none; } .leaflet-bar a.leaflet-disabled { cursor: default; background-color: #f4f4f4; color: #bbb; } .leaflet-touch .leaflet-bar a { width: 30px; height: 30px; line-height: 30px; } .leaflet-touch .leaflet-bar a:first-child { border-top-left-radius: 2px; border-top-right-radius: 2px; } .leaflet-touch .leaflet-bar a:last-child { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; } /* zoom control */ .leaflet-control-zoom-in, .leaflet-control-zoom-out { font: bold 18px 'Lucida Console', Monaco, monospace; text-indent: 1px; } .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { font-size: 22px; } /* layers control */ .leaflet-control-layers { box-shadow: 0 1px 5px rgba(0,0,0,0.4); background: #fff; border-radius: 5px; } .leaflet-control-layers-toggle { background-image: url(images/layers.png); width: 36px; height: 36px; } .leaflet-retina .leaflet-control-layers-toggle { background-image: url(images/layers-2x.png); background-size: 26px 26px; } .leaflet-touch .leaflet-control-layers-toggle { width: 44px; height: 44px; } .leaflet-control-layers .leaflet-control-layers-list, .leaflet-control-layers-expanded .leaflet-control-layers-toggle { display: none; } .leaflet-control-layers-expanded .leaflet-control-layers-list { display: block; position: relative; } .leaflet-control-layers-expanded { padding: 6px 10px 6px 6px; color: #333; background: #fff; } .leaflet-control-layers-scrollbar { overflow-y: scroll; overflow-x: hidden; padding-right: 5px; } .leaflet-control-layers-selector { margin-top: 2px; position: relative; top: 1px; } .leaflet-control-layers label { display: block; font-size: 13px; font-size: 1.08333em; } .leaflet-control-layers-separator { height: 0; border-top: 1px solid #ddd; margin: 5px -10px 5px -6px; } /* Default icon URLs */ .leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */ background-image: url(images/marker-icon.png); } /* attribution and scale controls */ .leaflet-container .leaflet-control-attribution { background: #fff; background: rgba(255, 255, 255, 0.8); margin: 0; } .leaflet-control-attribution, .leaflet-control-scale-line { padding: 0 5px; color: #333; line-height: 1.4; } .leaflet-control-attribution a { text-decoration: none; } .leaflet-control-attribution a:hover, .leaflet-control-attribution a:focus { text-decoration: underline; } .leaflet-attribution-flag { display: inline !important; vertical-align: baseline !important; width: 1em; height: 0.6669em; } .leaflet-left .leaflet-control-scale { margin-left: 5px; } .leaflet-bottom .leaflet-control-scale { margin-bottom: 5px; } .leaflet-control-scale-line { border: 2px solid #777; border-top: none; line-height: 1.1; padding: 2px 5px 1px; white-space: nowrap; -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(255, 255, 255, 0.8); text-shadow: 1px 1px #fff; } .leaflet-control-scale-line:not(:first-child) { border-top: 2px solid #777; border-bottom: none; margin-top: -2px; } .leaflet-control-scale-line:not(:first-child):not(:last-child) { border-bottom: 2px solid #777; } .leaflet-touch .leaflet-control-attribution, .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { box-shadow: none; } .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { border: 2px solid rgba(0,0,0,0.2); background-clip: padding-box; } /* popup */ .leaflet-popup { position: absolute; text-align: center; margin-bottom: 20px; } .leaflet-popup-content-wrapper { padding: 1px; text-align: left; border-radius: 12px; } .leaflet-popup-content { margin: 13px 24px 13px 20px; line-height: 1.3; font-size: 13px; font-size: 1.08333em; min-height: 1px; } .leaflet-popup-content p { margin: 17px 0; margin: 1.3em 0; } .leaflet-popup-tip-container { width: 40px; height: 20px; position: absolute; left: 50%; margin-top: -1px; margin-left: -20px; overflow: hidden; pointer-events: none; } .leaflet-popup-tip { width: 17px; height: 17px; padding: 1px; margin: -10px auto 0; pointer-events: auto; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: white; color: #333; box-shadow: 0 3px 14px rgba(0,0,0,0.4); } .leaflet-container a.leaflet-popup-close-button { position: absolute; top: 0; right: 0; border: none; text-align: center; width: 24px; height: 24px; font: 16px/24px Tahoma, Verdana, sans-serif; color: #757575; text-decoration: none; background: transparent; } .leaflet-container a.leaflet-popup-close-button:hover, .leaflet-container a.leaflet-popup-close-button:focus { color: #585858; } .leaflet-popup-scrolled { overflow: auto; } .leaflet-oldie .leaflet-popup-content-wrapper { -ms-zoom: 1; } .leaflet-oldie .leaflet-popup-tip { width: 24px; margin: 0 auto; -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); } .leaflet-oldie .leaflet-control-zoom, .leaflet-oldie .leaflet-control-layers, .leaflet-oldie .leaflet-popup-content-wrapper, .leaflet-oldie .leaflet-popup-tip { border: 1px solid #999; } /* div icon */ .leaflet-div-icon { background: #fff; border: 1px solid #666; } /* Tooltip */ /* Base styles for the element that has a tooltip */ .leaflet-tooltip { position: absolute; padding: 6px; background-color: #fff; border: 1px solid #fff; border-radius: 3px; color: #222; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,0.4); } .leaflet-tooltip.leaflet-interactive { cursor: pointer; pointer-events: auto; } .leaflet-tooltip-top:before, .leaflet-tooltip-bottom:before, .leaflet-tooltip-left:before, .leaflet-tooltip-right:before { position: absolute; pointer-events: none; border: 6px solid transparent; background: transparent; content: ""; } /* Directions */ .leaflet-tooltip-bottom { margin-top: 6px; } .leaflet-tooltip-top { margin-top: -6px; } .leaflet-tooltip-bottom:before, .leaflet-tooltip-top:before { left: 50%; margin-left: -6px; } .leaflet-tooltip-top:before { bottom: 0; margin-bottom: -12px; border-top-color: #fff; } .leaflet-tooltip-bottom:before { top: 0; margin-top: -12px; margin-left: -6px; border-bottom-color: #fff; } .leaflet-tooltip-left { margin-left: -6px; } .leaflet-tooltip-right { margin-left: 6px; } .leaflet-tooltip-left:before, .leaflet-tooltip-right:before { top: 50%; margin-top: -6px; } .leaflet-tooltip-left:before { right: 0; margin-right: -12px; border-left-color: #fff; } .leaflet-tooltip-right:before { left: 0; margin-left: -12px; border-right-color: #fff; } /* Printing */ @media print { /* Prevent printers from removing background-images of controls. */ .leaflet-control { -webkit-print-color-adjust: exact; print-color-adjust: exact; } } ================================================ FILE: assets/css/menu.css ================================================ /* SportsPress menu styles */ @font-face { font-family: 'sportspress'; src:url('../fonts/sportspress.eot?42ynjo'); src:url('../fonts/sportspress.eot?#iefix42ynjo') format('embedded-opentype'), url('../fonts/sportspress.woff2?42ynjo') format('woff2'), url('../fonts/sportspress.ttf?42ynjo') format('truetype'), url('../fonts/sportspress.woff?42ynjo') format('woff'), url('../fonts/sportspress.svg?42ynjo#sportspress') format('svg'); font-weight: normal; font-style: normal; } [class^="sp-icon-"], [class*=" sp-icon-"] { font-family: sportspress, dashicons; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; display: inline-block; width: 20px; height: 20px; font-size: 20px; vertical-align: top; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .sp-icon-archive:before { content: "\f322"; } .sp-icon-availability:before { content: "\f508"; } .sp-icon-blocks:before { content: "\f164" } .sp-icon-book:before { content: "\f330"; } .sp-icon-bracket:before { content: "\f325" } .sp-icon-bracket-center:before { content: "\f181" } .sp-icon-buddypress:before { content: "\f507"; } .sp-icon-calculator:before { content: "\f108"; } .sp-icon-calendar:before, .sp-icon-sp_event:before { content: "\f145"; } .sp-icon-cake:before { content: "\f453"; } .sp-icon-cancel:before { content: "\f335"; } .sp-icon-chart:before { content: "\f185"; } .sp-icon-clipboard:before { content: "\f481"; } .sp-icon-color:before { content: "\f309"; } .sp-icon-copy:before { content: "\f105"; } .sp-icon-edit:before { content: "\f464"; } .sp-icon-export:before { content: "\f317"; } .sp-icon-eye:before { content: "\f147"; } .sp-icon-friendly:before { content: "\f328"; } .sp-icon-globe:before { content: "\f319"; } .sp-icon-history:before { content: "\f321"; } .sp-icon-import:before { content: "\f316"; } .sp-icon-league:before { content: "\f332"; } .sp-icon-list:before { content: "\f163" } .sp-icon-location:before { content: "\f231"; } .sp-icon-matrix:before { content: "\f314"; } .sp-icon-megaphone:before { content: "\f488"; } .sp-icon-menu:before { content: "\f116"; } .sp-icon-minimal:before { content: "\f237"; } .sp-icon-popup:before { content: "\f504"; } .sp-icon-shield:before { content: "\f334"; } .sp-icon-sponsor:before { content: "\f488"; } .sp-icon-sportspress:before { content: "\f111"; } .sp-icon-staff:before { content: "\f338"; } .sp-icon-statistics:before { content: "\f489"; } .sp-icon-time:before { content: "\f469"; } .sp-icon-timeline:before { content: "\f203"; } .sp-icon-ticket:before { content: "\f524"; } .sp-icon-tournament:before { content: "\f313"; } .sp-icon-scoreboard:before { content: "\f509"; } .sp-icon-tshirt:before, .sp-icon-sp_player:before { content: "\f307"; } .sp-icon-trash:before { content: "\f182"; } .sp-icon-whistle:before { content: "\f227"; } .sp-icon-key:before { content: "\f112"; } .sp-icon-user-scores:before { content: "\f101"; } .sp-icon-woo:before { content: "\f174"; } .sp-icon-wordpay:before { content: "\f526"; } .sp-icon-yoast:before { content: "\f179"; } .sp-icon-sub:before { content: "\f503"; } .sp-icon-star-filled:before { content: "\f155"; } .sp-icon-update:before { content: "\f113"; } .sp-icon-undo:before { content: "\f171"; } .sp-icon-redo:before { content: "\f172"; } .sp-icon-marker:before { content: "\f159"; } .sp-icon-no:before { content: "\f158"; } .sp-icon-heart:before { content: "\f487"; } /* Performance Icons - Sports */ .sp-icon-soccerball:before { content: "\e700"; } .sp-icon-baseball:before { content: "\e701"; } .sp-icon-basketball:before { content: "\e602"; } .sp-icon-golfball:before { content: "\e603"; } .sp-icon-cricketball:before { content: "\e604"; } .sp-icon-bowling:before { content: "\e605"; } .sp-icon-ice-hockey:before { content: "\e606"; } .sp-icon-football:before { content: "\e607"; } .sp-icon-poolball:before { content: "\e608"; } .sp-icon-table-tennis:before { content: "\e609"; } .sp-icon-tennis:before { content: "\e610"; } .sp-icon-racing-flag:before { content: "\e611"; } .sp-icon-volleyball:before { content: "\e612"; } /* Performance Icons - Sports (Alt) */ .sp-icon-soccerball-alt:before { content: "\e600"; } .sp-icon-baseball-alt:before { content: "\e601"; } /* Performance Icons - Misc */ .sp-icon-shoe:before { content: "\e800"; } .sp-icon-card:before { content: "\e801"; } .sp-icon-card:before { content: "\e801"; } #adminmenu #toplevel_page_sportspress .toplevel_page_sportspress div.wp-menu-image:before, #adminmenu #toplevel_page_themeboy .toplevel_page_themeboy div.wp-menu-image:before, #adminmenu #menu-posts-sp_event .menu-icon-sp_event div.wp-menu-image:before, #adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before, #adminmenu #menu-posts-sp_player .menu-icon-sp_player div.wp-menu-image:before, #adminmenu #menu-posts-sp_staff .menu-icon-sp_staff div.wp-menu-image:before, #adminmenu #menu-posts-sp_official .menu-icon-sp_official div.wp-menu-image:before, #sp_formatdiv #post-formats-select .post-format-icon:before, #sp_modediv #post-formats-select .post-format-icon:before { font-family: sportspress, dashicons; width: 20px; text-align: center; } /* Widgets */ [id*="sportspress-"] .widget-title h3:before, [id*="sportspress-"] .widget-title h4:before { font-family: sportspress, dashicons; color: #aaa; font-size: 20px; content: '\f111'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 0; position: relative; top: 4px; margin-right: 4px; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } /* Prefs */ .sp-prefs .button { margin: 0 3px 4px 0; padding: 0 7px 1px 5px; } .sp-prefs .button input[type=checkbox] { background: transparent; border: none; -webkit-box-shadow: none; box-shadow: none; } .sp-prefs .button input[type=checkbox]:before { font: 400 14px/22px sportspress, dashicons; width: 22px; } .sp-prefs .button input[type=checkbox]:not(:checked):before { float: left; display: inline-block; vertical-align: middle; speak: none; content: '\f147'; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; margin: -3px 0 0 -4px; color: #ccc; } /* Icons */ .sp-icons .button { margin: 0 3px 4px 0; padding: 0 7px 1px 5px; } .sp-icons .button i { margin: 3px 0; } .sp-color-box-for-icon input[type=text] { color: #fff; } .wp-admin .sp-icons label input[type=radio] { margin-top: -3px; } @media screen and (max-width: 782px) { .wp-admin .sp-icons label input[type=radio] { margin-top: 1px; } } /* TinyMCE */ .mce-toolbar i.mce-i-sp_shortcodes_button, .mce-toolbar span.mce_sp_shortcodes_button { margin-right: -5px; } i.mce-i-sp_shortcodes_button:before, span.mce_sp_shortcodes_button:before { font-family: 'sportspress'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; content: "\f111"; font-size: 20px; } ================================================ FILE: assets/css/setup.css ================================================ .sp-setup-content p, .sp-setup-content table { font-size: 1em; line-height: 1.75em; color: #666; } body { margin: 100px auto 24px; box-shadow: none; background: #f1f1f1; padding: 0; } #sp-logo { border: 0; margin: 24px 0; padding: 0; text-align: center; } #sp-logo img { width: auto; height: auto; max-width: 100%; max-height: 50px; } .sp-setup-content { box-shadow: 0 1px 3px rgba(0, 0, 0, .13); padding: 24px 24px 0; background: #fff; zoom: 1; } .sp-setup-content:after { content: ""; display: table; clear: both; } .sp-setup-content h1, .sp-setup-content h2, .sp-setup-content h3, .sp-setup-content table { margin: 0 0 24px; border: 0; padding: 0; color: #666; clear: none; } .sp-setup-content p { margin: 0 0 24px; } .sp-setup-content a { color: #00a69c; } .sp-setup-content a:focus, .sp-setup-content a:hover { color: #111; } .sp-setup-content .form-table { width: 100%; border-top: 1px solid #eee; } .sp-setup-content .form-table th { width: 30%; vertical-align: top; font-weight: 700; } .sp-setup-content .form-table td { vertical-align: top; } .sp-setup-content .form-table td input, .sp-setup-content .form-table td select { width: 100%; box-sizing: border-box; } .sp-setup-content .form-table td input[size] { width: auto; } .sp-setup-content .form-table td ol, .sp-setup-content .form-table td ul { margin: 0; padding: 0; } .sp-setup-content .form-table td ul { list-style: none; } .sp-setup-content .form-table td li { margin-bottom: 10px; } .sp-setup-content .form-table td li:last-child { margin-bottom: 0; } .sp-setup-content .form-table td .description { line-height: 1.5em; display: block; margin: .25em 0 0; color: #999; font-style: italic; } .sp-setup-content .form-table td .input-checkbox, .sp-setup-content .form-table td .input-radio { width: auto; box-sizing: inherit; padding: inherit; margin: 0 .5em 0 0; box-shadow: none; } .sp-setup-content .form-table .section_title td { padding: 0; } .sp-setup-content .form-table .section_title td h2, .sp-setup-content .form-table .section_title td p { margin: 12px 0 0; } .sp-setup-content .form-table td, .sp-setup-content .form-table th { padding: 14px 0; margin: 0; border: 0; border-bottom: 1px solid #eee; } .sp-setup-content .form-table td:first-child, .sp-setup-content .form-table th:first-child { padding-right: 9px; } .sp-setup-content .form-table th .sp-desc-tip { line-height: 1.4; } .sp-setup-content .form-table .sp-chosen-container { display: block; } .sp-setup-content .form-table .sp-location-picker { width: 100%; height: 320px; margin: 0.5em 0 0; } .sp-setup-content .twitter-share-button { float: right; } .sp-setup-content .sp-banner { margin: 0 -24px 24px; } .sp-setup-content .sp-banner img { display: block; width: auto; height: auto; max-width: 100%; } .sp-setup-content .sp-setup-next-steps { overflow: hidden; margin: 0 0 24px; } .sp-setup-content .sp-setup-next-steps h2 { margin-bottom: 12px; } .sp-setup-content .sp-setup-next-steps .sp-setup-next-steps-first { float: left; width: 50%; box-sizing: border-box; } .sp-setup-content .sp-setup-next-steps .sp-setup-next-steps-last { float: right; width: 50%; box-sizing: border-box; } .sp-setup-content .sp-setup-next-steps ul { padding: 0 2em 0 0; list-style: none; margin: 0; } .sp-setup-content .sp-setup-next-steps ul li .button { display: block; padding: 0 0 .75em; } .sp-setup-content .sp-setup-next-steps ul li .button-first-event { background-color: #3bbab3; border-color: #15a29a; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a; text-shadow: 0 -1px 1px #15a29a, 1px 0 1px #15a29a, 0 1px 1px #15a29a, -1px 0 1px #15a29a; font-size: 1em; height: auto; line-height: 1.75em; margin: 0 0 .75em; opacity: 1; padding: 1em; text-align: center; } .sp-setup-content .sp-setup-next-steps ul li .button-first-event:active, .sp-setup-content .sp-setup-next-steps ul li .button-first-event:focus, .sp-setup-content .sp-setup-next-steps ul li .button-first-event:hover { background: #15a29a; border-color: #15a29a; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a; } .sp-setup-content .sp-setup-next-steps ul li a:before { color: #82878c; font: 400 20px/1 dashicons; speak: none; display: inline-block; padding: 0 10px 0 0; top: 1px; position: relative; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-decoration: none!important; vertical-align: top; } .sp-setup-content .sp-setup-next-steps ul .learn-more a:before { content: "\f105"; } .sp-setup-content .sp-setup-next-steps ul .video-walkthrough a:before { content: "\f126"; } .sp-setup-content .sp-setup-next-steps ul .newsletter a:before { content: "\f465"; } .sp-setup-content .updated { padding: 24px 24px 0; margin: 0 0 24px; overflow: hidden; background: #f5f5f5; } .sp-setup-content .updated p { padding: 0; margin: 0 0 12px; } .sp-setup-content .updated p:last-child { margin: 0 0 24px; } .sp-setup-steps { padding: 0 0 24px; margin: 0; list-style: none; overflow: hidden; color: #ccc; width: 100%; display: -webkit-inline-flex; display: -ms-inline-flexbox; display: inline-flex; } .sp-setup-steps li { width: 20%; float: left; padding: 0 0 .8em; margin: 0; text-align: center; position: relative; border-bottom: 4px solid #ccc; line-height: 1.4em; } .sp-setup-steps li:before { content: ""; border: 4px solid #ccc; border-radius: 100%; width: 4px; height: 4px; position: absolute; bottom: 0; left: 50%; margin-left: -6px; margin-bottom: -8px; background: #fff; } .sp-setup-steps li.active { border-color: #00a69c; color: #00a69c; } .sp-setup-steps li.active:before { border-color: #00a69c; } .sp-setup-steps li.done { border-color: #00a69c; color: #00a69c; } .sp-setup-steps li.done:before { border-color: #00a69c; background: #00a69c; } .sp-setup .sp-setup-actions:after { content: ""; display: table; clear: both; } .sp-setup .sp-setup-actions .button { float: right; font-size: 1.25em; padding: .5em 1em; line-height: 1em; margin-right: .5em; margin-bottom: 2px; height: auto; border-radius: 4px; } .sp-setup .sp-setup-actions .button-primary { background-color: #3bbab3; border-color: #15a29a; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a; text-shadow: 0 -1px 1px #15a29a, 1px 0 1px #15a29a, 0 1px 1px #15a29a, -1px 0 1px #15a29a; float: right; margin: 0 0 0 1em; opacity: 1; } .sp-setup .sp-setup-actions .button-primary:active, .sp-setup .sp-setup-actions .button-primary:focus, .sp-setup .sp-setup-actions .button-primary:hover { background: #15a29a; border-color: #15a29a; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #15a29a; } .sp-setup .sp-setup-actions .button-muted { border: none; background: transparent; -webkit-box-shadow: none; box-shadow: none; padding: 0; margin: .55em 0.05em 0.65em; color: #ccc; } .sp-setup .sp-setup-actions .button-muted:hover { color: #999; } .sp-return-to-dashboard { font-size: .85em; margin: 1.18em 0; display: block; text-align: center; } .sp-return-to-dashboard a { color: #b5b5b5; } .sp-return-to-dashboard a:hover { color: #888; } /* Media Queries */ @media screen and (max-width: 782px) { .sp-setup-content .form-table tbody th { width: auto }; } @media screen and (min-width: 783px) { .sp-setup-content .form-table td li input { width: 40%; } .sp-setup-content .form-table td .player input { width: 40%; } .sp-setup-content .form-table td .player .player-number { width: 11%; } .sp-setup-content .form-table td .staff .staff-name { width: 52%; } } ================================================ FILE: assets/css/slickmap.css ================================================ /*! Adapted from SlickMap CSS by Matt Everson of Astuteo, LLC http://astuteo.com/slickmap Version 1.1 Copyright (c) 2009 Astuteo, LLC http://astuteo.com */ .sportspress-overview-wrap { margin-right: 0; } .sp-sitemap { margin: 40px 0; float: left; width: 100%; position: relative; } /* ------------------------------------------------------------ Reset Styles (adapted from meyerweb.com) ------------------------------------------------------------ */ .sp-sitemap div, .sp-sitemap span, .sp-sitemap applet, .sp-sitemap object, .sp-sitemap iframe, .sp-sitemap h1, .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 a, .sp-sitemap abbr, .sp-sitemap acronym, .sp-sitemap address, .sp-sitemap big, .sp-sitemap cite, .sp-sitemap code, .sp-sitemap del, .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 small, .sp-sitemap strike, .sp-sitemap strong, .sp-sitemap sub, .sp-sitemap sup, .sp-sitemap tt, .sp-sitemap var, .sp-sitemap dl, .sp-sitemap dt, .sp-sitemap dd, .sp-sitemap ol, .sp-sitemap ul, .sp-sitemap li, .sp-sitemap fieldset, .sp-sitemap form, .sp-sitemap label, .sp-sitemap legend, .sp-sitemap table, .sp-sitemap caption, .sp-sitemap tbody, .sp-sitemap tfoot, .sp-sitemap thead, .sp-sitemap tr, .sp-sitemap th, .sp-sitemap td { margin: 0; padding: 0; border: 0; outline: 0; vertical-align: baseline; } /* ------------------------------------------------------------ Number of Columns ------------------------------------------------------------ */ .sp-sitemap li { width: 12.5%; } .sp-sitemap li ul li { width:100% !important; } .sp-sitemap .sp-primary { max-width: 1600px; } .sp-sitemap .col0 { max-width: 200px; } .sp-sitemap .col1 { max-width: 200px; } .sp-sitemap .col2 { max-width: 400px; } .sp-sitemap .col3 { max-width: 600px; } .sp-sitemap .col4 { max-width: 800px; } .sp-sitemap .col5 { max-width: 1000px; } .sp-sitemap .col6 { max-width: 1200px; } .sp-sitemap .col7 { max-width: 1400px; } .sp-sitemap .col8 { max-width: 1600px; } .sp-sitemap .col1 li { width:99.9%; } .sp-sitemap .col2 li { width:50%; } .sp-sitemap .col3 li { width:33.3%; } .sp-sitemap .col4 li { width:25%; } .sp-sitemap .col5 li { width:20%; } .sp-sitemap .col6 li { width:16.6%; } .sp-sitemap .col7 li { width:14.2%; } .sp-sitemap .col8 li { width:12.5%; } /* ------------------------------------------------------------ General Styles ------------------------------------------------------------ */ .sp-sitemap h1 { font-weight: bold; text-transform: uppercase; font-size: 20px; margin: 0 0 5px 0; } .sp-sitemap h2 { font-size: 10px; color: #777777; margin: 0 0 20px 0; } .sp-sitemap a { text-decoration: none; } .sp-sitemap ol, .sp-sitemap ul { list-style: none; } .sp-sitemap li { margin: 0; } .sp-sitemap li a.button { white-space: normal; position: relative; text-align: center; padding: 10px 0; } .sp-sitemap li a.action { white-space: normal; position: relative; text-align: center; padding: 10px 28px; } .sp-sitemap li a.button span { position: absolute; left: 9px; top: 9px; } .sp-sitemap li a.button span.dashicons-plus { top: 12px; } .sp-sitemap li a.button-primary span { opacity: 0.55; } /* ------------------------------------------------------------ Site Map Styles ------------------------------------------------------------ */ /* -------- Top Level --------- */ .sp-sitemap .sp-primary .sp-home { display: block; float: none; background: #f1f1f1 url('../images/slickmap/L1-left.png') center bottom no-repeat; position: relative; z-index: 2; padding: 0 0 30px 0; } .sp-sitemap .sp-primary .sp-breadcrumb { display: block; float: none; background: #f1f1f1 url('../images/slickmap/vertical-line.png') center bottom repeat-y; position: relative; z-index: 2; padding: 0 0 30px 0; margin-bottom: 30px; } .sp-sitemap .sp-primary li { min-width: 149px; float: left; background: url('../images/slickmap/L1-center.png') center top no-repeat; padding: 30px 0; margin-top: -30px; } .sp-sitemap .sp-primary li a.button { margin: 0 20px 0 0; display: block; font-size: 13px; font-weight: bold; height: auto; line-height: normal; } .sp-sitemap .sp-primary li:last-child { background: url('../images/slickmap/L1-right.png') center top no-repeat; } /* -------- Second Level --------- */ .sp-sitemap .sp-primary li li { width: 100%; clear: left; margin-top: 0; padding: 10px 0 0 0; background: url('../images/slickmap/vertical-line.png') center bottom repeat-y; } .sp-sitemap .sp-primary li li:first-child { padding-top: 30px; } .sp-sitemap .sp-primary li li:last-child { background: url('../images/slickmap/vertical-line.png') center bottom repeat-y; } /* -------- Third Level --------- */ .sp-sitemap .sp-primary li li ul { margin: 10px 0 0 0; width: 100%; float: right; padding: 9px 0 10px 0; background: #f1f1f1 url('../images/slickmap/L3-ul-top.png') center top no-repeat; } .sp-sitemap .sp-primary li li li { background: url('../images/slickmap/L3-center.png') left center no-repeat; padding: 5px 0; } .sp-sitemap .sp-primary li li li a { width: 80%; float: right; } .sp-sitemap .sp-primary li li li:first-child { padding: 15px 0 5px 0; background: url('../images/slickmap/L3-li-top.png') left center no-repeat; } .sp-sitemap .sp-primary li li li:last-child { background: url('../images/slickmap/L3-bottom.png') left center no-repeat; } /* ------------------------------------------------------------ Utility Navigation ------------------------------------------------------------ */ .sp-sitemap .sp-utility { float: right; max-width: 80%; margin-top: -30px; margin-right: 10px; } .sp-sitemap .sp-utility li { float: left; margin-bottom: 10px; width: auto; } .sp-sitemap .sp-utility li a.button { margin: 0 10px 0 0; padding: 10px 16px; display: block; font-size: 13px; font-weight: bold; height: auto; line-height: normal; position: relative; z-index: 10; } .sp-sitemap .sp-utility li a:link:before, .sp-sitemap .sp-utility li a:visited:before { margin-bottom: 3px; } @media screen and ( max-width: 782px ) { .sp-sitemap .sp-primary { clear: both; padding-top: 50px; } .sp-sitemap .sp-utility { max-width: none; } } ================================================ FILE: assets/css/sportspress-rtl.css ================================================ /* SportsPress RTL */ /* Thumbnails and Details */ .sp-template-logo, .sp-template-photo { float: right; margin-right: 0; margin-left: 2em; } /* Profile selector */ .sp-template-profile-selector { text-align: left; } /* Data Tables */ .sp-data-table .data-name { text-align: right !important; } /* Pagination */ .sp-table-wrapper .dataTables_paginate .previous { float: right; margin-left: 0.5em; margin-right: 0; } .sp-table-wrapper .dataTables_paginate .next { float: left; margin-right: 0.5em; margin-left: 0; } /* League Table and Player List */ .sp-player-list .data-name .player-photo, .sp-player-list .data-name .player-flag { margin-right: 0; margin-left: 0.5em; } /* Event Performance (Icons) */ .sp-event-performance-teams .sp-template-event-performance-icons { float: right; clear: right; padding-right: 0; padding-left: 10px; } .sp-event-performance-teams .sp-template-event-performance-icons:nth-child(2n) { float: left; clear: left; padding-left: 0; padding-right: 10px; } /* Event Calendar */ .sp-event-calendar #next { text-align: left; } .sp-event-calendar #prev { text-align: right; } /* Event List */ .sp-event-list .data-article a .dashicons { padding-right: 0; padding-left: 3px; } .sp-event-list .data-home { text-align: left; } .sp-event-list .data-away { text-align: right; } .sp-event-list .data-home img { float: left; margin-left: 0; margin-right: 8px; } .sp-event-list .data-away img { float: right; margin-right: 0; margin-left: 8px; } /* Event Blocks */ .sp-event-blocks .logo-odd { float: right; } .sp-event-blocks .logo-even { float: left; } @media only screen and (min-width: 601px) { .sp-template-logo + .sp-post-content { clear: right; } } ================================================ FILE: assets/css/sportspress-style-ltr.css ================================================ /* SportsPress Templates LTR */ /* * Note: !important everything to enforce overrides. * This stylesheet can be disabled via SportsPress General Settings. */ .sp-tournament-bracket .sp-team .sp-team-name:before { border-left-color: #e5e5e5 !important; border-right-color: #e5e5e5 !important; left: -10px !important; } .sp-tournament-bracket .sp-team-flip .sp-team-name:before { left: auto !important; right: -10px !important; } .sp-tournament-bracket .sp-team.sp-first-round .sp-team-name { margin-left: -1px !important; } .sp-tournament-bracket .sp-team.sp-last-round .sp-team-name { margin-right: -1px !important; } .sp-template-event-performance-icons .sp-performance-icons { text-align: right !important; } .sp-data-table .data-name { text-align: left !important; } ================================================ FILE: assets/css/sportspress-style-rtl.css ================================================ /* SportsPress Templates RTL */ /* * Note: !important everything to enforce overrides. * This stylesheet can be disabled via SportsPress General Settings. */ .sp-tournament-bracket .sp-team .sp-team-name:before { border-right-color: #e5e5e5 !important; border-left-color: #e5e5e5 !important; right: -10px !important; } .sp-tournament-bracket .sp-team-flip .sp-team-name:before { right: auto !important; left: -10px !important; } .sp-tournament-bracket .sp-team.sp-first-round .sp-team-name { margin-right: -1px !important; } .sp-tournament-bracket .sp-team.sp-last-round .sp-team-name { margin-left: -1px !important; } .sp-template-event-performance-icons .sp-performance-icons { text-align: left !important; } .sp-data-table .data-name { text-align: right !important; } ================================================ FILE: assets/css/sportspress-style.css ================================================ /* SportsPress Templates */ .sp-template, .sp-data-table, .sp-table-caption { font-family: "Roboto", "Helvetica", sans-serif; } .sp-template { clear: both; overflow: hidden; } /* * Note: !important everything below to enforce overrides. * This stylesheet can be disabled via SportsPress General Settings. */ .sp-template h1, .sp-template h2, .sp-template h3, .sp-template h4, .sp-template h5, .sp-template h6, .sp-data-table h1, .sp-data-table h2, .sp-data-table h3, .sp-data-table h4, .sp-data-table h5, .sp-data-table h6, .sp-table-caption h1, .sp-table-caption h2, .sp-table-caption h3, .sp-table-caption h4, .sp-table-caption h5, .sp-table-caption h6 { font-family: "Roboto", "Helvetica", sans-serif !important; } .sp-template { margin-bottom: 20px !important; } .sp-template *, .sp-data-table *, .sp-table-caption { box-sizing: border-box !important; font-weight: 400 !important; text-transform: none !important; letter-spacing: normal !important; color: #333 !important; } .sp-table-caption { margin: 0 !important; padding: 15px !important; background: #fff !important; border: 1px solid #e5e5e5 !important; border-bottom: none !important; font-size: 20px !important; font-weight: 400 !important; line-height: 1.5 !important; display: table !important; width: 100% !important; } /* Color Resets */ .sp-template input, .sp-data-table input, .sp-template .sp-event-logos, .sp-template .sp-event-staff { color: initial !important; } /* Links */ .sp-template a, .sp-data-table a { box-shadow: none !important; border: none !important; text-decoration: none !important; font-weight: inherit !important; color: #00a69c !important; } .sp-template a:hover, .sp-data-table a:hover { text-decoration: underline !important; } .sp-template a:hover .dashicons, .sp-template a:hover [class^="sp-icon-"], [class*=" sp-icon-"], .sp-data-table a:hover .dashicons, .sp-data-table a:hover [class^="sp-icon-"], [class*=" sp-icon-"] { text-decoration: none !important; } .sp-view-all-link { padding: 10px 15px !important; margin: 0 !important; background: #fff !important; border: 1px solid #e5e5e5 !important; border-top: none !important; overflow: hidden !important; display: table !important; width: 100% !important; text-align: right !important; } .sp-view-all-link a { font-size: 12px !important; font-weight: 400 !important; line-height: 1.5 !important; text-decoration: none !important; color: rgba(51,51,51,0.5) !important; } .sp-view-all-link a:hover { color: #333 !important; text-decoration: none !important; } .sp-form-events a:hover { color: #fff !important; text-decoration: none !important; } /* Images */ .sp-template img { display: inline-block !important; box-shadow: none !important; } /* Tables */ .sp-data-table { margin: 0 !important; background: #fff !important; border-collapse: collapse !important; border: 1px solid #e5e5e5 !important; width: 100% !important; } .sp-data-table tr { border: none !important; } .sp-data-table th, .sp-data-table td { font-size: 13px !important; font-weight: 400 !important; line-height: 1.5 !important; border: 1px solid #e5e5e5 !important; padding: 5px 10px !important; text-align: center !important; } .sp-data-table th { font-size: 12px !important; font-weight: 500 !important; background: #fff !important; color: #999 !important; border: none !important; } .sp-data-table th a { color: inherit !important; } .sp-data-table .sp-highlight, .sp-data-table .highlighted td { font-weight: 500 !important; background: #f9f9f9 !important; } /* Galleries */ .sp-template-gallery .sp-gallery-wrapper { border: 1px solid #e5e5e5 !important; background: #fff !important; display: table !important; width: 100% !important; } .sp-template-gallery .gallery-item { padding: 0 !important; margin: 0 !important; position: relative !important; } .sp-template-gallery .gallery-item a { display: block !important; color: #999 !important; } .sp-template-gallery .gallery-item img { display: block !important; border: none !important; padding: 0 !important; margin: 0 !important; border-radius: 0 !important; } .sp-template-gallery .gallery-caption { padding: 0 !important; margin: 0 !important; font-size: 12px !important; font-style: normal !important; font-weight: 500 !important; text-align: center !important; color: #999 !important; line-height: 1.5 !important; padding: 5px 10px !important; } .sp-template-gallery .gallery-caption strong { color: #fff !important; background: #00a69c !important; display: block !important; font-weight: 400 !important; font-size: 13px !important; line-height: 1.5 !important; position: absolute !important; left: 0 !important; top: 0 !important; padding: 5px 10px !important; } .sp-template-staff-gallery .gallery-caption strong { display: none !important; } .sp-template-gallery .sp-gallery-group-name { margin: 0 !important; padding: 15px !important; background: #fff !important; border-bottom: 1px solid #e5e5e5 !important; font-size: 20px !important; font-weight: 400 !important; line-height: 1.5 !important; display: block !important; } /* Countdowns */ .sp-template-countdown .sp-event-name, .sp-template-countdown .sp-event-venue, .sp-template-countdown .sp-event-league, .sp-template-countdown .sp-event-date { margin: 0 !important; padding: 5px 10px !important; text-align: center !important; line-height: 1.5 !important; display: table !important; width: 100% !important; background: #fff !important; border: 1px solid #e5e5e5 !important; border-bottom: none !important; } .sp-template-countdown .sp-event-name { font-size: 13px !important; font-weight: 400 !important; color: #333 !important; } .sp-template-countdown .sp-event-venue, .sp-template-countdown .sp-event-league, .sp-template-countdown .sp-event-date { font-size: 12px !important; font-weight: 500 !important; background: #fff !important; color: #999 !important; } .sp-template-countdown .sp-event-venue a, .sp-template-countdown .sp-event-league a { color: inherit !important; } .sp-countdown time { display: table !important; background: #fff !important; border: 1px solid #e5e5e5 !important; border-collapse: collapse !important; width: 100% !important; } .sp-countdown span { font-size: 20px !important; font-weight: 400 !important; line-height: 1.5 !important; display: table-cell !important; border: 1px solid #e5e5e5 !important; padding: 10px 5px !important; text-align: center !important; } .sp-countdown span small { font-size: 12px !important; font-weight: 400 !important; line-height: 1.5 !important; font-weight: 500 !important; color: rgba(51,51,51,0.5) !important; display: block !important; } /* Event Calendars */ .sp-template-event-calendar .sp-table-caption { display: table-caption !important; } .sp-template-event-calendar td { padding: 10px 5px !important; } .sp-template-event-calendar tfoot td { padding: 10px 15px !important; border: none !important; } .sp-template-event-calendar .sp-previous-month { text-align: left !important; } .sp-template-event-calendar .sp-next-month { text-align: right !important; } .sp-template-event-calendar tfoot a { font-size: 12px !important; font-weight: 400 !important; line-height: 1.5 !important; text-decoration: none !important; color: rgba(51,51,51,0.5) !important; } .sp-template-event-calendar tfoot a:hover { color: #333 !important; text-decoration: none !important; } .sp-template-event-calendar tbody td { position: relative !important; } .sp-template-event-calendar tbody td a:before { content: '•' !important; position: absolute !important; font-size: 20px !important; line-height: 1 !important; width: 1em !important; top: 0 !important; right: 0 !important; } /* Event Lists */ .sp-template-event-list .data-home { text-align: right !important; } .sp-template-event-list .data-away { text-align: left !important; } /* Event Blocks */ .sp-template-event-blocks td { padding: 0 !important; } .sp-template-event-blocks .sp-event-date { color: rgba(51,51,51,0.5) !important; font-weight: 500 !important; font-size: 12px !important; margin: 10px !important; } .sp-template-event-blocks .sp-event-date a, .sp-template-event-blocks .sp-event-date a:hover { color: inherit !important; } .sp-template-event-blocks .sp-event-results { font-size: 20px !important; font-weight: 400 !important; padding: 0 !important; margin: 0 !important; color: #333 !important; } .sp-template-event-blocks .sp-event-results a { color: inherit !important; } .sp-template-event-blocks .sp-event-results a:hover { color: inherit !important; text-decoration: none !important; } .sp-template-event-blocks .sp-event-title, .sp-template-event-blocks .sp-event-status { display: block !important; padding: 0 !important; margin: 10px !important; font-size: 13px !important; font-weight: 400 !important; } /* Event Logos */ .sp-template-event-logos .sp-team-name, .sp-template-event-logos .sp-team-result { font-size: 20px !important; font-weight: 400 !important; padding: 0 !important; margin: 0 !important; color: #333 !important; } .sp-template-event-logos a, .sp-template-event-logos a:hover { border: none !important; text-decoration: none !important; } /* Event Performance */ .sp-template-event-performance-icons td { border: none !important; } .sp-template-event-performance-icons tr:first-child td { border-top: 1px solid #e5e5e5 !important; } /* Videos */ .sp-template-event-video iframe { width: 100% !important; } /* Match Stats */ .sp-template-event-statistics .sp-statistic-label { font-size: 12px !important; font-weight: 500 !important; color: inherit !important; opacity: 0.5 !important; } .sp-event-statistics { background: transparent !important; margin: 0 0 10px !important; } .sp-event-statistics, .sp-event-statistics tr, .sp-event-statistics td { border: none !important; } .sp-event-statistics .sp-statistic-ratio { padding: 0 !important; } .sp-event-statistics .sp-statistic-bar { border: 1px solid #e5e5e5 !important; background: #f9f9f9 !important; } /* Venues */ .sp-event-venue-map-row td { padding: 0 !important; } .sp-event-venue-map-row .sp-google-map { display: block !important; margin: 0 !important; } /* Teams */ .sp-template-logo { float: right !important; margin: 0 0 20px 20px !important; clear: none !important; } /* Profiles */ .sp-template-details dl { margin: 0 0 20px !important; padding: 15px !important; border: 1px solid #e5e5e5 !important; background: #fff !important; } .sp-template-details dt, .sp-template-details dd { margin: 0 !important; padding: 0 !important; } .sp-template-details dt { font-size: 12px !important; font-weight: 500 !important; color: rgba(51,51,51,0.5) !important; } .sp-template-details dd { font-size: 16px !important; font-weight: 400 !important; color: #333 !important; margin-bottom: 10px !important; } .sp-template-details dd:last-child { margin-bottom: 0 !important; } /* Twitter */ .sp-tweets { border: 1px solid #e5e5e5 !important; border-top: none !important; } /* Scoreboards */ .sp-header-scoreboard .sp-template-scoreboard { margin-bottom: 0 !important; } .sp-template-scoreboard td { padding: 0 !important; } .sp-template-scoreboard td:hover { background: #f9f9f9 !important; } .sp-template-scoreboard a, .sp-template-scoreboard a:hover { text-decoration: none !important; color: #333 !important; } .sp-template-scoreboard .sp-scoreboard-date { font-size: 12px !important; font-weight: 500 !important; color: rgba(51,51,51,0.5) !important; } .sp-template-scoreboard .sp-scoreboard-nav { color: #fff !important; background: #00a69c !important; } /* Timelines */ .sp-template-timeline .sp-timeline * { color: initial !important; } /* Tournaments */ .sp-tournament-bracket { color: #333 !important; background: transparent !important; width: 100% !important; border-collapse: separate !important; } .sp-tournament-bracket a, .sp-tournament-bracket a:hover { text-decoration: none !important; color: inherit !important; border: none! important; } .sp-tournament-bracket tr, .sp-tournament-bracket th, .sp-tournament-bracket td { border: none !important; } .sp-tournament-bracket thead th { font-size: 12px !important; font-weight: 500 !important; color: rgba(51,51,51,0.5) !important; text-align: center !important; border-bottom: 1px solid #e5e5e5 !important; } .sp-tournament-bracket .sp-team-name { font-size: 13px !important; font-weight: 400 !important; text-align: center !important; background: #fff !important; border: 1px solid #e5e5e5 !important; } .sp-tournament-bracket .sp-team-name:hover { border: 1px solid #e5e5e5 !important; } .sp-tournament-bracket .sp-heading, .sp-tournament-bracket .sp-heading:hover { color: #fff !important; background: #00a69c !important; border-color: #00a69c !important; } .sp-tournament-bracket .sp-event { border-color: #e5e5e5 !important; border-width: 1px !important; } .sp-tournament-bracket .sp-event .sp-event-title { font-size: 12px !important; font-weight: 400 !important; color: rgba(51,51,51,0.5) !important; text-align: center !important; } .sp-tournament-bracket .sp-event .sp-event-title:hover { color: #333 !important; } /* Tabs */ .sp-tab-menu { display: block !important; clear: both !important; margin: 0 0 20px !important; padding: 0 !important; list-style: none !important; } .sp-tab-menu-item { display: inline-block !important; margin: 0 !important; padding: 0 !important; } .sp-tab-menu-item a { margin: 0 !important; padding: 5px 10px; border-bottom: 2px solid transparent !important; box-shadow: none !important; } .sp-tab-menu-item a:hover { text-decoration: none !important; } .sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover { color: #00a69c !important; border-bottom-color: #00a69c !important; } /* Messages */ .sp-template .sp-message { color: #00a69c !important; border-color: #00a69c !important; } /* Post Content */ .single-sp_team .has-post-thumbnail .sp-post-content { clear: none; } /* Media Queries */ @media screen and (min-width: 601px) { .sp-template-event-calendar tbody td { padding: 15px 5px !important; } .sp-template-event-calendar tbody td a:before { font-size: 25px !important; } .widget .sp-template-event-calendar tbody td { padding: 10px 5px !important; } .widget .sp-template-event-calendar tbody td a:before { font-size: 20px !important; } } @media screen and (min-width: 801px) { .sp-template-event-calendar tbody td { padding: 20px 5px !important; } .sp-template-event-calendar tbody td a:before { font-size: 30px !important; } .widget .sp-template-event-calendar tbody td { padding: 10px 5px !important; } .widget .sp-template-event-calendar tbody td a:before { font-size: 20px !important; } .sp-template-event-performance-icons.sp-template-event-performance-section:nth-child(2n) { padding-top: 61px !important; } } ================================================ FILE: assets/css/sportspress.css ================================================ /* SportsPress */ .sp-align-left { text-align: left; } .sp-align-right { text-align: right; } .sp-align-center { text-align: center; } /* Header */ .sp-header { position: relative; overflow: visible; z-index: 10000; } /* Templates */ .sp-template { margin-bottom: 1.5em; } .sp-template-profile-selector { clear: both; overflow: hidden; } .sp-template-logo, .sp-template-photo { float: left; margin-bottom: 2em; margin-right: 2em; max-width: 50%; } .sp-template-event-logos { text-align: center; } .sp-template-details { display: inline; } .sp-template-details dl { overflow: hidden; } /* Tabs */ .sp-tab-menu { display: block; clear: both; padding: 0 5px; margin: 0 0 1.5em; list-style: none; } .sp-tab-menu-item { display: inline-block; margin: 0; } .sp-tab-menu-item a { display: block; margin: 0 10px; color: inherit; opacity: 0.5; transition: all .3s; } .sp-tab-menu-item a:focus { outline: none; } .sp-tab-menu-item-active a, .sp-tab-menu-item a:hover { color: inherit; opacity: 1; } .sp-tab-content { display: none; } /* Profile selector */ .sp-template-profile-selector { text-align: right; margin-bottom: 0.5em; } /* Data Tables */ .sp-scrollable-table-wrapper { width: 100%; overflow: hidden; overflow-x: auto; } .sp-data-table { width: 100%; table-layout: auto; border-spacing: 0; } .sp-paginated-table { margin-bottom: 0; } .sp-data-table thead th { white-space: nowrap; } .sp-data-table thead .sorting, .sp-data-table thead .sorting_asc, .sp-data-table thead .sorting_desc, .sp-data-table thead .sorting_asc_disabled, .sp-data-table thead .sorting_desc_disabled { cursor: pointer; position: relative; } .sp-data-table tbody a { text-decoration: none; } .sp-data-table .sorting:after, .sp-data-table .sorting_asc:after, .sp-data-table .sorting_desc:after { font-family: dashicons; margin: 0 -.2em; } .sp-data-table .sorting:after { content: "\f156"; color: transparent; position: absolute; } .sp-data-table .sorting_asc:after { content: "\f142"; position: absolute; } .sp-data-table .sorting_desc:after { content: "\f140"; position: absolute; } .sp-data-table .data-name { text-align: left; } .sp-data-table .data-number, .sp-data-table .data-rank { width: 1px; } .sp-data-table .sp-checkbox { font-family: sportspress; vertical-align: bottom; } /* Post Content */ .sp-post-content { clear: both; } /* Pagination */ .sp-table-wrapper .dataTables_paginate { text-align: center; } .sp-table-wrapper .dataTables_paginate .paginate_button { margin: 0.5em; cursor: pointer; display: inline-block; } .sp-table-wrapper .dataTables_paginate .previous { float: left; margin-left: 0; } .sp-table-wrapper .dataTables_paginate .next { float: right; margin-right: 0; } .sp-table-wrapper .dataTables_paginate .current { opacity: 0.5; color: inherit; cursor: default; } .sp-table-wrapper .dataTables_paginate .disabled { opacity: 0; cursor: default; } /* Post Excerpt */ .sp-excerpt { display: block; margin-bottom: 1em; } /* League Table */ .sp-league-table td.has-logo { line-height: 2em; } .sp-league-table .team-logo { width: 2em; height: 2em; display: inline-block; vertical-align: middle; text-align: center; } .sp-league-table .data-name .team-logo { margin-right: 0.5em; } .sp-league-table .team-logo img { width: auto; height: auto; max-width: 2em; max-height: 2em; } /* Team Gallery */ .sp-template-team-gallery img { padding: 1em; } /* Player List */ .sp-player-list td { line-height: 2em; } .sp-player-list .data-name .player-photo, .sp-player-list .data-name .player-flag, .sp-player-list .data-team .team-logo { width: 2em; height: 2em; display: inline-block; vertical-align: middle; text-align: center; } .sp-player-list .data-name .player-photo, .sp-player-list .data-name .player-flag { margin-right: 0.5em; } .sp-player-list .data-name .player-photo img, .sp-player-list .data-name .player-flag img, .sp-player-list .data-team .team-logo img { width: auto; height: auto; max-width: 2em; max-height: 2em; } /* Staff */ .sp-staff-role-delimiter { margin: 0 0.125em; } /* Button */ .sp-button { border: none; cursor: pointer; } /* Messages */ .sp-message { padding: 1em; border: 1px solid transparent; text-align: center; } /* Event Logos */ .sp-event-logos a { text-decoration: none; color: inherit; } .sp-event-logos img { display: inline !important; vertical-align: middle; } /* Events */ .sp-event-overview, .sp-event-performance-tables { overflow: hidden; clear: both; } /* Event Logos */ .sp-event-logos .sp-team-logo { white-space: nowrap; display: block; } .sp-event-logos .sp-team-logo .sp-team-result { display: block; margin: 0.5em 0; } /* Event Venue */ .sp-event-venue thead th { white-space: normal; } /* Event Performance */ .sp-template-event-performance-icons thead { display: none; } .sp-event-performance .sub { background: rgba(0,0,0,0.05); } .sp-event-performance .sub-in, .sp-event-performance .sub-out { cursor: default; } .sp-event-performance .sub-in:before, .sp-event-performance .sub-out:before { font-family: dashicons; } .sp-event-performance .sub-in:before { content: "\f140"; } .sp-event-performance .sub-out:before { content: "\f142"; } .sp-event-performance .sp-performance-icons { width: 25%; } .sp-event-performance .sp-event-star { color: #f4d014; } .sp-event-performance .sp-event-star-number { margin-left: -20px; width: 20px; text-align: center; display: inline-block; font-size: smaller; line-height: 20px; } /* Event Performance (Icons) */ .sp-event-performance-teams .sp-template-event-performance-icons { box-sizing: border-box; width: 50%; float: left; clear: left; padding-right: 10px; } .sp-event-performance-teams .sp-template-event-performance-icons:nth-child(2n) { float: right; clear: right; padding-right: 0; padding-left: 10px; } .sp-template-event-performance-icons .sp-player-position { display: block; } /* Event Calendar */ .sp-event-calendar { border-spacing: 0; } .sp-event-calendar a { text-decoration: none; } .sp-event-calendar tbody td, .sp-event-calendar thead th { text-align: center; } .sp-event-calendar #next { text-align: right; } .sp-event-calendar #prev { text-align: left; } /* Event List */ .sp-event-list .data-date date, .sp-event-list .data-time date { display: none !important; } .sp-event-list .data-article { white-space: nowrap; } .sp-event-list .data-article a .dashicons { padding-right: 3px; } .sp-event-list .data-time, .sp-event-list .data-results { white-space: nowrap; } .sp-event-list .data-home { text-align: right; } .sp-event-list .data-away { text-align: left; } .sp-event-list td.has-logo { line-height: 2em; } .sp-event-list .team-logo { width: 2em; height: 2em; margin-right: 0.5em; display: inline-block; vertical-align: middle; text-align: center; } .sp-event-list .team-logo img { width: auto; height: auto; max-width: 2em; max-height: 2em; } .sp-event-list .data-home img, .sp-event-list .data-away img { display: inline-block; vertical-align: middle; } .sp-event-list .data-home img { margin-left: 8px; } .sp-event-list .data-away img { margin-right: 8px; } .sp-event-list-format-homeaway .data-time { text-align: center; padding-left: 1em; padding-right: 1em; } /* Event Blocks */ .sp-event-blocks thead { display: none; } .sp-event-blocks .sp-event-date, .sp-event-blocks .sp-event-time, .sp-event-blocks .sp-event-results, .sp-event-blocks .sp-event-title { text-align: center; display: block; margin: 10px 0; clear: none; } .sp-event-blocks .sp-event-league, .sp-event-blocks .sp-event-season, .sp-event-blocks .sp-event-venue { text-align: center; margin: 0 20%; padding: 0 20px; } .sp-event-blocks .team-logo { margin: 10px; width: 20%; height: 4em; max-width: 6em; text-align: center; } .sp-event-blocks .logo-odd { float: left; } .sp-event-blocks .logo-even { float: right; } .sp-event-blocks .team-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; } .sp-fixtures-results { clear: both; } .widget .sp-event-blocks .sp-event-title { margin: 10px; padding: 0; clear: both; } span.sp_event_spec_label { font-weight: bold; } /* Event Logos Block */ .sp-template-event-logos-block .team-logo { float: none; max-width: none; width: 100%; height: auto; color: inherit; } .sp-template-event-logos-block .team-logo img { vertical-align: middle; } .sp-template-event-logos-block .sp-team-name { display: block; clear: both; vertical-align: middle; font-size: 28px; } .sp-template-event-logos-block .sp-event-results { font-size: 36px; } /* Event Form */ .sp-form-events { text-align: center; } .sp-form-events .sp-form-event-link { display: inline-block; text-align: center; vertical-align: text-top; line-height: 1.5em; width: 1.5em; margin: 0 0 0.25em; color: #fff !important; font-weight: normal; } .sp-form-events .sp-form-event-link:hover { color: #fff !important; } /* Countdowns */ .sp-template-countdown .event-image img { display: block; margin: 0 auto; } .sp-template-countdown .event-name { clear: both; overflow: hidden; } .sp-template-countdown .team-logo { width: 20%; height: auto; max-width: 4em; } .sp-template-countdown .logo-odd { float: left; margin-right: 10px; } .sp-template-countdown .logo-even { float: right; margin-left: 10px; } .sp-template-countdown .team-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; } .sp-template-countdown .sp-countdown { clear: both; } /* Google Maps */ .sp-google-map-container { position: relative; } .sp-google-map { width: 100%; height: 320px; } .sp-google-map-link { content: ''; display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: url(../images/maps/pin.png) no-repeat center center; background-size: 26px 82px; } .sp-google-map img { max-width: none !important; } .sp-venue-map { margin-bottom: 4em; } /* View All */ .sp-view-all-link { display: block; margin-top: 0.5em; } /* Highlight & Heading */ .sp-highlight, .sp-heading { font-weight: bold; } /* Hidden Responsive Element */ .sp-desktop { display: none; } /* Admin Bar */ #wpadminbar #wp-admin-bar-sportspress>.ab-item:before { font-family: sportspress, dashicons; } #wpadminbar #wp-admin-bar-sportspress>.ab-item:before { content: "\f111"; top: 2px; } /* Media Queries */ @media screen and (min-width: 801px) { /* Widget Alignment */ .sp-widget-align-none { clear: both; } .sp-widget-align-left { width: 50%; float: left; clear: left; padding-right: 10px; box-sizing: border-box; } .sp-widget-align-right { width: 50%; float: right; clear: right; padding-left: 10px; box-sizing: border-box; } /* Hidden Responsive Element */ .sp-desktop { display: block; } .sp-mobile { display: none; } } @media screen and (min-width: 601px) { .sp-event-logos .sp-team-logo { display: inline-block; } .sp-event-logos-2 .sp-team-logo { display: inline; } .sp-event-logos-2 .sp-team-logo .sp-team-result { display: inline-block; margin: 0 0.25em; } .sp-template-logo + .sp-post-content { clear: left; } .sp-template-photo + .sp-post-content { clear: none; } .sp-template-event-logos-block .team-logo { width: 33%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sp-template-event-logos-block .team-logo img { height: 100px; } .sp-template-event-logos-block .logo-odd { text-align: left; float: left; } .sp-template-event-logos-block .logo-even { text-align: right; float: right; } .sp-template-event-logos-block .logo-odd img { margin-right: 10px; } .sp-template-event-logos-block .logo-even img { margin-left: 10px; } .sp-template-event-logos-block .sp-team-name { display: inline; clear: none; } } ================================================ FILE: assets/css/themes/twentyfourteen.css ================================================ /* * Theme-specific stylesheet. * * 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. */ .sportspress-page .entry-content h4:first-child { margin-top: 36px; } ================================================ FILE: assets/js/admin/colorpicker.js ================================================ jQuery( document ).ready( function($){ // Color picker $( '.colorpick' ).iris( { change: function(event, ui){ $( this ).css( { backgroundColor: ui.color.toString() } ); }, hide: true, border: true } ).each( function() { $( this ).css( { backgroundColor: $( this ).val() } ); } ) .click( function(){ $( '.iris-picker' ).hide(); $( this ).closest( '.sp-color-box, td' ).find( '.iris-picker' ).show(); } ); $( 'body' ).click( function() { $( '.iris-picker' ).hide(); } ); $( '.sp-color-box, .colorpick' ).click( function(event){ event.stopPropagation(); } ); } ); ================================================ FILE: assets/js/admin/dashboard.js ================================================ jQuery( document ).ready( function($){ // Dashboard countdown $( "#sportspress_dashboard_status .sp_status_list li.countdown" ).each( function() { var $this = $( this ), finalDate = $( this ).data( 'countdown' ); $this.countdown( finalDate, function(event) { $this.find( 'strong' ).html( event.strftime( "%D " + localized_strings.days + " %H:%M:%S" ) ); } ); } ); } ); ================================================ FILE: assets/js/admin/editor-lang.php ================================================ array( 'details', 'results', 'performance', 'venue', 'officials', 'teams', 'full', ), 'team' => array(), 'player' => array( 'details', 'statistics', ), ); $options = apply_filters( 'sportspress_shortcodes', $options ); foreach ( $options as $name => $group ) { if ( empty( $group ) ) { continue; } $shortcodes .= $name . '[' . implode( '|', $group ) . ']'; } $raw = apply_filters( 'sportspress_tinymce_strings', array( 'shortcodes' => $shortcodes, 'insert' => esc_attr__( 'SportsPress Shortcodes', 'sportspress' ), 'auto' => esc_attr__( 'Auto', 'sportspress' ), 'manual' => esc_attr__( 'Manual', 'sportspress' ), 'select' => esc_attr__( 'Select...', 'sportspress' ), 'event' => esc_attr__( 'Event', 'sportspress' ), 'details' => esc_attr__( 'Details', 'sportspress' ), 'results' => esc_attr__( 'Results', 'sportspress' ), 'countdown' => esc_attr__( 'Countdown', 'sportspress' ), 'performance' => esc_attr__( 'Box Score', 'sportspress' ), 'venue' => esc_attr__( 'Venue', 'sportspress' ), 'officials' => esc_attr__( 'Officials', 'sportspress' ), 'teams' => esc_attr__( 'Teams', 'sportspress' ), 'full' => esc_attr__( 'Full Info', 'sportspress' ), 'calendar' => esc_attr__( 'Calendar', 'sportspress' ), 'statistics' => esc_attr__( 'Statistics', 'sportspress' ), 'team' => esc_attr__( 'Team', 'sportspress' ), 'standings' => esc_attr__( 'League Table', 'sportspress' ), 'player' => esc_attr__( 'Player', 'sportspress' ), 'list' => esc_attr__( 'List', 'sportspress' ), 'blocks' => esc_attr__( 'Blocks', 'sportspress' ), 'gallery' => esc_attr__( 'Gallery', 'sportspress' ), ) ); $formatted = array(); foreach ( $raw as $key => $value ) { $formatted[] = $key . ': "' . esc_js( $value ) . '"'; } $strings = 'tinyMCE.addI18n({' . _WP_Editors::$mce_locale . ':{ sportspress:{ ' . implode( ', ', $formatted ) . ' } }})'; ================================================ FILE: assets/js/admin/editor.js ================================================ /* global tinymce */ ( function () { tinymce.PluginManager.add( 'sp_shortcodes_button', function( editor, url ) { var ed = tinymce.activeEditor; var groups = ed.getLang( 'sportspress.shortcodes' ).split( "]" ); var menu = new Array(); groups.forEach( function(g) { if ( "" == g ) { return; } var p = g.split( "[" ); var label = p.shift(); var variations = p.shift(); var shortcodes = typeof variations !== 'undefined' ? variations.split( "|" ) : []; var submenu = new Array(); shortcodes.forEach( function(s) { submenu.push( { text: ed.getLang( 'sportspress.' + s ), onclick: function() { // triggers the thickbox var width = jQuery( window ).width(), H = jQuery( window ).height(), W = ( 720 < width ) ? 720 : width; W = W - 80; H = H - 84; tb_show( ed.getLang( 'sportspress.' + label ) + ' - ' + ed.getLang( 'sportspress.' + s ), 'admin-ajax.php?action=sportspress_' + label + '_' + s + '_shortcode&width=' + W + '&height=' + H ); } } ); } ); menu.push( { text: ed.getLang( 'sportspress.' + label ), menu: submenu } ); } ); editor.addButton( 'sp_shortcodes_button', { title: ed.getLang( 'sportspress.insert' ), text: false, icon: false, type: 'menubutton', menu: menu } ); } ); })(); ================================================ FILE: assets/js/admin/equationbuilder.js ================================================ jQuery( document ).ready( function($){ $( "#title" ).keyup( function() { val = $( this ).val(); if ( val == '' ) { val = 'f(x)'; } $( ".sp-equation-variable" ).text( val + ' =' ); } ); $( ".sp-equation-parts .button" ).draggable( { appendTo: "body", helper: "clone", cursor: "move", distance: 10, containment: "#sp_equationdiv", } ).click( function() { $( "" ).text( $( this ).text() ).append( "×" ).appendTo( $( ".sp-equation-formula" ) ); } ); $( ".sp-equation" ).droppable( { activeClass: "ui-state-active", hoverClass: "ui-state-hover", accept: ".button:not(.ui-sortable-helper)", drop: function( event, ui ) { $( "" ).text( ui.draggable.text() ).append( "×" ).appendTo( $( ".sp-equation-formula" ) ); } } ).sortable( { items: ".button", tolerance: "pointer", containment: "#sp_equationdiv", sort: function() { $( this ).removeClass( "ui-state-active" ); } } ); $( ".sp-equation-formula" ).on( "click", ".button .remove", function() { $( this ).closest( ".button" ).remove(); } ); } ); ================================================ FILE: assets/js/admin/iconpicker.js ================================================ jQuery( document ).ready( function($){ // Icon picker $( '.sp-icons input' ).on( 'change', function() { if ('' == $( this ).val()) { $( '.sp-custom-colors' ).hide(); $( '.sp-custom-thumbnail' ).show(); } else { $( '.sp-custom-thumbnail' ).hide(); $( '.sp-custom-colors' ).show(); } } ); // Color picker $( '.colorpick' ).iris( { change: function(event, ui){ $( this ).css( { backgroundColor: ui.color.toString() } ); }, hide: true, border: true } ).each( function() { $( this ).css( { backgroundColor: $( this ).val() } ); } ) .click( function(){ $( '.iris-picker' ).hide(); $( this ).closest( '.sp-color-box-for-icon, td' ).find( '.iris-picker' ).show(); } ); $( 'body' ).click( function() { $( '.iris-picker' ).hide(); } ); $( '.sp-color-box-for-icon, .colorpick' ).click( function(event){ event.stopPropagation(); } ); } ); ================================================ FILE: assets/js/admin/quickeditor.js ================================================ (function($) { // we create a copy of the WP inline edit post function var $wp_inline_edit = inlineEditPost.edit; // and then we overwrite the function with our own code inlineEditPost.edit = function( id ) { // "call" the original WP edit function // we don't want to leave WordPress hanging $wp_inline_edit.apply( this, arguments ); // now we take care of our business // get the post ID var $post_id = 0; if ( typeof( id ) == 'object' ) { $post_id = parseInt( this.getId( id ) ); } if ( $post_id > 0 ) { // define the edit row var $edit_row = $( '#edit-' + $post_id ); var $post_row = $( '#post-' + $post_id ); // get the data var $number = $( '.column-sp_number', $post_row ).text(); var $current_teams = String( $( '.column-sp_team', $post_row ).find( '.sp-player-teams' ).data( 'current-teams' ) ).split( ',' ); var $past_teams = String( $( '.column-sp_team', $post_row ).find( '.sp-player-teams' ).data( 'past-teams' ) ).split( ',' ); // populate the data $( ':input[name="sp_number"]', $edit_row ).val( $number ); $( ':input[name="sp_current_team[]"]', $edit_row ).each( function() { $( this ).prop( "checked", ($.inArray( $( this ).val(), $current_teams ) != -1) ); } ); $( ':input[name="sp_past_team[]"]', $edit_row ).each( function() { $( this ).prop( "checked", ($.inArray( $( this ).val(), $past_teams ) != -1) ); } ); } }; $( document ).on( 'click', '#bulk_edit', function() { // define the bulk edit row var $bulk_row = $( '#bulk-edit' ); // get the selected post ids that are being edited var $post_ids = new Array(); $bulk_row.find( '#bulk-titles' ).children().each( function() { $post_ids.push( $( this ).attr( 'id' ).replace( /^(ttle)/i, '' ) ); } ); // get the data var $current_teams = []; $bulk_row.find( 'input[name="sp_current_team[]"]:checked' ).each( function() { $current_teams.push( $( this ).val() ); } ); var $past_teams = []; $bulk_row.find( 'input[name="sp_past_team[]"]:checked' ).each( function() { $past_teams.push( $( this ).val() ); } ); // save the data $.ajax( { url: ajaxurl, // this is a variable that WordPress has already defined for us type: 'POST', async: false, cache: false, data: { action: 'save_bulk_edit_sp_player', post_ids: $post_ids, current_teams: $current_teams, past_teams: $past_teams, nonce: $( "#sp_player_edit_nonce" ).val() } } ); } ); })( jQuery ); ================================================ FILE: assets/js/admin/settings.js ================================================ jQuery( document ).ready( function($){ // Display custom sport name field as needed $( "body.toplevel_page_sportspress #sportspress_sport" ).change( function() { $target = $( "#sportspress_custom_sport_name" ); if ( $( this ).val() == "custom" ) { $target.show(); } else { $target.hide(); } } ); // Color picker $( '.colorpick' ).iris( { change: function(event, ui){ $( this ).css( { backgroundColor: ui.color.toString() } ); }, hide: true, border: true } ).each( function() { $( this ).css( { backgroundColor: $( this ).val() } ); } ) .click( function(){ $( '.iris-picker' ).hide(); $( this ).closest( '.sp-color-box, td' ).find( '.iris-picker' ).show(); } ); $( 'body' ).click( function() { $( '.iris-picker' ).hide(); } ); $( '.sp-color-box, .colorpick' ).click( function(event){ event.stopPropagation(); } ); // Chosen select $( ".chosen-select" ).chosen( { allow_single_deselect: true, single_backstroke_delete: false, placeholder_text_multiple: localized_strings.none } ); // Preset field modifier $( ".sp-custom-input-wrapper .preset" ).click( function() { val = $( this ).val(); if (val == "\\c\\u\\s\\t\\o\\m") { return true; } example = $( this ).attr( "data-example" ); $( this ).closest( ".sp-custom-input-wrapper" ).find( ".value" ).val( val ).siblings( ".example" ).html( example ); } ); // Select custom preset when field is brought to focus $( ".sp-custom-input-wrapper .value" ).focus( function() { $( this ).siblings( "label" ).find( ".preset" ).prop( "checked", true ); } ); // Adjust example field when custom preset is entered $( ".sp-custom-input-wrapper .value" ).on( "keyup", function() { val = $( this ).val(); if ( val === undefined ) { return true; } format = $( this ).attr( "data-example-format" ); example = format.replace( /__val__/g, val ); $( this ).siblings( ".example" ).html( example ); } ); } ); ================================================ FILE: assets/js/admin/sp-geocoder.js ================================================ // Get variables form input values latitude = document.getElementById( 'term_meta[sp_latitude]' ).value; longitude = document.getElementById( 'term_meta[sp_longitude]' ).value; // Initialize the map and add the Search control box var map = L.map( 'sp-location-picker' ).setView( [latitude, longitude], 15 ), geocoder = L.Control.Geocoder.nominatim(), control = L.Control.geocoder( { geocoder: geocoder, collapsed: false, defaultMarkGeocode: false } ).addTo( map ), // Add a marker to use from the begining marker = L.marker( [latitude, longitude],{draggable: true, autoPan: true} ).addTo( map ); L.tileLayer( 'http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' } ).addTo( map ); // Pass the values to the fields after dragging marker.on( 'dragend', function (e) { document.getElementById( 'term_meta[sp_latitude]' ).value = marker.getLatLng().lat; document.getElementById( 'term_meta[sp_longitude]' ).value = marker.getLatLng().lng; geocoder.reverse( marker.getLatLng(), map.options.crs.scale( map.getZoom() ), function(results) { var r = results[0]; if (r) { document.getElementById( 'term_meta[sp_address]' ).value = r.name; } } ) } ); // After searching control.on( 'markgeocode', function(e) { var center = e.geocode.center; var address = e.geocode.name; map.setView( [center.lat, center.lng], 15 ); // Center map to the new place map.removeLayer( marker ); // Remove previous marker marker = L.marker( [center.lat, center.lng],{draggable: true, autoPan: true} ).addTo( map ); // Add new marker to use // Pass the values to the fields after searching document.getElementById( 'term_meta[sp_latitude]' ).value = center.lat; document.getElementById( 'term_meta[sp_longitude]' ).value = center.lng; document.getElementById( 'term_meta[sp_address]' ).value = address; // Pass the values to the fields after dragging marker.on( 'dragend', function (e) { document.getElementById( 'term_meta[sp_latitude]' ).value = marker.getLatLng().lat; document.getElementById( 'term_meta[sp_longitude]' ).value = marker.getLatLng().lng; geocoder.reverse( marker.getLatLng(), map.options.crs.scale( map.getZoom() ), function(results) { var r = results[0]; if (r) { document.getElementById( 'term_meta[sp_address]' ).value = r.name; } } ) } ); } ).addTo( map ); ================================================ FILE: assets/js/admin/sp-setup-geocoder.js ================================================ // Get variables form input values latitude = document.getElementById( 'sp_latitude' ).value; longitude = document.getElementById( 'sp_longitude' ).value; // Initialize the map and add the Search control box var map = L.map( 'sp-location-picker' ).setView( [latitude, longitude], 15 ), geocoder = L.Control.Geocoder.nominatim(), control = L.Control.geocoder( { geocoder: geocoder, collapsed: false, defaultMarkGeocode: false } ).addTo( map ), // Add a marker to use from the begining marker = L.marker( [latitude, longitude],{draggable: true, autoPan: true} ).addTo( map ); L.tileLayer( 'http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' } ).addTo( map ); // Pass the values to the fields after dragging marker.on( 'dragend', function (e) { document.getElementById( 'sp_latitude' ).value = marker.getLatLng().lat; document.getElementById( 'sp_longitude' ).value = marker.getLatLng().lng; geocoder.reverse( marker.getLatLng(), map.options.crs.scale( map.getZoom() ), function(results) { var r = results[0]; if (r) { document.getElementById( 'sp_address' ).value = r.name; } } ) } ); // After searching control.on( 'markgeocode', function(e) { var center = e.geocode.center; var address = e.geocode.name; map.setView( [center.lat, center.lng], 15 ); // Center map to the new place map.removeLayer( marker ); // Remove previous marker marker = L.marker( [center.lat, center.lng],{draggable: true, autoPan: true} ).addTo( map ); // Add new marker to use // Pass the values to the fields after searching document.getElementById( 'sp_latitude' ).value = center.lat; document.getElementById( 'sp_longitude' ).value = center.lng; document.getElementById( 'sp_address' ).value = address; // Pass the values to the fields after dragging marker.on( 'dragend', function (e) { document.getElementById( 'sp_latitude' ).value = marker.getLatLng().lat; document.getElementById( 'sp_longitude' ).value = marker.getLatLng().lng; geocoder.reverse( marker.getLatLng(), map.options.crs.scale( map.getZoom() ), function(results) { var r = results[0]; if (r) { document.getElementById( 'sp_address' ).value = r.name; } } ) } ); } ).addTo( map ); ================================================ FILE: assets/js/admin/sportspress-admin.js ================================================ jQuery( document ).ready( function($){ // Tiptip $( ".sp-tip" ).tipTip( { delay: 200, fadeIn: 100, fadeOut: 100 } ); $( ".sp-desc-tip" ).tipTip( { delay: 200, fadeIn: 100, fadeOut: 100, defaultPosition: 'right' } ); // Chosen select $( document ).on( "postbox-toggled", function() { $( ".chosen-select" ).filter( ":visible" ).chosen( { allow_single_deselect: true, search_contains: true, single_backstroke_delete: false, disable_search_threshold: 10, placeholder_text_multiple: localized_strings.none } ); } ).trigger( "postbox-toggled" ); // Auto key placeholder $( "#poststuff #title" ).on( "keyup", function() { val = $( this ).val() lc = val.replace( /[^a-z]/gi,"" ).toLowerCase(); $( "#sp_key" ).attr( "placeholder", lc ); $( "#sp_default_key" ).val( lc ); $( "#sp_singular" ).attr( "placeholder", val ); } ); // Activate auto key placeholder $( "#poststuff #title" ).keyup(); // Radio input toggle $( ".sp-radio-toggle" ).click( function() { if ($( this ).data( "sp-checked" )) { $( this ).prop( "checked", false ); $( this ).data( "sp-checked", false ); } else { $( this ).data( "sp-checked", true ); } } ); // Table switcher $( ".sp-table-panel" ).siblings( ".sp-table-bar" ).find( "a" ).click( function() { $( 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(); return false; } ); // Tab switcher $( ".sp-tab-panel" ).siblings( ".sp-tab-bar" ).find( "a" ).click( function() { $( this ).closest( "li" ).addClass( "tabs" ).siblings().removeClass( "tabs" ).closest( ".sp-tab-bar" ).siblings( $( this ).attr( "href" ) ).show().trigger( 'checkCheck' ).siblings( ".sp-tab-panel" ).hide(); return false; } ); // Tab filter $( ".sp-tab-filter-panel" ).siblings( ".sp-tab-select" ).find( "select" ).change( function() { var val = $( this ).val(); var filter = ".sp-filter-" + val; var $filters = $( this ).closest( ".sp-tab-select" ).siblings( ".sp-tab-select" ); if ($filters.length) { $filters.each( function() { filterval = $( this ).find( "select" ).val(); if (filterval !== undefined) { filter += ".sp-filter-" + filterval; } } ); } $panel = $( this ).closest( ".sp-tab-select" ).siblings( ".sp-tab-panel" ); $panel.each( function() { $( this ).find( ".sp-post" ).hide( 0, function() { $( this ).find( "input" ).prop( "disabled", true ); $( this ).filter( filter ).show( 0, function() { $( this ).find( "input" ).prop( "disabled", false ); } ); } ); if ($( this ).find( ".sp-post:visible" ).length > 0) { $( this ).find( ".sp-select-all-container" ).show(); $( this ).find( ".sp-show-all-container" ).show(); $( this ).find( ".sp-not-found-container" ).hide(); } else { $( this ).find( ".sp-select-all-container" ).hide(); $( this ).find( ".sp-show-all-container" ).hide(); $( this ).find( ".sp-not-found-container" ).show(); } } ); } ); // Trigger tab filter $( ".sp-tab-filter-panel" ).siblings( ".sp-tab-select" ).find( "select" ).change(); // Dropdown filter $( ".sp-dropdown-target" ).siblings( ".sp-dropdown-filter" ).find( "select" ).change( function() { var val = $( this ).val(); var filter = ".sp-filter-" + val; var $filters = $( this ).closest( ".sp-dropdown-filter" ).siblings( ".sp-dropdown-filter" ); if ($filters.length) { $filters.each( function() { filterval = $( this ).find( "select" ).val(); if (filterval !== undefined) { filter += ".sp-filter-" + filterval; } } ); } $target = $( this ).closest( ".sp-dropdown-filter" ).siblings( ".sp-dropdown-target" ).find( "select" ); $target.find( ".sp-post" ).prop( "disabled", true ).each( function() { $( this ).filter( filter ).prop( "disabled", false ); } ); } ); // Trigger dropdown filter $( ".sp-dropdown-target" ).siblings( ".sp-dropdown-filter" ).find( "select" ).change(); // Filter show all action links $( ".sp-tab-panel" ).find( ".sp-post input:checked" ).each( function() { $( this ).prop( "disabled", false ).closest( "li" ).show().siblings( ".sp-not-found-container" ).hide().siblings( ".sp-show-all-container" ).show(); } ); // Show all filter $( ".sp-tab-panel" ).on( "click", ".sp-show-all", function() { $( this ).closest( "li" ).hide().siblings( ".sp-post, .sp-select-all-container" ).show().find( "input" ).prop( "disabled", false ); } ); // Self-cloning $( ".sp-clone:last" ).find( "select" ).change( function() { $( this ).closest( ".sp-clone" ).siblings().find( "select" ).change( function() { if ($( this ).val() == "0") { $( this ).closest( ".sp-clone" ).remove(); } } ).find( "option:first" ).text( localized_strings.remove_text ); if ($( this ).val() != "0") { $original = $( this ).closest( ".sp-clone" ); $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(); } } ); // Activate self-cloning $( ".sp-clone:last" ).find( "select" ).change(); // Custom value editor $( ".sp-data-table .sp-default-value" ).click( function() { $( this ).hide().siblings( ".sp-custom-value" ).show().find( ".sp-custom-value-input" ).focus(); } ); // Define custom value editor saving $( ".sp-data-table .sp-custom-value .sp-custom-value-input" ).on( "saveInput", function() { $val = $( this ).val(); if ($val == "") { $val = $( this ).attr( "placeholder" ); } $( this ).closest( ".sp-custom-value" ).hide().siblings( ".sp-default-value" ).show().find( ".sp-default-value-input" ).html( $val ); } ); // Define custom value editor cancellation $( ".sp-data-table .sp-custom-value .sp-custom-value-input" ).on( "cancelInput", function() { $val = $( this ).closest( ".sp-custom-value" ).siblings( ".sp-default-value" ).find( ".sp-default-value-input" ).html(); if ($val == $( this ).attr( "placeholder" )) { $( this ).val( "" ); } else { $( this ).val( $val ); } $( this ).closest( ".sp-custom-value" ).hide().siblings( ".sp-default-value" ).show(); } ); // Custom value editor save $( ".sp-data-table .sp-custom-value .sp-save" ).click( function() { $( this ).siblings( ".sp-custom-value-input" ).trigger( "saveInput" ); } ); // Custom value editor cancel $( ".sp-data-table .sp-custom-value .sp-cancel" ).click( function() { $( this ).siblings( ".sp-custom-value-input" ).trigger( "cancelInput" ); } ); // Prevent custom value editor input from submitting form $( ".sp-data-table .sp-custom-value .sp-custom-value-input" ).keypress( function(event) { if (event.keyCode == 13) { event.preventDefault(); $( this ).trigger( "saveInput" ); return false; } } ); // Cancel custom value editor form on escape $( ".sp-data-table .sp-custom-value .sp-custom-value-input" ).keyup( function(event) { if (event.keyCode == 27) { event.preventDefault(); $( this ).trigger( "cancelInput" ); return false; } } ); // Data table adjustments $( ".sp-table-adjustments input" ).change( function() { matrix = $( this ).attr( "data-matrix" ); $el = $( this ).closest( ".sp-table-adjustments" ).siblings( ".sp-table-values" ).find( "input[data-matrix=" + matrix + "]" ); placeholder = $el.attr( "data-placeholder" ); current_adjustment = parseFloat( $el.attr( "data-adjustment" ) ); adjustment = parseFloat( $( this ).val() ); if ( ! isNaN( adjustment ) && adjustment != 0) { placeholder = parseFloat( placeholder ); if (isNaN( placeholder )) { placeholder = 0; } if (isNaN( current_adjustment )) { current_adjustment = 0; } placeholder += adjustment - current_adjustment; } $el.attr( "placeholder", placeholder ); } ).change(); // Data table keyboard navigation $( ".sp-data-table tbody tr td input:text" ).keydown( function(event) { if ( ! $( this ).parent().hasClass( "chosen-search" ) && [37,38,39,40].indexOf( event.keyCode ) > -1) { $el = $( this ).closest( "td" ); var col = $el.parent().children().index( $el ) + 1; var row = $el.parent().parent().children().index( $el.parent() ) + 1; if (event.keyCode == 37) { if ( $( this ).caret().start != 0 ) { return true; } col -= 1; } if (event.keyCode == 38) { row -= 1; } if (event.keyCode == 39) { if ( $( this ).caret().start != $( this ).val().length ) { return true; } col += 1; } if (event.keyCode == 40) { row += 1; } $el.closest( "tbody" ).find( "tr:nth-child(" + row + ") td:nth-child(" + col + ") input:text" ).first().focus(); } } ); // Prevent data table from submitting form $( ".sp-data-table tbody tr td input:text" ).keypress( function(event) { if ( ! $( this ).parent().hasClass( "chosen-search" ) && event.keyCode == 13) { event.preventDefault(); $el = $( this ).closest( "td" ); var col = $el.parent().children().index( $el ) + 1; var row = $el.parent().parent().children().index( $el.parent() ) + 2; $el.closest( "tbody" ).find( "tr:nth-child(" + row + ") td:nth-child(" + col + ") input:text" ).focus(); return false; } } ); // Total stats calculator $( ".sp-data-table .sp-total input[data-sp-format=number][data-sp-total-type!=average]" ).on( "updateTotal", function() { index = $( this ).parent().index(); var sum = 0; $( this ).closest( ".sp-data-table" ).find( ".sp-post" ).each( function() { val = $( this ).find( "td" ).eq( index ).find( "input" ).val(); if (val == "") { val = $( this ).find( "td" ).eq( index ).find( "input" ).attr( "placeholder" ); } if ($.isNumeric( val )) { sum += parseFloat( val, 10 ); } } ); $( this ).attr( "placeholder", sum ); } ); // Activate total stats calculator if ($( ".sp-data-table .sp-total" ).length) { $( ".sp-data-table .sp-post td input" ).on( "keyup", function() { $( 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" ); } ); } // Trigger total stats calculator $( ".sp-data-table .sp-total input[data-sp-format=number][data-sp-total-type!=average]" ).trigger( "updateTotal" ); // Sync inputs $( ".sp-sync-input" ).on( "keyup", function() { name = $( this ).attr( "name" ); $el = $( "input[name='" + name + "']" ); if ( $el.length > 1 ) { val = $( this ).val(); $el.val( val ); } } ); // Sync selects $( ".sp-sync-select" ).on( "change", function() { name = $( this ).attr( "name" ); $el = $( "select[name='" + name + "']" ) if ( $el.length > 1 ) { val = $( this ).val(); $el.val( val ); } } ); // Select all checkboxes $( ".sp-select-all-range" ).on( "change", ".sp-select-all", function() { $range = $( this ).closest( ".sp-select-all-range" ); $range.find( "input[type=checkbox]" ).prop( "checked", $( this ).prop( "checked" ) ); } ); // Check if all checkboxes are checked already $( ".sp-select-all-range" ).on( "checkCheck", function() { $( this ).each( function() { $( 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 ); } ); } ); // Activate check check when a checkbox is checked $( ".sp-select-all-range input[type=checkbox]:not(.sp-select-all)" ).change( function() { $( this ).closest( ".sp-select-all-range" ).trigger( "checkCheck" ); } ); // Activate check check on page load $( ".sp-select-all-range" ).trigger( "checkCheck" ); // Trigger check check $( ".sp-data-table" ).trigger( "checkCheck" ); // Sortable tables $( ".sp-sortable-table tbody" ).sortable( { handle: ".icon", axis: "y" } ); // Sortable lists $( ".sp-sortable-list" ).sortable( { handle: ".sp-item-handle", placeholder: "sp-item-placeholder", connectWith: ".sp-connected-list" } ); // Autosave $( ".sp-autosave" ).change( function() { $( this ).attr( "readonly", true ).closest( "form" ).submit(); } ); // Video embed $( ".sp-add-video" ).click( function() { $( this ).closest( "fieldset" ).hide().siblings( ".sp-video-field" ).show(); return false; } ); // Removing video embed $( ".sp-remove-video" ).click( function() { $( this ).closest( "fieldset" ).hide().siblings( ".sp-video-adder" ).show().siblings( ".sp-video-field" ).find( "input" ).val( null ); return false; } ); // Equation selector $( ".sp-equation-selector select:last" ).change( function() { $( this ).siblings().change( function() { if ($( this ).val() == "") { $( this ).remove(); } } ).find( "option:first" ).text( localized_strings.remove_text ); if ($( this ).val() != "") { $( this ).before( $( this ).clone().val( $( this ).val() ) ).val( "" ).change(); } } ); // Trigger equation selector $( ".sp-equation-selector select:last" ).change().siblings().change(); // Order selector $( ".sp-order-selector select:first" ).change( function() { if ($( this ).val() == "0") { $( this ).siblings().prop( "disabled", true ); } else { $( this ).siblings().prop( "disabled", false ) } } ); // Trigger order selector $( ".sp-order-selector select:first" ).change(); // Format selector $( ".sp-format-selector select:first" ).change( function() { $precisiondiv = $( "#sp_precisiondiv" ); $precisioninput = $( "#sp_precision" ); $timeddiv = $( "#sp_timeddiv" ); $equationdiv = $( "#sp_equationdiv" ); // Equation settings if ($( this ).val() == "equation") { $equationdiv.show(); $precisiondiv.show(); $timeddiv.hide(); $precisioninput.prop( "disabled", false ); } else if ($( this ).val() == "number") { $equationdiv.hide(); $precisiondiv.hide(); $timeddiv.show(); $precisioninput.prop( "disabled", true ); } else { $equationdiv.hide(); $precisiondiv.hide(); $timeddiv.hide(); $precisioninput.prop( "disabled", true ); } } ); // Trigger format selector $( ".sp-format-selector select:first" ).change(); // Team era selector $( ".sp-team-era-selector select:first-child" ).change( function() { $subselector = $( this ).siblings(); // Sub settings if ($( this ).val() == 0) { $subselector.hide(); } else { $subselector.show(); } } ); // Trigger team era selector $( ".sp-team-era-selector select:first-child" ).change(); // Status selector $( ".sp-status-selector select:first-child" ).change( function() { $subselector = $( this ).siblings(); // Sub settings if ($( this ).val() == "sub") { $subselector.show(); } else { $subselector.hide(); } } ); // Trigger status selector $( ".sp-status-selector select:first-child" ).change(); // Preset field modifier $( ".sp-custom-input-wrapper .preset" ).click( function() { val = $( this ).val(); if (val == "\\c\\u\\s\\t\\o\\m") { return true; } example = $( this ).attr( "data-example" ); $( this ).closest( ".sp-custom-input-wrapper" ).find( ".value" ).val( val ).siblings( ".example" ).html( example ); } ); // Select custom preset when field is brought to focus $( ".sp-custom-input-wrapper .value" ).focus( function() { $( this ).siblings( "label" ).find( ".preset" ).prop( "checked", true ); } ); // Adjust example field when custom preset is entered $( ".sp-custom-input-wrapper .value" ).on( "keyup", function() { val = $( this ).val(); if ( val === undefined ) { return true; } format = $( this ).attr( "data-example-format" ); example = format.replace( "__val__", val ); $( this ).siblings( ".example" ).html( example ); } ); // Prevent address input from submitting form $( ".sp-address" ).keypress( function(event) { return event.keyCode != 13; } ); // Dashboard countdown $( "#sportspress_dashboard_status .sp_status_list li.countdown" ).each( function() { var $this = $( this ); // Get countdown time var countDownDate = new Date( $( this ).data( 'countdown' ) ).getTime(); // Iterate every second var x = setInterval( function() { // Get todays date and time var now = new Date(); // Convert curent date and time to UTC var tzDifference = now.getTimezoneOffset(); var nowutc = new Date( now.getTime() + tzDifference * 60 * 1000 ); // Find the distance between now and the count down date var distance = countDownDate - nowutc; if ( distance < 0 ) { distance = 0; } // Time calculations for days, hours, minutes and seconds var days = Math.floor( distance / (1000 * 60 * 60 * 24) ); var hours = Math.floor( (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) ); var minutes = Math.floor( (distance % (1000 * 60 * 60)) / (1000 * 60) ); var seconds = Math.floor( (distance % (1000 * 60)) / 1000 ); // Output the result $this.find( 'strong' ).html( days + " " + localized_strings.days + " " + ('0' + hours).slice( -2 ) + ":" + ('0' + minutes).slice( -2 ) + ":" + ('0' + seconds).slice( -2 ) ); }, 1000 ); } ); // Event format affects data $( ".post-type-sp_event #post-formats-select" ).change( function() { layout = $( ".post-type-sp_event #post-formats-select input:checked" ).val(); if ( layout == "friendly" ) { $( ".sp_event-sp_league-field" ).hide().find( "select" ).prop( "disabled", true ); $( ".sp_event-sp_season-field" ).hide().find( "select" ).prop( "disabled", true ); } else { $( ".sp_event-sp_league-field" ).show().find( "select" ).prop( "disabled", false ); $( ".sp_event-sp_season-field" ).show().find( "select" ).prop( "disabled", false ); } } ); // Trigger event format change $( ".post-type-sp_event #post-formats-select" ).trigger( "change" ); // Calendar layout affects data $( ".post-type-sp_calendar #post-formats-select" ).change( function() { layout = $( ".post-type-sp_calendar #post-formats-select input:checked" ).val(); $( ".sp-calendar-table tr" ).each( function() { if ( layout == "list" ) { $( this ).find( "th input[type=checkbox]" ).show(); $( this ).find( "th select" ).prop( "disabled", false ); } else { $( this ).find( "th input[type=checkbox]" ).hide(); $( this ).find( "th select" ).prop( 'selectedIndex', 0 ).prop( "disabled", true ); } } ); } ); // Trigger calendar layout change $( ".post-type-sp_calendar #post-formats-select" ).trigger( "change" ); // Player list layout affects data $( ".post-type-sp_list #post-formats-select" ).change( function() { layout = $( ".post-type-sp_list #post-formats-select input:checked" ).val(); $( ".sp-player-list-table tr" ).each( function() { if ( layout == "list" ) { $( this ).find( "th input[type=checkbox]" ).show(); } else { $( this ).find( "th input[type=checkbox]" ).hide(); } } ); } ); // Trigger player list layout change $( ".post-type-sp_list #post-formats-select" ).trigger( "change" ); // Configure primary result option (Ajax) $( ".sp-admin-config-table" ).on( "click", ".sp-primary-result-option", function() { $.post( ajaxurl, { action: "sp-save-primary-result", primary_result: $( this ).val(), nonce: $( "#sp-primary-result-nonce" ).val() } ); } ); // Configure primary performance option (Ajax) $( ".sp-admin-config-table" ).on( "click", ".sp-primary-performance-option", function() { $.post( ajaxurl, { action: "sp-save-primary-performance", primary_performance: $( this ).val(), nonce: $( "#sp-primary-performance-nonce" ).val() } ); } ); // Update importer post count $( ".sp-import-table" ).on( "updatePostCount", function() { $( ".sp-post-count" ).text( localized_strings.displaying_posts.replace( "%s", 1 ).replace( /%s/g, count = $( this ).find( "tbody tr" ).length ) ); } ); // Delete importer row $( ".sp-import-table" ).on( "click", ".sp-delete-row", function() { $self = $( this ); $self.closest( "tr" ).css( "background-color", "#f99" ).fadeOut( 400, function() { $table = $self.closest( ".sp-import-table" ); $( this ).remove(); $table.trigger( "updatePostCount" ); } ); return false; } ); // Add importer row $( ".sp-import-table" ).on( "click", ".sp-add-row", function() { $self = $( this ); $table = $self.closest( ".sp-import-table" ); if ( $self.hasClass( "sp-add-first" ) ) { $tr = $table.find( "tbody tr:first-child" ); $row = $tr.clone(); $row.insertBefore( $tr ).find( "input" ).val( "" ); } else { $tr = $self.closest( "tr" ); $row = $tr.clone(); $tr.find( "input" ).val( "" ); $row.insertBefore( $tr ); } $table.trigger( "updatePostCount" ); return false; } ); // Enable or disable importer inputs based on column label $( ".sp-import-table" ).on( "change", "select", function() { $self = $( this ); $table = $self.closest( ".sp-import-table" ); index = parseInt( $self.data( "index" ) ); if ( $self.val() == 0 ) { $table.find( "tbody tr td:nth-child(" + parseInt( index + 1 ) + ") input" ).prop( "disabled", true ); } else { $table.find( "tbody tr td:nth-child(" + parseInt( index + 1 ) + ") input" ).prop( "disabled", false ); $self.closest( "th" ).siblings().find( "select" ).each( function() { if ( $( this ).val() == $self.val() ) { $( this ).val( "0" ).trigger( "change" ); } } ); } } ); // Datepicker $( ".sp-datepicker" ).datepicker( { dateFormat : "yy-mm-dd" } ); $( ".sp-datepicker-from" ).datepicker( { dateFormat : "yy-mm-dd", onClose: function( selectedDate ) { $( this ).closest( ".sp-date-selector" ).find( ".sp-datepicker-to" ).datepicker( "option", "minDate", selectedDate ); } } ); $( ".sp-datepicker-to" ).datepicker( { dateFormat : "yy-mm-dd", onClose: function( selectedDate ) { $( this ).closest( ".sp-date-selector" ).find( ".sp-datepicker-from" ).datepicker( "option", "maxDate", selectedDate ); } } ); // Show or hide datepicker $( ".sp-date-selector select" ).change( function() { if ( $( this ).val() == "range" ) { $( this ).closest( ".sp-date-selector" ).find( ".sp-date-range" ).show(); } else { $( this ).closest( ".sp-date-selector" ).find( ".sp-date-range" ).hide(); } } ); $( ".sp-date-selector select" ).trigger( "change" ); // Toggle date range selectors $( ".sp-date-relative input" ).change( function() { $relative = $( this ).closest( ".sp-date-relative" ).siblings( ".sp-date-range-relative" ).toggle( 0, $( this ).attr( "checked" ) ); $absolute = $( this ).closest( ".sp-date-relative" ).siblings( ".sp-date-range-absolute" ).toggle( 0, $( this ).attr( "checked" ) ); if ( $( this ).is( ":checked" ) ) { $relative.show(); $absolute.hide(); } else { $absolute.show(); $relative.hide(); } } ); $( ".sp-date-selector input" ).trigger( "change" ); // Apply color scheme $( ".sp-color-option" ).on( "click", function() { colors = $( this ).find( "label" ).data( "sp-colors" ).split( "," ); $( ".sp-custom-colors" ).find( ".sp-color-box" ).each( function(index) { $( this ).find( "input" ).val( "#" + colors[index] ).css( "background-color", "#" + colors[index] ); } );; } ); // Edit inline results $( "#the-list" ).on( "click, focus", ".sp-result, .sp-edit-results", function(){ team = $( this ).data( "team" ); $column = $( this ).closest( ".column-sp_team" ); $column.find( ".sp-result, .sp-row-actions" ).hide(); $column.find( ".sp-edit-result, .sp-inline-edit-save" ).show(); if ( team != undefined ) { $column.find( ".sp-edit-result[data-team='" + team + "']" ).select(); } return false; } ); // Cancel inline results $( "#the-list" ).on( "click", ".sp-inline-edit-save .cancel", function(){ $column = $( this ).closest( ".column-sp_team" ); $column.find( ".sp-edit-result, .sp-inline-edit-save" ).hide(); $column.find( ".sp-result, .sp-row-actions" ).show(); return false; } ); // Save inline results $( "#the-list" ).on( "click", ".sp-inline-edit-save .save", function(){ $column = $( this ).closest( ".column-sp_team" ); results = {}; $column.find( ".sp-edit-result" ).each( function() { id = $( this ).data( "team" ); result = $( this ).val(); results[id] = result; } ); $.post( ajaxurl, { action: "sp-save-inline-results", post_id: $column.find( "input[name='sp_post_id']" ).val(), results: results, nonce: $( "#sp-inline-nonce" ).val() }, function(response) { $column.find( ".sp-edit-result" ).each( function() { val = $( this ).val(); $column.find( ".sp-result[data-team='" + $( this ).data( "team" ) + "']" ).html( val == '' ? '-' : val ); } ); $column.find( ".sp-edit-result, .sp-inline-edit-save" ).hide(); $column.find( ".sp-result, .sp-row-actions" ).show(); return false; } ); } ); // Override inline form submission $( "#the-list" ).on( "keypress", ".sp-edit-result", function(e) { if ( e.which == 13 ) { $( this ).closest( ".column-sp_team" ).find( ".sp-inline-edit-save .save" ).trigger( "click" ); return false; } } ); // Fitvids $( ".sp-fitvids" ).fitVids(); // Display configure sport button $( ".sp-select-sport" ).change( function() { $( ".sp-configure-sport" ).hide(); } ); // Ajax checklist $( ".sp-ajax-checklist" ).siblings( ".sp-tab-select" ).find( "select" ).change( function() { $( this ).closest( ".sp-tab-select" ).siblings( ".sp-ajax-checklist" ).find( "ul" ).html( "
  • " + localized_strings.loading + "
  • " ); $.post( ajaxurl, { action: "sp-get-players", team: $( this ).val(), league: ('yes' == localized_strings.option_filter_by_league) ? $( "select[name=\"tax_input[sp_league][]\"]" ).val() : null, season: ('yes' == localized_strings.option_filter_by_season) ? $( "select[name=\"tax_input[sp_season][]\"]" ).val() : null, index: $( this ).closest( ".sp-instance" ).index(), nonce: $( "#sp-get-players-nonce" ).val() } ).done( function( response ) { index = response.data.index; $target = $( ".sp-instance" ).eq( index ).find( ".sp-ajax-checklist ul" ); if ( response.success ) { $target.html( "" ); i = 0; if (-1 == response.data.sections) { if (response.data.players.length) { $target.eq( 0 ).append( "
  • " ); $( response.data.players ).each( function( key, value ) { $target.eq( 0 ).append( "
  • " ); } ); $target.eq( 0 ).append( "
  • " + localized_strings.show_all + "
  • " ); } else { $target.eq( 0 ).html( "
  • " + localized_strings.no_results_found + " " + localized_strings.show_all + "
  • " ); } } else { if ( 1 == response.data.sections ) { defense = i; offense = i + 1; } else { offense = i; defense = i + 1; } if (response.data.players.length) { $target.eq( offense ).append( "
  • " ); $target.eq( defense ).append( "
  • " ); $( response.data.players ).each( function( key, value ) { $target.eq( offense ).append( "
  • " ); $target.eq( defense ).append( "
  • " ); } ); $target.eq( offense ).append( "
  • " + localized_strings.show_all + "
  • " ); $target.eq( defense ).append( "
  • " + localized_strings.show_all + "
  • " ); } else { $target.eq( offense ).html( "
  • " + localized_strings.no_results_found + " " + localized_strings.show_all + "
  • " ); $target.eq( defense ).html( "
  • " + localized_strings.no_results_found + " " + localized_strings.show_all + "
  • " ); } i++; } i++; if (response.data.staff.length) { $target.eq( i ).append( "
  • " ); $( response.data.staff ).each( function( key, value ) { $target.eq( i ).append( "
  • " ); } ); $target.eq( i ).append( "
  • " + localized_strings.show_all + "
  • " ); } else { $target.eq( i ).html( "
  • " + localized_strings.no_results_found + " " + localized_strings.show_all + "
  • " ); } } else { $target.html( "
  • " + localized_strings.no_results_found + "
  • " ); } } ); } ); // Activate Ajax trigger $( ".sp-ajax-trigger" ).change( function() { $( ".sp-ajax-checklist" ).siblings( ".sp-tab-select" ).find( "select" ).change(); } ); // Ajax show all filter $( ".sp-tab-panel" ).on( "click", ".sp-ajax-show-all", function() { index = $( this ).closest( ".sp-instance" ).index(); $( this ).parent().html( localized_strings.loading ); $.post( ajaxurl, { action: "sp-get-players", index: index, nonce: $( "#sp-get-players-nonce" ).val() } ).done( function( response ) { index = response.data.index; console.log( index ); $target = $( ".sp-instance" ).eq( index ).find( ".sp-ajax-checklist ul" ); $target.find( ".sp-ajax-show-all-container" ).hide(); if ( response.success ) { i = 0; console.log( response.data.sections ); if ( -1 == response.data.sections ) { if (response.data.players.length) { $( response.data.players ).each( function( key, value ) { if ($target.eq( i ).find( "input[value=" + value.ID + "]" ).length) { return true; } $target.eq( i ).append( "
  • " ); } ); } else { $target.eq( i ).html( "
  • " + localized_strings.no_results_found + "
  • " ); } } else { if (response.data.players.length) { if ( 1 == response.data.sections ) { defense = i; offense = i + 1; } else { offense = i; defense = i + 1; } $( response.data.players ).each( function( key, value ) { $target.eq( offense ).append( "
  • " ); $target.eq( defense ).append( "
  • " ); } ); } else { $target.eq( offense ).html( "
  • " + localized_strings.no_results_found + "
  • " ); $target.eq( defense ).html( "
  • " + localized_strings.no_results_found + "
  • " ); } i++; } i++; if (response.data.staff.length) { $( response.data.staff ).each( function( key, value ) { $target.eq( i ).append( "
  • " ); } ); } else { $target.eq( i ).html( "
  • " + localized_strings.no_results_found + "
  • " ); } } else { $target.html( "
  • " + localized_strings.no_results_found + "
  • " ); } } ); } ); // Event status selector $( '.sp-edit-event-status' ).click( function(e) { e.preventDefault(); $select = $( this ).siblings( '.sp-event-status-select' ); if ( $select.is( ':hidden' ) ) { $select.slideDown( 'fast', function() { $select.find( 'input[type="radio"]' ).first().focus(); } ); $( this ).hide(); } } ); $( '.sp-save-event-status' ).click( function(e) { e.preventDefault(); $select = $( this ).closest( '.sp-event-status-select' ); $input = $select.find( 'input[name=sp_status]:checked' ); val = $input.val(); label = $input.data( 'sp-event-status' ); $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 ); } ); $( '.sp-cancel-event-status' ).click( function(e) { e.preventDefault(); $select = $( this ).closest( '.sp-event-status-select' ); val = $select.siblings( '.sp-event-status' ).find( '.sp-event-status-display' ).data( 'sp-event-status' ); $select.find( 'input[value=' + val + ']' ).attr( 'checked', true ); $select.slideUp( 'fast' ).siblings( '.sp-edit-event-status' ).show(); } ); // Box score time converter $( '.sp-convert-time-input' ).change( function() { var s = 0; var val = $( this ).val(); if (val === '') { $( this ).siblings( '.sp-convert-time-output' ).val( '' ); return; } var a = val.split( ':' ).reverse(); $.each( a, function( index, value ) { s += parseInt( value ) * Math.pow( 60, index ); } ); $( this ).siblings( '.sp-convert-time-output' ).val( s ); } ); // Trigger box score time converter $( '.sp-convert-time-input' ).change(); // Trigger show/hide of team table ordering $( '#sp_orderby' ).change( function(){ if ($( '#sp_orderby' ).val() == 'default') { $( "#sp_order" ).hide(); } else { $( '#sp_order' ).show(); } } ); } ); ================================================ FILE: assets/js/admin/sportspress-setup.js ================================================ jQuery( document ).ready( function($){ // Tiptip $( ".sp-tip" ).tipTip( { delay: 200, fadeIn: 100, fadeOut: 100 } ); $( ".sp-desc-tip" ).tipTip( { delay: 200, fadeIn: 100, fadeOut: 100, defaultPosition: 'right' } ); // Chosen select $( ".chosen-select, #poststuff #post_author_override" ).chosen( { allow_single_deselect: true, search_contains: true, single_backstroke_delete: false, disable_search_threshold: 10, placeholder_text_multiple: localized_strings.none } ); } ); ================================================ FILE: assets/js/admin/widgets.js ================================================ jQuery( document ).ready( function($){ // Orderby affects order select in widget options $( "body" ).on( "change", ".sp-select-orderby", function() { $( this ).closest( ".widget-content" ).find( ".sp-select-order" ).prop( "disabled", $( this ).val() == "default" ); } ); // Calendar affects view all link checkbox in widget options $( "body" ).on( "change", ".sp-event-calendar-select", function() { $el = $( this ).closest( ".widget-content" ).find( ".sp-event-calendar-show-all-toggle" ); if ($( this ).val() == 0) { $el.hide(); } else { $el.show(); } } ); // Show or hide datepicker $( "body" ).on( "change", ".sp-date-selector select", function() { if ( $( this ).val() == "range" ) { $( this ).closest( ".sp-date-selector" ).find( ".sp-date-range" ).show(); } else { $( this ).closest( ".sp-date-selector" ).find( ".sp-date-range" ).hide(); } } ); $( ".sp-date-selector select" ).trigger( "change" ); // Toggle date range selectors $( "body" ).on( "change", ".sp-date-relative input", function() { $relative = $( this ).closest( ".sp-date-relative" ).siblings( ".sp-date-range-relative" ).toggle( 0, $( this ).attr( "checked" ) ); $absolute = $( this ).closest( ".sp-date-relative" ).siblings( ".sp-date-range-absolute" ).toggle( 0, $( this ).attr( "checked" ) ); if ( $( this ).is( ":checked" ) ) { $relative.show(); $absolute.hide(); } else { $absolute.show(); $relative.hide(); } } ); $( ".sp-date-selector input" ).trigger( "change" ); } ); ================================================ FILE: assets/js/blocks/event-calendar.js ================================================ import apiFetch from '@wordpress/api-fetch'; console.log( wp.api.collections.Posts() ); wp.blocks.registerBlockType( 'sportspress/event-calendar', { title: strings.event_calendar, icon: 'calendar', category: 'sportspress', attributes: { title: { type: 'string' }, id: { type: 'number' }, status: { type: 'string' }, date: { type: 'string' }, date_from: { type: 'string' }, date_to: { type: 'string' }, date_past: { type: 'number' }, date_future: { type: 'number' }, date_relative: { type: 'number' }, day: { type: 'string' }, show_all_events_link: { type: 'number' }, content: {type: 'string'}, color: {type: 'string'} }, edit: function(props) { function updateContent(event) { props.setAttributes( {content: event.target.value} ) } function updateColor(value) { props.setAttributes( {color: value.hex} ) } return React.createElement( wp.components.Panel, {header: strings.event_calendar}, React.createElement( wp.components.PanelBody, {title: strings.properties}, React.createElement( wp.components.TextControl, {label: strings.title, type: "text", value: props.attributes.title} ), React.createElement( wp.components.SelectControl, {label: strings.select_calendar, options: [{label: strings.all, value: 0}].concat( posts.events.map( post => { return {label: post.post_title, value: post.ID} } ) )} ) ) ); }, save: function(props) { return wp.element.createElement( "h3", { style: { border: "3px solid " + props.attributes.color } }, props.attributes.content ); } } ) ================================================ FILE: assets/js/jquery.fitvids.js ================================================ /*global jQuery */ /*jshint browser:true */ /*! * FitVids 1.1 * * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ * */ (function( $ ){ 'use strict'; $.fn.fitVids = function( options ) { var settings = { customSelector: null, ignore: null }; if(!document.getElementById('fit-vids-style')) { // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js var head = document.head || document.getElementsByTagName('head')[0]; 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%;}'; var div = document.createElement("div"); div.innerHTML = '

    x

    '; head.appendChild(div.childNodes[1]); } if ( options ) { $.extend( settings, options ); } return this.each(function(){ var selectors = [ 'iframe[src*="player.vimeo.com"]', 'iframe[src*="youtube.com"]', 'iframe[src*="youtube-nocookie.com"]', 'iframe[src*="kickstarter.com"][src*="video.html"]', 'object', 'embed' ]; if (settings.customSelector) { selectors.push(settings.customSelector); } var ignoreList = '.fitvidsignore'; if(settings.ignore) { ignoreList = ignoreList + ', ' + settings.ignore; } var $allVideos = $(this).find(selectors.join(',')); $allVideos = $allVideos.not('object object'); // SwfObj conflict patch $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video. $allVideos.each(function(){ var $this = $(this); if($this.parents(ignoreList).length > 0) { return; // Disable FitVids on this video. } if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width')))) { $this.attr('height', 9); $this.attr('width', 16); } var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(), width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), aspectRatio = height / width; if(!$this.attr('id')){ var videoID = 'fitvid' + Math.floor(Math.random()*999999); $this.attr('id', videoID); } $this.wrap('
    ').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%'); $this.removeAttr('height').removeAttr('width'); }); }); }; // Works with either jQuery or Zepto })( window.jQuery || window.Zepto ); ================================================ FILE: assets/js/leaflet.js ================================================ /* @preserve * Leaflet 1.9.4+v1.d15112c, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade */ !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=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.xe.y&&n.y=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.late.lng&&n.lng","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='',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;othis.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;sthis.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",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;se.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:'',zoomInTitle:"Zoom in",zoomOutText:'',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._zoomthis._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'+(b.inlineSvg?' ':"")+"Leaflet"},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(' ')}}}),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&&1e&&(i.push(t[n]),o=n);oe.max.x&&(i|=2),t.ye.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 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()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;es.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.xthis.options.maxZoom||nthis.options.maxZoom||void 0!==this.options.minZoom&&oi.max.x)||!e.wrapLat&&(t.yi.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')}}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(;1e.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)e.getMaxZoom()&&1' ); } /* Countdown */ $( "[data-countdown]" ).each( function() { var $this = $( this ); // Get countdown time var countDownDate = new Date( $( this ).data( 'countdown' ) ).getTime(); // Iterate every second var x = setInterval( function() { // Get todays date and time var now = new Date(); // Convert curent date and time to UTC var tzDifference = now.getTimezoneOffset(); var nowutc = new Date( now.getTime() + tzDifference * 60 * 1000 ); // Find the distance between now and the count down date var distance = countDownDate - nowutc; if ( distance < 0 ) { distance = 0; } // Time calculations for days, hours, minutes and seconds var days = Math.floor( distance / (1000 * 60 * 60 * 24) ); var hours = Math.floor( (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) ); var minutes = Math.floor( (distance % (1000 * 60 * 60)) / (1000 * 60) ); var seconds = Math.floor( (distance % (1000 * 60)) / 1000 ); // Output the result $this.html( "" + (days < 10 ? '0' + days : days) + " " + localized_strings.days + " " + "" + ('0' + hours).slice( -2 ) + " " + localized_strings.hrs + " " + "" + ('0' + minutes).slice( -2 ) + " " + localized_strings.mins + " " + "" + ('0' + seconds).slice( -2 ) + " " + localized_strings.secs + "" ); }, 1000 ); } ); /* Scrollable Tables */ $( ".sp-scrollable-table" ).wrap( "
    " ); /* Selector Redirect */ $( ".sp-selector-redirect" ).change( function() { window.location = $( this ).val(); } ); /* Template Tabs */ $( ".sp-tab-menu-item a" ).click( function() { $template = $( this ).data( "sp-tab" ); $( this ).closest( ".sp-tab-menu-item" ).addClass( "sp-tab-menu-item-active" ).siblings( ".sp-tab-menu-item" ).removeClass( "sp-tab-menu-item-active" ); $( this ).closest( ".sp-tab-group" ).find( ".sp-tab-content-" + $template ).show().siblings( ".sp-tab-content" ).hide(); return false; } ); /* API method to get paging information */ $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings ) { return { "iStart": oSettings._iDisplayStart, "iEnd": oSettings.fnDisplayEnd(), "iLength": oSettings._iDisplayLength, "iTotal": oSettings.fnRecordsTotal(), "iFilteredTotal": oSettings.fnRecordsDisplay(), "iPage": oSettings._iDisplayLength === -1 ? 0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ), "iTotalPages": oSettings._iDisplayLength === -1 ? 0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength ) }; } /* Data Tables */ $( ".sp-data-table" ).each( function() { sortable = $( this ).hasClass( "sp-sortable-table" ); paginated = $( this ).hasClass( "sp-paginated-table" ); display_length = parseInt( $( this ).attr( "data-sp-rows" ) ); if ( display_length == undefined || isNaN( display_length ) ) { display_length = 10; } if ( $( this ).find( "tbody tr" ).length <= display_length ) { paginated = false; } if ( sortable || paginated ) { $( this ).dataTable( { "order": [], "autoWidth": false, "searching": false, "info": false, "paging": paginated, "lengthChange": false, "pagingType": "simple_numbers", "pageLength": display_length, "ordering": sortable, "language": { "aria": { "sortAscending": "", "sortDescending": "" }, "paginate": { "previous": localized_strings.previous, "next": localized_strings.next, } }, "columnDefs": [ { "type": "num-fmt", "targets": [ ".data-number", ".data-rank" ] }, ] } ); } } ); })( jQuery ); ================================================ FILE: changelog.txt ================================================ == SportsPress Changelog == = 2.7.29 = * Fix - Error when extensions add null values. * Fix - Non-numeric metrics being converted to numeric values. = 2.7.27 = * Fix - Security issues. = 2.7.26 = * Tweak - Make SportsPress compatible with the Polylang plugin. * Fix - Non-numeric value error in player list. * Fix - Countdown widget null parameter deprecation. * Fix - Deprecated functiong get_page_by_title(). * Fix - Output when image is used as a performance icon. = 2.7.24 = * Update - Leaflet version to 1.9.4. * Tweak - Refactor equation builder to support nested conditional equations. * Tweak - Add option to filter events by venue in admin. * Tweak - Include events with no status in countdown widget. * Fix - Errors related to PHP version 8. * Fix - Statistic format not saving. * Fix - Position stats in offense and defense not saving. * Fix - Google error: Date/time not in ISO 8601 format. * Fix - Minutes in league table. * Fix = Fatal error due to wrong type. = 2.7.23 = * Update - Version bump for SportsPress Pro. = 2.7.22 = * Fix - Security issues. = 2.7.21 = * Fix - Add nonce checks to hide notice links. = 2.7.20 = * Fix - Permalink access for non-admins. = 2.7.19 = * Fix - Games back showing as zero. = 2.7.18 = * Tweak - Only get staff template if enabled. * Tweak - Show visible option only when "Auto" mode is selected. * Fix - "None" option disappeared from dropdowns. * Fix - Minutes not shown when image used as icon. * Fix - Deprecated urlencode() notice. * Fix - Null parameter notice. * Fix - Undefined array key warnings. * Fix - Add user capability check and nonce check when updating permalinks. = 2.7.17 = * Fix - PHP 8.2.x deprecated code warnings. * Fix - Next team not working in shortcodes. * Fix - Links rendering in event specs. * Localization - Update translatable strings. = 2.7.16 = * Update - WP version tested up to 6.1. * Update - Leaflet version to 1.8.0. * Tweak - Datepicker support for event blocks, list, and calendar widgets. * Fix - Toggle between absolute and resltive dates in shortcodes. * Fix - Undefined variables showdob and showage. * Fix - Date range error in player lists. * Fix - Loss condition not applied on event results. * Fix - Can't set statistic variable for player positions. * Fix - API error when using _fields. * Fix - Event map and video not being displayed. * Fix - Escape functions in admin. = 2.7.15 = * Feature - Sports news widget in dashboard. * Fix - Fixture importer bug with extended characters in league and season name. * Fix - Player list not loading (too many resources). * Fix - Performance format not updating. * Fix - Trim whitespace on geo coordinates to avoid import error. = 2.7.14 = * Fix - Error when non-value added as adjustment. * Fix - Map links not escaped properly. * Fix - Event blocks missing attributes. * Fix - Player statistics meta escaping. = 2.7.13 = * Fix - Theme notice escaping. * Fix - Timezone dropdown selection now shown in general settings. * Fix - Double header when multiple player lists are displayed in team. * Fix - Dropdown options not saving in settings. * Fix - Setup page conflict with WooCommerce. = 2.7.12 = * Fix - OpenStreetMap not displaying map after update. = 2.7.11 = * Fix - Player status selector not reflecting changes in match edit screen. * Fix - Player dropdown template not displaying names. * Fix - Staff dropdown template not displaying names. = 2.7.10 = * Fix - Players not selectable in event edit page. * Fix - Videos embedded in post content not rendering. = 2.7.9 = * Tweak - Add support for event format in REST API. * Tweak - Add "Order" and "Order by" selection fields for countdown widget. * Tweak - Add option to display event status in countdown widget. * Tweak - Add ability to filter events by format in calendar template. * Tweak - Update TGM plugin activation library. * Fix - Remove plugin headers from modules for improved compatibility. * Fix - Reverse order not applying to teams in event lists. * Fix - Add validation to user inputs for improved security. * Fix - Sanitize all user inputs for improved security. * Fix - Escape all outputs in admin for improved security. * Fix - Filtering based on format for event blocks. * Fix - Last week and next week filter not applying to player lists. * Fix - Deselecting a selected team in settings. * Fix - PHP 8.0 deprecated warnings. * Localization - Add nationalities and flags for French Guiana, French Polynesia, Guadeloupe, Greenland, Martinique, Reunion, and Sint Maarten. = 2.7.8 = * Fix - Event results, box scores, and players stats not updating via REST API. = 2.7.7 = * Fix - Events not appearing due to filter malfunction. = 2.7.6 = * Feature - Add ability to bulk set events as on time. * Fix - Players in events not being filtered by team. = 2.7.5 = * Tweak - Add ability to filter events by team and match day in one query. * Tweak - Improve performance by updating leaflet script and only loading when required. * Tweak - Add overtime notation compatibility for minutes played. * Fix - Issue with event edit page where the scripts were not working. * Fix - No records when format is default in event list shortcode. = 2.7.4 = * Tweak - Add option to display birthday, age, or both in birthdays widget. * Fix - Player list data showing zeroes in some cases. = 2.7.3 = * Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary. * Tweak - Avoid showing minutes box for subs when not needed. * Tweak - Improve filtering speed for queries without leagues or seasons. * Tweak - Apply reverse order setting in event lists. * Tweak - Enable filtering a player's events played on a specific team. * Fix - Include future events in REST API for WordPress 5.5. * Fix - Enable updating player metrics using the REST API. * Fix - Deprecated code for PHP 7.4. * Fix - Elementor compatibility. * Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini. * Localization - Adjust RTL stylesheet for event performance icons. = 2.7.2 = * Tweak - Sanitize delimiter field in event settings. = 2.7.1 = * Feature - Enable player list filtering by nationality. * Feature - Add option to display date of birth in player lists. * Tweak - Exclude postponed and canceled events from countdowns. * Tweak - Apply reverse order option to event results. * Tweak - When a team has more than one home venue, separate with commas. * Fix - Venue address containing pluses in events. * Fix - Event blocks showing the wrong dates when embedded within other event pages. * Fix - Statistics not adding manual values when not based on equations. * Fix - Event lists ignoring the format parameter. * Fix - League table order when displaying multiple tables in team profiles. * Fix - Error when deleting configuration columns. * Fix - Player lists not including past players in some cases. * Fix - Prevent error when viewing event calendar in some cases. = 2.7 = * Feature - New bulk actions to postpone and cancel multiple events. * Feature - Add date of birth to player importer. * Feature - Automatically select the home team's venue as the default venue when importing fixtures. * Feature - Add ability to turn on comment for team profiles. * Feature - Filter league tables by event status. * Tweak - When an icon is used for player performance, display the icon in player lists and profiles. * Tweak - Add title attribute for player statistic icons. * Tweak - Default stylesheet sorting icon width. * Fix - Icon color picker rendering issue. * Fix - Image selector not working for player statistics. * Fix - Enqueue scripts and styles for OpenStreetMap when used in shortcodes. * Localization - Add translation options for countdown units. = 2.6.20 = * Tweak - Improve compatibility with volleyball for checkbox performance. * Preset - Update volleyball preset with additional options. = 2.6.19 = * Feature - Enable filtering calendars base on players. * Feature - Add checkbox type to event performance. * Fix - Javascript error when columns are hidden in event list. * Fix - Notice when displaying staff in event performance table. * Fix - Notice when event results are empty. * Fix - Uncaught error in player class. * Preset - Update volleyball preset using checkbox performance type. = 2.6.18 = * Fix - Prevent OpenStreetMap scripts from loading when Google Maps is active via SportsPress Pro. * Fix - Headers already sent error related to default nationality module. = 2.6.17 = * Tweak - Only show welcome screen on major version upgrade. * Tweak - Add filters to enable career totals calculation with extensions. * Fix - Countdowns not reflecting timezone setting. = 2.6.16 = * Tweak - Add support for updated baseball extension with partial innings. * Fix - Error displaying staff in events when offense and defense are separate tables. = 2.6.15 = * Important - Using Google Maps will require a SportsPress Pro license after August 31, 2019. * Refactor - Fallback to OpenStreetMap for venue maps without SportsPress Pro. * Feature - Option to display team logos instead of team names in player lists. * Feature - Option to display custom specs in event blocks and event lists. * Tweak - Improve page load speed when creating new league tables. * Tweak - Prevent displaying events other than published or scheduled. * Fix - Icons only appearing in the first table when player lists are grouped. * Fix - Character encoding and CRLF errors in calendar feeds. * Fix - Missing field location Schema error. * Fix - Dropdowns collapsing in admin when meta boxes are hidden. * Fix - Timezone handling in countdowns. * Fix - Error when using special characters in admin settings. = 2.6.14 = * Fix - API endpoints for secondary post types. = 2.6.13 = * Fix - Missing functionality with Gutenberg enabled. * Fix - Enable API endpoints with WordPress 5.0 and Gutenberg. = 2.6.12 = * Tweak - Match styling of date row in countdown. * Fix - Calculated totals in player performance array missing for custom templates. * Fix - Date field hidden from existing calendars. = 2.6.11 = * Tweak - Apply reverse teams setting to event blocks. * Tweak - Add zero before days in countdown when there are less than 10 days to go. * Fix - Venue address not setting correctly. * Fix - RTL language support for first column in tables. * Fix - PHP warnings for various static functions. * Fix - Custom post types displaying blank screen in admin when Gutenberg is active. = 2.6.10 = * Tweak - Apply reverse teams settings to logos. * Fix - Statistics doubling in player lists when player is assigned to a team. * Fix - Display blank placeholder in player lists when no team is assigned. * Preset - Update basketball efficiency rating equation. = 2.6.9 = * Feature - New event shortcodes: venue, officials, teams, and full event info. * Feature - Option to choose default nationality for faster data entry. * Feature - Date and time display options in countdown widgets. * Feature - Ability to filter player list shortcodes by league, season, and team. * Tweak - Improve page load for new player lists. * Tweak - Improve iCal feed by fixing wrapping issues. * Tweak - Use lighter placeholder color to differentiate from entered values. * Tweak - Preserve league, season, and position assignments when importing players. * Fix - PHP warnings when using version 7.2 or later. * Fix - Countdown timer format when event is 100 or more days away. * Fix - Player list displaying zero values when formatted using decimal places. * Fix - Start of the week filters for week-based calendars. * Fix - Location picker freezing issue. * Fix - Custom post types pages displaying blank page when Gutenberg is installed. = 2.6.8 = * Feature - Ability to add icons to player statistics. * Feature - Ability to display matchday in event blocks. * Feature - Add support for commenting on scheduled events. * Feature - Option to filter birthdays widget by week. * Feature - Option to filter events by competitive or friendly. * Tweak - Display pin in venue map and link map to web version. * Tweak - Add UK as alternate to GB in countries legacy list. * Tweak - Remove duplicate teams from players. * Tweak - Improve player assignment filtering for player lists. * Fix - Animated countdowns when visitor and site are in a different timezones. = 2.6.7 = * Fix - Update Google Maps API endpoints. = 2.6.6 = * Fix - Apply reverse teams to frontend templates only. = 2.6.5 = * Tweak - Increase coverage of reverse teams option. * Tweak - Improve sorting of leagues, positions, and seasons. * Localization - Additional legacy country code for Greece. * Fix - Broken post author select on certain pages. * Fix - Google Calendar link protocol. = 2.6.4 = * Fix - Undefined variable notice in player list. = 2.6.3 = * Fix - Assign past teams during player import. * Fix - Next team column displaying events furthest away. * Fix - Add fallback array_replace function for PHP versions earlier than 5.3. * Fix - Add fallback for web hosts that don't support multibyte PHP functions, causing blank player profiles. = 2.6.2 = * Fix - Newly added players from past and current team appearing in player lists. * Fix - Player lists appearing empty without league, season, and team selected. = 2.6.1 = * Fix - Player lists with a team selected showing players from other teams. * Fix - REST API endpoints not resolving for players. * Fix - Empty system status page. = 2.6 = * Feature - Add custom details to events using event specs. * Feature - Conditional equations for variables. * Feature - Display the next opponent in league tables. * Feature - Short name option added to teams. * Feature - Automatic event titles using short name when available. * Feature - Display featured image in countdown widget. * Tweak - Stronger connections between leagues, seasons, and teams for automatic player lists. * Tweak - Relative date option added to editor shortcodes. * Tweak - Display only current team in player list. * Tweak - Filter players dropdown by current team only. * Tweak - Allow 0 as a squad number when importing players. * Tweak - Prevent filtering through empty results. * Fix - Interpreting non-integer substitution times. * Fix - Warning when sorting terms without order. * Localization - Add WPML support to staff header. * Localization - Fix RTL not being applied in league tables. = 2.5.10 = * Fix - Date ranges not being applied to calendars. = 2.5.9 = * Fix - Unpublished posts being displayed in some themes. = 2.5.8 = * Fix - Display scheduled events using default permalinks via archives and third-party widgets. = 2.5.7 = * Fix - Blank general settings screen on WordPress versions prior to 4.9. * Fix - Revert responsive table behavior to prevent display issues on mobile. = 2.5.6 = * Tweak - Adjust player-related hooks. * Fix - Turn off responsive tables by default. = 2.5.5 = * Feature - Main league and current season settings. * Feature - New shortcode including full staff profile. * Feature - Add code highlighting to custom CSS field. * Feature - Add responsive layout option to tables. * Feature - Add filters to REST API players endpoint. * Feature - Option to merge duplicate teams, players, and staff. * Feature - Option to display specific event in event blocks. * Feature - Option to sort player checklist by name and squad number in events. * Feature - Option to filter player lists by team. * Feature - Option to link staff members. * Feature - Filter countdown by calendar. * Fix - Calculate column totals in box score. * Fix - Mismatched encoding of included library. * Localization - Fix translation function missing around string. = 2.5.4 = * Fix - Error when editing league table using older versions of WordPress. = 2.5.3 = * Fix - Calendar templates not loading when timezone setting is relative to UTC. = 2.5.2 = * Feature - Add match day to REST API. * Tweak - Add order to positions during preset installation. * Tweak - Display links to add new duties and officials if empty. * Tweak - Add linebreaks to substitute dropdowns. * Fix - Use default full time minutes in REST API. * Fix - Uploading custom images as performance icons. * Fix - Displaying timed performance with custom images. = 2.5.1 = * Feature - Officials importer. * Feature - Officials added to dashboard glance items. * Feature - Order setting added to staff jobs for custom sorting. * Tweak - Display only the highest order job in staff profiles. * Tweak - Require box score importer to be accessed from within an event. * Tweak - Add hook to declare importable post types. * Fix - Officials meta box in events when module is inactive. * Fix - Issues when timezone is not set. = 2.5 = * Feature - Player of the match and star numbers added to box scores. * Feature - Officials module for displaying referee appointments in matches. * Feature - New player performance icons to choose from. * Feature - Schema microdata added to event calendars, lists, and blocks. * Feature - Box score importer for updating existing events. * Feature - Order setting added to taxonomies for custom sorting. * Feature - New relative date range options in event calendars. * Feature - Date range options added to league tables and player lists. * Feature - Option to hide players with zero statistics in player list. * Tweak - Allow staff members to have multiple jobs. * Tweak - Indicator dots added to calendars with events in frontend stylesheet. * Tweak - Box score columns are now selected by default when adding new events. * Tweak - Events made sortable by match day in admin. * Tweak - Competitions renamed to leagues. * Fix - Quick edit teams not showing when filtering players by team. * Fix - Calendar feeds not updating without E-tag. * Fix - Admin table cells wrapping. * Fix - Timezone issues in calendars. = 2.4.3 = * Fix - Substitute Typo. * Fix - WordPay image trailing slash. = 2.4.2 = * Feature - Add visibility option to player metrics. * Fix - Remove protocol from default Gravatar images to prevent mix content warnings. = 2.4.1 = * Fix - Static function displaying notice in header. = 2.4 = * Feature - Integration with WordPay to allow paid team and player registrations. * Feature - New team gallery shortcode and widget for displaying a gallery of team logos. * Feature - Added support for player career totals based on calculated averages. * Tweak - Allow competitions to be selected for friendly matches. * Tweak - Added columns selector to gallery shortcodes. * Fix - Full time defaulting to 90 minutes. * Fix - Statistic format not reflected in meta box. * Fix - Shortcode button hook timing conflicts. * Preset - Swap par and score in golf preset. * Preset - Update all presets to reflect new career total type. = 2.3.2 = * Fix - Team in player statistics total row displaying as zero. * Fix - Notice when no sendoffs are available during minutes played calculation. = 2.3.1 = * Tweak - Update version numbers of recommended sport-specific extensions. * Fix - Manually entered statistics not reflected in player profile totals. * Fix - Template hooks not callable for third-party integration. * Fix - Error when editing league tables in PHP versions earlier than 5.5. = 2.3 = * Feature - New setup wizard for first-time installs. * Feature - Option to automatically create player profiles during user registration. * Feature - Choose team or individual mode for each event. * Feature - Send Off setting for player statistics to suspend minute count for that player. * Tweak - Remove horizontal scrolling in dashboard to fix hidden dropdowns. * Tweak - Revert text color overrides for dark color schemes in frontend styles. * Fix - Borrowed players not automatically loading on event edit. * Fix - Played minutes calculation and player profile statistics. = 2.2.11 = * Fix - Timeout issue when tiebreaker checks for head-to-head standings. * Fix - Check for REST API controllers to prevent errors when using Jetpack. = 2.2.10 = * Tweak - Update modules page. * Fix - League table discrepancy due to change in number of teams setting. * Fix - JavaScript error caused by box score displaying icons without players. = 2.2.9 = * Fix - Warning message above player list template. = 2.2.8 = * Fix - Hidden box score header in values mode. * Fix - Welcome page displaying after upgrade if preset was saved from settings. * Fix - Decimal places being dropped from player list statistics. = 2.2.7 = * Tweak - Adjust frontend styles to allow some overrides. * Tweak - Update modules page with new module options. * Fix - Javascript error in icon mode box scores. * Fix - Player list default sorting issue. * Fix - Empty team checkboxes in player quick edit. = 2.2.6 = * Tweak - Hide box score table header row in icon mode. * Tweak - Adjust frontend stylesheet. * Fix - Empty league tables when no columns are selected. * Fix - Empty player lists when no columns are selected. * Fix - Link events setting not applied to box score time. * Fix - Player list sorting error with non-numeric values. * Fix - Home and away records being combined when opponent not in league table. = 2.2.5 = * Feature - Enable positions to be displayed in icons mode box score. * Tweak - Reflect mixed column order in player list admin. * Tweak - Remove table row border in frontend stylesheet. * Tweak - Automatically apply table adjustments on admin page load. * Tweak - Simplify box score icon totals. * Fix - Adjustments not applying to player list values. * Fix - Minutes not displaying in box score. * Fix - Player positions displaying not displaying in box score. * Fix - Total time displaying as 0:00. = 2.2.4 = * Feature - Option to show or hide career totals in player profiles. * Tweak - Icons not rendering when frontend stylesheet is active. * Tweak - Remove underline from icon links in frontend stylesheet. * Tweak - Change competition and season placeholders in events to "None". * Tweak - Enable horizontal scrolling on large tables in admin. * Fix - Equations returning zero when no events played. * Fix - Player lists and player profiles showing different statistics when filtered by competition or season. * Fix - Substitution icon not rendering for starting lineup players. * Fix - Manual player performance errors in profile. * Fix - Error in event results if team was deleted. * Fix - Remove deprecated function in PHP 7.0. * Fix - Non-numeric errors in PHP 7.1. = 2.2.3 = * Fix - Placeholders for non-numeric values in player list displaying as zero. = 2.2.2 = * Tweak - Center align form events. * Fix - Reverse form array to display events in chronological order. * Fix - Error in player lists when querying legacy events. * Fix - Manual values in player lists when no events have been played. = 2.2.1 = * Fix - Empty timeline error when calculating substitution time. = 2.2 = * Feature - New frontend stylesheet for third-party themes. * Feature - New chronological streak format in league tables. * Feature - Head to head tiebreaker option in league tables. * Feature - Add option to select number of players in player lists. * Feature - Quick edit player's team and squad number. * Feature - Bulk edit players' past and current teams. * Feature - Taxonomies added to REST API. * Feature - Ability to display event history in player profiles. * Feature - Event list format option added to player and team events. * Feature - Option to record minutes for specific statistics. * Feature - Time format added for racing and timed sports. * Feature - Dedicated option to redirect team pages to site URL. * Feature - Bulk action to generate team calendars. * Feature - Automatically adjust played minutes based on substitution times. * Feature - Match day column option added to event lists. * Tweak - Remove event limit in calendars. * Tweak - Allow player squad number to be zero. * Tweak - Enable mixing performance and statistic column order. * Tweak - Filter player statistic equations by offense and defense. * Tweak - System status hidden unless in debug mode. * Tweak - Move event list column options to sidebar. * Tweak - Return zero instead of error if dividing by zero. * Tweak - Always display performance icons in admin. * Tweak - Add preview notation in event blocks by default. * Tweak - Single player performance name option added for hover text in icons mode. * Fix - Player list precision number format error. * Fix - Player list adjustments for existing values. * Fix - Hide empty positions in player lists and galleries. * Fix - Import button selectors disappeared in WordPress 4.7. * Fix - Substitution time missing parentheses. * Fix - Staff for home team not being displayed in events. * Fix - Enable output of time and results without team names in home/away mode. * Fix - Prevent totals override in box scores. * Localization - Add Gibraltar nationality option and flag. = 2.1.7 = * Fix - Activation error on older versions of PHP. = 2.1.6 = * Feature - Add equation format option to player performance. * Tweak - Add text options to change tab labels. * Fix - Activation errors using TGMPA. * Fix - Empty footer column in team staff table. * Preset - Update basketball preset. = 2.1.5 = * Feature - Add option to filter players by current or past team in player lists. * Fix - Scheduled events not queried in REST API. = 2.1.4 = * Feature - Player and staff dropdown templates added to layout designer. * Tweak - Default tab labels from layout designer. * Tweak - Add "Home" and "Away" to text options. * Tweak - Add horizontal padding to centered event list columns. * Fix - Disable numeric slug generation for events due to permalink issues in some cases. * Fix - Permalink issues caused by filter for scheduled events. * Fix - Scheduled events being ignored by REST API. * Fix - Inconsistent styling of player and staff dropdowns. * Fix - Only include current players in player lists. * Fix - Age calculation in BuddyPress context. = 2.1.3 = * Tweak - Add options to select number, team, and position columns to player list shortcode. * Fix - Totals row offset in player statistics admin. * Fix - Events not automatically ordered by date in some cases. * Fix - Google Maps error when address is empty. * Fix - Player lists for all teams not appearing in team edit screen. * Fix - Error in player list when team no longer exists. * Fix - Error in event logos when results are empty. * Fix - Issue with link to future event from daily archive when multiple events are scheduled for a single day. = 2.1.2 = * Feature - Add offense and defense statistics to REST API. * Tweak - Hide template tabs with no content. * Tweak - Allow selection of player lists without teams. * Tweak - Center-align time/results when between home and away teams in event list. * Tweak - Increase checklist panel height in admin. * Tweak - Update text options. * Fix - Hidden box score columns still displaying when in offense/defense mode. * Preset - Update cricket preset. = 2.1.1 = * Feature - Add substitution times in box score. * Feature - Add text options to change template tab names. * Tweak - Automatically align home and away columns in event lists. * Fix - Box score minutes display issue. = 2.1 = * Feature - New simplified fixtures importer compatible with [LeagueLobster](http://tboy.co/leaguelobster). * Feature - Add match day field to events. * Feature - Add box score minutes to events. * Feature - Add option to display full time in event details. * Feature - Add inline and block option to event logos. * Feature - Add squad number and name option to player details. * Feature - Add tab options to layout designer. * Feature - Add option to display player and staff dropdowns in profiles. * Feature - Add option to select TBA, postponed, and canceled event status. * Feature - Licenses tab for third-party extensions. * Tweak - Get player data only when needed. * Tweak - Add capabilities to taxonomies. * Tweak - Display tutorials in main menu if user role is not admin or league manager. * Tweak - Use contextual strings for featured images. * Tweak - Enable meta query vars in REST API. * Tweak - Adopt new tab class names in admin. * Tweak - Inherit text color for event logo team text. * Tweak - New developers section on modules page with link to join [Slack community](http://tboy.co/slack). * Fix - Taxonomy links appearing in admin for users that can't edit events. * Fix - Debug error on non-standard admin pages. * Fix - REST API notice in Jetpack. = 2.0.16 = * Tweak - Add shortcode parameter to override global date in event calendar. = 2.0.15 = * Fix - Subversion issues. = 2.0.14 = * Fix - Use search mode in maps to prevent invalid parameter error. = 2.0.13 = * Fix - Google Maps embed code to reflect selected map type. * Fix - Countdown error when teams are not selected. = 2.0.12 = * Tweak - Add API key to Google Maps in admin. = 2.0.11 = * Tweak - Embed code to reflect change in Google Maps API. = 2.0.10 = * Tweak - Enable sortable tables on all devices. = 2.0.9 = * Feature - Display admin notice when user is not allowed to edit an item. = 2.0.8 = * Feature - Add shortcode parameter to filter event calendars by player. * Feature - Add text options to change age and birthday labels. = 2.0.7 = * Feature - Add option to show or hide logos or photos in event blocks. * Tweak - Combine reverse teams option for results and box score. * Fix - Add filter to template output for extensions. = 2.0.6 = * Tweak - Display squad numbers in defense section. * Tweak - Display shared values in both offense and defense sections and sync when editing event. = 2.0.5 = * Fix - Hide team column in player statistics for player-vs-player sports. = 2.0.4 = * Fix - Title generator in event importer. = 2.0.3 = * Tweak - Restore career total tables in player profiles. * Fix - Display sport and timezone selector after first installation. = 2.0.2 = * Fix - New events not saving with automatic titles when title is empty. * Fix - Event importer not importing new events. = 2.0.1 = * Fix - Some player statistics calculating as zero. = 2.0 = * Feature - Integration with [WP REST API](https://wordpress.org/plugins/rest-api/) by adding endpoints for viewing, creating, editing, and deleting SportsPress data. * Feature - New drag-and-drop layout designer for customizing events, teams, players, and staff pages. * Feature - Allow player biography to float next to photo in profile. * Feature - Add option to display separate offensive and defensive statistics in player profiles. * Feature - Add option to display career totals as a footer row in player statistics tables. * Feature - Add option to display event calendar or fixtures & results on team pages. * Feature - Add option to display time in event logos section when results are not ready. * Feature - Add global visibility settings to player statistic columns. * Feature - Add team, competition, league, and venue filter to event calendar, event list, and event blocks shortcodes. * Feature - Automatically re-order competitions, seasons, venues, positions, and jobs by slug. * Feature - New welcome page outlining notable changes to major plugin version. * Refactor - Change parameter for sp_get_next_event function to allow custom templating. * Tweak - Reverse team order also applies to admin. * Tweak - Hide squad number from defense box score. * Tweak - Use more compact labeling in player columns admin meta box. * Tweak - Update modules page to reflect new premium scoreboard module. * Tweak - Remove hardcoded protocol for calls to Google Maps scripts. * Tweak - Limit venue archives to events. * Tweak - Float team profile next to logo on team pages. * Tweak - Display league table and player list option in teams only when modules are active. * Tweak - Load profile and description meta boxes as native editors instead of custom methods. * Tweak - Load team abbreviations independent of post title filter. * Tweak - Add z-index to make header float above other elements. * Fix - Error when league table column has no equation. * Fix - Error when displaying checkboxes for manual event statistics. * Fix - Venues linking automatically in countdown widgets. * Fix - Styling issue where countdown widgets were pushed off-screen in some themes. * Fix - Avoid loading countdown widget if no events are available. * Preset - Update baseball, cricket, floorball, handball, ice hockey, and softball presets. = 1.9.20 = * Tweak - Expand event title section for team logos in countdown widget. * Tweak - Center align team logo images in event. * Tweak - Add iCal feed venue name and description. * Fix - Escape address, summary, and description in iCal feed. * Preset - Add ties and defense/offense definition to baseball preset. * Localization - Add West Indies to nationality options. * Localization - Update strings. = 1.9.19 = * Feature - Add Birthdays module. * Feature - Add Lazy Loading module. * Feature - Add separate offense and defense categories to player performance and box score. * Feature - Add format setting to player performance with the options Number and Text. * Feature - Add option to show and hide date and time in events. * Tweak - Improve compatibility between custom color settings and theme options. * Tweak - Add light shade to substitute rows in box score. * Tweak - Prevent box score section from appearing when event is set in the future. * Fix - Display icon setting in editor. * Fix - Empty variable button appearing in equation builder when equation is empty. * Preset - Update cricket preset with batting and bowling categories. = 1.9.15 = * Tweak - Add medium crop image size to ensure gallery images are square. * Tweak - Add shortcut icon to admin bar. * Fix - Mobile admin table cell width. * Fix - Tutorial tab styling. * Localization - Update Norwegian Bokmål and Turkish translations. = 1.9.14 = * Fix - Error appearing on team page in some cases when there are no competitions or seasons. * Localization - Update source language file. = 1.9.13 = * Feature - Add option to display positions in player lists. * Feature - Add option to show or hide player squad number and rank column. * Feature - Add ability to display staff members in team page. * Feature - Unique widget option added to hide widget when same as content. * Tweak - Get auto and manual league tables in team page. * Tweak - Add row numbers to league table and event list. * Tweak - Allow searching from middle of sport preset names. * Tweak - Remove deprecated settings from admin. * Tweak - Prevent unnecessary scrollbar from appearing under scrollable tables. * Tweak - Add spaces between results in event blocks widget. * Tweak - Default template positions adjusted to render main content first. * Tweak - Adjust checkbox column padding in admin. * Tweak - Prevent positions and jobs from automatically linking to archives. * Tweak - Adjust capabilities to allow team managers to edit venues. * Fix - Player gallery thumbnail size too small in some cases. * Fix - Competitive event icon in edit screen. * Fix - SportsPress widget icons not appearing in 4.4 admin. * Localization - Add demoyer to translation team. * Localization - Update Dutch translations. = 1.9.12 = * Tweak - Display team names and score template without logos. * Tweak - Validate hex color input. * Tweak - Add sp prefix to TGMPA notice to avoid conflict with other plugins. * Fix - Empty seasons displaying in player profiles. * Fix - Error on pages with no screen objects. * Localization - Add Tandor, muhahmetkara, elarequi, diego.battistella, and tkausch to translation team. * Localization - Update Polish, Tamil, German, Turkish, Spanish, Dutch, and Portuguese translations. = 1.9.10 = * Fix - Automatic event results calculating without player performance. * Localization - Update Turkish translation. = 1.9.9 = * Feature - Enable presets to define result equations. * Tweak - Move event logo settings to new section in admin. * Tweak - Disable custom colors by default. * Tweak - Display league tables and player lists as auto when not manual. * Fix - Prevent teams containing quotes to duplicate during import. * Fix - Enable importing with special characters in team and player names. * Fix - Check for zero in equation denominator contained within parenthesis. * Fix - Placeholder in admin indicating automatic result. * Preset - Update cricket preset. * Localization - Update Tamil translation. = 1.9.8 = * Feature - Option to add custom table headings to calendars, league tables, and player lists. * Tweak - Revert automatically hiding featured images when viewing teams, players, and staff. * Fix - Team site URL escaping links in admin. = 1.9.7 = * Fix - Escape text inputs in admin. * Localization - Update German translation. = 1.9.6 = * Feature - Venue subset to reflect statistics from a team's home venue. * Tweak - Use team order instead of venue to get home and away subset. * Tweak - Allow special HTML characters in player list fields. * Tweak - Relabel box score to scorecard. * Fix - Player list sorting by ascending squad number. * Localization - Add Ales70, Elmister, and chinnz25 to translation team. * Localization - Add Tamil (India) translations. * Localization - Update Persian, Finnish, Italian, Czech, Greek, Slovenian, and Polish translations. = 1.9.5 = * Fix - Streaks calculation in league tables. = 1.9.4 = * Feature - Add Home and Away subset options to table column equation builder. * Tweak - Display player and team checklists in admin only when Manual mode is enabled to improve performance. * Localization - Add mahdi12 to translation team. * Localization - Update Persian and Polish translation. = 1.9.3 = * Fix - Event results skipping some players in player list. = 1.9.2 = * Fix - Dynamic stats not being reflected in player lists. = 1.9.1 = * Fix - Add up statistics from multiple competitions and seasons in player list. * Fix - Use player metrics as default in player list. * Localization - Update Spanish translation. = 1.9 = * Feature - New Icons module containing vector icon options for player performance. * Feature - Add event results to equation builder. * Feature - Allow different page templates to be selected for each post type. * Feature - Add equation builder to automate event results based on player performance. * Feature - Allow Event Managers to edit venues. * Feature - Display post excerpts in templates. * Feature - Hide featured image if photo or logo is displayed. * Feature - Add default outcome condition for events with more than 2 teams. * Feature - Add option to display competition and season in player details. * Feature - Add Google map zoom option. * Feature - Add national flag option to player list. * Feature - Add competition and season filter to manually inserted calendar shortcodes. * Refactor - Move cricket functionality to free extension. * Tweak - Improve individual mode admin screens and functionality. * Tweak - Add styling to default event teams template. * Tweak - Add cell padding to admin edit table. * Tweak - Display position column only if positions exist. * Tweak - Display Performance as Box Score in all occurrences. * Tweak - Simplify sample data team names. * Tweak - Move League Table module to Teams section. * Tweak - Display column labels for time and results in split team mode. * Tweak - Lock variable names once published to prevent equations from breaking. * Tweak - Rename featured image meta boxes to reflect image type. * Tweak - Improve readability of equations in admin. * Tweak - Trim delimiter example when limit is more than 3 teams. * Tweak - Allow a team limit of 0 for unlimited teams per event. * Fix - Sample data generator for individual mode. * Fix - Overview hierarchy in individual mode. * Fix - Event delimiter sample output. * Fix - Error in league table when stats are empty. * Fix - Check if teams exist in countdown. * Preset - Add golf preset. * Preset - Recommend sport-specific extensions for cricket, golf, and football (soccer). * Localization - Update Greek and French translations. = 1.8.9 = * Feature - Enable multiple nationalities for players and staff. * Feature - Enable multiple seasons and competitions for league tables. * Feature - Enable multiple seasons, competitions, and positions for player lists. * Feature - Add custom title field and widget alignment option to shortcodes. * Feature - Add option to always increment league table position. * Fix - Import button on admin pages. * Fix - Update jQuery DataTables to version 1.10.8 props devilsaces. * Localization - Group translation team by language and display stats. * 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. * Localization - Update Polish, Finnish, Armenian, German, Slovenian, Italian, Czech, Dutch, Spanish, Romanian, and French translations. = 1.8.8 = * Feature - Add option to hide player and staff details. * Tweak - Ability to display multiple current teams in staff profile. = 1.8.7 = * Feature - Add custom table heading option to widgets. * Feature - Add random sorting to player gallery. * Feature - Add option to hide player list and league table titles. * Feature - Add heading option to player positions. * Tweak - Display Soccer (Association Football) as Football. * Tweak - Flush permalinks automatically when saving modules. * Tweak - Separate scrollable and responsive table options. * Tweak - Display event performance icon tables in 2 columns. * Fix - Duplicate league table captions in team page. * Preset - Add softball preset. * Localization - Add FollowCandyPanda to translation team. * Localization - Update Polish, Spanish, German, Norwegian, Dutch, Finnish, Russian, Armenian, and Czech translations. = 1.8.6 = * Tweak - Update modules page to reflect a change in offered features. * Fix - Team dropdowns disappearing when none found in the competition and season assigned to an event. * Localization - Update Russian translations. = 1.8.5 = * Fix - Error merging option arrays. * Localization - Add m4rsal to translation team. * Localization - Update Polish, Spanish, German, Norwegian, Dutch, and Finnish translations. = 1.8.4 = * Fix - Installation screen notice related to default color scheme. * Localization - Add vetsmi, ceyhunulas, pgbenini, paulcoppen, fernandori, wolforg, and chr86 to translation team. * Localization - Update Dutch, Spanish, Portuguese (Brazil), French, and German translations. = 1.8.3 = * Tweak - Settings page styling updated. * Tweak - New modules category added for admin-related dashboard modules. * Fix - Widget floating issue in some themes. * Fix - Timezones added to calendar feeds using blog timezone setting. * Fix - Event filters generating redundant queries. * Localization - Update Finnish, Norwegian, Turkish, Polish, Portuguese (Brazil), and Portuguese (Portugal) translations. = 1.8.2 = * Tweak - Make scrollable tables fill content width. * Tweak - Improve widget alignment precision. * Tweak - Remove paginate link default color. * Fix - Future event post permalinks not found. = 1.8.1 = * Feature - Ability to display multiple widgets on one line by aligning left and right. * Tweak - Increase league table row height only when logos are displayed. * Fix - Taxonomy selection not displaying in admin after WordPress 4.2 update. * Localization - Add nagashitw, jikji96, and edesl to translation team. * Localization - Update Czech, German, Finnish, Portuguese, Korean, Italian, and Spanish translations. = 1.8 = * Feature - Games Behind calculation added to equation builder. * Feature - Home Record and Away Record calculation added to equation builder. * Feature - Add option to reverse team order in events. * Tweak - Allow inline results editing only if user has permissions. * Tweak - Allow underscore in equation variable names. * Tweak - Update welcome page with free Rookie theme link. * Tweak - Group sport presets into more descriptive categories. * Tweak - Display module descriptions in admin. * Tweak - Combine player and staff modules. * Tweak - Move mode setting to event page. * Tweak - Add option to show only top-level positions in events. * Tweak - Change Rounding to Decimal Places for clarity. * Tweak - Change Player Performance to Box Score. * Tweak - Add proper editing capabilities to Team Manager role. * Fix - Empty positions hidden in box score. * Preset - Update baseball preset. * Localization - Add Kosovo to countries list. * Localization - Use standard localization functions to improve translatability. * Localization - Update Spanish and Japanese translations. = 1.7.7 = * Tweak - Add option to filter teams in event by competition and season with no filter as default setting. = 1.7.6 = * Fix - Modules sidebar not displaying in admin. = 1.7.5 = * Fix - Calendars empty when no teams selected. = 1.7.4 = * Feature - Filter teams by competition and season on page load when editing event. * Feature - Enable multiple team selection in calendars. * Feature - Ability to install free starter theme from modules page. * Tweak - Use YouTube for tutorials instead of Vimeo. * Localization - Update Finnish, Dutch, Czech, Italian, and Polish translations. = 1.7.3 = * Tweak - Add option to hide/show player statistics. * Tweak - Always load overview, widgets, and importers. * Fix - Notice displaying in player statistics when no players available. * Localization - Update Greek, Polish, Finnish, Dutch, and Icelandic translations. = 1.7.2 = * Fix - Player positions disappearing in event page. * Fix - Individual mode automatically loading by default. * Localization - Update Polish translation. = 1.7.1 = * Fix - Activation error related to server limitations. * Localization - Update Greek translation. = 1.7 = * Feature - Enable multiple seasons and competitions to be selected for events, calendars, player lists, and league tables. * Feature - Enable primary performance selection. * Feature - Enable event result columns to be displayed automatically. * Feature - Enable switching overview, widgets, and importers on and off via modules. * Feature - New color scheme selector. * Feature - New video tutorials module. * Feature - Allow event performance tables to be split by team and by player position. * Feature - Allow extras row to be displayed in event performance. * Tweak - Display event venue address below map. * Tweak - Display plugin and theme recommendations only to network admins. * Tweak - Hide player details section if none available. * Tweak - Link module request to form instead of email. * Fix - Responsive table scrollbar causing horizontal page scrolling. * Fix - Misplaced config meta boxes. * Fix - Scrollbar appearing in countdown widget. * Fix - Event blocks template not honoring link events setting. * Fix - League table position calculations for tied teams. * Fix - Filter out empty results when viewing events in admin list view. * Fix - Invalid array issue when viewing league tables. * Preset - Enable sport presets to define plugin options. * Preset - Update cricket and ice hockey presets. * Localization - Number changed to Squad Number. * Localization - Update Polish, French, Czech, Dutch, Kannada, Finnish, Swedish, German, Russian, Greek, Portuguese, and Japanese translations. = 1.6.1 = * Feature - Countdown moved to module and now able to display team logos. * Feature - Add option to show or hide event list titles. * Tweak - Display latitude and longitude fields when adding venues. * Fix - Calculating equations with nested parentheses. * Fix - Minor meta box mislabeling. * Preset - Add Lacrosse preset. * Localization - Update Polish, French, Czech, Dutch, Kannada, Finnish, and Swedish translations. = 1.6 = * Feature - New modules page to quickly toggle additional features. * Feature - Option to automatically populate player list and league table based on criteria. * Feature - Display link to CSV importer at the top of admin list pages. * Feature - Update jQuery dataTables to version 1.10.4. * Feature - Wrap responsive tables via script. * Feature - New API functions for team abbreviations. * Feature - Enable searching team names in event edit screen. * Refactor - Enable global setting to use plugin as team-vs-team or player-vs-player (beta). * Refactor - Use 3-letter FIFA country codes with fallback for 2-letter codes. * Refactor - Merge scrollable and responsive settings. * Tweak - Make AJAX shortcodes hookable for extensions and modules. * Tweak - Mode maps setting to events tab. * Tweak - Highlight jobs link in admin menu when editing a job. * Tweak - Hide theme notice from welcome pages. * Tweak - Prepend prefix to frontend CSS selectors. * Tweak - Change Team Results to Event Results. * Tweak - Display result rows only for teams that have been selected. * Fix - League table displaying zeroes when competition is selected and season is set to all. * Fix - Notice when players don't exist in event. * Fix - Career totals not displaying in player profiles. * Fix - Player performance displaying rows when no team is selected. * Fix - Events linking in countdown widget and event list when option is turned off. * Fix - Option to hide event blocks title. * Fix - Event logos displaying different images when teams are not selected. * Preset - Add default labels for overtime in baseball and basketball presets. * Preset - Add Counter-Strike: Global Offensive preset. * Localization - Update list of countries for nationality selection. = 1.5 = * Feature - New inline quick result editing for events. * Feature - Automatically detect event outcome based on user-defined conditions. * Feature - Enable individual players to compete in events. * Feature - Add new API functions for theme developers. * Feature - Add event list time/results formatting options. * Feature - Add option to display player career totals. * Feature - Add option to display team logos in event lists. * Feature - Add option to display venue in event blocks. * Feature - Split iCal feed links for Apple Calendar, Google, and Outlook. * Refactor - Move Staff to dedicated menu link. * Refactor - Load sportspress.php template as a fallback only. * Tweak - Add caption header to event blocks. * Tweak - Add selector classes to event venue rows. * Tweak - Remove line breaks after template output. * Tweak - Disable responsive event performance when icons are shown. * Tweak - Update default color scheme. * Tweak - Update player gallery thumbnail markup. * Tweak - Sort Player positions dropdown by slug. * Tweak - Frontend styling to add margins and fix overflows. * Fix - Countdown datetime format. * Fix - Page slug conflict with SendPress. * Fix - Missing sample event video link. * Fix - iCal feed formatting when venue location is not set. * Preset - Update presets to include automatic outcome conditions. * Localization - Add Puerto Rico to countries list. * Localization - Update Polish, German, Spanish, Russian, Finnish, Italian, Armenian, Greek, Dutch, Turkish, French, and Bengali translations. = 1.4.7 = * Feature - New staff shortcode and widget to display staff photo and details. * Tweak - Display player photo in player details shortcode. * Tweak - Sample event csv to reflect soccer preset. * Fix - Saving a manual offset timezone. * Preset - Add player positions to volleyball preset. * Localization - Update Turkish, Italian, Polish, Finnish, and French translations. = 1.4.6 = * Tweak - Include all events that have results in league table calculations. * Fix - Duplicate Jobs selector in Edit Staff page. * Preset - Update basketball preset column priorities. * Localization - Update Finnish, Polish, Italian, Greek, Dutch, Turkish, and Russian translations. = 1.4.5 = * Fix - Away team players not being displayed without players in home team. * Fix - Primary team results always using default setting. * Localization - Update Finnish and Spanish translations. = 1.4.4 = * Feature - Automatically select event venue based on home team. * Fix - Featured images not displaying in some themes. * Preset - New Floorball preset. * Localization - Update Finnish and Armenian translations. = 1.4.3 = * Tweak - Update API functions for events and teams. * Tweak - Update sample video links. * Fix - Remove calendar link background color for more consistent styling. * Localization - Update Finnish, Italian, Russian, and Spanish translations. = 1.4.2 = * Tweak - Remove solid color from base stylesheet to improve integration. = 1.4.1 = * Fix - League table positions not sorting by sort order. = 1.4 = * Feature - New welcome page with intro video and separate tabs. * Feature - New iCal feeds for event calendars. * Feature - Add date range selector to event calendars. * Feature - Ability to insert sample data during installation. * Feature - Assign teams same position in league table when all values are tied. * Feature - Display time/results between home and away teams in event list. * Feature - Theme-specific stylesheets to apply when third-party theme is active. * Feature - Make event lists sortable. * Feature - Add team and event logo templates. * Feature - Add player and staff photo templates. * Feature - Option to hide Rank column in player lists. * Feature - Option to toggle frontend templates per post type. * Feature - Option to use abbreviated team names. * Feature - Option to enable comments in events articles. * Refactor - Change label for League to Competition. * Tweak - Bold and apply class to highlighted team name in league table. * Tweak - Remove team from venue hierarchy in overview. * Tweak - Admin editor styles to match WordPress 4.0 inline editor. * Tweak - Display performance icons in admin. * Tweak - Change default sport to Custom. * Tweak - Display none when no team available for player. * Tweak - Permanently delete config post types when sent to trash. * Tweak - Add hooks to widgets, shortcodes, and templates for integration. * Fix - Display team checkbox only once in player admin. * Fix - CSV team importer not saving all fields. * Preset - Adjust player positions in sport presets. * Preset - Add Bats / Throws metric to Baseball preset. * Preset - Add Bat brand metric to Cricket preset. * Localization - Make Video and Current Teams translatable. * Localization - Auto-load RTL stylesheet. * Localization - Include only compiled languages to reduce overall size. * Localization - Apply text options to translations. * Localization - Update Dutch, French, Armenian, Russian, Croatian, German, Greek, Thai, Japanese, Bosnian, Turkish, Spanish, Arabic, Italian, and Polish translations. = 1.3.2 = * Integration - WPML compatibility. * Feature - Option to set number of columns in player gallery. * Tweak - Remove line break after templates. * Tweak - Update plugin icon. * Tweak - Update welcome screen badge. * Tweak - Display admin menu label as Players & Staff. * Fix - Typo in sample CSV import file. * Fix - Apply default color scheme when left blank. * Fix - Notices where taxonomies or posts not found. * Localization - Update source strings. * Localization - Update French and Dutch translations. = 1.3.1 = * Fix - Player list shortcode meta displayed on league table edit page. * Localization - Update Dutch translation. = 1.3 = * Feature - New overview page with interactive sitemap. * Feature - New and improved CSV import tools for bulk adding. * Feature - New full time minutes setting in events for statistics calculation. * Feature - New roles taxonomy for staff. * Feature - Option to display home/away teams in event lists. * Feature - Option to display league and season in event blocks. * Feature - Option to choose all leagues and seasons in league table. * Feature - Option to choose all leagues and seasons in player list. * Feature - Choose between displaying values and icons in event player performance. * Feature - Option to display photos in player list. * Feature - Filter players by league and season in admin. * Feature - Select a team to highlight in league tables. * Feature - Display league tables in team pages. * Feature - Display total statistics per player. * Feature - Add team option to countdown widget. * Feature - Add scrollable tables option. * Feature - Ability to adjust overall table columns per team. * Refactor - Remove individual mode in favor of upcoming hybrid. * Refactor - Use global linking options per post type. * Refactor - Display player position in profile. * Tweak - Reorganize settings options. * Tweak - Update SportsPress icon. * Tweak - Rename widgets for better usability. * Tweak - Add div wrappers to templates for easier targeting. * Tweak - Show or hide admin checkboxes based on event format. * Tweak - Make event list and blocks pagination independent. * Tweak - Trim admin table padding. * Tweak - Display all event performance columns by default. * Fix - Event list results column not always displaying. * Preset - New Rugby Union preset. * Preset - New League of Legends preset. * Preset - New DotA 2 preset. * Preset - Group into traditional sports and esports. * Preset - Add missing primary results and column priorities. * Localization - Fix multilingual post linking. * Localization - Thai translation by Xyteton. * Localization - Add Xyteton, tyby94, & SilverXp to translation team. * Localization - Update translations from Transifex. = 1.2.8 = * Preset - Add water polo preset. * Localization - Add Macedonian translations. * Localization - Update Armenian, Bulgarian, Finnish, German, Greek, Japanese, & Norwegian translations. = 1.2.7 = * Fix - Responsive table columns hidden when script active. * Localization - Update Finnish & German translations. = 1.2.6 = * Fix - Number format rounding issue. = 1.2.5 = * Fix - Data calculations for values above 1000. * Localization - Update French, Finnish, Dutch, Greek, & Armenian translations. = 1.2.4 = * Fix - Team URL and abbreviation not saving when adding new team. * Localization - Update Armenian, Finnish, French, & German translations. = 1.2.3 = * Feature - Display event results in admin teams columns. * Tweak - Ensure teams are in order in event results. * Fix - Streaks calculator in league tables. * Fix - Streaks calculator in team columns. * Localization - Update German, Greek, & Norwegian translations. = 1.2.2 = * Tweak - Display link to docs instead of themes. * Fix - Enable hide theme support notice. * Fix - Typo in table caption classes. = 1.2.1 = * Feature - Enable option to display team's total player performance per event. * Tweak - Order player gallery positions by slug. * Tweak - Remove unused Played column setting from Player List widget. * Fix - League Table widget columns setting independent from post setting. * Fix - Event List widget columns setting not being applied. * Fix - Row limits in League Table, Player List, & Event List shortcodes. * Localization - Update Armenian, Finnish, & French translations. = 1.2 = * Feature - Shortcode dropdown menu added to page and post editor. * Feature - New shortcodes added to individual player profiles. * Tweak - Add timezone setting in place of base country. * Localization - Update translations. = 1.1.8 = * Tweak - Order player list positions by slug. * Tweak - Wrap templates with div for frontend styling. * Fix - Date format in sample events CSV. * Localization - Fix WPML duplicate posts. * Localization - Update Armenian, Finnish, French, German, Norwegian, & Spanish translations. = 1.1.7 = * Fix - Inconsistent country code for Wales. * Fix - Localize post date month names. * Fix - Warning message when changing mode on welcome page. * Localization - Update Armenian, French, Italian & Norwegian translations. = 1.1.6 = * Fix - Maps not loading in admin. = 1.1.5 = * Tweak - Wrap post content with div for easier templating. * Localization - Update French translation. * Localization - Update Spanish translation. = 1.1.4 = * Feature - Add home venue option in team admin. * Tweak - Move editor meta boxes to bottom of post edit page. * Tweak - Remove link to league and season archives. * Fix - Previous and next post function in some themes. * Fix - Duplicate team checkboxes in player. * Preset - Add table tennis preset. * Preset - Update ice hockey preset. = 1.1.3 = * Fix - Display all event result columns by default. = 1.1.2 = * Feature - Event outcome abbreviation for streak column. * Fix - League table calculations for constants with 2 or more digits. * Preset - Add ice hockey preset. * Preset - Add volleyball preset. * Localization - Update Armenian translation. * Localization - Update Finnish translation. * Localization - Update German translation. = 1.1.1 = * Tweak - Check if equation is attempting to divide by zero to prevent errors. * Fix - Player statistics meta box message. * Preset - Make baseball preset appear in dropdown. = 1.1 = * Feature - Enable individual sport mode. * Feature - Enable displaying player lists on team pages. * Feature - Enable player performance reordering in events. * Feature - Enable changing player numbers and positions per event. * Feature - Add date selector to display today's events and this week's events in calendar. * Feature - Option to redirect team permalinks to official team website instead of team page. * Feature - Display staff in event performance section. * Feature - Add column selector to player profiles and player lists. * Feature - Add option to show or hide player performance section in events. * Feature - Add global padding option to SportsPress settings. * Tweak - Force decimals to display when precision is set. * Tweak - Add SportsPress post types to At a Glance section in dashboard. * Tweak - Filter checklists by league and season. * Tweak - Display layout type in admin. * Tweak - Improve roles and permissions. * Fix - Some select all checkboxes defaulted to being checked. * Refactor - Use gettext filter to alter frontend text. * Preset - Add American Football preset. * Preset - Add Australian Rules Football preset. * Preset - Add baseball preset. * Preset - Add cricket preset. * Preset - Add darts preset. * Preset - Add handball preset. * Preset - Add netball preset. * Preset - Add Rugby League preset. * Preset - Add squash preset. * Preset - Add tennis preset. * Preset - Update soccer preset. * Localization - Armenian translation by ArtakEVN. * Localization - Update translations. = 1.0.4 = * Fix - Shorthand php notation removed for better compatibility. * Localization - Update Finnish translation. * Localization - Update Greek translation. = 1.0.3 = * Tweak - Hide theme integration notice. = 1.0.2 = * Fix - Initialize columns array in player list class. = 1.0.1 = * Fix - Conditional install error relating to post types function. = 1.0 = * Feature - New drag and drop equation builder. * Feature - Add team website link in admin. * Feature - Enable searching for post user when there are more than 10. * Feature - New event manager role that can publish and manage events only. * Tweak - Fix league table alignment and responsive height. * Tweak - Set maximum size of event blocks logos. * Tweak - Add option to link venues in event list. * Tweak - Remove margin between table and scrollbar. * Tweak - Display delimiter between team logos under event title. * Tweak - Hide media, comments, and tools from feature limited users. * Tweak - Hide previous and next post links for custom post types. * Tweak - Rounding explicitly displays all decimal places. * Refactor - Combine players and staff in admin menu. * Fix - Duplicate team logos in event blocks. * Fix - Query future events for next team event. * Fix - Live countdown in admin dashboard. * Fix - Display all current teams in player profile. * Localization - Norwegian Bokmål translation by sijo. * Localization - Update translations. = 0.9.4 = * Tweak - Force delete preset variables when switching sports in settings. * Fix - Apply player gallery limit. * Fix - Display localized team results string. * Refactor - Use more common thumbnail sizes. * Localization - Portuguese (Portugal) translation by Andrew_Melim. = 0.9.3 = * Fix - Player list columns not displaying. = 0.9.2 = * Fix - Duplicate editor fields in team edit screen. = 0.9.1 = * Tweak - Add text domain to configure descriptions. * Tweak - Change default country to US. * Fix - Event block results display for teams without logos. = 0.9 = * Feature - Import tool added for importing staff from CSV file. * Feature - Add checkboxes to select player statistics columns. * Feature - Add option to select Google Map type. * Feature - Add option to display team logos under event title. * Feature - Enable player metrics and statistics selection in player list widget. * Feature - Enable linking event blocks and event list to team pages. * Tweak - Move leagues and seasons to SportsPress submenu. * Tweak - Use singular post type slugs by default for consistency with WP core. * Tweak - Remove alternate color in favor of link color setting. * Tweak - Enable scrollable tables to prevent overflow. * Tweak - Add helper text to venue location picker. * Tweak - Adjust markup and remove link in league table caption. * Tweak - Insert group name anchors to player list. * Tweak - Display post type counts in system status. * Fix - Event list results calculation when team column unchecked. * Fix - Display player group names. * Preset - Add snooker preset. * Localization - Finnish translation by JuKi and hanro. * Localization - Chinese translation by dic_2008. * Localization - Dutch translation by valentijnreza. = 0.8.6 = * Fix - Issue adding teams to events. = 0.8.5 = * Fix - Issue saving new venues. = 0.8.4 = * Feature - Add option to limit number of teams per event. * Feature - Show venue option in Countdown widget. * Feature - Enable multiple current teams per player. * Feature - Format performance data for use in templates. * Feature - Add next event function to team for template. * Refactor - Adjust theme template loader for venues and seasons. * Tweak - Replace featured image text in admin. * Tweak - Use wider map zoom setting. * Tweak - Make SportsPress tables full width by default. * Fix - Team filter in admin. * Fix - Displaying 1 view as plural. = 0.8.3 = * Feature - Enable using events started and substituted in statistics equations. * Tweak - Remove deprecated MySQL version function from System Status page. * Fix - Adjust styling to display select boxes in admin. = 0.8.2 = * Fix - Add content in main loop only. = 0.8.1 = * Tweak - Output player statistics in system status. * Tweak - Prepend templates to content instead of outputting directly. * Fix - Enable metrics usage in individual player statistics. = 0.8 = * Feature - New shortcode event_results. * Feature - New shortcode event_details. * Feature - New shortcode event_performance. * Feature - New blocks layout to display calendars in fixtures/results style. * Feature - New player statistics calculate values using performance and metrics. * Feature - New staff profiles. * Feature - New System Status screen in admin. * Feature - Add status selector to calendars and event widgets. * Feature - Add ability to display statistics and metrics in player lists. * Feature - Add time/results column to event list. * Feature - Link WP user roles with players and staff. * Feature - Display player substitutions in event page. * Feature - Option to group player lists by position. * Feature - Option to display outcomes in event results. * Refactor - Player profiles now use statistics and performance. * Refactor - Split admin CSS files for better performance. * Tweak - Display player numbers in admin. * Tweak - Move SportsPress settings to top-level page. * Tweak - Link date to event page in event list. * Tweak - Load Google Maps script only when needed. * Tweak - Add descriptions to configure screen for clarity. * Tweak - Create dedicated settings tab for text settings. * Tweak - Remove redundant border from pagination table. * Tweak - Display players and teams as total count in admin. * Fix - Display player number when 0 or 00. * Fix - Enable changing variable name or key from quick edit. * Fix - Team data saving issue. * Fix - Display all future events in venue archive. * Fix - Display all metrics instead of filtering by position. * Localization - Croatian translation by i__k. * Localization - Greek translation by Spirossmil. * Localization - Portuguese (Brazil) translation by rochester. * Localization - Russian translation by Selskei. * Localization - Slovenian translation by BOCo. * Localization - Update translations. = 0.7.4 = * Feature - Shortcode added to display single event content. * Tweak - Display default shortcode format when editing a calendar or player list. * Tweak - Add backwards compatibility for shortcodes prior to version 0.7. * Fix - Template hook to change display strings in admin. = 0.7.3 = * Feature - Enable editing Key field in Metrics and Performance. * Tweak - Lighter default color scheme. = 0.7.2 = * Fix - Update missing assets. = 0.7.1 = * Fix - Activation error preventing new installation. = 0.7 = * Feature - Welcome page to display on activation. * Feature - Frontend color scheme selection. * Feature - Custom CSS option. * Feature - Add venue column to event list. * Feature - Manual point adjustments added to league tables. * Feature - Enable table pagination. * Feature - Enable live countdown setting. * Refactor - Only load required classes to improve performance. * Refactor - Change statistic to performance. * Refactor - Soft deprecate sportspress prefixed functions in favor of sp prefix. * Tweak - Filter players in events by current team. * Tweak - Separate admin styles to improve load times. * Tweak - Add margin above view all link in widgets. * Tweak - Group text options by context. * Tweak - Display event details in standard table markup for style consistency. * Tweak - Display venue as a table for style consistency. * Tweak - Hide individual player performance when players not selected. * Fix - Responsive league table glitch. * Fix - Warning messages when adding new team, player, or event. * Fix - Countdown widget when event is selected. * Fix - Multiple select box height glitch in some browsers fixed. * Localization - Arabic translation by Abdulelah. * Localization - German translation by Bhelpful2. * Localization - Update Swedish translation by JensZ. = 0.6.2 = * Feature - Add options to make tables responsive and sortable. * Feature - Use consistent shortcode naming with backwards compatibility. = 0.6.1 = * Feature - Display full event results on hover over main team result in admin. * Feature - Add option to choose delimiter to use between team names in event titles. * Tweak - Adjust text options to modify front-end only. * Fix - Responsive league table output and styling. = 0.6 = * Feature - New events shortcodes: countdown, events-calendar, and events-list. * Feature - New teams shortcode: league-table. * Feature - New players shortcodes: player-list and player-gallery. * Feature - Display available shortcodes in post edit screen. * Feature - Add new settings page to change default text output. * Feature - Add new section to permalinks settings to change post and term slugs. * Tweak - Display teams as link list in admin page for league table teams columns. * Tweak - Vertically align team logos in league table. * Fix - Check if player belongs to leagues to avoid warnings in player profile. * Fix - Total player statistics calculation in events. * Fix - Responsive tables in event details and outcomes. * Fix - Display players from all seasons or leagues when none have been created. = 0.5 = * Feature - Import tool added for importing events from CSV file. * Feature - New post type Calendar added. * Feature - League and Friendly format options added to events. * Feature - List and Gallery format options added to player lists. * Feature - Calendar and List format options added to calendars. * Feature - Options added to turn on and off player list columns. * Feature - Options added to player list widget to limit rows and display link to view all players. * Feature - Options added to calendar widget to filter events. * Feature - New widget Events List added. * Feature - New widget Player Gallery added. * Refactor - Use singular slugs for secondary post types. * Tweak - Add tooltips to icons in admin table headings. * Tweak - Style event results in admin events list. * Tweak - Separate event date and time in admin events list. * Fix - Enable custom post type sorting in admin. * Fix - Added check before displaying deleted posts in league tables and player lists. * Fix - Adjust Select All filter in player lists and league tables. = 0.4.3 = * Feature - Enable selecting multiple outcomes per team per event. * Tweak - Use icons in dashboard column labels for teams and roster. * Tweak - Mark current team with check icon in admin player table. * Fix - Check that selected columns are in array to avoid warning. * Localization - Add Czech translation. * Localization - Add Slovak translation. * Localization - Add Polish translation by karimjarro. = 0.4.2 = * Feature - Enable selecting columns to display in single league table. * Feature - Add options to limit rows, display logos, and display full table link. * Feature - Add option to display national flags in player profiles. * Refactor - Group Players and Staff under Roster menu group. * Tweak - Reorder default player profile content. * Tweak - Display player number before page title instead of metrics section. * Tweak - Display player metrics as definition list instead of table. * Fix - Check if static player list is array to avoid warning message. = 0.4.1 = * Tweak - Activate checkbox when all players are added to player list. * Fix - Function date_diff added for PHP < 5.3. * Localization - Swedish translation by JensZ. = 0.4 = * Feature - SportsPress Status dashboard widget added to display number of events and countdown in admin. * Feature - New dashboard menu icons. * Feature - More intuitive player edit screen. * Feature - Enable spreadsheet style keyboard navigation in admin data tables. * Feature - Add hover action on league table team names to edit display name. * Refactor - Remove min and max outcome options from column equation. * Refactor - Change Rounding precision to default to 0. * Tweak - Used jQuery Chosen for inputs where useful. * Tweak - Prepend plugin name to widget titles. * Tweak - Highlight settings in admin menu when adding new config post type. * Tweak - Display Events as Schedule in admin sidebar menu. * Tweak - Update widget descriptions. * Tweak - Remove unused external class eqGraph. * Tweak - Display sort order priority options for number of columns available. * Fix - Apply table column rounding when precision is set. * Fix - Display event results on events page when available. * Fix - Check that event results are available before displaying a warning under certain conditions. * Fix - Namespace eqEOS class to avoid conflict with other plugins. * Localization - Use specific strings instead of dynamic ones for more accurate translations. * Localization - Use generic strings where appropriate. * Localization - Update German translation. * Localization - Update Spanish translation. * Localization - Update French translation. * Localization - Update Italian translation. * Localization - Update Japanese translation. = 0.3.3 = * Feature - Add default sorting options per player list. * Feature - Add option to sort player list alphabetically by name or by default. = 0.3.2 = * Feature - Add England, Scotland, Northern Ireland, and Wales to countries selector. * Feature - Enable searching for countries in dropdown. = 0.3.1 = * Feature - Import tool added for importing teams from CSV file. * Tweak - Added option to select custom sport and enter sport name. * Tweak - Display player number under photo in admin screen. * Tweak - Positions, Leagues, and Seasons columns added to player import tool. * Tweak - Styled SportsPress setup notice. * Refactor - Sum changed to Total in player statistic calculation settings. = 0.3 = * Feature - Import tool added for importing players from CSV file. * Feature - Add ability to select * Tweak - Display current team indicator in players admin screen. = 0.2.10 = * Fix - Team filtering in events, tables, players, and lists. * Tweak - Display statistics for all league/season events played in player profiles and player lists. * Tweak - Count events as played when in starting lineup or made substitution. * Tweak - Display player metrics only when value is set. = 0.2.9 = * Feature - Ability to select players from all teams in player list. * Fix - Decimal sorting in league tables and player lists. = 0.2.8 = * Feature - Add player list widget. * Localization - Add German translations. * Localization - Add Spanish translations. * Localization - Add Italian translations. = 0.2.7 = * Feature - Select columns to display in league table widget. * Tweak - Start league table positions at 1 instead of 0. = 0.2.6 = * Localization - Add French translations. * Preset - Update soccer preset. = 0.2.5 = * Fix - Update deprecated function to prevent error in Player Lists. = 0.2.4 = * Feature - Display venue map on event page and venue archive. * Fix - Add checks to prevent league table dividing by zero when no events have been played. * Fix - Flush rewrite rules for taxonomies on activation. * Tweak - Sort sports presets alphabetically by localized name. = 0.2.3 = * Feature - Enable selecting main event result. * Feature - Add Last 5 counter to table columns. * Localization - Update Japanese translations. * Preset - Complete American Football preset. = 0.2.2 = * Feature - League Table widget added. * Feature - Recent Events widget added. * Feature - Future Events widget added. * Feature - Countdown widget added. * Fix - Syntax error fixed for PHP version 5.2 and below. * Tweak - Editor section added to League Tables and Player Lists. = 0.2.1 = * Feature - Events Calendar widget added. * Fix - Player settings table markup fixed. * Tweak - Refine custom post type capabilities for user roles. = 0.2 = * Feature - Add option to select whether statistics are calculated as a sum or average. * Feature - Enable pageview tracking for posts and custom post types. * Feature - Responsive datatables. * Fix - Add site admin capabilities for multisite. * Fix - Force numerical sorting of number column. * Tweak - Enable SportsPress content functions to be called without explicit ID. * Tweak - Remove redundant admin menu links via filter. = 0.1.7 = * Feature - Enable selecting venues to use uploaded images. = 0.1.6 = * Tweak - Activate per post type permissions. * Tweak - Give admin all permissions for custom posts. = 0.1.5 = * Tweak - Remove flag images to lighten download size. = 0.1.4 = * Fix - All Plugin-Check warnings. * Tweak - Split templates into files in subdirectory. * Tweak - Simplify gettext filters. = 0.1.3 = * Fix - Style conflict with Foundation framework in table columns. * Feature - HTML output added to custom post types with data table sorting. * Feature - Enable metrics and statistics per player position. * Feature - Save team played per season per league in player edit screen. * Feature - Give teams the option to show and hide past seasons. * Feature - Venues, Seasons, and Leagues added as taxonomies. * Feature - Add L10 counter to report last 10 outcomes. * Feature - Add STRK counter to report current outcome streak. * Localization - Add country names in Czech, German, Spanish, French, Italian, Japanese, Polish, Russian, and Slovak. = 0.1.2 = * Tweak - Use custom post types for metrics and statistics configuration. * Feature - Display HTML tables when viewing League Table and Player List post types. * Feature - Link player and team names to single post pages. * Feature - Register default configuration for soccer. * Feature - Sort league table and player list by priority. = 0.1.1 = * Tweak - Update description. = 0.1 = * Alpha release for first look and testing. ================================================ FILE: dummy-data/event-performance-sample.csv ================================================ Player,Goals,Assists,Yellow Cards,Red Cards Dee Callery,0,1,0,0 Romeo Melvin,2,0,1,0 Ty Carrell,0,2,0,0 Alonzo Ohalloran,1,1,0,0 Nelson Giddings,1,0,0,1 Ellis Nicholls,0,1,0,0 Corey Kirk,0,0,1,0 Spencer Duncan,0,0,0,1 ================================================ FILE: dummy-data/events-sample.csv ================================================ Date,Time,Venue,Teams,Results,Outcome,Players,Goals,Assists,Yellow Cards,Red Cards 2015/01/20,14:15:00,Little Park,Eagles,1|3|4,Win,Joe Allen,0,1,0,0 ,,,,,,David Hardy,2,0,1,0 ,,,,,,Jude Murray,0,2,0,0 ,,,,,,Isaac Hall,1,1,0,0 ,,,,,,Nathan Knowles,1,0,0,1 ,,,Sharks,2|0|2,Loss,Daniel Sturridge,1,0,1,0 ,,,,,,Jake Price,0,0,1,1 ,,,,,,Owen Goodwin,1,2,0,0 ,,,,,,Dylan Gray,0,0,1,0 ,,,,,,Zachary Noble,0,0,2,0 2015/01/24,16:00:00,Big Stadium,Kangaroos,1|1|2,Draw,Steven Gerrard,0,0,0,0 ,,,,,,Gabrielle Gonzalez,1,0,1,0 ,,,,,,Harrison Hancock,0,2,0,0 ,,,,,,Reece Reeves,1,0,0,0 ,,,,,,Edward Colier,0,0,0,1 ,,,Eagles,0|2|2,Draw,Joe Allen,1,0,3,0 ,,,,,,David Hardy,0,0,1,1 ,,,,,,Ellis Nicholls,0,1,0,0 ,,,,,,Corey Kirk,0,0,1,0 ,,,,,,Isaac Hall,1,1,2,0 2015/03/14,16:00:00,Little Park,Sharks,2|0|2,Loss,Daniel Sturridge,1,0,1,0 ,,,,,,Jake Price,1,0,0,0 ,,,,,,Owen Goodwin,0,1,0,0 ,,,,,,Dylan Gray,0,1,1,0 ,,,,,,Henry Chadwick,0,0,0,1 ,,,Eagles,1|2|3,Win,Joe Allen,1,1,0,0 ,,,,,,David Hardy,0,0,1,0 ,,,,,,Jude Murray,1,0,1,0 ,,,,,,Corey Kirk,1,1,0,0 ,,,,,,Spencer Duncan,0,0,0,1 2016/12/10,13:00:00,Little Park,Eagles,,,,,,, ,,,Kangaroos,,,,,,, 2017/05/05,12:00:00,Big Stadium,Sharks,,,,,,, ,,,Kangaroos,,,,,,, ================================================ FILE: dummy-data/fixtures-sample.csv ================================================ Date,Time,Venue,Home,Away 2017/01/20,14:30:00,Little Park,Eagles,Sharks 2017/01/24,16:00:00,Big Stadium,Kangaroos,Eagles 2017/02/14,16:15:00,Little Park,Sharks,Eagles 2017/03/05,13:00:00,Little Park,Eagles,Kangaroos 2017/04/27,12:45:00,Big Stadium,Sharks,Kangaroos ================================================ FILE: dummy-data/officials-sample.csv ================================================ Name Marco Andrews Daniel Jacobs Erick Herbertson Rupert Abraham ================================================ FILE: dummy-data/players-sample.csv ================================================ Number,Name,Positions,Teams,Leagues,Seasons,Nationality,DoB 1,Joe Allen,Goalkeeper,Eagles,Primary League|Secondary League,2014,aus,1983/05/05 3,Steven Gerrard,Defender,Kangaroos,Primary League,2014|2013,usa,1970/03/10 5,Daniel Sturridge,Midfielder|Forward,Sharks,Primary League|Secondary League,2014|2013,eng,1990/02/15 6,Gabrielle Gonzalez,Forward,Kangaroos|Sharks,Primary League,2014,esp,1987/01/20 ================================================ FILE: dummy-data/staff-sample.csv ================================================ Name,Jobs,Teams,Leagues,Seasons,Nationality Bobby Brown,Coach,Eagles,Primary League|Secondary League,2014,aus Charles Johnson,Assistant Coach,Kangaroos,Primary League,2014,eng Matt Smith,Waterboy,Sharks,Primary League|Secondary League,2013|2014,aus Derrick Dawson,Manager,Tigers,Primary League,2014,usa John Allen,Investor,Foxes,Primary League|Secondary League,2014,esp ================================================ FILE: dummy-data/teams-sample.csv ================================================ Name,Leagues,Seasons,Site URL,Abbreviation,Home Eagles,Primary League|Secondary League,2014,http://tboy.co/eagles,EAGLES,Little Park Sharks,Primary League|Secondary League,2014|2013,http://tboy.co/sharks,SHARKS Kangaroos,Primary League,2014|2013,http://tboy.co/roos,ROOS,Big Stadium ================================================ FILE: feeds/ical.php ================================================ 404 ) ); } // Get events in calendar $calendar = new SP_Calendar( $post ); $events = $calendar->data(); // Get blog locale $locale = substr( get_locale(), 0, 2 ); // Get main result setting $main_result = get_option( 'sportspress_primary_result', null ); // Get the timezone setting $timezone = sanitize_option( 'timezone_string', get_option( 'timezone_string' ) ); // Get the URL $url = add_query_arg( 'feed', 'sp-ical', get_post_permalink( $post ) ); $url = wordwrap( $url, 60, "\r\n\t", true ); $output = "BEGIN:VCALENDAR\r\n" . "VERSION:2.0\r\n" . 'PRODID:-//ThemeBoy//SportsPress//' . strtoupper( $locale ) . "\r\n" . "CALSCALE:GREGORIAN\r\n" . "METHOD:PUBLISH\r\n" . 'URL:' . $url . "\r\n" . 'X-FROM-URL:' . $url . "\r\n" . 'NAME:' . $post->post_title . "\r\n" . 'X-WR-CALNAME:' . $post->post_title . "\r\n" . 'DESCRIPTION:' . $post->post_title . "\r\n" . 'X-WR-CALDESC:' . $post->post_title . "\r\n" . "REFRESH-INTERVAL;VALUE=DURATION:PT2M\r\n" . "X-PUBLISHED-TTL:PT2M\r\n" . 'TZID:' . $timezone . "\r\n" . 'X-WR-TIMEZONE:' . $timezone . "\r\n"; // Loop through each event foreach ( $events as $event ) : // Define date format $date_format = 'Ymd\THis'; // Get description $description = preg_replace( '/([\,;])/', '\\\$1', $event->post_content ); $description = wordwrap( $description, 60, "\n\t" ); // Initialize end time $end = new DateTime( $event->post_date ); // Get full time minutes $minutes = get_post_meta( $event->ID, 'sp_minutes', true ); if ( '' === $minutes ) { $minutes = get_option( 'sportspress_event_minutes', 90 ); } // Add full time minutes to end time $end->add( new DateInterval( 'PT' . $minutes . 'M' ) ); // Initialize location $location = ''; // Get venue information $venues = get_the_terms( $event->ID, 'sp_venue' ); if ( $venues ) { $venue = reset( $venues ); $location .= $venue->name; // Get venue term meta $t_id = $venue->term_id; $meta = get_option( "taxonomy_$t_id" ); // Add details to location $address = sp_array_value( $meta, 'sp_address', false ); if ( false !== $address ) { $location = $venue->name . '\, ' . preg_replace( '/([\,;])/', '\\\$1', $address ); } // Generate geo tag $latitude = sp_array_value( $meta, 'sp_latitude', false ); $longitude = sp_array_value( $meta, 'sp_longitude', false ); if ( false !== $latitude && false !== $longitude ) { $geo = $latitude . ';' . $longitude; } else { $geo = false; } } $location = wordwrap( $location, 60, "\r\n\t" ); // Get title or write summary based on scores $results = array(); $teams = (array) get_post_meta( $event->ID, 'sp_team', false ); $teams = array_filter( $teams ); $teams = array_unique( $teams ); if ( ! empty( $teams ) ) { $event_results = get_post_meta( $event->ID, 'sp_results', true ); foreach ( $teams as $team_id ) { if ( ! $team_id ) { continue; } $team = get_post( $team_id ); if ( $team ) { $team_results = sportspress_array_value( $event_results, $team_id, null ); if ( $main_result ) { $team_result = sportspress_array_value( $team_results, $main_result, null ); } else { if ( is_array( $team_results ) ) { end( $team_results ); $team_result = prev( $team_results ); } else { $team_result = null; } } if ( $team_result != null ) { $results[] = get_the_title( $team_id ) . ' ' . $team_result; } } } } if ( sizeof( $results ) ) { $summary = implode( ' ', $results ); } else { $summary = $event->post_title; } // Convert &#[0-9]+ entities to UTF-8 $summary = preg_replace_callback( '/(&#[0-9]+;)/', function( $m ) { return mb_convert_encoding( $m[1], 'UTF-8', 'HTML-ENTITIES' ); }, $summary ); $summary = apply_filters( 'sportspress_ical_feed_summary', $summary, $event ); // Append to output string $output .= "BEGIN:VEVENT\r\n" . 'SUMMARY:' . preg_replace( '/([\,;])/', '\\\$1', $summary ) . "\r\n" . "UID:$event->ID\r\n" . "STATUS:CONFIRMED\r\n" . "DTSTAMP:19700101T000000\r\n" . 'DTSTART:' . mysql2date( $date_format, $event->post_date ) . "\r\n" . 'DTEND:' . $end->format( $date_format ) . "\r\n" . 'LAST-MODIFIED:' . mysql2date( $date_format, $event->post_modified_gmt ) . "\r\n"; if ( $description ) { $output .= 'DESCRIPTION:' . $description . "\r\n"; } if ( $location ) { $output .= 'LOCATION:' . $location . "\r\n"; } if ( $geo ) { $output .= 'GEO:' . $geo . "\r\n"; } $output .= "END:VEVENT\r\n"; endforeach; // End output $output .= 'END:VCALENDAR'; // Print headers header( 'Content-type: text/calendar; charset=utf-8' ); // The E-Tag is not being changed when the output file is generated – Some Webdav clients do not like this and // do not then 'see' that the file has changed – updates to the calendars are then not displayed to the user. // Props @garygomm https://wordpress.org/support/topic/calendar-feed-issue-not-updating-after-change/ $etag = md5( $output ); header( 'Etag:' . '"' . $etag . '"' ); header( 'Content-Disposition: inline; filename=' . $post->post_name . '.ics' ); // Print content echo wp_kses_post( $output ); ================================================ FILE: includes/abstracts/abstract-sp-custom-post.php ================================================ ID = absint( $post->ID ); $this->post = $post; else : $this->ID = absint( $post ); $this->post = get_post( $this->ID ); endif; } /** * __isset function. * * @access public * @param mixed $key * @return bool */ public function __isset( $key ) { return metadata_exists( 'post', $this->ID, 'sp_' . $key ); } /** * __get function. * * @access public * @param mixed $key * @return bool */ public function __get( $key ) { if ( ! isset( $key ) ) : return $this->post; else : $value = get_post_meta( $this->ID, 'sp_' . $key, true ); endif; return $value; } /** * Get the post data. * * @access public * @return object */ public function get_post_data() { return $this->post; } /** * Get terms sorted by order. * * @access public * @param string $taxonomy The taxonomy. * @return array|false|WP_Error See `get_the_terms()` */ public function get_terms_sorted_by_sp_order( $taxonomy ) { $terms = get_the_terms( $this->ID, $taxonomy ); if ( $terms ) { usort( $terms, 'sp_sort_terms' ); } return $terms; } } ================================================ FILE: includes/abstracts/abstract-sp-secondary-post.php ================================================ ID = absint( $post->ID ); $this->post = $post; else : $this->ID = absint( $post ); $this->post = get_post( $this->ID ); endif; } public function range( $where = '', $format = 'Y-m-d' ) { $from = new DateTime( $this->from ); $to = new DateTime( $this->to ); $to->modify( '+1 day' ); $where .= " AND post_date BETWEEN '" . $from->format( $format ) . "' AND '" . $to->format( $format ) . "'"; return $where; } public function relative( $where = '', $format = 'Y-m-d' ) { $from = new DateTime( 'now' ); $to = new DateTime( 'now' ); $from->modify( '-' . abs( (int) $this->past ) . ' day' ); $to->modify( '+' . abs( (int) $this->future ) . ' day' ); $to->modify( '+1 day' ); $where .= " AND post_date BETWEEN '" . $from->format( $format ) . "' AND '" . $to->format( $format ) . "'"; return $where; } } ================================================ FILE: includes/admin/class-sp-admin-ajax.php ================================================ plugin_url() . '/assets/css/menu.css', array(), SP_VERSION ); $screen = get_current_screen(); if ( in_array( $screen->id, sp_get_screen_ids() ) ) { // Admin styles for SP pages only wp_enqueue_style( 'jquery-chosen', SP()->plugin_url() . '/assets/css/chosen.css', array(), '1.1.0' ); wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION ); } elseif ( strpos( $screen->id, 'sportspress-config' ) !== false ) { wp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION ); } if ( strpos( $screen->id, 'sportspress-overview' ) !== false ) { wp_enqueue_style( 'sportspress-admin-slickmap', SP()->plugin_url() . '/assets/css/slickmap.css', array(), '1.1.0' ); } if ( in_array( $screen->id, array( 'dashboard' ) ) ) { wp_enqueue_style( 'sportspress-admin-dashboard-styles', SP()->plugin_url() . '/assets/css/dashboard.css', array(), SP_VERSION ); } if ( in_array( $screen->id, array( 'customize' ) ) ) { wp_enqueue_style( 'sportspress-admin-customize-styles', SP()->plugin_url() . '/assets/css/customize.css', array(), SP_VERSION ); } if ( in_array( $screen->id, array( 'sp_result', 'sp_performance', 'sp_column', 'sp_statistic' ) ) ) { wp_enqueue_style( 'sportspress-admin-equation-styles', SP()->plugin_url() . '/assets/css/equation.css', array(), SP_VERSION ); } if ( 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' ) ) ) { wp_enqueue_style( 'jquery-ui-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css' ); wp_enqueue_style( 'sportspress-admin-datepicker-styles', SP()->plugin_url() . '/assets/css/datepicker.css', array( 'jquery-ui-style' ), SP_VERSION ); } do_action( 'sportspress_admin_css', $screen ); } /** * Enqueue scripts */ public function admin_scripts( $hook ) { global $wp_query, $post; $screen = get_current_screen(); // Register scripts wp_register_script( 'chosen', SP()->plugin_url() . '/assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true ); wp_register_script( 'jquery-tiptip', SP()->plugin_url() . '/assets/js/jquery.tipTip.min.js', array( 'jquery' ), '1.3', true ); wp_register_script( 'jquery-caret', SP()->plugin_url() . '/assets/js/jquery.caret.min.js', array( 'jquery' ), '1.02', true ); wp_register_script( 'jquery-fitvids', SP()->plugin_url() . '/assets/js/jquery.fitvids.js', array( 'jquery' ), '1.1', true ); wp_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 ); wp_register_script( 'sportspress-admin-colorpicker', SP()->plugin_url() . '/assets/js/admin/colorpicker.js', array( 'jquery', 'wp-color-picker', 'iris' ), SP_VERSION, true ); wp_register_script( 'sportspress-admin-widgets', SP()->plugin_url() . '/assets/js/admin/widgets.js', array( 'jquery' ), SP_VERSION, true ); wp_register_script( 'sportspress-admin-quickeditor', SP()->plugin_url() . '/assets/js/admin/quickeditor.js', array( 'jquery' ), SP_VERSION, true ); // SportsPress admin pages if ( in_array( $screen->id, sp_get_screen_ids() ) || strpos( $screen->id, 'sportspress-config' ) || in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) { wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'chosen' ); wp_enqueue_script( 'jquery-ui-core' ); wp_enqueue_script( 'jquery-ui-draggable' ); wp_enqueue_script( 'jquery-ui-droppable' ); wp_enqueue_script( 'jquery-ui-sortable' ); wp_enqueue_script( 'jquery-tiptip' ); wp_enqueue_script( 'jquery-caret' ); wp_enqueue_script( 'jquery-fitvids' ); wp_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 ); $strings = apply_filters( 'sportspress_localized_strings', array( 'none' => esc_attr__( 'None', 'sportspress' ), 'remove_text' => esc_attr__( '— Remove —', 'sportspress' ), 'days' => esc_attr__( 'days', 'sportspress' ), 'hrs' => esc_attr__( 'hrs', 'sportspress' ), 'mins' => esc_attr__( 'mins', 'sportspress' ), 'secs' => esc_attr__( 'secs', 'sportspress' ), 'displaying_posts' => html_entity_decode( esc_attr__( 'Displaying %1$s–%2$s of %3$s', 'sportspress' ) ), ) ); // Localize scripts wp_localize_script( 'sportspress-admin', 'localized_strings', $strings ); } if ( in_array( $screen->id, array( 'widgets' ) ) ) { wp_enqueue_script( 'sportspress-admin-widgets' ); } // Edit color if ( in_array( $screen->id, array( 'sp_outcome' ) ) ) { wp_enqueue_script( 'sportspress-admin-colorpicker' ); } // Edit equation if ( in_array( $screen->id, array( 'sp_result', 'sp_performance', 'sp_column', 'sp_statistic' ) ) ) { wp_enqueue_script( 'sportspress-admin-equationbuilder' ); } // Quick edit if ( in_array( $screen->id, array( 'edit-sp_player' ) ) ) { wp_enqueue_script( 'sportspress-admin-quickeditor' ); } } } endif; return new SP_Admin_Assets(); ================================================ FILE: includes/admin/class-sp-admin-dashboard.php ================================================ publish ); $post_type = get_post_type_object( $type ); $text = _n( '%s ' . $post_type->labels->singular_name, '%s ' . $post_type->labels->name, $published, 'sportspress' ); $text = sprintf( $text, number_format_i18n( $published ) ); if ( current_user_can( $post_type->cap->edit_posts ) ) : $output = '' . $text . ''; else : $output = '' . $text . ''; endif; echo '
  • ' . wp_kses_post( $output ) . '
  • '; endif; endforeach; return $items; } /** * Show status widget */ public function status_widget() { ?> plugin_path() . '/assets/js/admin/editor-lang.php'; return $arr; } /** * Register the shortcode button. * * @param array $buttons * @return array */ public function register_shortcode_button( $buttons ) { array_push( $buttons, 'sp_shortcodes_button' ); return $buttons; } /** * Add the shortcode button to TinyMCE * * @param array $plugin_array * @return array */ public function add_shortcode_tinymce_plugin( $plugin_array ) { $plugin_array['sp_shortcodes_button'] = SP()->plugin_url() . '/assets/js/admin/editor.js'; return $plugin_array; } /** * Force TinyMCE to refresh. * * @param int $ver * @return int */ public function refresh_mce( $ver ) { $ver += 3; return $ver; } } new SP_Admin_Editor(); ================================================ FILE: includes/admin/class-sp-admin-importers.php ================================================ array( 'name' => esc_attr__( 'SportsPress Events (CSV)', 'sportspress' ), 'description' => wp_kses_post( __( 'Import events from a csv file.', 'sportspress' ) ), 'callback' => array( $this, 'events_importer' ), ), 'sp_fixture_csv' => array( 'name' => esc_attr__( 'SportsPress Fixtures (CSV)', 'sportspress' ), 'description' => wp_kses_post( __( 'Import upcoming events from a csv file.', 'sportspress' ) ), 'callback' => array( $this, 'fixtures_importer' ), ), 'sp_team_csv' => array( 'name' => esc_attr__( 'SportsPress Teams (CSV)', 'sportspress' ), 'description' => wp_kses_post( __( 'Import teams from a csv file.', 'sportspress' ) ), 'callback' => array( $this, 'teams_importer' ), ), 'sp_player_csv' => array( 'name' => esc_attr__( 'SportsPress Players (CSV)', 'sportspress' ), 'description' => wp_kses_post( __( 'Import players from a csv file.', 'sportspress' ) ), 'callback' => array( $this, 'players_importer' ), ), 'sp_staff_csv' => array( 'name' => esc_attr__( 'SportsPress Staff (CSV)', 'sportspress' ), 'description' => wp_kses_post( __( 'Import staff from a csv file.', 'sportspress' ) ), 'callback' => array( $this, 'staff_importer' ), ), ) ); if ( 'import.php' !== $pagenow ) { $importers['sp_event_performance_csv'] = array( 'name' => esc_attr__( 'SportsPress Box Score (CSV)', 'sportspress' ), 'description' => '' . sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Event', 'sportspress' ) ) . '', 'callback' => array( $this, 'event_performance_importer' ), ); } foreach ( $importers as $id => $importer ) { register_importer( $id, $importer['name'], $importer['description'], $importer['callback'] ); } } /** * Add menu item */ public function events_importer() { $this->includes(); require 'importers/class-sp-event-importer.php'; // Dispatch $importer = new SP_Event_Importer(); $importer->dispatch(); } /** * Add menu item */ public function event_performance_importer() { $this->includes(); require 'importers/class-sp-event-performance-importer.php'; // Dispatch $importer = new SP_Event_Performance_Importer(); $importer->dispatch(); } /** * Add menu item */ public function fixtures_importer() { $this->includes(); require 'importers/class-sp-fixture-importer.php'; // Dispatch $importer = new SP_Fixture_Importer(); $importer->dispatch(); } /** * Add menu item */ public function teams_importer() { $this->includes(); require 'importers/class-sp-team-importer.php'; // Dispatch $importer = new SP_Team_Importer(); $importer->dispatch(); } /** * Add menu item */ public function players_importer() { $this->includes(); require 'importers/class-sp-player-importer.php'; // Dispatch $importer = new SP_Player_Importer(); $importer->dispatch(); } /** * Add menu item */ public function staff_importer() { $this->includes(); require 'importers/class-sp-staff-importer.php'; // Dispatch $importer = new SP_Staff_Importer(); $importer->dispatch(); } public static function includes() { // Load Importer API require_once ABSPATH . 'wp-admin/includes/import.php'; if ( ! class_exists( 'WP_Importer' ) ) { $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php'; if ( file_exists( $class_wp_importer ) ) { require $class_wp_importer; } } require 'importers/class-sp-importer.php'; } } endif; return new SP_Admin_Importers(); ================================================ FILE: includes/admin/class-sp-admin-menus.php ================================================ id == 'sp_role' ) { $this->highlight_admin_menu( 'edit.php?post_type=sp_staff', 'edit-tags.php?taxonomy=sp_role&post_type=sp_staff' ); } elseif ( is_sp_config_type( $typenow ) ) { $this->highlight_admin_menu( 'sportspress', 'sportspress-config' ); } elseif ( $typenow == 'sp_calendar' ) { $this->highlight_admin_menu( 'edit.php?post_type=sp_event', 'edit.php?post_type=sp_calendar' ); } elseif ( $typenow == 'sp_table' ) { $this->highlight_admin_menu( 'edit.php?post_type=sp_team', 'edit.php?post_type=sp_table' ); } elseif ( $typenow == 'sp_list' ) { $this->highlight_admin_menu( 'edit.php?post_type=sp_player', 'edit.php?post_type=sp_list' ); } } /** * Renames admin menu items. * * @access public * @return void */ public function menu_rename() { global $menu, $submenu; if ( isset( $submenu['sportspress'] ) && isset( $submenu['sportspress'][0] ) && isset( $submenu['sportspress'][0][0] ) ) { $submenu['sportspress'][0][0] = esc_attr__( 'Settings', 'sportspress' ); } } public function parent_file( $parent_file ) { global $current_screen; $taxonomy = $current_screen->taxonomy; if ( in_array( $taxonomy, array( 'sp_league', 'sp_season' ) ) ) { $parent_file = 'sportspress'; } return $parent_file; } /** * Reorder the SP menu items in admin. * * @param mixed $menu_order * @return array */ public function menu_order( $menu_order ) { // Initialize our custom order array $sportspress_menu_order = array(); // Get the index of our custom separator $sportspress_separator = array_search( 'separator-sportspress', $menu_order ); // Get index of menu items $sportspress_event = array_search( 'edit.php?post_type=sp_event', $menu_order ); $sportspress_team = array_search( 'edit.php?post_type=sp_team', $menu_order ); $sportspress_player = array_search( 'edit.php?post_type=sp_player', $menu_order ); $sportspress_staff = array_search( 'edit.php?post_type=sp_staff', $menu_order ); // Loop through menu order and do some rearranging foreach ( $menu_order as $index => $item ) : if ( ( ( 'sportspress' ) == $item ) ) : $sportspress_menu_order[] = 'separator-sportspress'; $sportspress_menu_order[] = $item; $sportspress_menu_order[] = 'edit.php?post_type=sp_event'; $sportspress_menu_order[] = 'edit.php?post_type=sp_team'; $sportspress_menu_order[] = 'edit.php?post_type=sp_player'; $sportspress_menu_order[] = 'edit.php?post_type=sp_staff'; unset( $menu_order[ $sportspress_separator ] ); unset( $menu_order[ $sportspress_event ] ); unset( $menu_order[ $sportspress_team ] ); unset( $menu_order[ $sportspress_player ] ); unset( $menu_order[ $sportspress_staff ] ); // Apply to added menu items $menu_items = apply_filters( 'sportspress_menu_items', array() ); foreach ( $menu_items as $menu_item ) : $sportspress_menu_order[] = $menu_item; $index = array_search( $menu_item, $menu_order ); unset( $menu_order[ $index ] ); endforeach; elseif ( ! in_array( $item, array( 'separator-sportspress' ) ) ) : $sportspress_menu_order[] = $item; endif; endforeach; // Return order return $sportspress_menu_order; } /** * custom_menu_order * * @return bool */ public function custom_menu_order() { if ( ! current_user_can( 'manage_sportspress' ) ) { return false; } return true; } /** * Clean the SP menu items in admin. */ public function menu_clean() { global $menu, $submenu, $current_user; // Find where our separator is in the menu foreach ( $menu as $key => $data ) : if ( is_array( $data ) && array_key_exists( 2, $data ) && $data[2] == 'edit.php?post_type=sp_separator' ) { $separator_position = $key; } endforeach; // Swap our separator post type with a menu separator if ( isset( $separator_position ) ) : $menu[ $separator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' ); endif; // Remove "Leagues" and "Seasons" links from Events submenu if ( isset( $submenu['edit.php?post_type=sp_event'] ) ) : $submenu['edit.php?post_type=sp_event'] = array_filter( $submenu['edit.php?post_type=sp_event'], array( $this, 'remove_leagues' ) ); $submenu['edit.php?post_type=sp_event'] = array_filter( $submenu['edit.php?post_type=sp_event'], array( $this, 'remove_seasons' ) ); endif; // Remove "Venues", "Leagues" and "Seasons" links from Teams submenu if ( isset( $submenu['edit.php?post_type=sp_team'] ) ) : $submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_venues' ) ); $submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_leagues' ) ); $submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_seasons' ) ); endif; // Remove "Leagues" and "Seasons" links from Players submenu if ( isset( $submenu['edit.php?post_type=sp_player'] ) ) : $submenu['edit.php?post_type=sp_player'] = array_filter( $submenu['edit.php?post_type=sp_player'], array( $this, 'remove_leagues' ) ); $submenu['edit.php?post_type=sp_player'] = array_filter( $submenu['edit.php?post_type=sp_player'], array( $this, 'remove_seasons' ) ); endif; // Remove "Leagues" and "Seasons" links from Staff submenu if ( isset( $submenu['edit.php?post_type=sp_staff'] ) ) : $submenu['edit.php?post_type=sp_staff'] = array_filter( $submenu['edit.php?post_type=sp_staff'], array( $this, 'remove_leagues' ) ); $submenu['edit.php?post_type=sp_staff'] = array_filter( $submenu['edit.php?post_type=sp_staff'], array( $this, 'remove_seasons' ) ); endif; $user_roles = $current_user->roles; $user_role = array_shift( $user_roles ); if ( in_array( $user_role, array( 'sp_player', 'sp_staff', 'sp_event_manager', 'sp_team_manager' ) ) ) : remove_menu_page( 'upload.php' ); remove_menu_page( 'edit-comments.php' ); remove_menu_page( 'tools.php' ); endif; } /** * Init the config page */ public function config_page() { include 'views/html-admin-config.php'; } /** * Init the settings page */ public function settings_page() { include_once 'class-sp-admin-settings.php'; SP_Admin_Settings::output(); } public function remove_add_new( $arr = array() ) { return $arr[0] != esc_attr__( 'Add New', 'sportspress' ); } public function remove_leagues( $arr = array() ) { return $arr[0] != esc_attr__( 'Leagues', 'sportspress' ); } public function remove_positions( $arr = array() ) { return $arr[0] != esc_attr__( 'Positions', 'sportspress' ); } public function remove_seasons( $arr = array() ) { return $arr[0] != esc_attr__( 'Seasons', 'sportspress' ); } public function remove_venues( $arr = array() ) { return $arr[0] != esc_attr__( 'Venues', 'sportspress' ); } public static function highlight_admin_menu( $p = 'sportspress', $s = 'sportspress' ) { global $parent_file, $submenu_file; $parent_file = $p; $submenu_file = $s; } public static function sitemap_taxonomy_post_types( $post_types = array(), $taxonomy = 'sp_venue' ) { $post_types = array_intersect( $post_types, sp_primary_post_types() ); // Remove teams from venues taxonomy post type array if ( $taxonomy === 'sp_venue' && ( $key = array_search( 'sp_team', $post_types ) ) !== false ) : unset( $post_types[ $key ] ); endif; return $post_types; } } endif; return new SP_Admin_Menus(); ================================================ FILE: includes/admin/class-sp-admin-notices.php ================================================ id, array( 'dashboard_page_sp-about', 'dashboard_page_sp-credits', 'dashboard_page_sp-translators' ) ) ) { wp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ) ); add_action( 'admin_notices', array( $this, 'setup_notice' ) ); } if ( 'post' == $screen->base ) { $post_id = get_the_ID(); if ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) { add_action( 'admin_notices', array( $this, 'no_access_notice' ) ); } } if ( ! empty( $_GET['hide_theme_support_notice'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ) ) ) { $notices = array_diff( $notices, array( 'theme_support' ) ); update_option( 'sportspress_admin_notices', $notices ); } if ( ! empty( $_GET['hide_template_files_notice'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ) ) ) { $notices = array_diff( $notices, array( 'template_files' ) ); update_option( 'sportspress_admin_notices', $notices ); } if ( 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' ) ) ) { $template = get_option( 'template' ); if ( ! in_array( $template, array( 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ) { wp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ) ); add_action( 'admin_notices', array( $this, 'theme_check_notice' ) ); } } if ( in_array( 'template_files', $notices ) ) { wp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ) ); add_action( 'admin_notices', array( $this, 'template_file_check_notice' ) ); } } /** * Show the setup notices */ public function setup_notice() { include 'views/html-notice-install.php'; } /** * Displays a notice when the user doesn't have access to edit a post type */ public function no_access_notice() { include 'views/html-notice-no-access.php'; } /** * Show the Theme Check notice */ public function theme_check_notice() { include 'views/html-notice-theme-support.php'; } /** * Show a notice highlighting bad template files */ public function template_file_check_notice() { if ( isset( $_GET['page'] ) && 'sportspress' == $_GET['page'] && isset( $_GET['tab'] ) && 'status' == $_GET['tab'] ) { return; } $status = include 'class-sp-admin-status.php'; $core_templates = $status->scan_template_files( SP()->plugin_path() . '/templates' ); $outdated = false; foreach ( $core_templates as $file ) { $theme_file = false; if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/' . $file; } elseif ( file_exists( get_stylesheet_directory() . '/sportspress/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/sportspress/' . $file; } elseif ( file_exists( get_template_directory() . '/' . $file ) ) { $theme_file = get_template_directory() . '/' . $file; } elseif ( file_exists( get_template_directory() . '/sportspress/' . $file ) ) { $theme_file = get_template_directory() . '/sportspress/' . $file; } if ( $theme_file ) { $core_version = $status->get_file_version( SP()->plugin_path() . '/templates/' . $file ); $theme_version = $status->get_file_version( $theme_file ); if ( $core_version && $theme_version && version_compare( $theme_version, $core_version, '<' ) ) { $outdated = true; break; } } } if ( $outdated ) { include 'views/html-notice-template-check.php'; } } } endif; return new SP_Admin_Notices(); ================================================ FILE: includes/admin/class-sp-admin-permalink-settings.php ================================================ slugs = apply_filters( 'sportspress_permalink_slugs', array( array( 'event', esc_attr__( 'Events', 'sportspress' ) ), array( 'venue', esc_attr__( 'Venues', 'sportspress' ) ), array( 'calendar', esc_attr__( 'Calendars', 'sportspress' ) ), array( 'team', esc_attr__( 'Teams', 'sportspress' ) ), array( 'league', esc_attr__( 'Leagues', 'sportspress' ) ), array( 'season', esc_attr__( 'Seasons', 'sportspress' ) ), array( 'table', esc_attr__( 'League Tables', 'sportspress' ) ), array( 'player', esc_attr__( 'Players', 'sportspress' ) ), array( 'position', esc_attr__( 'Positions', 'sportspress' ) ), array( 'list', esc_attr__( 'Player Lists', 'sportspress' ) ), array( 'staff', esc_attr__( 'Staff', 'sportspress' ) ), ) ); add_action( 'admin_init', array( $this, 'settings_init' ) ); add_action( 'admin_init', array( $this, 'settings_save' ) ); } /** * Init our settings */ public function settings_init() { // Add a section to the permalinks page add_settings_section( 'sportspress-permalink', esc_attr__( 'SportsPress', 'sportspress' ), array( $this, 'settings' ), 'permalink' ); // Add our settings foreach ( $this->slugs as $slug ) : add_settings_field( $slug[0], // id $slug[1], // setting title array( $this, 'slug_input' ), // display callback 'permalink', // settings page 'sportspress-permalink' // settings section ); endforeach; } /** * Show a slug input box. */ public function slug_input() { $slug = array_shift( $this->slugs ); $key = $slug[0]; $text = get_option( 'sportspress_' . $key . '_slug', null ); ?>
    not using "default" permalinks above.', 'sportspress' ) ) ); wp_nonce_field( plugin_basename( __FILE__ ), 'sp_permalink_nonce' ); } /** * Save the settings */ public function settings_save() { if ( ! is_admin() ) : return; endif; if ( ! is_user_logged_in() ) : return; endif; if ( ! current_user_can( 'manage_sportspress' ) ) : return; endif; if ( isset( $_POST['permalink_structure'] ) || isset( $_POST['sportspress_event_slug'] ) ) : if ( ! isset( $_POST['sp_permalink_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['sp_permalink_nonce'] ), plugin_basename( __FILE__ ) ) ) : return; endif; foreach ( $this->slugs as $slug ) : $key = 'sportspress_' . $slug[0] . '_slug'; $value = null; if ( isset( $_POST[ $key ] ) ) { $value = sanitize_text_field( wp_unslash( $_POST[ $key ] ) ); } if ( empty( $value ) ) { delete_option( $key ); } else { update_option( $key, $value ); } endforeach; sp_flush_rewrite_rules(); endif; } } endif; return new SP_Admin_Permalink_Settings(); ================================================ FILE: includes/admin/class-sp-admin-post-types.php ================================================ ' . __( 'View All', 'sportspress' ) . ''; endfor; elseif ( is_sp_post_type( $typenow ) ) : $obj = get_post_type_object( $typenow ); $messages['post'][1] = esc_attr__( 'Changes saved.', 'sportspress' ) . ' ' . $obj->labels->view_item . ''; $messages['post'][4] = esc_attr__( 'Changes saved.', 'sportspress' ); $messages['post'][6] = esc_attr__( 'Success!', 'sportspress' ) . ' ' . $obj->labels->view_item . ''; $messages['post'][7] = esc_attr__( 'Changes saved.', 'sportspress' ); $messages['post'][8] = esc_attr__( 'Success!', 'sportspress' ) . ' ' . sprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . ''; $messages['post'][9] = sprintf( __( 'Scheduled for: %1$s.', 'sportspress' ), date_i18n( esc_attr__( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post->ID ) ) ) . ' ' . sprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . ''; $messages['post'][10] = esc_attr__( 'Success!', 'sportspress' ) . ' ' . sprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . ''; endif; return $messages; } /** * Remove meta boxes as needed */ public static function meta_boxes( $meta_boxes ) { if ( 'manual' != get_option( 'sportspress_player_columns', 'auto' ) ) { unset( $meta_boxes['sp_player']['columns'] ); } return $meta_boxes; } } endif; return new SP_Admin_Post_Types(); ================================================ FILE: includes/admin/class-sp-admin-sample-data.php ================================================ array(), 'sp_season' => array(), 'sp_venue' => array(), 'sp_position' => array(), 'sp_role' => array(), 'sp_event' => array(), 'sp_calendar' => array(), 'sp_team' => array(), 'sp_table' => array(), 'sp_player' => array(), 'sp_list' => array(), 'sp_staff' => array(), ); // Terms to insert $taxonomies = array(); // Leagues $taxonomies['sp_league'] = array( _x( 'Primary League', 'example', 'sportspress' ), _x( 'Secondary League', 'example', 'sportspress' ) ); // Seasons $current_year = date( 'Y' ); $current_year = intval( $current_year ); $taxonomies['sp_season'] = array( $current_year - 1, $current_year, $current_year + 1 ); // Venues $taxonomies['sp_venue'] = array( array( 'name' => 'Bentleigh', 'meta' => array( 'sp_address' => '12A Bolinda Street, Bentleigh VIC 3204, Australia', 'sp_latitude' => -37.920537, 'sp_longitude' => 145.043199, ), ), array( 'name' => 'Essendon', 'meta' => array( 'sp_address' => '74 Napier Street, Essendon VIC 3040, Australia', 'sp_latitude' => -37.751940, 'sp_longitude' => 144.919549, ), ), array( 'name' => 'Kensington', 'meta' => array( 'sp_address' => '50 Altona Street, Kensington, Victoria, Australia', 'sp_latitude' => -37.797789, 'sp_longitude' => 144.924709, ), ), ); // Jobs $taxonomies['sp_role'] = array( 'Coach' ); /* * Insert terms */ foreach ( $taxonomies as $taxonomy => $terms ) { foreach ( $terms as $term ) { // Determine if term is array or name string if ( is_array( $term ) ) { $name = $term['name']; } else { $name = $term; } // Insert term $inserted = wp_insert_term( $name, $taxonomy, array( 'description' => $name, 'slug' => sanitize_title( $name ), ) ); // Add meta to term if is array if ( ! is_wp_error( $inserted ) && is_array( $term ) && array_key_exists( 'meta', $term ) ) { $t_id = sp_array_value( $inserted, 'term_id', 1 ); $meta = sp_array_value( $term, 'meta' ); update_option( "taxonomy_$t_id", $meta ); // Add to inserted ids array $inserted_ids[ $taxonomy ][] = $t_id; } } } // Create sample content $sample_content = _x( 'This is an example %1$s. As a new SportsPress user, you should go to your dashboard to delete this %1$s and create new %2$s for your content. Have fun!', 'example', 'sportspress' ); // Define teams $teams = array( array( 'name' => 'Bluebirds', 'url' => 'http://tboy.co/bluebirds', ), array( 'name' => 'Eagles', 'url' => 'http://tboy.co/eagles', ), array( 'name' => 'Kangaroos', 'url' => 'http://tboy.co/kangaroos', ), ); // Define players $players = array( 'Mario Bellucci', 'Aiden Leggatt', 'Seth Clemens', 'Mitchell Childe', 'Daniel Benn', 'Archie Stead', 'Finn Rosetta', 'Koby Brough', 'Blake Bannan', 'Hugo Stones', 'Tristian Holme', 'Mason Ewing', ); // Define staff $staff = array( 'Bobby Brown', ); // Define event videos $event_videos = array( 'https://www.youtube.com/watch?v=xNkf2LYckI0', 'https://www.youtube.com/watch?v=sIrjQyuwteM', 'https://www.youtube.com/watch?v=xSGxuTGVQYE', ); // Get countries $countries = new SP_Countries(); /* * Insert teams */ foreach ( $teams as $index => $team ) { $post['post_title'] = $team['name']; $post['post_type'] = 'sp_team'; $post['post_status'] = 'publish'; $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' ) ) ); // Terms $post['tax_input'] = array(); $taxonomies = array( 'sp_league', 'sp_season' ); foreach ( $taxonomies as $taxonomy ) { $post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids', ) ); } $post['tax_input']['sp_venue'] = get_terms( 'sp_venue', array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, 'offset' => $index, ) ); // Insert post $id = wp_insert_post( $post ); // Add to inserted ids array $inserted_ids['sp_team'][] = $id; // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); // Update meta update_post_meta( $id, 'sp_url', $team['url'] ); } // Get columns $columns = array( 'team' ); $args = array( 'post_type' => array( 'sp_performance', 'sp_statistic' ), 'posts_per_page' => 2, 'orderby' => 'menu_order', 'order' => 'ASC', ); $vars = get_posts( $args ); foreach ( $vars as $var ) { $columns[] = $var->post_name; } /* * Insert players */ foreach ( $players as $index => $name ) { $post['post_title'] = $name; $post['post_type'] = 'sp_player'; $post['post_status'] = 'publish'; $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' ) ) ); // Terms $post['tax_input'] = array(); $taxonomies = array( 'sp_league', 'sp_season' ); foreach ( $taxonomies as $taxonomy ) { $post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids', ) ); } $taxonomies = array( 'sp_position' ); foreach ( $taxonomies as $taxonomy ) { $terms = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'slug', 'number' => 1, 'offset' => $index % 4, ) ); if ( $terms && ! is_wp_error( $terms ) ) { $post['tax_input'][ $taxonomy ] = $terms; } } // Insert post $id = wp_insert_post( $post ); // Add to inserted ids array $inserted_ids['sp_player'][] = $id; // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); // Calculate meta $nationality = array_rand( $countries->countries ); $team_index = floor( $index / 4 ); $past_team_index = ( $team_index + 1 ) % 3; $current_team = sp_array_value( $inserted_ids['sp_team'], $team_index, 0 ); $past_team = sp_array_value( $inserted_ids['sp_team'], $past_team_index, 0 ); $primary_league = reset( $post['tax_input']['sp_league'] ); $season_teams = $season_stats = array(); foreach ( $post['tax_input']['sp_season'] as $season_index => $season_id ) { $season_stats[ $season_id ] = array(); if ( $season_index == 0 ) { $season_teams[ $season_id ] = $past_team; } else { $season_teams[ $season_id ] = $current_team; if ( $season_index == 1 ) { foreach ( $vars as $var ) { $season_stats[ $season_id ][ $var->post_name ] = rand( 1, 10 ); } } } } $player_stats = array( $primary_league => $season_stats ); $player_leagues = array( $primary_league => $season_teams ); // Update meta update_post_meta( $id, 'sp_columns', $columns ); update_post_meta( $id, 'sp_number', $index + 1 ); update_post_meta( $id, 'sp_nationality', $nationality ); update_post_meta( $id, 'sp_current_team', $current_team ); update_post_meta( $id, 'sp_past_team', $past_team ); update_post_meta( $id, 'sp_leagues', $player_leagues ); update_post_meta( $id, 'sp_statistics', $player_stats ); sp_update_post_meta_recursive( $id, 'sp_team', array( $current_team, $past_team ) ); } // Get columns $columns = array(); $args = array( 'post_type' => 'sp_performance', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $performance_posts = get_posts( $args ); foreach ( $performance_posts as $performance_post ) { if ( sizeof( $columns ) >= 5 ) { continue; } $columns[] = $performance_post->post_name; } $args = array( 'post_type' => 'sp_result', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $result_posts = get_posts( $args ); $args = array( 'post_type' => 'sp_outcome', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $outcome_posts = get_posts( $args ); /* * Insert staff */ foreach ( $staff as $index => $name ) { $post['post_title'] = $name; $post['post_type'] = 'sp_staff'; $post['post_status'] = 'publish'; $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' ) ) ); // Terms $post['tax_input'] = array(); $taxonomies = array( 'sp_league', 'sp_season' ); foreach ( $taxonomies as $taxonomy ) { $post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids', ) ); } $taxonomies = array( 'sp_role' ); foreach ( $taxonomies as $taxonomy ) { $terms = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'slug', 'number' => 1, 'offset' => $index % 4, ) ); $post['tax_input'][ $taxonomy ] = $terms; } // Insert post $id = wp_insert_post( $post ); // Add to inserted ids array $inserted_ids['sp_staff'][] = $id; // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); // Calculate meta $team_index = floor( $index / 4 ); $past_teams = $inserted_ids['sp_team']; $current_team = sp_array_value( $past_teams, $team_index, 0 ); unset( $past_teams[ $team_index ] ); // Update meta update_post_meta( $id, 'sp_columns', $columns ); update_post_meta( $id, 'sp_number', $index + 1 ); update_post_meta( $id, 'sp_nationality', 'aus' ); update_post_meta( $id, 'sp_current_team', $current_team ); sp_update_post_meta_recursive( $id, 'sp_past_team', $past_teams ); sp_update_post_meta_recursive( $id, 'sp_team', $inserted_ids['sp_team'] ); } /* * Insert events */ for ( $index = 0; $index < 6; $index ++ ) { // Determine team index and post status $i = $index % 3; if ( $index < 3 ) { $post_status = 'publish'; $post_year = $current_year - 1; $event_season = get_terms( 'sp_season', array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, ) ); } else { $post_status = 'future'; $post_year = $current_year + 1; $event_season = get_terms( 'sp_season', array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'DESC', 'number' => 1, ) ); } // The away team should be the next inserted team, or the first if this is the last event if ( $i == 2 ) { $away_index = 0; } else { $away_index = $i + 1; } $post = array( 'post_title' => $teams[ $i ]['name'] . ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ' . $teams[ $away_index ]['name'], 'post_type' => 'sp_event', 'post_status' => $post_status, 'post_content' => sprintf( $sample_content, esc_attr__( 'Event', 'sportspress' ), esc_attr__( 'Events', 'sportspress' ), add_query_arg( 'post_type', 'sp_event', admin_url( 'edit.php' ) ) ), 'post_date' => $post_year . '-' . sprintf( '%02d', 3 + $i * 3 ) . '-' . sprintf( '%02d', 5 + $i * 10 ) . ' ' . ( 18 + $i ) . ':00:00', 'tax_input' => array( 'sp_league' => get_terms( 'sp_league', array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, ) ), 'sp_season' => $event_season, 'sp_venue' => get_terms( 'sp_venue', array( 'hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, 'offset' => $i, ) ), ), ); // Insert post $id = wp_insert_post( $post ); // Add to inserted ids array $inserted_ids['sp_event'][] = $id; // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); // Calculate home and away team ids $home_team_index = ( $i ) % 3; $away_team_index = ( $i + 1 ) % 3; $home_team_id = sp_array_value( $inserted_ids['sp_team'], $home_team_index, 0 ); $away_team_id = sp_array_value( $inserted_ids['sp_team'], $away_team_index, 0 ); $event_teams = array( $home_team_id, $away_team_id, ); // Initialize meta $event_players = array( 0 ); $performance = $results = array(); if ( $home_team_id ) { // Add home team player performance $performance[ $home_team_id ] = array(); for ( $j = 0; $j < 4; $j ++ ) { $player_id = sp_array_value( $inserted_ids['sp_player'], $home_team_index * 4 + $j ); $event_players[] = $player_id; $player_performance = array(); foreach ( $performance_posts as $performance_post ) { $player_performance[ $performance_post->post_name ] = rand( 0, 1 ); } $performance[ $home_team_id ][ $player_id ] = $player_performance; } // Add home team results $results[ $home_team_id ] = array(); foreach ( $result_posts as $result_post_index => $result_post ) { $results[ $home_team_id ][ $result_post->post_name ] = 1 + $result_post_index; } $outcome = reset( $outcome_posts ); if ( is_object( $outcome ) ) { $results[ $home_team_id ]['outcome'] = array( $outcome->post_name ); } } // Separate teams with zero $event_players[] = 0; if ( $away_team_id ) { $performance[ $away_team_id ] = array(); for ( $j = 0; $j < 4; $j ++ ) { $player_id = sp_array_value( $inserted_ids['sp_player'], $away_team_index * 4 + $j ); $event_players[] = $player_id; $player_performance = array(); foreach ( $performance_posts as $performance_post ) { $player_performance[ $performance_post->post_name ] = rand( 0, 1 ); } $performance[ $away_team_id ][ $player_id ] = $player_performance; } // Add away team results $results[ $away_team_id ] = array(); foreach ( $result_posts as $result_post ) { $results[ $away_team_id ][ $result_post->post_name ] = '0'; } $outcome = next( $outcome_posts ); if ( is_object( $outcome ) ) { $results[ $away_team_id ]['outcome'] = array( $outcome->post_name ); } } if ( 'publish' === $post_status ) { // Swap results for last event only if ( $i == 2 ) { $k = array_keys( $results ); $v = array_values( $results ); $rv = array_reverse( $v ); $results = array_combine( $k, $rv ); } // Update future post meta update_post_meta( $id, 'sp_players', $performance ); update_post_meta( $id, 'sp_results', $results ); } // Update general meta sp_update_post_meta_recursive( $id, 'sp_team', $event_teams ); sp_update_post_meta_recursive( $id, 'sp_player', $event_players ); update_post_meta( $id, 'sp_columns', $columns ); update_post_meta( $id, 'sp_format', 'league' ); update_post_meta( $id, 'sp_video', $event_videos[ $i ] ); } /* * Insert calendar */ $post = array( 'post_title' => _x( 'Fixtures & Results', 'example', 'sportspress' ), 'post_type' => 'sp_calendar', 'post_status' => 'publish', 'post_content' => sprintf( $sample_content, esc_attr__( 'Calendar', 'sportspress' ), esc_attr__( 'Calendars', 'sportspress' ), add_query_arg( 'post_type', 'sp_calendar', admin_url( 'edit.php' ) ) ), ); // Insert post $id = wp_insert_post( $post ); // Add to inserted ids array $inserted_ids['sp_calendar'][] = $id; // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); // Define columns $columns = array( 'event', 'time', 'article' ); // Update meta update_post_meta( $id, 'sp_format', 'list' ); update_post_meta( $id, 'sp_status', 'any' ); update_post_meta( $id, 'sp_date', 0 ); update_post_meta( $id, 'sp_team', 0 ); update_post_meta( $id, 'sp_order', 'ASC' ); update_post_meta( $id, 'sp_columns', $columns ); /* * Insert league table */ $leagues = get_terms( 'sp_league', array( 'hide_empty' => 0, 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, ) ); $league = reset( $leagues ); $seasons = get_terms( 'sp_season', array( 'hide_empty' => 0, 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, ) ); $season = reset( $seasons ); $post = array( 'post_title' => $league->name . ' ' . $season->name, 'post_type' => 'sp_table', 'post_status' => 'publish', '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' ) ) ), 'tax_input' => array( 'sp_league' => $league->term_id, 'sp_season' => $season->term_id, ), ); // Insert post $id = wp_insert_post( $post ); // Add to inserted ids array $inserted_ids['sp_table'][] = $id; // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); // Get columns $columns = array(); $args = array( 'post_type' => 'sp_column', 'posts_per_page' => 8, 'orderby' => 'menu_order', 'order' => 'ASC', ); $column_posts = get_posts( $args ); foreach ( $column_posts as $column_post ) { $columns[] = $column_post->post_name; } // Update meta sp_update_post_meta_recursive( $id, 'sp_team', $inserted_ids['sp_team'] ); update_post_meta( $id, 'sp_columns', $columns ); update_post_meta( $id, 'sp_highlight', reset( $inserted_ids['sp_team'] ) ); /* * Insert player list for each team */ foreach ( $inserted_ids['sp_team'] as $index => $team_id ) { $post = array( 'post_title' => get_the_title( $team_id ) . ' ' . _x( 'Roster', 'example', 'sportspress' ), 'post_type' => 'sp_list', 'post_status' => 'publish', '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' ) ) ), ); // Insert post $id = wp_insert_post( $post ); // Add to inserted ids array $inserted_ids['sp_list'][] = $id; // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); // Get players from team $list_players = array_slice( $inserted_ids['sp_player'], $index * 4, 4 ); // Get columns $columns = array(); $args = array( 'post_type' => array( 'sp_metric' ), 'posts_per_page' => 2, 'orderby' => 'menu_order', 'order' => 'ASC', ); $column_posts = get_posts( $args ); foreach ( $column_posts as $column_post ) { $columns[] = $column_post->post_name; } // Update meta update_post_meta( $id, 'sp_format', 'list' ); sp_update_post_meta_recursive( $id, 'sp_player', $list_players ); update_post_meta( $id, 'sp_columns', $columns ); update_post_meta( $id, 'sp_grouping', 'position' ); update_post_meta( $id, 'sp_orderby', 'name' ); update_post_meta( $id, 'sp_order', 'ASC' ); update_post_meta( $id, 'sp_team', $team_id ); } /* * Insert player list for player ranking */ $post = array( 'post_title' => _x( 'Player Ranking', 'example', 'sportspress' ), 'post_type' => 'sp_list', 'post_status' => 'publish', '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' ) ) ), ); // Insert post $id = wp_insert_post( $post ); // Add to inserted ids array $inserted_ids['sp_list'][] = $id; // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); // Get columns $columns = array( 'team' ); $performance_post = reset( $performance_posts ); if ( is_object( $performance_post ) ) { $columns[] = $performance_post->post_name; } // Update meta update_post_meta( $id, 'sp_format', 'list' ); sp_update_post_meta_recursive( $id, 'sp_player', $inserted_ids['sp_player'] ); update_post_meta( $id, 'sp_columns', $columns ); update_post_meta( $id, 'sp_grouping', '0' ); update_post_meta( $id, 'sp_order', 'DESC' ); if ( is_object( $performance_post ) ) { update_post_meta( $id, 'sp_orderby', $performance_post->post_name ); } /* * Update player list and league table per team */ foreach ( $inserted_ids['sp_team'] as $index => $team_id ) { update_post_meta( $team_id, 'sp_list', sp_array_value( $inserted_ids['sp_list'], $index, 0 ) ); update_post_meta( $team_id, 'sp_table', sp_array_value( $inserted_ids['sp_table'], 0 ) ); } } /** * Deletes sample SportsPress data * * @access public */ public static function delete_posts() { $post_types = sp_post_types(); $args = array( 'post_type' => $post_types, 'posts_per_page' => -1, 'post_status' => array( 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash' ), 'meta_query' => array( array( 'key' => '_sp_sample', 'value' => 1, ), ), ); // Delete posts $old_posts = get_posts( $args ); foreach ( $old_posts as $post ) : wp_delete_post( $post->ID, true ); endforeach; } } ================================================ FILE: includes/admin/class-sp-admin-settings.php ================================================ 0 ) { foreach ( self::$errors as $error ) { echo '

    ' . esc_html( $error ) . '

    '; } } elseif ( sizeof( self::$overrides ) > 0 ) { foreach ( self::$overrides as $override ) { echo '

    ' . esc_html( $override ) . '

    '; } } elseif ( sizeof( self::$messages ) > 0 ) { foreach ( self::$messages as $message ) { echo '

    ' . esc_html( $message ) . '

    '; } } } /** * Settings page. * * Handles the display of the main sportspress settings page in admin. * * @access public * @return void */ public static function output() { global $current_section, $current_tab; do_action( 'sportspress_settings_start' ); wp_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 ); wp_localize_script( 'sportspress_settings', 'localized_strings', array( 'none' => esc_attr__( 'None', 'sportspress' ), ) ); // Include settings pages self::get_settings_pages(); // Get current tab/section $current_tab = empty( $_GET['tab'] ) ? 'modules' : sanitize_title( wp_unslash( $_GET['tab'] ) ); $current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( wp_unslash( $_REQUEST['section'] ) ); // Save settings if data has been posted if ( ! empty( $_POST ) ) { self::save(); } // Add any posted messages if ( ! empty( $_GET['sp_error'] ) ) { self::add_error( stripslashes( sanitize_text_field( wp_unslash( $_GET['sp_error'] ) ) ) ); } if ( ! empty( $_GET['sp_message'] ) ) { self::add_message( stripslashes( sanitize_text_field( wp_unslash( $_GET['sp_message'] ) ) ) ); } self::show_messages(); // Get tabs for the settings page $tabs = apply_filters( 'sportspress_settings_tabs_array', array() ); include 'views/html-admin-settings.php'; } /** * Get a setting from the settings API. * * @param mixed $option * @return string */ public static function get_option( $option_name, $default = '' ) { // Array value if ( strstr( $option_name, '[' ) ) { parse_str( html_entity_decode( $option_name ), $option_array ); // Option name is first key $option_name = current( array_keys( $option_array ) ); // Get value $option_values = get_option( $option_name, '' ); $key = key( $option_array[ $option_name ] ); if ( isset( $option_values[ $key ] ) ) { $option_value = $option_values[ $key ]; } else { $option_value = null; } // Single value } else { $option_value = get_option( $option_name, null ); } if ( is_array( $option_value ) ) { $option_value = array_map( 'stripslashes', $option_value ); } elseif ( ! is_null( $option_value ) ) { $option_value = stripslashes( $option_value ); } return $option_value === null ? $default : $option_value; } /** * Output admin fields. * * Loops though the sportspress options array and outputs each field. * * @access public * @param array $options Opens array to output */ public static function output_fields( $options ) { foreach ( $options as $value ) { if ( ! isset( $value['type'] ) ) { continue; } if ( ! isset( $value['id'] ) ) { $value['id'] = ''; } if ( ! isset( $value['title'] ) ) { $value['title'] = isset( $value['name'] ) ? $value['name'] : ''; } if ( ! isset( $value['class'] ) ) { $value['class'] = ''; } if ( ! isset( $value['css'] ) ) { $value['css'] = ''; } if ( ! isset( $value['default'] ) ) { $value['default'] = ''; } if ( ! isset( $value['desc'] ) ) { $value['desc'] = ''; } if ( ! isset( $value['desc_tip'] ) ) { $value['desc_tip'] = false; } if ( ! isset( $value['placeholder'] ) ) { $value['placeholder'] = ''; } // Custom attribute handling $custom_attributes = array(); if ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) { foreach ( $value['custom_attributes'] as $attribute => $attribute_value ) { $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"'; } } // Description handling if ( $value['desc_tip'] === true ) { $description = ''; $tip = $value['desc']; } elseif ( ! empty( $value['desc_tip'] ) ) { $description = $value['desc']; $tip = $value['desc_tip']; } elseif ( ! empty( $value['desc'] ) ) { $description = $value['desc']; $tip = ''; } else { $description = $tip = ''; } if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) { $description = '

    ' . wp_kses_post( $description ) . '

    '; } elseif ( $description && in_array( $value['type'], array( 'checkbox' ) ) ) { $description = wp_kses_post( $description ); } elseif ( $description && in_array( $value['type'], array( 'select' ) ) ) { $description = '

    ' . wp_kses_post( $description ) . '

    '; } elseif ( $description ) { $description = '' . wp_kses_post( $description ) . ''; } if ( $tip && in_array( $value['type'], array( 'checkbox' ) ) ) { $tip = '

    ' . $tip . '

    '; } elseif ( $tip ) { $tip = ''; } // Switch based on type switch ( $value['type'] ) { // Section Titles case 'title': echo '
    '; echo ''; if ( ! empty( $value['title'] ) ) { echo '

    ' . esc_html( $value['title'] ) . '

    '; } if ( ! empty( $value['desc'] ) ) { echo wp_kses_post( wpautop( wptexturize( $value['desc'] ) ) ); } echo '' . "\n\n"; if ( ! empty( $value['id'] ) ) { do_action( 'sportspress_settings_' . sanitize_title( $value['id'] ) ); } break; // Section Ends case 'sectionend': if ( ! empty( $value['id'] ) ) { do_action( 'sportspress_settings_' . sanitize_title( $value['id'] ) . '_end' ); } echo '
    '; if ( ! empty( $value['id'] ) ) { do_action( 'sportspress_settings_' . sanitize_title( $value['id'] ) . '_after' ); } echo '
    '; break; // Standard text inputs and subtypes like 'number' case 'text': case 'email': case 'number': case 'color': case 'password': $type = $value['type']; $class = ''; $option_value = self::get_option( $value['id'], $value['default'] ); if ( $value['type'] == 'color' ) { $type = 'text'; $value['class'] .= 'colorpick'; $description .= ''; } ?> />

      $val ) { ?>
    $value ) { update_option( $name, $value ); } return true; } } endif; ================================================ FILE: includes/admin/class-sp-admin-setup-wizard.php ================================================ steps = array( 'introduction' => array( 'name' => esc_attr__( 'Introduction', 'sportspress' ), 'view' => array( $this, 'sp_setup_introduction' ), 'handler' => '', ), 'basics' => array( 'name' => esc_attr__( 'Basic Setup', 'sportspress' ), 'view' => array( $this, 'sp_setup_basics' ), 'handler' => array( $this, 'sp_setup_basics_save' ), ), 'teams' => array( 'name' => esc_attr__( 'Teams', 'sportspress' ), 'view' => array( $this, 'sp_setup_teams' ), 'handler' => array( $this, 'sp_setup_teams_save' ), ), 'players_staff' => array( 'name' => esc_attr__( 'Players', 'sportspress' ) . ' & ' . esc_attr__( 'Staff', 'sportspress' ), 'view' => array( $this, 'sp_setup_players_staff' ), 'handler' => array( $this, 'sp_setup_players_staff_save' ), ), 'venue' => array( 'name' => esc_attr__( 'Venue', 'sportspress' ), 'view' => array( $this, 'sp_setup_venue' ), 'handler' => array( $this, 'sp_setup_venue_save' ), ), 'pages' => array( 'name' => esc_attr__( 'Pages', 'sportspress' ), 'view' => array( $this, 'sp_setup_pages' ), 'handler' => array( $this, 'sp_setup_pages_save' ), ), 'next_steps' => array( 'name' => esc_attr__( 'Ready!', 'sportspress' ), 'view' => array( $this, 'sp_setup_ready' ), 'handler' => '', ), ); $this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) ); $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_style( 'jquery-chosen', SP()->plugin_url() . '/assets/css/chosen.css', array(), '1.1.0' ); wp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION ); wp_enqueue_style( 'sportspress-setup', SP()->plugin_url() . '/assets/css/setup.css', array( 'dashicons', 'install' ), SP_VERSION ); wp_register_script( 'chosen', SP()->plugin_url() . '/assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true ); wp_register_script( 'jquery-tiptip', SP()->plugin_url() . '/assets/js/jquery.tipTip.min.js', array( 'jquery' ), '1.3', true ); wp_register_script( 'sportspress-setup', SP()->plugin_url() . '/assets/js/admin/sportspress-setup.js', array( 'jquery', 'chosen', 'jquery-tiptip' ), SP_VERSION, true ); do_action( 'sp_setup_geocoder_scripts' ); $strings = apply_filters( 'sportspress_localized_strings', array( 'none' => esc_attr__( 'None', 'sportspress' ), 'remove_text' => esc_attr__( '— Remove —', 'sportspress' ), ) ); // Localize scripts wp_localize_script( 'sportspress-setup', 'localized_strings', $strings ); if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { call_user_func( $this->steps[ $this->step ]['handler'] ); } ob_start(); $this->setup_wizard_header(); $this->setup_wizard_steps(); $this->setup_wizard_content(); $this->setup_wizard_footer(); exit; } public function get_next_step_link() { $keys = array_keys( $this->steps ); return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ) ) + 1 ] ); } /** * Setup Wizard Header. */ public function setup_wizard_header() { ?> > <?php esc_html_e( 'SportsPress', 'sportspress' ); ?> › <?php echo esc_html( $this->steps[ $this->step ]['name'] ); ?>

    ' ) ); ?>

    step ) : ?>

    steps; array_shift( $ouput_steps ); ?>
      $step ) : ?>
    '; call_user_func( $this->steps[ $this->step ]['view'] ); echo ''; } /** * Introduction Step. */ public function sp_setup_introduction() { ?>

    It’s completely optional and shouldn’t take longer than five minutes.', 'sportspress' ) ); ?>

    get_next_step_link() ) ); exit; } /** * Team Setup. */ public function sp_setup_teams() { $class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' ); ?>

    0, 'fields' => 'ids', ) ); } wp_insert_post( $post ); // Add home team $post['post_title'] = sanitize_text_field( wp_unslash( $_POST['home_team'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput wp_insert_post( $post ); wp_redirect( esc_url_raw( $this->get_next_step_link() ) ); exit; } /** * Players & Staff Setup. */ public function sp_setup_players_staff() { $positions = (array) get_terms( 'sp_position', array( 'hide_empty' => 0, 'orderby' => 'slug', 'fields' => 'names', ) ) ?>

    • value="">

    1, 'post_type' => 'sp_team', 'fields' => 'ids', ) ); $team = reset( $teams ); // Add players $post['post_type'] = 'sp_player'; $post['post_status'] = 'publish'; $post['tax_input'] = array(); $taxonomies = array( 'sp_league', 'sp_season' ); foreach ( $taxonomies as $taxonomy ) { $post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids', ) ); } if ( is_array( $_POST['players'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput foreach ( $_POST['players'] as $i => $player ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput if ( empty( $player['name'] ) ) { continue; } $post['post_title'] = $player['name']; $id = wp_insert_post( $post ); // Add squad number $number = sanitize_text_field( sp_array_value( $player, 'number' ) ); update_post_meta( $id, 'sp_number', $number ); // Add position wp_set_object_terms( $id, sp_array_value( $player, 'position', esc_attr__( 'Position', 'sportspress' ) ), 'sp_position', false ); // Add team if ( $team ) { update_post_meta( $id, 'sp_team', $team ); update_post_meta( $id, 'sp_current_team', $team ); } } } // Add staff if ( ! empty( $_POST['staff'] ) ) { $post['post_type'] = 'sp_staff'; $post['post_title'] = sanitize_text_field( wp_unslash( $_POST['staff'] ) ); $id = wp_insert_post( $post ); // Add role wp_set_object_terms( $id, sp_array_value( $_POST, 'role', 'Coach' ), 'sp_role', false ); // Add team if ( $team ) { update_post_meta( $id, 'sp_team', $team ); update_post_meta( $id, 'sp_current_team', $team ); } } wp_redirect( esc_url_raw( $this->get_next_step_link() ) ); exit; } /** * Venue Step. */ public function sp_setup_venue() { do_action( 'sp_setup_venue_geocoder_scripts' ); ?>

    1, 'post_type' => 'sp_team', 'fields' => 'ids', ) ); $team = reset( $teams ); // Insert venue $venue = sanitize_text_field( wp_unslash( $_POST['venue'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput if ( ! is_string( $venue ) || empty( $venue ) ) { $venue = sp_array_value( $_POST, 'address', esc_attr__( 'Venue', 'sportspress' ) ); } $inserted = wp_insert_term( $venue, 'sp_venue' ); // Add address and coordinates to venue if ( ! is_wp_error( $inserted ) ) { $t_id = sp_array_value( $inserted, 'term_id', 1 ); if ( $team ) { wp_set_object_terms( $team, $t_id, 'sp_venue', true ); } $meta = array( 'sp_address' => sanitize_text_field( sp_array_value( $_POST, 'address' ) ), 'sp_latitude' => sanitize_text_field( sp_array_value( $_POST, 'latitude' ) ), 'sp_longitude' => sanitize_text_field( sp_array_value( $_POST, 'longitude' ) ), ); update_option( "taxonomy_$t_id", $meta ); } wp_redirect( esc_url_raw( $this->get_next_step_link() ) ); exit; } /** * Pages Step. */ public function sp_setup_pages() { $pages = apply_filters( 'sportspress_setup_pages', array( 'sp_calendar' => esc_attr__( 'Organize and publish calendars using different layouts.', 'sportspress' ), 'sp_table' => esc_attr__( 'Create automated league tables to keep track of team standings.', 'sportspress' ), 'sp_list' => esc_attr__( 'Create team rosters, player galleries, and ranking charts.', 'sportspress' ), ) ); ?>

    ', '' ); ?>

    $description ) { ?>
    labels->singular_name ); ?>

    ', '', '', '' ); ?>

    esc_attr__( 'Organize and publish calendars using different layouts.', 'sportspress' ), 'sp_table' => esc_attr__( 'Create automated league tables to keep track of team standings.', 'sportspress' ), 'sp_list' => esc_attr__( 'Create team rosters, player galleries, and ranking charts.', 'sportspress' ), ) ); // Initialize post $post = array( 'post_status' => 'publish' ); $sample_content = _x( 'This is an example %1$s. As a new SportsPress user, you should go to your dashboard to delete this %1$s and create new %2$s for your content. Have fun!', 'example', 'sportspress' ); // Insert posts foreach ( $pages as $post_type => $description ) { $obj = get_post_type_object( $post_type ); if ( ! is_object( $obj ) ) { continue; } // Skip if post exists $posts = get_posts( array( 'posts_per_page' => 1, 'post_type' => $post_type, ) ); if ( $posts ) { continue; } // Add post args $post['post_title'] = $obj->labels->singular_name; $post['post_type'] = $post_type; $post['post_content'] = sprintf( $sample_content, $obj->labels->singular_name, $obj->labels->name, add_query_arg( 'post_type', $post_type, admin_url( 'edit.php' ) ) ); // Insert post $id = wp_insert_post( $post ); // Flag as sample update_post_meta( $id, '_sp_sample', 1 ); } wp_redirect( esc_url_raw( $this->get_next_step_link() ) ); exit; } /** * Actions on the final step. */ private function sp_setup_ready_actions() { delete_option( '_sp_needs_welcome' ); update_option( 'sportspress_installed', 1 ); update_option( 'sportspress_completed_setup', 1 ); delete_transient( '_sp_activation_redirect' ); // Check if first event already exists $events = get_posts( array( 'post_type' => 'sp_event', 'posts_per_page' => 1, 'post_status' => 'draft', 'meta_query' => array( array( 'key' => '_sp_first', 'value' => 1, ), ), ) ); if ( $events ) { $event = reset( $events ); return $event->ID; } // Get teams $team_post_type = 'sp_team'; if ( 'player' === get_option( 'sportspress_mode', 'team' ) ) { $team_post_type = 'sp_player'; } $teams = get_posts( array( 'posts_per_page' => 2, 'post_type' => $team_post_type, ) ); // Get players $players = (array) get_posts( array( 'posts_per_page' => 3, 'post_type' => 'sp_player', 'fields' => 'ids', ) ); // Get staff $staff = (array) get_posts( array( 'posts_per_page' => 1, 'post_type' => 'sp_staff', 'fields' => 'ids', ) ); // Initialize post $post['post_type'] = 'sp_event'; $post['post_status'] = 'draft'; $post['tax_input'] = array(); // Add taxonomies $taxonomies = array( 'sp_league', 'sp_season', 'sp_venue' ); foreach ( $taxonomies as $taxonomy ) { $post['tax_input'][ $taxonomy ] = get_terms( $taxonomy, array( 'hide_empty' => 0, 'fields' => 'ids', 'number' => 1, ) ); } // Add post title if ( is_array( $teams ) && sizeof( $teams ) ) { $team_names = array(); foreach ( $teams as $team ) { if ( ! $team ) { continue; } $team_names[] = $team->post_title; } $post['post_title'] = implode( ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ', $team_names ); } else { $post['post_title'] = esc_attr__( 'Event', 'sportspress' ); } // Insert event $id = wp_insert_post( $post ); // Add teams if ( is_array( $teams ) && sizeof( $teams ) ) { foreach ( $teams as $team ) { if ( ! $team ) { continue; } add_post_meta( $id, 'sp_team', $team->ID ); } } // Add players add_post_meta( $id, 'sp_player', 0 ); foreach ( $players as $player ) { if ( ! $player ) { continue; } add_post_meta( $id, 'sp_player', $player ); } add_post_meta( $id, 'sp_player', 0 ); update_post_meta( $id, '_sp_first', 1 ); return $id; } /** * Final step. */ public function sp_setup_ready() { $id = $this->sp_setup_ready_actions(); shuffle( $this->tweets ); $steps = apply_filters( 'sportspress_setup_wizard_next_steps', array( 'first' => array( 'label' => esc_attr__( 'Next Steps', 'sportspress' ), 'content' => '' . esc_attr__( 'Schedule your first event!', 'sportspress' ) . '', ), 'last' => array( 'label' => esc_attr__( 'Upgrade to Pro', 'sportspress' ), 'content' => esc_attr__( 'Get SportsPress Pro to get access to all modules. You can upgrade any time without losing any of your data.', 'sportspress' ) . ' ' . esc_attr__( 'Learn more', 'sportspress' ) . '', ), ) ); ?>

    $step ) { ?>

    array(), 'racket-sports' => array(), 'water-sports' => array(), 'target-sports' => array(), 'esports' => array(), 'other' => array(), ); foreach ( self::$options as $slug => $options ) { $dir = scandir( SP()->plugin_path() . '/presets/' . $slug ); $files = array(); if ( $dir ) { foreach ( $dir as $key => $value ) { if ( substr( $value, 0, 1 ) !== '.' && strpos( $value, '.' ) !== false ) { $files[] = $value; } } } foreach ( $files as $file ) { $json_data = file_get_contents( SP()->plugin_path() . '/presets/' . $slug . '/' . $file ); $data = json_decode( $json_data, true ); if ( ! is_array( $data ) ) { continue; } $id = preg_replace( '/\\.[^.\\s]{3,4}$/', '', $file ); $presets[ $id ] = $data; $name = array_key_exists( 'name', $data ) ? esc_attr__( $data['name'], 'sportspress' ) : $id; // Conditionally append filename in parentheses for clarity if ( false === strpos( str_replace( ' ', '', strtolower( $data['name'] ) ), str_replace( '-', '', $id ) ) ) { if ( 4 < strlen( $id ) ) { $name .= ' (' . ucfirst( $id ) . ')'; } else { $name .= ' (' . strtoupper( $id ) . ')'; } } self::$options[ $slug ][ $id ] = $name; } asort( self::$options[ $slug ] ); } self::$presets = apply_filters( 'sportspress_get_presets', $presets ); } return self::$presets; } public static function get_preset( $id ) { $json_data = @file_get_contents( SP()->plugin_path() . '/presets/' . $id . '.json', true ); if ( $json_data ) { return json_decode( $json_data, true ); } $dir = scandir( SP()->plugin_path() . '/presets' ); if ( $dir ) { foreach ( $dir as $key => $value ) { if ( substr( $value, 0, 1 ) !== '.' && strpos( $value, '.' ) === false ) { $json_data = @file_get_contents( SP()->plugin_path() . '/presets/' . $value . '/' . $id . '.json', true ); if ( $json_data ) { return json_decode( $json_data, true ); } } } } } public static function get_preset_options() { $presets = self::get_presets(); return self::$options; } /** * Apply preset * * @access public * @return void */ public static function apply_preset( $id ) { $preset = self::get_preset( $id ); // Positions $positions = sp_array_value( $preset, 'positions', array() ); $i = 0; foreach ( $positions as $position ) { if ( is_string( $position ) ) { $name = $position; $sections = array( 0, 1 ); } else { $name = sp_array_value( $position, 'name', esc_attr__( 'Position', 'sportspress' ) ); $sections = sp_array_value( $position, 'sections', array( 0, 1 ) ); } $term = wp_insert_term( $name, 'sp_position' ); if ( is_wp_error( $term ) ) { continue; } $t_id = $term['term_id']; $term_meta = (array) get_option( "taxonomy_$t_id" ); $term_meta['sp_sections'] = $sections; update_option( "taxonomy_$t_id", $term_meta ); update_term_meta( $t_id, 'sp_order', $i + 1 ); $i++; } // Outcomes $post_type = 'sp_outcome'; $outcomes = sp_array_value( $preset, 'outcomes', array() ); self::delete_preset_posts( $post_type ); foreach ( $outcomes as $index => $outcome ) { $post = self::get_post_array( $outcome, $post_type ); if ( empty( $post ) ) { continue; } $id = self::insert_preset_post( $post, $index ); update_post_meta( $id, 'sp_abbreviation', sp_array_value( $outcome, 'abbreviation', null ) ); update_post_meta( $id, 'sp_condition', sp_array_value( $outcome, 'condition', null ) ); } // Results $post_type = 'sp_result'; $results = sp_array_value( $preset, 'results', array() ); self::delete_preset_posts( $post_type ); $primary_result = 0; foreach ( $results as $index => $result ) { $post = self::get_post_array( $result, $post_type ); if ( empty( $post ) ) { continue; } $id = self::insert_preset_post( $post, $index ); if ( is_array( $result ) && array_key_exists( 'primary', $result ) ) { $primary_result = $post['post_name']; } update_post_meta( $id, 'sp_equation', sp_array_value( $result, 'equation', null ) ); } // Make sure statistics, metrics and specs have greater menu order than performance $i = 0; // Performance $post_type = 'sp_performance'; $performances = sp_array_value( $preset, 'performance', array() ); self::delete_preset_posts( $post_type ); foreach ( $performances as $index => $performance ) { $post = self::get_post_array( $performance, $post_type ); if ( empty( $post ) ) { continue; } $id = self::insert_preset_post( $post, $index ); if ( isset( $performance['position'] ) ) { wp_set_object_terms( $id, $performance['position'], 'sp_position', false ); } update_post_meta( $id, 'sp_singular', sp_array_value( $performance, 'singular', null ) ); update_post_meta( $id, 'sp_icon', sp_array_value( $performance, 'icon', null ) ); update_post_meta( $id, 'sp_color', sp_array_value( $performance, 'color', null ) ); update_post_meta( $id, 'sp_section', sp_array_value( $performance, 'section', -1 ) ); update_post_meta( $id, 'sp_format', sp_array_value( $performance, 'format', 'number' ) ); update_post_meta( $id, 'sp_equation', sp_array_value( $performance, 'equation', null ) ); update_post_meta( $id, 'sp_precision', sp_array_value( $performance, 'precision', 0 ) ); update_post_meta( $id, 'sp_timed', sp_array_value( $performance, 'timed', null ) ); $i ++; } // Columns $post_type = 'sp_column'; $columns = sp_array_value( $preset, 'columns', array() ); self::delete_preset_posts( $post_type ); foreach ( $columns as $index => $column ) { $post = self::get_post_array( $column, $post_type ); if ( empty( $post ) ) { continue; } $id = self::insert_preset_post( $post, $index ); update_post_meta( $id, 'sp_equation', sp_array_value( $column, 'equation', null ) ); update_post_meta( $id, 'sp_precision', sp_array_value( $column, 'precision', 0 ) ); update_post_meta( $id, 'sp_priority', sp_array_value( $column, 'priority', null ) ); update_post_meta( $id, 'sp_order', sp_array_value( $column, 'order', 'DESC' ) ); } // Metrics $post_type = 'sp_metric'; $metrics = sp_array_value( $preset, 'metrics', array() ); self::delete_preset_posts( $post_type ); foreach ( $metrics as $index => $metric ) { $post = self::get_post_array( $metric, $post_type ); if ( empty( $post ) ) { continue; } $id = self::insert_preset_post( $post, $i + $index ); $i ++; } // Event Specs $post_type = 'sp_spec'; $specs = sp_array_value( $preset, 'specs', array() ); self::delete_preset_posts( $post_type ); foreach ( $specs as $index => $spec ) { $post = self::get_post_array( $spec, $post_type ); if ( empty( $post ) ) { continue; } $id = self::insert_preset_post( $post, $i + $index ); $i ++; } // Statistics $post_type = 'sp_statistic'; $statistics = sp_array_value( $preset, 'statistics', array() ); self::delete_preset_posts( $post_type ); foreach ( $statistics as $index => $statistic ) { $post = self::get_post_array( $statistic, $post_type ); if ( empty( $post ) ) { continue; } $id = self::insert_preset_post( $post, $i + $index ); update_post_meta( $id, 'sp_equation', sp_array_value( $statistic, 'equation', null ) ); update_post_meta( $id, 'sp_precision', sp_array_value( $statistic, 'precision', 0 ) ); update_post_meta( $id, 'sp_type', sp_array_value( $statistic, 'type', 'total' ) ); } // Options $options = sp_array_value( $preset, 'options', array() ); foreach ( $options as $option => $value ) { update_option( 'sportspress_' . $option, $value ); } // Primary Result update_option( 'sportspress_primary_result', $primary_result ); } public static function delete_preset_posts( $post_type = null ) { $args = array( 'post_type' => $post_type, 'posts_per_page' => -1, 'post_status' => array( 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash' ), 'meta_query' => array( array( 'key' => '_sp_preset', 'value' => 1, ), ), ); // Delete posts $old_posts = get_posts( $args ); foreach ( $old_posts as $post ) : wp_delete_post( $post->ID, true ); endforeach; } public static function get_post_array( $post = array(), $post_type = null ) { $post_array = array(); if ( is_string( $post ) ) { $post_array['post_title'] = $post; $post_array['post_name'] = sp_get_eos_safe_slug( $post_array['post_title'] ); } elseif ( is_array( $post ) ) { if ( ! array_key_exists( 'name', $post ) ) { $post_array = array(); } $post_array['post_title'] = $post['name']; $post_array['post_name'] = sp_array_value( $post, 'id', sp_get_eos_safe_slug( $post_array['post_title'] ) ); } // Return empty array if post with same slug already exists if ( get_page_by_path( $post_array['post_name'], OBJECT, $post_type ) ) { return array(); } // Set post type $post_array['post_type'] = $post_type; // Add post excerpt if ( is_array( $post ) && array_key_exists( 'description', $post ) ) { $post_array['post_excerpt'] = $post['description']; } return $post_array; } public static function insert_preset_post( $post, $index = 0 ) { // Increment menu order by 10 and publish post $post['menu_order'] = $index * 10 + 10; $post['post_status'] = 'publish'; $id = wp_insert_post( $post ); // Flag as preset update_post_meta( $id, '_sp_preset', 1 ); return $id; } /** * Sport category names * * @return null */ public static function sport_category_names() { return apply_filters( 'sportspress_sport_categories', array( 'team-sports' => esc_attr__( 'Team Sports', 'sportspress' ), 'racket-sports' => esc_attr__( 'Racket Sports', 'sportspress' ), 'water-sports' => esc_attr__( 'Water Sports', 'sportspress' ), 'target-sports' => esc_attr__( 'Target Sports', 'sportspress' ), 'esports' => esc_attr__( 'Esports', 'sportspress' ), 'other' => esc_attr__( 'Other', 'sportspress' ), ) ); } /** * Sport preset names for localization * * @return null */ public static function sport_preset_names() { __( 'Baseball', 'sportspress' ); __( 'Basketball', 'sportspress' ); __( 'Cricket', 'sportspress' ); __( 'Darts', 'sportspress' ); __( 'Floorball', 'sportspress' ); __( 'Association Football', 'sportspress' ); __( 'American Football', 'sportspress' ); __( 'Australian Rules Football', 'sportspress' ); __( 'Handball', 'sportspress' ); __( 'Ice Hockey', 'sportspress' ); __( 'Lacrosse', 'sportspress' ); __( 'Netball', 'sportspress' ); __( 'Rugby League', 'sportspress' ); __( 'Rugby Union', 'sportspress' ); __( 'Snooker', 'sportspress' ); __( 'Softball', 'sportspress' ); __( 'Squash', 'sportspress' ); __( 'Table Tennis', 'sportspress' ); __( 'Tennis', 'sportspress' ); __( 'Volleyball', 'sportspress' ); __( 'Water Polo', 'sportspress' ); __( 'Dota 2', 'sportspress' ); __( 'League of Legends', 'sportspress' ); __( 'Counter-Strike: Global Offensive', 'sportspress' ); } } ================================================ FILE: includes/admin/class-sp-admin-status.php ================================================ 'Header Name') */ public function get_file_version( $file ) { // We don't need to write to the file, so just open for reading. $fp = fopen( $file, 'r' ); // Pull only the first 8kiB of the file in. $file_data = fread( $fp, 8192 ); // PHP will close file handle, but we are good citizens. fclose( $fp ); // Make sure we catch CR-only line endings. $file_data = str_replace( "\r", "\n", $file_data ); $version = ''; if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( '@version', '/' ) . '(.*)$/mi', $file_data, $match ) && $match[1] ) { $version = _cleanup_header_comment( $match[1] ); } return $version; } /** * Scan the template files * * @access public * @param string $template_path * @return array */ public function scan_template_files( $template_path ) { $files = scandir( $template_path ); $result = array(); if ( $files ) { foreach ( $files as $key => $value ) { if ( ! in_array( $value, array( '.', '..' ) ) ) { if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) { $sub_files = $this->scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value ); foreach ( $sub_files as $sub_file ) { $result[] = $value . DIRECTORY_SEPARATOR . $sub_file; } } else { $result[] = $value; } } } } return $result; } } endif; return new SP_Admin_Status(); ================================================ FILE: includes/admin/class-sp-admin-taxonomies.php ================================================ term_id; ?> 'id', 'order' => 'DESC', 'hide_empty' => false, 'number' => 1, ); // Get latitude and longitude from the last added venue $terms = get_terms( 'sp_venue', $args ); if ( $terms && array_key_exists( 0, $terms ) && is_object( reset( $terms ) ) ) { $term = reset( $terms ); $t_id = $term->term_id; $term_meta = get_option( "taxonomy_$t_id" ); $latitude = sp_array_value( $term_meta, 'sp_latitude', '-37.8165647' ); $longitude = sp_array_value( $term_meta, 'sp_longitude', '144.9475055' ); $address = sp_array_value( $term_meta, 'sp_address', '' ); }else{ // Sanitize latitude and longitude, fallback to default. $latitude = '-37.8165647'; $longitude = '144.9475055'; $address = ''; } ?>

    term_id; $term_meta = get_option( "taxonomy_$t_id" ); $latitude = is_numeric( $term_meta['sp_latitude'] ) ? $term_meta['sp_latitude'] : ''; $longitude = is_numeric( $term_meta['sp_longitude'] ) ? $term_meta['sp_longitude'] : ''; $address = $term_meta['sp_address'] ? $term_meta['sp_address'] : ''; ?>

    term_id; $sections = sp_get_term_sections( $t_id ); ?> esc_attr__( 'Offense', 'sportspress' ), 1 => esc_attr__( 'Defense', 'sportspress' ), ) ); $sections = sp_get_term_sections( $id ); $section_names = array(); if ( is_array( $sections ) ) { foreach ( $sections as $section ) { if ( array_key_exists( $section, $options ) ) { $section_names[] = $options[ $section ]; } } } $columns .= implode( ', ', $section_names ); } elseif ( $column == 'sp_order' ) { $columns = (int) get_term_meta( $id, 'sp_order', true ); } return $columns; } } new SP_Admin_Taxonomies(); ================================================ FILE: includes/admin/class-sp-admin-welcome.php ================================================ plugin = 'sportspress/sportspress.php'; add_action( 'admin_menu', array( $this, 'admin_menus' ) ); add_action( 'admin_head', array( $this, 'admin_head' ) ); add_action( 'admin_init', array( $this, 'welcome' ) ); } /** * Add admin menus/screens * * @access public * @return void */ public function admin_menus() { if ( empty( $_GET['page'] ) ) { return; } $welcome_page_name = esc_attr__( 'About SportsPress', 'sportspress' ); $welcome_page_title = esc_attr__( 'Welcome to SportsPress', 'sportspress' ); switch ( $_GET['page'] ) { case 'sp-about': $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-about', array( $this, 'about_screen' ) ); add_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) ); break; case 'sp-credits': $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-credits', array( $this, 'credits_screen' ) ); add_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) ); break; case 'sp-translators': $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-translators', array( $this, 'translators_screen' ) ); add_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) ); break; } } /** * admin_css function. * * @access public * @return void */ public function admin_css() { wp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ), array(), SP_VERSION ); } /** * Add styles just for this page, and remove dashboard page links. * * @access public * @return void */ public function admin_head() { remove_submenu_page( 'index.php', 'sp-about' ); remove_submenu_page( 'index.php', 'sp-credits' ); remove_submenu_page( 'index.php', 'sp-translators' ); } /** * Into text/links shown on all about pages. * * @access private * @return void */ private function intro() { // Flush after upgrades if ( ! empty( $_GET['sp-updated'] ) || ! empty( $_GET['sp-installed'] ) ) { flush_rewrite_rules(); } // Get major version number $version = explode( '.', SP()->version, 3 ); unset( $version[2] ); $display_version = implode( '.', $version ); ?>

    ' ) ); ?>

    version ) ); ?>

    intro(); ?>

    New Features 🌟

    Screenshot

    Conditional Equations

    Use the newly introduced conditional operators >, <, , , , and to calculate the relationship between variables, then insert that calculation into more complex equations. Visit the Configure page to edit variables and equations.

    Screenshot

    Event Specs

    Measure and display additional details per event using the new Event Specs variables. They are customizable and can be useful for keeping track of information like player of the match, attendance, and venue weather.

    Screenshot

    Next Team Column

    Provide a quick overview of who each team is playing next using the new Next Team preset for league table columns. This will automatically display the next team's name or logo that links to the next match for each team in the table.


    SportsPress Pro Updates 🏆

    Results Matrix

    Results Matrix

    Display matches between home and away team in a grid. Create or select an existing calendar and select the Matrix layout to convert the calendar to an interactive results matrix!

    Midseason Transfers

    Midseason Transfers

    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.

    Vertical Timelines

    Vertical Timelines

    Display a match commentary style play-by-play timeline within events. Upgrade to SportsPress Pro to get access to Timelines and other pro features.


    Player Data Improvements

    Player Assignments

    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 player lists.

    Current Team Column

    The Team column in player lists will now display only the current team that player belongs to, determined by the Current Team setting of each player.

    Squad Number Zero

    It's now possible to import players with the squad number 0 (zero) or any other value that would previously be interpreted as empty.


    Other Notes

    Countdown Images

    A new option has been added to the Countdown widget, allowing you to display a featured image from the next event.

    Relative Date in Shortcodes

    You'll now be able to select a relative date range when inserting calendar-related shortcodes from the visual editor.

    Short Names

    Teams have been given a Short Name setting in addition to the existing Abbreviation for added customizability.

    intro(); ?>

    Contribute to SportsPress.', 'sportspress' ) ), 'https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md' ); ?>

    contributors() ); ?>
    intro(); ?>

    Translate SportsPress.', 'sportspress' ) ), 'https://translate.wordpress.org/projects/wp-plugins/sportspress' ); ?>

    get_contributors(); if ( empty( $contributors ) ) { return ''; } $contributor_list = ''; return $contributor_list; } /** * Retrieve list of contributors from GitHub. * * @access public * @return mixed */ public function get_contributors() { $contributors = get_transient( 'sportspress_contributors' ); if ( false !== $contributors ) { return $contributors; } $response = wp_remote_get( 'https://api.github.com/repos/ThemeBoy/SportsPress/contributors', array( 'sslverify' => false ) ); if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { return array(); } $contributors = json_decode( wp_remote_retrieve_body( $response ) ); if ( ! is_array( $contributors ) ) { return array(); } set_transient( 'sportspress_contributors', $contributors, HOUR_IN_SECONDS ); return $contributors; } /** * Sends user to the welcome page on first activation */ public function welcome() { // Bail if no activation redirect transient is set if ( ! get_transient( '_sp_activation_redirect' ) ) { return; } // Delete the redirect transient delete_transient( '_sp_activation_redirect' ); // Bail if we are waiting to install or update via the interface update/install links if ( get_option( '_sp_needs_update' ) == 1 || get_option( '_sp_needs_pages' ) == 1 ) { return; } // Bail if activating from network, or bulk, or within an iFrame if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) ) { return; } if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == sanitize_key( $_GET['action'] ) ) && ( isset( $_GET['plugin'] ) && strstr( $_GET['plugin'], 'sportspress.php' ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput return; } if ( ! get_option( 'sportspress_completed_setup' ) ) { wp_redirect( admin_url( 'admin.php?page=sp-setup' ) ); exit; } wp_redirect( admin_url( 'index.php?page=sp-about' ) ); exit; } } new SP_Admin_Welcome(); ================================================ FILE: includes/admin/class-sp-admin.php ================================================ id ) { case 'dashboard': include 'class-sp-admin-dashboard.php'; break; } } /** * Prevent any user who cannot 'edit_posts' (subscribers, fans etc) from accessing admin */ public function prevent_admin_access() { $prevent_access = false; if ( '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 $prevent_access = true; } $prevent_access = apply_filters( 'sportspress_prevent_admin_access', $prevent_access ); if ( $prevent_access ) { wp_safe_redirect( get_permalink( sp_get_page_id( 'myaccount' ) ) ); exit; } } /** * Add action link after post list title */ public function action_links() { global $pagenow, $typenow; if ( in_array( $typenow, sp_importable_post_types() ) ) { if ( 'sp_event' === $typenow ) { if ( 'edit.php' === $pagenow ) { ?> import_page = 'sp_event_csv'; $this->import_label = esc_attr__( 'Import Events', 'sportspress' ); $this->columns = array( 'post_date' => esc_attr__( 'Date', 'sportspress' ), 'post_time' => esc_attr__( 'Time', 'sportspress' ), 'sp_venue' => esc_attr__( 'Venue', 'sportspress' ), 'sp_team' => esc_attr__( 'Teams', 'sportspress' ), 'sp_results' => esc_attr__( 'Results', 'sportspress' ), 'sp_outcome' => esc_attr__( 'Outcome', 'sportspress' ), 'sp_player' => esc_attr__( 'Players', 'sportspress' ), ); $performance_labels = sp_get_var_labels( 'sp_performance' ); if ( $performance_labels && is_array( $performance_labels ) && sizeof( $performance_labels ) ) { $this->columns = array_merge( $this->columns, $performance_labels ); } } /** * import function. * * @access public * @param array $array * @param array $columns * @return void */ function import( $array = array(), $columns = array( 'post_title' ) ) { $this->imported = $this->skipped = 0; if ( ! is_array( $array ) || ! sizeof( $array ) ) : $this->footer(); die(); endif; $rows = array_chunk( $array, sizeof( $columns ) ); // Get event format, league, and season from post vars $event_format = ( empty( $_POST['sp_format'] ) ? false : sanitize_key( $_POST['sp_format'] ) ); $league = ( sp_array_value( $_POST, 'sp_league', '-1' ) == '-1' ? false : sanitize_key( $_POST['sp_league'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput $season = ( sp_array_value( $_POST, 'sp_season', '-1' ) == '-1' ? false : sanitize_key( $_POST['sp_season'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput $date_format = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : sanitize_text_field( wp_unslash( $_POST['sp_date_format'] ) ) ); // Get labels from result and performance post types $result_labels = sp_get_var_labels( 'sp_result' ); $performance_labels = sp_get_var_labels( 'sp_performance' ); foreach ( $rows as $row ) : $row = array_filter( $row ); if ( empty( $row ) ) { continue; } $meta = array(); foreach ( $columns as $index => $key ) : $meta[ $key ] = sp_array_value( $row, $index ); endforeach; // Slice array into event, team, and player $event = array_slice( $row, 0, 3 ); $team = array_slice( $row, 3, 3 ); $player = array_slice( $row, 6 ); // Get event details $event = array( sp_array_value( $meta, 'post_date' ), sp_array_value( $meta, 'post_time' ), sp_array_value( $meta, 'sp_venue' ), ); unset( $meta['post_date'] ); unset( $meta['post_time'] ); unset( $meta['sp_venue'] ); // Get team results $team = array( sp_array_value( $meta, 'sp_team' ), sp_array_value( $meta, 'sp_results' ), sp_array_value( $meta, 'sp_outcome' ), ); unset( $meta['sp_team'] ); unset( $meta['sp_results'] ); unset( $meta['sp_outcome'] ); // Get player performance $player = array( sp_array_value( $meta, 'sp_player' ), ); unset( $meta['sp_player'] ); foreach ( $performance_labels as $key => $label ) : // Get performance object. $perf_column = get_page_by_path( $key, OBJECT, 'sp_performance' ); // Check if it has time format and convert it to seconds. if ( is_object( $perf_column ) && 'time' == get_post_meta( $perf_column->ID, 'sp_format', true ) ) { $player[] = sp_value_time( sp_array_value( $meta, $key, '0' ) ); }else{ $player[] = sp_array_value( $meta, $key, '' ); } endforeach; // Add new event if date is given if ( sizeof( $event ) > 0 && ! empty( $event[0] ) ) : // Add player performance to last event if available if ( isset( $id ) && isset( $players ) && sizeof( $players ) > 0 ) : update_post_meta( $id, 'sp_players', $players ); endif; // List event columns list( $date, $time, $venue ) = $event; // Format date $date = str_replace( '/', '-', trim( $date ) ); $date_array = explode( '-', $date ); switch ( $date_format ) : case 'dd/mm/yyyy': $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); break; case 'mm/dd/yyyy': $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); break; default: $date = substr( str_pad( sp_array_value( $date_array, 0, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 2, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); endswitch; // Add time to date if given if ( ! empty( $time ) ) : $date .= ' ' . trim( $time ); endif; // Define post type args $args = array( 'post_type' => 'sp_event', 'post_status' => 'publish', 'post_date' => $date, 'post_title' => esc_attr__( 'Event', 'sportspress' ), ); // Insert event $id = wp_insert_post( $args ); // Initialize performance array $players = array(); // Flag as import update_post_meta( $id, '_sp_import', 1 ); // Update event format if ( $event_format ) : update_post_meta( $id, 'sp_format', $event_format ); endif; // Update league if ( $league ) : wp_set_object_terms( $id, $league, 'sp_league', false ); endif; // Update season if ( $season ) : wp_set_object_terms( $id, $season, 'sp_season', false ); endif; // Update venue wp_set_object_terms( $id, $venue, 'sp_venue', false ); // Increment $this->imported ++; endif; // Add new team if team name is given if ( sizeof( $team ) > 0 && ! empty( $team[0] ) ) : // List team columns list( $team_name, $result, $outcome ) = $team; // Find out if team exists $team_object = sp_get_post_by_title( stripslashes( $team_name ), 'sp_team' ); // Get or insert team if ( $team_object ) : // Make sure team is published if ( $team_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $team_object->ID, 'post_status' => 'publish', ) ); endif; // Get team ID $team_id = $team_object->ID; else : // Insert team $team_id = wp_insert_post( array( 'post_type' => 'sp_team', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $team_name ), ) ); // Flag as import update_post_meta( $team_id, '_sp_import', 1 ); endif; // Update league if ( $league ) : wp_set_object_terms( $team_id, $league, 'sp_league', true ); endif; // Update season if ( $season ) : wp_set_object_terms( $team_id, $season, 'sp_season', true ); endif; // Add to event if exists if ( isset( $id ) ) : // Add team to event add_post_meta( $id, 'sp_team', $team_id ); // Add empty player to event add_post_meta( $id, 'sp_player', 0 ); // Explode results into array $results = explode( '|', $result ); // Create team results array from result keys $team_results = array(); if ( sizeof( $result_labels ) > 0 ) : foreach ( $result_labels as $key => $label ) : $team_results[ $key ] = trim( array_shift( $results ) ); endforeach; $team_results['outcome'] = array(); endif; // Explode outcomes into array $outcomes = explode( '|', $outcome ); // Add outcome slugs to team outcomes array foreach ( $outcomes as $outcome ) : // Continue if outcome doesn't exist if ( $outcome == null ) : continue; endif; // Remove whitespace $outcome = trim( $outcome ); // Get or insert outcome $outcome_object = sp_get_post_by_title( stripslashes( $outcome ), 'sp_outcome' ); if ( $outcome_object ) : // Make sure outcome is published if ( $outcome_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $outcome_object->ID, 'post_status' => 'publish', ) ); endif; // Get outcome slug $outcome_slug = $outcome_object->post_name; else : // Insert outcome $outcome_id = wp_insert_post( array( 'post_type' => 'sp_outcome', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $outcome ), ) ); // Get outcome slug $post_data = get_post( $outcome_id, ARRAY_A ); $outcome_slug = $post_data['post_name']; // Flag as import update_post_meta( $outcome_id, '_sp_import', 1 ); endif; // Add to team results array $team_results['outcome'][] = $outcome_slug; endforeach; // Get existing results $event_results = get_post_meta( $id, 'sp_results', true ); // Create new array if results not exists if ( ! $event_results ) : $event_results = array(); endif; // Add team results to existing results $event_results[ $team_id ] = $team_results; // Update event results update_post_meta( $id, 'sp_results', $event_results ); // Get event name $title = get_the_title( $id ); // Initialize event name if ( esc_attr__( 'Event', 'sportspress' ) === $title ) { $title = ''; } else { $title .= ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' '; } // Append team name to event name $title .= $team_name; // Update event with new name $post = array( 'ID' => $id, 'post_title' => $title, 'post_name' => $id, ); wp_update_post( $post ); endif; endif; // Add new player if player name is given if ( sizeof( $player ) > 0 && ! empty( $player[0] ) ) : // Get and unset player name leaving us with the performance $player_name = $player[0]; unset( $player[0] ); // Find out if player exists $player_object = sp_get_post_by_title( stripslashes( $player_name ), 'sp_player' ); // Get or insert player if ( $player_object ) : // Make sure player is published if ( $player_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $player_object->ID, 'post_status' => 'publish', ) ); endif; // Get player ID $player_id = $player_object->ID; // Get player number $player_number = get_post_meta( $player_id, 'sp_number', true ); else : // Insert player $player_id = wp_insert_post( array( 'post_type' => 'sp_player', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $player_name ), ) ); // Flag as import update_post_meta( $player_id, '_sp_import', 1 ); // Update number update_post_meta( $player_id, 'sp_number', null ); // Get player number $player_number = null; endif; // Update league if ( $league ) : wp_set_object_terms( $player_id, $league, 'sp_league', true ); endif; // Update season if ( $season ) : wp_set_object_terms( $player_id, $season, 'sp_season', true ); endif; // Add to event if exists if ( isset( $id ) ) : // Add player to event add_post_meta( $id, 'sp_player', $player_id ); // Add player performance to array if team is available if ( isset( $team_id ) ) : // Initialize performance array $performance = array( 'number' => $player_number ); // Map keys to player performance foreach ( $performance_labels as $key => $label ) : $performance[ $key ] = array_shift( $player ); endforeach; $players[ $team_id ][ $player_id ] = $performance; // Get player teams $player_teams = get_post_meta( $player_id, 'sp_team', false ); $current_team = get_post_meta( $player_id, 'sp_current_team', true ); $past_teams = get_post_meta( $player_id, 'sp_past_team', false ); // Add team if not exists in player if ( ! in_array( $team_id, $player_teams ) ) : add_post_meta( $player_id, 'sp_team', $team_id ); endif; // Add as past team or set current team if not set if ( ! $current_team ) : update_post_meta( $player_id, 'sp_current_team', $team_id ); elseif ( $current_team != $team_id && ! in_array( $team_id, $past_teams ) ) : add_post_meta( $player_id, 'sp_past_team', $team_id ); endif; endif; endif; endif; endforeach; // Add player performance to last event if available if ( isset( $id ) && isset( $players ) && sizeof( $players ) > 0 ) : update_post_meta( $id, 'sp_players', $players ); endif; // Show Result echo '

    ' . wp_kses_post( sprintf( __( 'Import complete - imported %1$s events and skipped %2$s.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '

    '; $this->import_end(); } /** * Performs post-import cleanup of files and the cache */ function import_end() { echo '

    ' . esc_html__( 'All done!', 'sportspress' ) . ' ' . esc_html__( 'View Events', 'sportspress' ) . '' . '

    '; do_action( 'import_end' ); } /** * greet function. * * @access public * @return void */ function greet() { echo '
    '; echo '

    ' . esc_html__( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Events need to be defined with columns in a specific order (3+ columns). Click here to download a sample.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/events-sample.csv' ) ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Supports CSV files generated by LeagueLobster.', 'sportspress' ), 'http://tboy.co/leaguelobster' ) ) . '

    '; wp_import_upload_form( 'admin.php?import=sp_event_csv&step=1' ); echo '
    '; } /** * options function. * * @access public * @return void */ function options() { ?>

      event as $name => $title ) { ?>

    'sp_league', 'name' => 'sp_league', 'values' => 'slug', 'show_option_none' => esc_attr__( '— Not set —', 'sportspress' ), ); if ( ! sp_dropdown_taxonomies( $args ) ) : echo '

    ' . esc_html__( 'None', 'sportspress' ) . '

    '; sp_taxonomy_adder( 'sp_league', 'sp_team', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    'sp_season', 'name' => 'sp_season', 'values' => 'slug', 'show_option_none' => esc_attr__( '— Not set —', 'sportspress' ), ); if ( ! sp_dropdown_taxonomies( $args ) ) : echo '

    ' . esc_html__( 'None', 'sportspress' ) . '

    '; sp_taxonomy_adder( 'sp_season', 'sp_team', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>
    import_page = 'sp_event_performance_csv'; $this->import_label = esc_attr__( 'Import Box Score', 'sportspress' ); $this->columns = array( 'sp_player' => esc_attr__( 'Player', 'sportspress' ), ); $performance_labels = sp_get_var_labels( 'sp_performance' ); if ( $performance_labels && is_array( $performance_labels ) && sizeof( $performance_labels ) ) { $this->columns = array_merge( $this->columns, $performance_labels ); } } /** * import function. * * @access public * @param array $array * @param array $columns * @return void */ function import( $array = array(), $columns = array( 'sp_player' ) ) { $this->imported = $this->skipped = 0; if ( ! is_array( $array ) || ! sizeof( $array ) ) : $this->footer(); die(); endif; $rows = array_chunk( $array, sizeof( $columns ) ); // Get event ID and team ID from post vars $event = ( empty( $_POST['sp_event'] ) ? false : sanitize_text_field( wp_unslash( $_POST['sp_event'] ) ) ); $teams = ( empty( $_POST['sp_teams'] ) ? false : sanitize_text_field( wp_unslash( $_POST['sp_teams'] ) ) ); $index = ( empty( $_POST['sp_index'] ) ? false : sanitize_text_field( wp_unslash( $_POST['sp_index'] ) ) ); $team = ( empty( $_POST['sp_team'] ) ? false : sanitize_text_field( wp_unslash( $_POST['sp_team'] ) ) ); $team_players = array( 0 ); $team_performance = array(); $name_index = (int) array_search( 'sp_player', $columns ); foreach ( $rows as $row ) : $row = array_filter( $row ); if ( empty( $row ) ) { continue; } $player_name = sp_array_value( $row, $name_index ); if ( ! $player_name ) : $this->skipped ++; continue; endif; $player_object = sp_get_post_by_title( stripslashes( $player_name ), 'sp_player' ); if ( $player_object ) : // Get player ID $player_id = $player_object->ID; else : // Insert player $player_id = wp_insert_post( array( 'post_type' => 'sp_player', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $player_name ), ) ); // Flag as import update_post_meta( $player_id, '_sp_import', 1 ); endif; $team_players[] = $player_id; $player = array(); foreach ( $columns as $i => $key ) : if ( 'sp_player' === $key ) { continue; } // Get performance object. $perf_column = get_page_by_path( $key, OBJECT, 'sp_performance' ); // Check if it has time format and convert it to seconds. if ( is_object( $perf_column ) && 'time' == get_post_meta( $perf_column->ID, 'sp_format', true ) ) { $player[ $key ] = sp_value_time( sp_array_value( $row, $i, '0' ) ); }else{ $player[ $key ] = sp_array_value( $row, $i, '' ); } endforeach; $team_performance[ $player_id ] = $player; endforeach; if ( $event && $team ) : $the_players = get_post_meta( $event, 'sp_player', false ); $players = array(); for ( $i = 0; $i < $teams; $i++ ) : if ( $index == $i ) : array_push( $players, $team_players ); else : array_push( $players, sp_array_between( $the_players, 0, $i ) ); endif; endfor; sp_update_post_meta_recursive( $event, 'sp_player', $players ); $this->imported = sizeof( $team_players ) - 1; $performance = (array) get_post_meta( $event, 'sp_players', true ); $performance = array_filter( $performance ); $performance[ $team ] = $team_performance; update_post_meta( $event, 'sp_players', $performance ); endif; // Show Result echo '

    ' . wp_kses_post( sprintf( __( 'Import complete - imported %1$s rows and skipped %2$s.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '

    '; $this->import_end( $event ); } /** * Performs post-import cleanup of files and the cache */ function import_end( $event = 0 ) { echo '

    ' . esc_html__( 'All done!', 'sportspress' ) . ' ' . esc_html__( 'View Event', 'sportspress' ) . '' . '

    '; do_action( 'import_end' ); } /** * greet function. * * @access public * @return void */ function greet() { $event = sp_array_value( $_REQUEST, 'event', 0 ); echo '
    '; if ( $event ) { $args = array_merge( $_REQUEST, array( 'import' => 'sp_event_performance_csv', 'step' => '1', ) ); echo '

    ' . esc_html__( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Box scores need to be defined with columns in a specific order. Click here to download a sample.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/event-performance-sample.csv' ) ) . '

    '; wp_import_upload_form( add_query_arg( $args, 'admin.php' ) ); } else { echo '

    ' . sprintf( esc_html__( 'Select %s', 'sportspress' ), esc_html__( 'Event', 'sportspress' ) ) . '

    '; } echo '
    '; } /** * options function. * * @access public * @return void */ function options() { $event = sp_array_value( $_REQUEST, 'event', 0, 'key' ); $teams = sp_array_value( $_REQUEST, 'teams', 0, 'key' ); $index = sp_array_value( $_REQUEST, 'index', 0, 'key' ); $team = sp_array_value( $_REQUEST, 'team', 0, 'key' ); $include = get_post_meta( $event, 'sp_team', false ); ?>


    'sp_team', 'name' => 'sp_team', 'values' => 'ID', 'selected' => $team, 'include' => $include, ); sp_dropdown_pages( $args ); ?>
    import_page = 'sp_fixture_csv'; $this->import_label = esc_attr__( 'Import Fixtures', 'sportspress' ); $this->columns = array( 'post_date' => esc_attr__( 'Date', 'sportspress' ), 'post_time' => esc_attr__( 'Time', 'sportspress' ), 'sp_venue' => esc_attr__( 'Venue', 'sportspress' ), 'sp_home' => esc_attr__( 'Home', 'sportspress' ), 'sp_away' => esc_attr__( 'Away', 'sportspress' ), 'sp_day' => esc_attr__( 'Match Day', 'sportspress' ), ); $this->optionals = array( 'sp_day' ); } /** * import function. * * @access public * @param array $array * @param array $columns * @return void */ function import( $array = array(), $columns = array( 'post_title' ) ) { $this->imported = $this->skipped = 0; if ( ! is_array( $array ) || ! sizeof( $array ) ) : $this->footer(); die(); endif; $rows = array_chunk( $array, sizeof( $columns ) ); // Get event format, league, and season from post vars $event_format = ( empty( $_POST['sp_format'] ) ? false : sanitize_key( $_POST['sp_format'] ) ); $league = ( sp_array_value( $_POST, 'sp_league', '-1' ) == '-1' ? false : $_POST['sp_league'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput $season = ( sp_array_value( $_POST, 'sp_season', '-1' ) == '-1' ? false : $_POST['sp_season'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput $date_format = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : sanitize_text_field( wp_unslash( $_POST['sp_date_format'] ) ) ); foreach ( $rows as $row ) : $row = array_filter( $row ); if ( empty( $row ) ) { continue; } $meta = array(); foreach ( $columns as $index => $key ) : $meta[ $key ] = sp_array_value( $row, $index ); endforeach; // Get event details $event = array( sp_array_value( $meta, 'post_date' ), sp_array_value( $meta, 'post_time' ), sp_array_value( $meta, 'sp_venue' ), sp_array_value( $meta, 'sp_day' ), ); $teams = array( sp_array_value( $meta, 'sp_home' ), sp_array_value( $meta, 'sp_away' ), ); // Add new event if date is given if ( sizeof( $event ) > 0 && ! empty( $event[0] ) ) : // List event columns list( $date, $time, $venue, $day ) = $event; // Format date $date = str_replace( '/', '-', trim( $date ) ); $date_array = explode( '-', $date ); switch ( $date_format ) : case 'dd/mm/yyyy': $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); break; case 'mm/dd/yyyy': $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); break; default: $date = substr( str_pad( sp_array_value( $date_array, 0, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 2, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); endswitch; // Add time to date if given if ( ! empty( $time ) ) : $date .= ' ' . trim( $time ); endif; // Define post type args $args = array( 'post_type' => 'sp_event', 'post_status' => 'publish', 'post_date' => $date, 'post_title' => esc_attr__( 'Event', 'sportspress' ), ); // Insert event $id = wp_insert_post( $args ); // Flag as import update_post_meta( $id, '_sp_import', 1 ); // Update event format if ( $event_format ) : update_post_meta( $id, 'sp_format', $event_format ); endif; // Update league if ( $league ) : wp_set_object_terms( $id, $league, 'sp_league', false ); endif; // Update season if ( $season ) : wp_set_object_terms( $id, $season, 'sp_season', false ); endif; // Update venue if ( $venue == '' ) { $team = reset( $teams ); $team_object = sp_get_post_by_title( stripslashes( $team ), 'sp_team' ); $venue = sp_get_the_term_id( $team_object->ID, 'sp_venue' ); } wp_set_object_terms( $id, $venue, 'sp_venue', false ); // Update match day if ( '' !== $day ) { update_post_meta( $id, 'sp_day', $day ); } // Increment $this->imported ++; endif; // Add teams to event if ( sizeof( $teams ) > 0 ) : foreach ( $teams as $team_name ) : if ( '' !== $team_name ) : // Find out if team exists $team_object = sp_get_post_by_title( stripslashes( $team_name ), 'sp_team' ); // Get or insert team if ( $team_object ) : // Make sure team is published if ( $team_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $team_object->ID, 'post_status' => 'publish', ) ); endif; // Get team ID $team_id = $team_object->ID; else : // Insert team $team_id = wp_insert_post( array( 'post_type' => 'sp_team', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $team_name ), ) ); // Flag as import update_post_meta( $team_id, '_sp_import', 1 ); endif; // Update league if ( $league ) : wp_set_object_terms( $team_id, $league, 'sp_league', true ); endif; // Update season if ( $season ) : wp_set_object_terms( $team_id, $season, 'sp_season', true ); endif; // Add to event if exists if ( isset( $id ) ) : // Add team to event add_post_meta( $id, 'sp_team', $team_id ); // Get event name $title = get_the_title( $id ); // Initialize event name if ( esc_attr__( 'Event', 'sportspress' ) === $title ) { $title = ''; } else { $title .= ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' '; } // Append team name to event name $title .= $team_name; // Update event with new name $post = array( 'ID' => $id, 'post_title' => $title, 'post_name' => $id, ); wp_update_post( $post ); endif; else : // Add empty team to event add_post_meta( $id, 'sp_team', -1 ); endif; endforeach; endif; endforeach; // Show Result echo '

    ' . wp_kses_post( sprintf( __( 'Import complete - imported %1$s events and skipped %2$s.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '

    '; $this->import_end(); } /** * Performs post-import cleanup of files and the cache */ function import_end() { echo '

    ' . esc_html__( 'All done!', 'sportspress' ) . ' ' . esc_html__( 'View Fixtures', 'sportspress' ) . '' . '

    '; do_action( 'import_end' ); } /** * greet function. * * @access public * @return void */ function greet() { echo '
    '; echo '

    ' . esc_html__( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Fixtures need to be defined with columns in a specific order (4+ columns). Click here to download a sample.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/fixtures-sample.csv' ) ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Supports CSV files generated by LeagueLobster.', 'sportspress' ), 'http://tboy.co/leaguelobster' ) ) . '

    '; wp_import_upload_form( 'admin.php?import=sp_fixture_csv&step=1' ); echo '
    '; } /** * options function. * * @access public * @return void */ function options() { ?>



    'sp_league', 'name' => 'sp_league', 'values' => 'slug', 'show_option_none' => esc_attr__( '— Not set —', 'sportspress' ), ); if ( ! sp_dropdown_taxonomies( $args ) ) : echo '

    ' . esc_html__( 'None', 'sportspress' ) . '

    '; sp_taxonomy_adder( 'sp_league', 'sp_team', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    'sp_season', 'name' => 'sp_season', 'values' => 'slug', 'show_option_none' => esc_attr__( '— Not set —', 'sportspress' ), ); if ( ! sp_dropdown_taxonomies( $args ) ) : echo '

    ' . esc_html__( 'None', 'sportspress' ) . '

    '; sp_taxonomy_adder( 'sp_season', 'sp_team', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>
    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 ); } /** * Registered callback function for the WordPress Importer * * Manages the three separate stages of the CSV import process */ function dispatch() { $this->header(); if ( ! empty( $_POST['delimiter'] ) ) { $this->delimiter = stripslashes( trim( sanitize_text_field( wp_unslash( $_POST['delimiter'] ) ) ) ); } if ( ! $this->delimiter ) { $this->delimiter = ','; } $step = empty( $_GET['step'] ) ? 0 : (int) $_GET['step']; switch ( $step ) : case 0: $this->greet(); break; case 1: check_admin_referer( 'import-upload' ); if ( $this->handle_upload() ) : if ( $this->id ) { $file = get_attached_file( $this->id ); } else { $file = ABSPATH . $this->file_url; } add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) ); if ( function_exists( 'gc_enable' ) ) { gc_enable(); } @set_time_limit( 0 ); @ob_flush(); @flush(); $this->table( $file ); endif; break; case 2: check_admin_referer( 'import-upload' ); if ( isset( $_POST['sp_import'] ) ) : $columns = array_filter( array_map( 'sanitize_key', array_map( 'wp_unslash', sp_array_value( $_POST, 'sp_columns', array( 'post_title' ) ) ) ) ); $this->import( $_POST['sp_import'], array_values( $columns ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput endif; break; endswitch; $this->footer(); } /** * dropdown function. * * @access public * @param mixed $file * @return void */ function dropdown( $selected ) { ?> imported = $this->skipped = 0; if ( ! is_file( $file ) ) : $this->footer(); die(); endif; // Only set auto_detect_line_endings on PHP versions that support it (< 8.1). if ( version_compare( PHP_VERSION, '8.1', '<' ) ) { ini_set( 'auto_detect_line_endings', '1' ); } if ( ( $handle = fopen( $file, 'r' ) ) !== false ) : $header = fgetcsv( $handle, 0, $this->delimiter ); if ( sizeof( $header ) >= 1 ) : $action = 'admin.php?import=' . $this->import_page . '&step=2'; ?>
    options(); ?> columns as $key => $label ) : ?> delimiter ) ) !== false ) : ?> columns as $key => $label ) : $value = sp_array_value( $row, $index ); ?> imported++; endwhile; ?> columns as $key => $label ) : ?>
    dropdown( $key ); ?>
    optionals ) ) { ?> placeholder="">

    imported + 1 ), esc_html( $this->imported + 1 ) ); ?>

    ' . esc_html__( 'Sorry, there has been an error.', 'sportspress' ) . '
    '; esc_html_e( 'The CSV is invalid.', 'sportspress' ) . '

    '; $this->footer(); die(); endif; fclose( $handle ); endif; } /** * format_data_from_csv function. * * @access public * @param mixed $data * @param string $enc * @return string */ function format_data_from_csv( $data, $enc ) { return ( $enc == 'UTF-8' ) ? $data : utf8_encode( $data ); } /** * Handles the CSV upload and initial parsing of the file to prepare for * displaying author import options * * @return bool False if error uploading or invalid file, true otherwise */ function handle_upload() { if ( empty( $_POST['file_url'] ) ) { $file = wp_import_handle_upload(); if ( isset( $file['error'] ) ) { echo '

    ' . esc_html__( 'Sorry, there has been an error.', 'sportspress' ) . '
    '; echo esc_html( $file['error'] ) . '

    '; return false; } $this->id = (int) $file['id']; } else { if ( file_exists( ABSPATH . sanitize_url( wp_unslash( $_POST['file_url'] ) ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput $this->file_url = sanitize_url( wp_unslash( $_POST['file_url'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput } else { echo '

    ' . esc_html__( 'Sorry, there has been an error.', 'sportspress' ) . '

    '; return false; } } return true; } /** * header function. * * @access public * @return void */ function header() { echo '

    ' . esc_html( $this->import_label ) . '

    '; } /** * footer function. * * @access public * @return void */ function footer() { echo '
    '; } /** * options function. * * @access public * @return void */ function options() { } /** * Added to http_request_timeout filter to force timeout at 60 seconds during import * * @param int $val * @return int 60 */ function bump_request_timeout( $val ) { return 60; } } } ================================================ FILE: includes/admin/importers/class-sp-official-importer.php ================================================ import_page = 'sp_official_csv'; $this->import_label = esc_attr__( 'Import Officials', 'sportspress' ); $this->columns = array( 'post_title' => esc_attr__( 'Name', 'sportspress' ), ); parent::__construct(); } /** * import function. * * @access public * @param array $array * @param array $columns * @return void */ function import( $array = array(), $columns = array( 'post_title' ) ) { $this->imported = $this->skipped = 0; if ( ! is_array( $array ) || ! sizeof( $array ) ) : $this->footer(); die(); endif; $rows = array_chunk( $array, sizeof( $columns ) ); foreach ( $rows as $row ) : $row = array_filter( $row ); if ( empty( $row ) ) { continue; } $meta = array(); foreach ( $columns as $index => $key ) : $meta[ $key ] = sp_array_value( $row, $index ); endforeach; $name = sp_array_value( $meta, 'post_title' ); if ( ! $name ) : $this->skipped++; continue; endif; $args = array( 'post_type' => 'sp_official', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $name ), ); $id = wp_insert_post( $args ); $this->imported++; endforeach; // Show Result echo '

    ' . wp_kses_post( sprintf( __( 'Import complete - imported %1$s officials and skipped %2$s.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '

    '; $this->import_end(); } /** * Performs post-import cleanup of files and the cache */ function import_end() { echo '

    ' . esc_html__( 'All done!', 'sportspress' ) . ' ' . esc_html__( 'View Officials', 'sportspress' ) . '' . '

    '; do_action( 'import_end' ); } /** * header function. * * @access public * @return void */ function header() { echo '

    ' . esc_html__( 'Import Officials', 'sportspress' ) . '

    '; } /** * greet function. * * @access public * @return void */ function greet() { echo '
    '; echo '

    ' . esc_html__( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Officials need to be defined with columns in a specific order. Click here to download a sample.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/officials-sample.csv' ) ) . '

    '; wp_import_upload_form( 'admin.php?import=sp_official_csv&step=1' ); echo '
    '; } } } ================================================ FILE: includes/admin/importers/class-sp-player-importer.php ================================================ import_page = 'sp_player_csv'; $this->import_label = esc_attr__( 'Import Players', 'sportspress' ); $this->columns = array( 'sp_number' => esc_attr__( 'Squad Number', 'sportspress' ), 'post_title' => esc_attr__( 'Name', 'sportspress' ), 'sp_position' => esc_attr__( 'Positions', 'sportspress' ), 'sp_team' => esc_attr__( 'Teams', 'sportspress' ), 'sp_league' => esc_attr__( 'Leagues', 'sportspress' ), 'sp_season' => esc_attr__( 'Seasons', 'sportspress' ), 'sp_nationality' => esc_attr__( 'Nationality', 'sportspress' ), 'post_date' => esc_attr__( 'Date of Birth', 'sportspress' ), ); parent::__construct(); } /** * import function. * * @access public * @param array $array * @param array $columns * @return void */ function import( $array = array(), $columns = array( 'post_title' ) ) { $this->imported = $this->skipped = 0; if ( ! is_array( $array ) || ! sizeof( $array ) ) : $this->footer(); die(); endif; $rows = array_chunk( $array, sizeof( $columns ) ); // Get Date of Birth format from post vars $date_format = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : sanitize_text_field( wp_unslash( $_POST['sp_date_format'] ) ) ); foreach ( $rows as $row ) : $row = array_filter( $row, 'strlen' ); if ( empty( $row ) ) { continue; } $meta = array(); /** * Prepare preservable metas keys. */ $preservable_metas_keys = array( 'sp_league', 'sp_position', 'sp_season', ); foreach ( $preservable_metas_keys as $p ) { $meta[ $p ] = ''; } foreach ( $columns as $index => $key ) : $meta[ $key ] = sp_array_value( $row, $index ); endforeach; $name = sp_array_value( $meta, 'post_title' ); $date = sp_array_value( $meta, 'post_date' ); // Format date of birth $date = str_replace( '/', '-', trim( $date ) ); $date_array = explode( '-', $date ); switch ( $date_format ) : case 'dd/mm/yyyy': $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); break; case 'mm/dd/yyyy': $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); break; default: $date = substr( str_pad( sp_array_value( $date_array, 0, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . substr( str_pad( sp_array_value( $date_array, 2, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); endswitch; if ( ! $name ) : $this->skipped++; continue; endif; // Get or insert player $player_object = sp_array_value( $_POST, 'merge', 0 ) ? sp_get_post_by_title( stripslashes( $name ), 'sp_player' ) : false; if ( $player_object ) : if ( $player_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $player_object->ID, 'post_status' => 'publish', ) ); endif; $id = $player_object->ID; // Handle preservable data. foreach ( $preservable_metas_keys as $p ) { $terms = wp_get_object_terms( $id, $p, array( 'fields' => 'names' ) ); $meta[ $p ] .= '|' . implode( '|', $terms ); } else : $args = array( 'post_type' => 'sp_player', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $name ), ); // Check if a DoB was set if ( '0000-00-00' !== $date ) { $args['post_date'] = $date; } $id = wp_insert_post( $args ); // Flag as import update_post_meta( $id, '_sp_import', 1 ); endif; // Update number update_post_meta( $id, 'sp_number', sp_array_value( $meta, 'sp_number' ) ); // Update positions $positions = explode( '|', sp_array_value( $meta, 'sp_position' ) ); wp_set_object_terms( $id, $positions, 'sp_position', false ); // Update leagues $leagues = explode( '|', sp_array_value( $meta, 'sp_league' ) ); wp_set_object_terms( $id, $leagues, 'sp_league', false ); // Update seasons $seasons = explode( '|', sp_array_value( $meta, 'sp_season' ) ); wp_set_object_terms( $id, $seasons, 'sp_season', false ); // Update teams $teams = (array) explode( '|', sp_array_value( $meta, 'sp_team' ) ); $i = 0; foreach ( $teams as $team ) : // Get or insert team $team_object = sp_get_post_by_title( stripslashes( $team ), 'sp_team' ); if ( $team_object ) : if ( $team_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $team_object->ID, 'post_status' => 'publish', ) ); endif; $team_id = $team_object->ID; else : $team_id = wp_insert_post( array( 'post_type' => 'sp_team', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $team ), ) ); // Flag as import update_post_meta( $team_id, '_sp_import', 1 ); wp_set_object_terms( $team_id, $leagues, 'sp_league', false ); wp_set_object_terms( $team_id, $seasons, 'sp_season', false ); endif; // Add team to player add_post_meta( $id, 'sp_team', $team_id ); // Update current team if first in array, otherwise use as past team if ( $i == 0 ) : update_post_meta( $id, 'sp_current_team', $team_id ); else : add_post_meta( $id, 'sp_past_team', $team_id ); endif; $i++; endforeach; // Update nationality $nationality = trim( strtolower( sp_array_value( $meta, 'sp_nationality' ) ) ); if ( $nationality == '*' ) { $nationality = ''; } update_post_meta( $id, 'sp_nationality', $nationality ); $this->imported++; endforeach; // Show Result echo '

    ' . wp_kses_post( sprintf( __( 'Import complete - imported %1$s players and skipped %2$s.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '

    '; $this->import_end(); } /** * Performs post-import cleanup of files and the cache */ function import_end() { echo '

    ' . esc_html__( 'All done!', 'sportspress' ) . ' ' . esc_html__( 'View Players', 'sportspress' ) . '' . '

    '; do_action( 'import_end' ); } /** * header function. * * @access public * @return void */ function header() { echo '

    ' . esc_html__( 'Import Players', 'sportspress' ) . '

    '; } /** * greet function. * * @access public * @return void */ function greet() { echo '
    '; echo '

    ' . esc_html__( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Players need to be defined with columns in a specific order (8 columns). Click here to download a sample.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/players-sample.csv' ) ) . '

    '; wp_import_upload_form( 'admin.php?import=sp_player_csv&step=1' ); echo '
    '; } /** * options function. * * @access public * @return void */ function options() { ?>
    import_page = 'sp_staff_csv'; $this->import_label = esc_attr__( 'Import Staff', 'sportspress' ); $this->columns = array( 'post_title' => esc_attr__( 'Name', 'sportspress' ), 'sp_role' => esc_attr__( 'Jobs', 'sportspress' ), 'sp_team' => esc_attr__( 'Teams', 'sportspress' ), 'sp_league' => esc_attr__( 'Leagues', 'sportspress' ), 'sp_season' => esc_attr__( 'Seasons', 'sportspress' ), 'sp_nationality' => esc_attr__( 'Nationality', 'sportspress' ), ); parent::__construct(); } /** * import function. * * @access public * @param array $array * @param array $columns * @return void */ function import( $array = array(), $columns = array( 'post_title' ) ) { $this->imported = $this->skipped = 0; if ( ! is_array( $array ) || ! sizeof( $array ) ) : $this->footer(); die(); endif; $rows = array_chunk( $array, sizeof( $columns ) ); foreach ( $rows as $row ) : $row = array_filter( $row ); if ( empty( $row ) ) { continue; } $meta = array(); foreach ( $columns as $index => $key ) : $meta[ $key ] = sp_array_value( $row, $index ); endforeach; $name = sp_array_value( $meta, 'post_title' ); if ( ! $name ) : $this->skipped++; continue; endif; // Get or insert staff $staff_object = sp_array_value( $_POST, 'merge', 0 ) ? sp_get_post_by_title( stripslashes( $name ), 'sp_staff' ) : false; if ( $staff_object ) : if ( $staff_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $staff_object->ID, 'post_status' => 'publish', ) ); endif; $id = $staff_object->ID; else : $args = array( 'post_type' => 'sp_staff', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $name ), ); $id = wp_insert_post( $args ); // Flag as import update_post_meta( $id, '_sp_import', 1 ); endif; // Update roles $roles = explode( '|', sp_array_value( $meta, 'sp_role' ) ); wp_set_object_terms( $id, $roles, 'sp_role', false ); // Update leagues $leagues = explode( '|', sp_array_value( $meta, 'sp_league' ) ); wp_set_object_terms( $id, $leagues, 'sp_league', false ); // Update seasons $seasons = explode( '|', sp_array_value( $meta, 'sp_season' ) ); wp_set_object_terms( $id, $seasons, 'sp_season', false ); // Update teams $teams = (array) explode( '|', sp_array_value( $meta, 'sp_team' ) ); $i = 0; foreach ( $teams as $team ) : // Get or insert team $team_object = sp_get_post_by_title( stripslashes( $team ), 'sp_team' ); if ( $team_object ) : if ( $team_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $team_object->ID, 'post_status' => 'publish', ) ); endif; $team_id = $team_object->ID; else : $team_id = wp_insert_post( array( 'post_type' => 'sp_team', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $team ), ) ); // Flag as import update_post_meta( $team_id, '_sp_import', 1 ); wp_set_object_terms( $team_id, $leagues, 'sp_league', false ); wp_set_object_terms( $team_id, $seasons, 'sp_season', false ); endif; // Add team to staff add_post_meta( $id, 'sp_team', $team_id ); // Update current team if first in array if ( $i == 0 ) : update_post_meta( $id, 'sp_current_team', $team_id ); endif; $i++; endforeach; // Update nationality $nationality = trim( strtolower( sp_array_value( $meta, 'sp_nationality' ) ) ); if ( $nationality == '*' ) { $nationality = ''; } update_post_meta( $id, 'sp_nationality', $nationality ); $this->imported++; endforeach; // Show Result echo '

    ' . wp_kses_post( sprintf( __( 'Import complete - imported %1$s staff and skipped %2$s.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '

    '; $this->import_end(); } /** * Performs post-import cleanup of files and the cache */ function import_end() { echo '

    ' . esc_html__( 'All done!', 'sportspress' ) . ' ' . esc_html__( 'View Staff', 'sportspress' ) . '' . '

    '; do_action( 'import_end' ); } /** * header function. * * @access public * @return void */ function header() { echo '

    ' . esc_html__( 'Import Staff', 'sportspress' ) . '

    '; } /** * greet function. * * @access public * @return void */ function greet() { echo '
    '; echo '

    ' . esc_html__( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Staff need to be defined with columns in a specific order (6 columns). Click here to download a sample.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/staff-sample.csv' ) ) . '

    '; wp_import_upload_form( 'admin.php?import=sp_staff_csv&step=1' ); echo '
    '; } /** * options function. * * @access public * @return void */ function options() { ?>
    import_page = 'sp_team_csv'; $this->import_label = esc_attr__( 'Import Teams', 'sportspress' ); $this->columns = array( 'post_title' => esc_attr__( 'Name', 'sportspress' ), 'sp_league' => esc_attr__( 'Leagues', 'sportspress' ), 'sp_season' => esc_attr__( 'Seasons', 'sportspress' ), 'sp_url' => esc_attr__( 'Site URL', 'sportspress' ), 'sp_abbreviation' => esc_attr__( 'Abbreviation', 'sportspress' ), 'sp_venue' => esc_attr__( 'Home', 'sportspress' ), ); parent::__construct(); } /** * import function. * * @access public * @param array $array * @param array $columns * @return void */ function import( $array = array(), $columns = array( 'post_title' ) ) { $this->imported = $this->skipped = 0; if ( ! is_array( $array ) || ! sizeof( $array ) ) : $this->footer(); die(); endif; $rows = array_chunk( $array, sizeof( $columns ) ); foreach ( $rows as $row ) : $row = array_filter( $row ); if ( empty( $row ) ) { continue; } $meta = array(); foreach ( $columns as $index => $key ) : $meta[ $key ] = sp_array_value( $row, $index ); endforeach; $name = sp_array_value( $meta, 'post_title' ); if ( ! $name ) : $this->skipped++; continue; endif; // Get or insert team $team_object = sp_array_value( $_POST, 'merge', 0 ) ? sp_get_post_by_title( stripslashes( $name ), 'sp_team' ) : false; if ( $team_object ) : if ( $team_object->post_status != 'publish' ) : wp_update_post( array( 'ID' => $team_object->ID, 'post_status' => 'publish', ) ); endif; $id = $team_object->ID; else : $args = array( 'post_type' => 'sp_team', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $name ), ); $id = wp_insert_post( $args ); // Flag as import update_post_meta( $id, '_sp_import', 1 ); endif; // Update leagues $leagues = explode( '|', sp_array_value( $meta, 'sp_league' ) ); wp_set_object_terms( $id, $leagues, 'sp_league', false ); // Update seasons $seasons = explode( '|', sp_array_value( $meta, 'sp_season' ) ); wp_set_object_terms( $id, $seasons, 'sp_season', false ); // Update venues $venues = explode( '|', sp_array_value( $meta, 'sp_venue' ) ); wp_set_object_terms( $id, $venues, 'sp_venue', false ); // Update meta update_post_meta( $id, 'sp_url', sp_array_value( $meta, 'sp_url' ) ); update_post_meta( $id, 'sp_abbreviation', sp_array_value( $meta, 'sp_abbreviation' ) ); $this->imported++; endforeach; // Show Result echo '

    ' . wp_kses_post( sprintf( __( 'Import complete - imported %1$s teams and skipped %2$s.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) ) . '

    '; $this->import_end(); } /** * Performs post-import cleanup of files and the cache */ function import_end() { echo '

    ' . esc_html__( 'All done!', 'sportspress' ) . ' ' . esc_html__( 'View Teams', 'sportspress' ) . '' . '

    '; do_action( 'import_end' ); } /** * greet function. * * @access public * @return void */ function greet() { echo '
    '; echo '

    ' . esc_html__( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '

    '; echo '

    ' . wp_kses_post( sprintf( __( 'Teams need to be defined with columns in a specific order (3 columns). Click here to download a sample.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/teams-sample.csv' ) ) . '

    '; wp_import_upload_form( 'admin.php?import=sp_team_csv&step=1' ); echo '
    '; } /** * options function. * * @access public * @return void */ function options() { ?>
    type = 'sp_calendar'; // Admin Columns add_filter( 'manage_edit-sp_calendar_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_calendar_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Filtering add_action( 'restrict_manage_posts', array( $this, 'filters' ) ); add_filter( 'parse_query', array( $this, 'filters_query' ) ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { unset( $existing_columns['author'], $existing_columns['date'] ); $columns = array_merge( array( 'cb' => '', 'title' => esc_attr__( 'Title', 'sportspress' ), 'sp_league' => esc_attr__( 'League', 'sportspress' ), 'sp_season' => esc_attr__( 'Season', 'sportspress' ), 'sp_venue' => esc_attr__( 'Venue', 'sportspress' ), 'sp_team' => esc_attr__( 'Team', 'sportspress' ), 'sp_events' => esc_attr__( 'Events', 'sportspress' ), 'sp_layout' => esc_attr__( 'Layout', 'sportspress' ), ), $existing_columns ); return apply_filters( 'sportspress_calendar_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_league': $terms = get_the_terms( $post_id, 'sp_league' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' ); break; case 'sp_season': $terms = get_the_terms( $post_id, 'sp_season' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' ); break; case 'sp_venue': $terms = get_the_terms( $post_id, 'sp_venue' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' ); break; case 'sp_team': $teams = (array) get_post_meta( $post_id, 'sp_team', false ); $teams = array_filter( $teams ); if ( empty( $teams ) ) : echo esc_html__( 'All', 'sportspress' ); else : $current_team = get_post_meta( $post_id, 'sp_current_team', true ); foreach ( $teams as $team_id ) : if ( ! $team_id ) { continue; } $team = get_post( $team_id ); if ( $team ) : echo esc_html( $team->post_title ); if ( $team_id == $current_team ) : echo ''; endif; echo '
    '; endif; endforeach; endif; break; case 'sp_events': $calendar = new SP_Calendar( $post_id ); echo esc_html( sizeof( $calendar->data() ) ); break; case 'sp_layout': echo esc_html( sp_array_value( SP()->formats->calendar, get_post_meta( $post_id, 'sp_format', true ), '—' ) ); break; endswitch; } /** * Show a category filter box */ public function filters() { global $typenow, $wp_query; if ( $typenow != 'sp_calendar' ) { return; } $selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ), 'taxonomy' => 'sp_league', 'name' => 'sp_league', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ), 'taxonomy' => 'sp_season', 'name' => 'sp_season', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null; $args = array( 'post_type' => 'sp_team', 'name' => 'team', 'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ), 'selected' => $selected, 'values' => 'ID', ); wp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Filter in admin based on options * * @param mixed $query */ public function filters_query( $query ) { global $typenow, $wp_query; if ( $typenow == 'sp_calendar' ) { if ( ! empty( $_GET['team'] ) ) { $query->query_vars['meta_value'] = sanitize_key( $_GET['team'] ); $query->query_vars['meta_key'] = 'sp_team'; } } } } endif; return new SP_Admin_CPT_Calendar(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-column.php ================================================ type = 'sp_column'; // Admin Columns add_filter( 'manage_edit-sp_column_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_column_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { $columns = array( 'cb' => '', 'title' => esc_attr__( 'Label', 'sportspress' ), 'sp_key' => esc_attr__( 'Key', 'sportspress' ), 'sp_equation' => esc_attr__( 'Equation', 'sportspress' ), 'sp_precision' => esc_attr__( 'Decimal Places', 'sportspress' ), 'sp_order' => esc_attr__( 'Sort Order', 'sportspress' ), 'sp_description' => esc_attr__( 'Description', 'sportspress' ), ); return apply_filters( 'sportspress_column_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_key': global $post; echo esc_html( $post->post_name ); break; case 'sp_equation': echo wp_kses_post( sp_get_post_equation( $post_id ) ); break; case 'sp_precision': echo esc_html( sp_get_post_precision( $post_id ) ); break; case 'sp_order': echo esc_html( sp_get_post_order( $post_id ) ); break; case 'sp_description': global $post; echo '' . wp_kses_post( $post->post_excerpt ) . ''; break; endswitch; } } endif; return new SP_Admin_CPT_Column(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-event.php ================================================ type = 'sp_event'; // Post title fields add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 ); // Empty data filter add_filter( 'wp_insert_post_empty_content', array( $this, 'wp_insert_post_empty_content' ), 99, 2 ); // Before data updates add_filter( 'wp_insert_post_data', array( $this, 'wp_insert_post_data' ), 99, 2 ); // Admin Columns add_filter( 'manage_edit-sp_event_columns', array( $this, 'edit_columns' ) ); add_filter( 'manage_edit-sp_event_sortable_columns', array( $this, 'sortable_columns' ) ); add_action( 'pre_get_posts', array( $this, 'orderby_columns' ) ); add_action( 'manage_sp_event_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Filtering add_action( 'restrict_manage_posts', array( $this, 'filters' ) ); add_filter( 'parse_query', array( $this, 'filters_query' ) ); // Post states add_filter( 'display_post_states', array( $this, 'post_states' ), 10, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change title boxes in admin. * * @param string $text * @param object $post * @return string */ public function enter_title_here( $text, $post ) { if ( $post->post_type == 'sp_event' ) { return esc_attr__( '(Auto)', 'sportspress' ); } return $text; } /** * Mark as not empty when saving event if teams are selected for auto title. * * @param array $maybe_empty * @param array $postarr * @return bool */ public function wp_insert_post_empty_content( $maybe_empty, $postarr ) { if ( $maybe_empty && 'sp_event' === sp_array_value( $postarr, 'post_type' ) ) : $teams = sp_array_value( $postarr, 'sp_team', array() ); $teams = array_filter( $teams ); if ( sizeof( $teams ) ) { return false; } endif; return $maybe_empty; } /** * Auto-generate an event title based on the team playing if left blank. * * @param array $data * @param array $postarr * @return array */ public function wp_insert_post_data( $data, $postarr ) { if ( $data['post_type'] == 'sp_event' && $data['post_title'] == '' ) : $teams = sp_array_value( $postarr, 'sp_team', array() ); $teams = array_filter( $teams ); $team_names = array(); foreach ( $teams as $team ) : while ( is_array( $team ) ) { $team = array_shift( array_filter( $team ) ); } if ( $team > 0 ) { $team_names[] = sp_team_short_name( $team ); } endforeach; $team_names = array_unique( $team_names ); $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false; if ( $reverse_teams ) { $team_names = array_reverse( $team_names ); } $data['post_title'] = implode( ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ', $team_names ); endif; return $data; } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { unset( $existing_columns['author'], $existing_columns['comments'] ); $columns = array_merge( array( 'cb' => '', 'sp_format' => '', 'title' => null, 'date' => esc_attr__( 'Date', 'sportspress' ), 'sp_time' => esc_attr__( 'Time', 'sportspress' ), 'sp_team' => esc_attr__( 'Teams', 'sportspress' ), 'sp_league' => esc_attr__( 'League', 'sportspress' ), 'sp_season' => esc_attr__( 'Season', 'sportspress' ), 'sp_venue' => esc_attr__( 'Venue', 'sportspress' ), 'sp_day' => esc_attr__( 'Match Day', 'sportspress' ), ), $existing_columns, array( 'title' => esc_attr__( 'Event', 'sportspress' ), ) ); return apply_filters( 'sportspress_event_admin_columns', $columns ); } /** * Change the sortable columns in admin. */ public function sortable_columns( $columns ) { $columns['sp_day'] = 'sp_day'; return $columns; } /** * Define the sortable columns in admin. */ public function orderby_columns( $query ) { if ( ! is_admin() ) { return; } $orderby = $query->get( 'orderby' ); if ( 'sp_day' == $orderby ) { $query->set( 'meta_key', 'sp_day' ); $query->set( 'orderby', 'meta_value_num' ); } } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_format': $format = get_post_meta( $post_id, 'sp_format', true ); $formats = new SP_Formats(); $event_formats = $formats->event; if ( array_key_exists( $format, $event_formats ) ) : echo ''; endif; break; case 'sp_time': echo wp_kses_post( apply_filters( 'sportspress_event_time_admin', get_post_time( 'H:i', false, $post_id, true ) ) ); break; case 'sp_team': $teams = (array) get_post_meta( $post_id, 'sp_team', false ); $teams = array_filter( $teams ); $teams = array_unique( $teams ); $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false; if ( $reverse_teams ) { $teams = array_reverse( $teams, true ); } if ( empty( $teams ) ) : echo '—'; else : $results = get_post_meta( $post_id, 'sp_results', true ); $main_result = get_option( 'sportspress_primary_result', null ); echo ''; echo '
    '; foreach ( $teams as $team_id ) : if ( ! $team_id ) { continue; } $team = get_post( $team_id ); if ( $team ) : $team_results = sportspress_array_value( $results, $team_id, null ); if ( $main_result ) : $team_result = sportspress_array_value( $team_results, $main_result, null ); else : if ( is_array( $team_results ) ) : end( $team_results ); $team_result = prev( $team_results ); $main_result = key( $team_results ); else : $team_result = null; endif; endif; if ( is_array( $team_results ) ) : unset( $team_results['outcome'] ); $team_results = array_filter( $team_results, 'sp_filter_non_empty' ); $team_results = implode( ' | ', $team_results ); endif; echo '' . ( esc_attr( $team_result ) == '' ? '-' : wp_kses_post( apply_filters( 'sportspress_event_team_result_admin', $team_result, $post_id, $team_id ) ) ) . ''; echo ' '; echo esc_html( $team->post_title ); echo '
    '; endif; endforeach; echo '
    '; if ( current_user_can( 'edit_others_sp_events' ) ) { ?>
    'sp_team', 'name' => 'team', 'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ), 'selected' => $selected, 'values' => 'ID', ); wp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $selected = isset( $_REQUEST['sp_venue'] ) ? sanitize_key( $_REQUEST['sp_venue'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all grounds', 'sportspress' ), 'taxonomy' => 'sp_venue', 'name' => 'sp_venue', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ), 'taxonomy' => 'sp_league', 'name' => 'sp_league', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ), 'taxonomy' => 'sp_season', 'name' => 'sp_season', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['match_day'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['match_day'] ) ) : null; echo ''; if ( current_user_can( 'edit_others_sp_events' ) ) { wp_nonce_field( 'sp-save-inline-results', 'sp-inline-nonce', false ); } } /** * Filter in admin based on options * * @param mixed $query */ public function filters_query( $query ) { global $typenow, $wp_query; if ( $typenow == 'sp_event' ) { // Avoid overriding relation operator if already set if ( ! isset( $query->query_vars['meta_query']['relation'] ) ) { $query->query_vars['meta_query']['relation'] = 'AND'; } if ( ! empty( $_GET['team'] ) ) { $query->query_vars['meta_query'][] = array( 'key' => 'sp_team', 'value' => sanitize_key( $_GET['team'] ), ); } if ( ! empty( $_GET['match_day'] ) ) { $query->query_vars['meta_query'][] = array( 'key' => 'sp_day', 'value' => sanitize_text_field( wp_unslash( $_GET['match_day'] ) ), ); } } } /** * Replace displayed post state for events * * @param array $post_states * @param object $post */ public function post_states( $post_states, $post ) { $status = get_post_meta( $post->ID, 'sp_status', true ); if ( 'postponed' == $status ) { $post_states = array( esc_attr__( 'Postponed', 'sportspress' ) ); } elseif ( 'cancelled' == $status ) { $post_states = array( esc_attr__( 'Canceled', 'sportspress' ) ); } elseif ( 'tbd' == $status ) { $post_states = array( esc_attr__( 'TBD', 'sportspress' ) ); } return $post_states; } } endif; return new SP_Admin_CPT_Event(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-list.php ================================================ type = 'sp_list'; // Admin Columns add_filter( 'manage_edit-sp_list_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_list_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Filtering add_action( 'restrict_manage_posts', array( $this, 'filters' ) ); add_filter( 'parse_query', array( $this, 'filters_query' ) ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { unset( $existing_columns['author'], $existing_columns['date'] ); $columns = array_merge( array( 'cb' => '', 'title' => esc_attr__( 'Title', 'sportspress' ), 'sp_league' => esc_attr__( 'League', 'sportspress' ), 'sp_season' => esc_attr__( 'Season', 'sportspress' ), 'sp_team' => esc_attr__( 'Team', 'sportspress' ), 'sp_player' => esc_attr__( 'Players', 'sportspress' ), 'sp_layout' => esc_attr__( 'Layout', 'sportspress' ), ), $existing_columns ); return apply_filters( 'sportspress_list_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_player': $select = get_post_meta( $post_id, 'sp_select', true ); if ( 'manual' == $select ) : $players = array_filter( get_post_meta( $post_id, 'sp_player' ) ); echo esc_html( sizeof( $players ) ); else : esc_html_e( 'Auto', 'sportspress' ); endif; break; case 'sp_league': $terms = get_the_terms( $post_id, 'sp_league' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' ); break; case 'sp_season': $terms = get_the_terms( $post_id, 'sp_season' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : esc_html__( 'All', 'sportspress' ); break; case 'sp_team': $teams = (array) get_post_meta( $post_id, 'sp_team', false ); $teams = array_filter( $teams ); if ( empty( $teams ) ) : echo esc_html__( 'All', 'sportspress' ); else : foreach ( $teams as $team_id ) : if ( ! $team_id ) { continue; } $team = get_post( $team_id ); if ( $team ) { echo esc_html( $team->post_title ) . '
    '; } endforeach; endif; break; case 'sp_layout': echo esc_html( sp_array_value( SP()->formats->list, get_post_meta( $post_id, 'sp_format', true ), '—' ) ); break; endswitch; } /** * Show a category filter box */ public function filters() { global $typenow, $wp_query; if ( $typenow != 'sp_list' ) { return; } $selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ), 'taxonomy' => 'sp_league', 'name' => 'sp_league', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ), 'taxonomy' => 'sp_season', 'name' => 'sp_season', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null; $args = array( 'post_type' => 'sp_team', 'name' => 'team', 'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ), 'selected' => $selected, 'values' => 'ID', ); wp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Filter in admin based on options * * @param mixed $query */ public function filters_query( $query ) { global $typenow, $wp_query; if ( $typenow == 'sp_list' ) { if ( ! empty( $_GET['team'] ) ) { $query->query_vars['meta_value'] = sanitize_key( $_GET['team'] ); $query->query_vars['meta_key'] = 'sp_team'; } } } } endif; return new SP_Admin_CPT_List(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-metric.php ================================================ type = 'sp_metric'; // Admin Columns add_filter( 'manage_edit-sp_metric_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_metric_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { $columns = array( 'cb' => '', 'title' => esc_attr__( 'Label', 'sportspress' ), 'sp_key' => esc_attr__( 'Variable', 'sportspress' ), 'sp_description' => esc_attr__( 'Description', 'sportspress' ), ); return apply_filters( 'sportspress_metric_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_key': global $post; echo esc_html( $post->post_name ); break; case 'sp_description': global $post; echo '' . wp_kses_post( $post->post_excerpt ) . ''; break; endswitch; } } endif; return new SP_Admin_CPT_Metric(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-official.php ================================================ type = 'sp_official'; // Post title fields add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change title boxes in admin. * * @param string $text * @param object $post * @return string */ public function enter_title_here( $text, $post ) { if ( $post->post_type == 'sp_official' ) { return esc_attr__( 'Name', 'sportspress' ); } return $text; } } endif; return new SP_Admin_CPT_Official(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-outcome.php ================================================ type = 'sp_outcome'; // Admin Columns add_filter( 'manage_edit-sp_outcome_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_outcome_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { $columns = array( 'cb' => '', 'title' => esc_attr__( 'Label', 'sportspress' ), 'sp_key' => esc_attr__( 'Variable', 'sportspress' ), 'sp_abbreviation' => esc_attr__( 'Abbreviation', 'sportspress' ), 'sp_description' => esc_attr__( 'Description', 'sportspress' ), ); return apply_filters( 'sportspress_outcome_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_key': global $post; echo esc_html( $post->post_name ); break; case 'sp_abbreviation': global $post; echo esc_html( sp_get_post_abbreviation( $post->ID ) ); break; case 'sp_description': global $post; echo '' . wp_kses_post( $post->post_excerpt ) . ''; break; endswitch; } } endif; return new SP_Admin_CPT_Outcome(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-performance.php ================================================ type = 'sp_performance'; // Admin Columns add_filter( 'manage_edit-sp_performance_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_performance_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { $columns = array( 'cb' => '', 'sp_icon' => esc_attr__( 'Icon', 'sportspress' ), 'title' => esc_attr__( 'Label', 'sportspress' ), 'sp_key' => esc_attr__( 'Variable', 'sportspress' ), 'sp_section' => esc_attr__( 'Category', 'sportspress' ), 'sp_config_format' => esc_attr__( 'Format', 'sportspress' ), 'sp_description' => esc_attr__( 'Description', 'sportspress' ), ); return apply_filters( 'sportspress_performance_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_icon': echo has_post_thumbnail( $post_id ) ? wp_kses_post( edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-fit-mini' ), '', '', $post_id ) ) : ''; break; case 'sp_key': global $post; echo esc_html( $post->post_name ); break; case 'sp_section': global $post; echo esc_html( sp_get_post_section( $post->ID ) ); break; case 'sp_config_format': global $post; echo esc_html( sp_get_post_format( $post->ID ) ); break; case 'sp_description': global $post; echo '' . wp_kses_post( $post->post_excerpt ) . ''; break; endswitch; } } endif; return new SP_Admin_CPT_Performance(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-player.php ================================================ type = 'sp_player'; // Post title fields add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 ); // Admin columns add_filter( 'manage_edit-sp_player_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_player_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Filtering add_action( 'restrict_manage_posts', array( $this, 'filters' ) ); add_filter( 'parse_query', array( $this, 'filters_query' ) ); // Quick edit add_action( 'quick_edit_custom_box', array( $this, 'quick_edit_number' ), 10, 2 ); add_action( 'quick_edit_custom_box', array( $this, 'quick_edit_teams' ), 10, 2 ); add_action( 'save_post', array( $this, 'quick_save' ) ); // Bulk edit add_action( 'bulk_edit_custom_box', array( $this, 'bulk_edit_teams' ), 10, 2 ); add_action( 'wp_ajax_save_bulk_edit_sp_player', array( $this, 'bulk_save' ) ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change title boxes in admin. * * @param string $text * @param object $post * @return string */ public function enter_title_here( $text, $post ) { if ( $post->post_type == 'sp_player' ) { return esc_attr__( 'Name', 'sportspress' ); } return $text; } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { unset( $existing_columns['author'], $existing_columns['date'] ); $columns = array_merge( array( 'cb' => '', 'sp_number' => '', 'title' => null, 'sp_position' => esc_attr__( 'Positions', 'sportspress' ), 'sp_team' => esc_attr__( 'Teams', 'sportspress' ), 'sp_league' => esc_attr__( 'Leagues', 'sportspress' ), 'sp_season' => esc_attr__( 'Seasons', 'sportspress' ), ), $existing_columns, array( 'title' => esc_attr__( 'Name', 'sportspress' ), ) ); return apply_filters( 'sportspress_player_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_number': echo esc_html( get_post_meta( $post_id, 'sp_number', true ) ); break; case 'sp_position': $terms = get_the_terms( $post_id, 'sp_position' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; case 'sp_team': $current_teams = get_post_meta( $post_id, 'sp_current_team', false ); $past_teams = get_post_meta( $post_id, 'sp_past_team', false ); $current_teams = array_filter( $current_teams ); $past_teams = array_filter( $past_teams ); echo ''; $teams = (array) get_post_meta( $post_id, 'sp_team', false ); $teams = array_filter( $teams ); $teams = array_unique( $teams ); if ( empty( $teams ) ) : echo '—'; else : foreach ( $teams as $team_id ) : if ( ! $team_id ) { continue; } $team = get_post( $team_id ); if ( $team ) : echo esc_html( $team->post_title ); if ( in_array( $team_id, $current_teams ) ) : echo ''; endif; echo '
    '; endif; endforeach; endif; break; case 'sp_league': $terms = get_the_terms( $post_id, 'sp_league' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; case 'sp_season': $terms = get_the_terms( $post_id, 'sp_season' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; case 'sp_venue': $terms = get_the_terms( $post_id, 'sp_venue' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; endswitch; } /** * Show a category filter box */ public function filters() { global $typenow, $wp_query; if ( $typenow != 'sp_player' ) { return; } if ( taxonomy_exists( 'sp_position' ) ) : $selected = isset( $_REQUEST['sp_position'] ) ? sanitize_key( $_REQUEST['sp_position'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all positions', 'sportspress' ), 'taxonomy' => 'sp_position', 'name' => 'sp_position', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); endif; $selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null; $args = array( 'post_type' => 'sp_team', 'name' => 'team', 'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ), 'selected' => $selected, 'values' => 'ID', ); wp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( taxonomy_exists( 'sp_league' ) ) : $selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ), 'taxonomy' => 'sp_league', 'name' => 'sp_league', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); endif; if ( taxonomy_exists( 'sp_season' ) ) : $selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ), 'taxonomy' => 'sp_season', 'name' => 'sp_season', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); endif; } /** * Filter in admin based on options * * @param mixed $query */ public function filters_query( $query ) { if ( empty( $query->query_vars['post_type'] ) || $query->query_vars['post_type'] !== 'sp_player' ) { return $query; } global $typenow, $wp_query; if ( $typenow == 'sp_player' ) { if ( ! empty( $_GET['team'] ) ) { $query->query_vars['meta_value'] = sanitize_key( $_GET['team'] ); $query->query_vars['meta_key'] = 'sp_team'; } } return $query; } /** * Quick edit squad number * * @param string $column_name * @param string $post_type */ public function quick_edit_number( $column_name, $post_type ) { if ( $this->type !== $post_type ) { return; } if ( 'sp_number' !== $column_name ) { return; } static $print_nonce = true; if ( $print_nonce ) { $print_nonce = false; wp_nonce_field( plugin_basename( __FILE__ ), 'sp_player_edit_nonce' ); } ?>
    type !== $post_type ) { return; } if ( 'sp_team' !== $column_name ) { return; } $teams = get_posts( array( 'post_type' => 'sp_team', 'numberposts' => -1, 'post_status' => 'publish', ) ); if ( ! $teams ) { return; } ?>
    type}_edit_nonce" => '' ); if ( ! isset( $_POST[ "{$this->type}_edit_nonce" ] ) || ! wp_verify_nonce( sanitize_key( $_POST[ "{$this->type}_edit_nonce" ] ), plugin_basename( __FILE__ ) ) ) { return $post_id; } if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return $post_id; } if ( isset( $post->post_type ) && $post->post_type == 'revision' ) { return $post_id; } if ( isset( $_POST['sp_number'] ) ) { update_post_meta( $post_id, 'sp_number', sanitize_text_field( wp_unslash( $_POST['sp_number'] ) ) ); } sp_update_post_meta_recursive( $post_id, 'sp_current_team', sp_array_value( $_POST, 'sp_current_team', array() ) ); sp_update_post_meta_recursive( $post_id, 'sp_past_team', sp_array_value( $_POST, 'sp_past_team', array() ) ); sp_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() ) ) ); } /** * Bulk edit teams * * @param string $column_name * @param string $post_type */ public function bulk_edit_teams( $column_name, $post_type ) { if ( $this->type !== $post_type ) { return; } if ( 'sp_team' !== $column_name ) { return; } static $print_nonce = true; if ( $print_nonce ) { $print_nonce = false; wp_nonce_field( plugin_basename( __FILE__ ), 'sp_player_edit_nonce' ); } $teams = get_posts( array( 'post_type' => 'sp_team', 'numberposts' => -1, 'post_status' => 'publish', ) ); if ( ! $teams ) { return; } ?>
    '' ); if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['nonce'] ), plugin_basename( __FILE__ ) ) ) { return; } $post_ids = ( ! empty( $_POST['post_ids'] ) ) ? $_POST['post_ids'] : array(); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput $current_teams = sp_array_value( $_POST, 'current_teams', array() ); $past_teams = sp_array_value( $_POST, 'past_teams', array() ); $teams = array_merge( $current_teams, $past_teams ); if ( ! empty( $post_ids ) && is_array( $post_ids ) ) { foreach ( $post_ids as $post_id ) { if ( ! current_user_can( 'edit_post', $post_id ) ) { continue; } sp_add_post_meta_recursive( $post_id, 'sp_current_team', $current_teams ); sp_add_post_meta_recursive( $post_id, 'sp_past_team', $past_teams ); sp_add_post_meta_recursive( $post_id, 'sp_team', $teams ); } } die(); } } endif; return new SP_Admin_CPT_Player(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-result.php ================================================ type = 'sp_result'; // Admin Columns add_filter( 'manage_edit-sp_result_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_result_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { $columns = array( 'cb' => '', 'title' => esc_attr__( 'Label', 'sportspress' ), 'sp_key' => esc_attr__( 'Variable', 'sportspress' ), 'sp_description' => esc_attr__( 'Description', 'sportspress' ), ); return apply_filters( 'sportspress_result_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_key': global $post; echo esc_html( $post->post_name ) . 'for, ' . esc_html( $post->post_name ) . 'against'; break; case 'sp_description': global $post; echo '' . wp_kses_post( $post->post_excerpt ) . ''; break; endswitch; } } endif; return new SP_Admin_CPT_Result(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-spec.php ================================================ type = 'sp_spec'; // Admin Columns add_filter( 'manage_edit-sp_spec_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_spec_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { $columns = array( 'cb' => '', 'title' => esc_attr__( 'Label', 'sportspress' ), 'sp_key' => esc_attr__( 'Variable', 'sportspress' ), 'sp_description' => esc_attr__( 'Description', 'sportspress' ), ); return apply_filters( 'sportspress_spec_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_key': global $post; echo esc_html( $post->post_name ); break; case 'sp_description': global $post; echo '' . wp_kses_post( $post->post_excerpt ) . ''; break; endswitch; } } endif; return new SP_Admin_CPT_Spec(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-staff.php ================================================ type = 'sp_staff'; // Post title fields add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 ); // Admin Columns add_filter( 'manage_edit-sp_staff_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_staff_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Filtering add_action( 'restrict_manage_posts', array( $this, 'filters' ) ); add_filter( 'parse_query', array( $this, 'filters_query' ) ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change title boxes in admin. * * @param string $text * @param object $post * @return string */ public function enter_title_here( $text, $post ) { if ( $post->post_type == 'sp_staff' ) { return esc_attr__( 'Name', 'sportspress' ); } return $text; } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { unset( $existing_columns['author'], $existing_columns['date'] ); $columns = array_merge( array( 'cb' => '', 'title' => null, 'sp_role' => esc_attr__( 'Job', 'sportspress' ), 'sp_team' => esc_attr__( 'Teams', 'sportspress' ), 'sp_league' => esc_attr__( 'Leagues', 'sportspress' ), 'sp_season' => esc_attr__( 'Seasons', 'sportspress' ), ), $existing_columns, array( 'title' => esc_attr__( 'Name', 'sportspress' ), ) ); return apply_filters( 'sportspress_staff_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_role': $terms = get_the_terms( $post_id, 'sp_role' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; case 'sp_team': $teams = (array) get_post_meta( $post_id, 'sp_team', false ); $teams = array_filter( $teams ); if ( empty( $teams ) ) : echo '—'; else : $current_teams = get_post_meta( $post_id, 'sp_current_team', false ); foreach ( $teams as $team_id ) : if ( ! $team_id ) { continue; } $team = get_post( $team_id ); if ( $team ) : echo esc_html( $team->post_title ); if ( in_array( $team_id, $current_teams ) ) : echo ''; endif; echo '
    '; endif; endforeach; endif; break; case 'sp_league': $terms = get_the_terms( $post_id, 'sp_league' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; case 'sp_season': $terms = get_the_terms( $post_id, 'sp_season' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; endswitch; } /** * Show a category filter box */ public function filters() { global $typenow, $wp_query; if ( $typenow != 'sp_staff' ) { return; } $selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null; $args = array( 'post_type' => 'sp_team', 'name' => 'team', 'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ), 'selected' => $selected, 'values' => 'ID', ); wp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ), 'taxonomy' => 'sp_league', 'name' => 'sp_league', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ), 'taxonomy' => 'sp_season', 'name' => 'sp_season', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); } /** * Filter in admin based on options * * @param mixed $query */ public function filters_query( $query ) { global $typenow, $wp_query; if ( $typenow == 'sp_staff' ) { if ( ! empty( $_GET['team'] ) ) { $query->query_vars['meta_value'] = sanitize_key( $_GET['team'] ); $query->query_vars['meta_key'] = 'sp_team'; } } } } endif; return new SP_Admin_CPT_Staff(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-statistic.php ================================================ type = 'sp_statistic'; // Admin Columns add_filter( 'manage_edit-sp_statistic_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_statistic_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { $columns = array( 'cb' => '', 'sp_icon' => esc_attr__( 'Icon', 'sportspress' ), 'title' => esc_attr__( 'Label', 'sportspress' ), 'sp_key' => esc_attr__( 'Key', 'sportspress' ), 'sp_equation' => esc_attr__( 'Equation', 'sportspress' ), 'sp_precision' => esc_attr__( 'Decimal Places', 'sportspress' ), 'sp_description' => esc_attr__( 'Description', 'sportspress' ), ); return apply_filters( 'sportspress_statistic_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_icon': echo has_post_thumbnail( $post_id ) ? wp_kses_post( edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-fit-mini' ), '', '', $post_id ) ) : ''; break; case 'sp_key': global $post; echo esc_html( $post->post_name ); break; case 'sp_equation': echo esc_html( sp_get_post_equation( $post_id ) ); break; case 'sp_precision': echo esc_html( sp_get_post_precision( $post_id ) ); break; case 'sp_description': global $post; echo '' . wp_kses_post( $post->post_excerpt ) . ''; break; endswitch; } } endif; return new SP_Admin_CPT_Statistic(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-table.php ================================================ type = 'sp_table'; // Admin Columns add_filter( 'manage_edit-sp_table_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_table_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Filtering add_action( 'restrict_manage_posts', array( $this, 'filters' ) ); add_filter( 'parse_query', array( $this, 'filters_query' ) ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { unset( $existing_columns['date'] ); $columns = array_merge( array( 'cb' => '', 'title' => esc_attr__( 'Title', 'sportspress' ), 'sp_league' => esc_attr__( 'League', 'sportspress' ), 'sp_season' => esc_attr__( 'Season', 'sportspress' ), 'sp_team' => esc_attr__( 'Teams', 'sportspress' ), ), $existing_columns ); return apply_filters( 'sportspress_table_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_league': $terms = get_the_terms( $post_id, 'sp_league' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; case 'sp_season': $terms = get_the_terms( $post_id, 'sp_season' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; case 'sp_team': $select = get_post_meta( $post_id, 'sp_select', true ); if ( 'manual' == $select ) : $teams = array_filter( get_post_meta( $post_id, 'sp_team' ) ); echo esc_html( sizeof( $teams ) ); else : esc_html_e( 'Auto', 'sportspress' ); endif; break; endswitch; } /** * Show a category filter box */ public function filters() { global $typenow, $wp_query; if ( $typenow != 'sp_table' ) { return; } $selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ), 'taxonomy' => 'sp_league', 'name' => 'sp_league', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ), 'taxonomy' => 'sp_season', 'name' => 'sp_season', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['team'] ) ? sanitize_key( $_REQUEST['team'] ) : null; $args = array( 'post_type' => 'sp_team', 'name' => 'team', 'show_option_none' => esc_attr__( 'Show all teams', 'sportspress' ), 'selected' => $selected, 'values' => 'ID', ); wp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Filter in admin based on options * * @param mixed $query */ public function filters_query( $query ) { global $typenow, $wp_query; if ( $typenow == 'sp_table' ) { if ( ! empty( $_GET['team'] ) ) { $query->query_vars['meta_value'] = sanitize_key( $_GET['team'] ); $query->query_vars['meta_key'] = 'sp_team'; } } } } endif; return new SP_Admin_CPT_Table(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt-team.php ================================================ type = 'sp_team'; // Post title fields add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 ); // Admin Columns add_filter( 'manage_edit-sp_team_columns', array( $this, 'edit_columns' ) ); add_action( 'manage_sp_team_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 ); // Filtering add_action( 'restrict_manage_posts', array( $this, 'filters' ) ); // Call SP_Admin_CPT constructor parent::__construct(); } /** * Change title boxes in admin. * * @param string $text * @param object $post * @return string */ public function enter_title_here( $text, $post ) { if ( $post->post_type == 'sp_team' ) { return esc_attr__( 'Name', 'sportspress' ); } return $text; } /** * Change the columns shown in admin. */ public function edit_columns( $existing_columns ) { unset( $existing_columns['author'], $existing_columns['date'] ); $columns = array_merge( array( 'cb' => '', 'sp_icon' => '', 'title' => null, 'sp_short_name' => esc_attr__( 'Short Name', 'sportspress' ), 'sp_abbreviation' => esc_attr__( 'Abbreviation', 'sportspress' ), 'sp_league' => esc_attr__( 'Leagues', 'sportspress' ), 'sp_season' => esc_attr__( 'Seasons', 'sportspress' ), ), $existing_columns, array( 'title' => esc_attr__( 'Team', 'sportspress' ), ) ); return apply_filters( 'sportspress_team_admin_columns', $columns ); } /** * Define our custom columns shown in admin. * * @param string $column */ public function custom_columns( $column, $post_id ) { switch ( $column ) : case 'sp_icon': if ( has_post_thumbnail( $post_id ) ) { $edit_link = edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-fit-mini' ), '', '', $post_id ); echo $edit_link ? wp_kses_post( $edit_link ) : ''; } else { echo ''; } break; case 'sp_short_name': $short_name = get_post_meta( $post_id, 'sp_short_name', true ); echo $short_name ? esc_html( $short_name ) : '—'; break; case 'sp_abbreviation': $abbreviation = get_post_meta( $post_id, 'sp_abbreviation', true ); echo $abbreviation ? esc_html( $abbreviation ) : '—'; break; case 'sp_league': $terms = get_the_terms( $post_id, 'sp_league' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; case 'sp_season': $terms = get_the_terms( $post_id, 'sp_season' ); echo ( $terms && ! is_wp_error( $terms ) ) ? wp_kses_post( implode( ', ', wp_list_pluck( $terms, 'name' ) ) ) : '—'; break; endswitch; } /** * Show a category filter box */ public function filters() { global $typenow, $wp_query; if ( $typenow != 'sp_team' ) { return; } $selected = isset( $_REQUEST['sp_league'] ) ? sanitize_key( $_REQUEST['sp_league'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all leagues', 'sportspress' ), 'taxonomy' => 'sp_league', 'name' => 'sp_league', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); $selected = isset( $_REQUEST['sp_season'] ) ? sanitize_key( $_REQUEST['sp_season'] ) : null; $args = array( 'show_option_all' => esc_attr__( 'Show all seasons', 'sportspress' ), 'taxonomy' => 'sp_season', 'name' => 'sp_season', 'selected' => $selected, ); sp_dropdown_taxonomies( $args ); } } endif; return new SP_Admin_CPT_Team(); ================================================ FILE: includes/admin/post-types/class-sp-admin-cpt.php ================================================ type ) { $obj = get_post_type_object( $this->type ); $strings['insertIntoPost'] = sprintf( esc_attr__( 'Insert into %s', 'sportspress' ), $obj->labels->singular_name ); $strings['uploadedToThisPost'] = sprintf( esc_attr__( 'Uploaded to this %s', 'sportspress' ), $obj->labels->singular_name ); } return $strings; } /** * Check if we're editing or adding an event * * @return boolean */ private function is_editing() { if ( ! empty( $_GET['post_type'] ) && $this->type == $_GET['post_type'] ) { return true; } if ( ! empty( $_GET['post'] ) && $this->type == get_post_type( sanitize_key( $_GET['post'] ) ) ) { return true; } if ( ! empty( $_REQUEST['post_id'] ) && $this->type == get_post_type( sanitize_key( $_REQUEST['post_id'] ) ) ) { return true; } return false; } } endif; ================================================ FILE: includes/admin/post-types/class-sp-admin-meta-boxes.php ================================================ array( 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Outcome_Details::save', 'output' => 'SP_Meta_Box_Outcome_Details::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_result' => array( 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Result_Details::save', 'output' => 'SP_Meta_Box_Result_Details::output', 'context' => 'side', 'priority' => 'default', ), 'equation' => array( 'title' => esc_attr__( 'Equation', 'sportspress' ), 'save' => 'SP_Meta_Box_Result_Equation::save', 'output' => 'SP_Meta_Box_Result_Equation::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_performance' => array( 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Performance_Details::save', 'output' => 'SP_Meta_Box_Performance_Details::output', 'context' => 'normal', 'priority' => 'high', ), 'equation' => array( 'title' => esc_attr__( 'Equation', 'sportspress' ), 'save' => 'SP_Meta_Box_Performance_Equation::save', 'output' => 'SP_Meta_Box_Performance_Equation::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_column' => array( 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Column_Details::save', 'output' => 'SP_Meta_Box_Column_Details::output', 'context' => 'side', 'priority' => 'default', ), 'equation' => array( 'title' => esc_attr__( 'Equation', 'sportspress' ), 'save' => 'SP_Meta_Box_Column_Equation::save', 'output' => 'SP_Meta_Box_Column_Equation::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_metric' => array( 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Metric_Details::save', 'output' => 'SP_Meta_Box_Metric_Details::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_statistic' => array( 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Statistic_Details::save', 'output' => 'SP_Meta_Box_Statistic_Details::output', 'context' => 'side', 'priority' => 'default', ), 'equation' => array( 'title' => esc_attr__( 'Equation', 'sportspress' ), 'save' => 'SP_Meta_Box_Statistic_Equation::save', 'output' => 'SP_Meta_Box_Statistic_Equation::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_event' => array( 'shortcode' => array( 'title' => esc_attr__( 'Shortcodes', 'sportspress' ), 'output' => 'SP_Meta_Box_Event_Shortcode::output', 'context' => 'side', 'priority' => 'default', ), 'format' => array( 'title' => esc_attr__( 'Format', 'sportspress' ), 'save' => 'SP_Meta_Box_Event_Format::save', 'output' => 'SP_Meta_Box_Event_Format::output', 'context' => 'side', 'priority' => 'default', ), 'mode' => array( 'title' => esc_attr__( 'Mode', 'sportspress' ), 'save' => 'SP_Meta_Box_Event_Mode::save', 'output' => 'SP_Meta_Box_Event_Mode::output', 'context' => 'side', 'priority' => 'default', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Event_Details::save', 'output' => 'SP_Meta_Box_Event_Details::output', 'context' => 'side', 'priority' => 'default', ), 'team' => array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'save' => 'SP_Meta_Box_Event_Teams::save', 'output' => 'SP_Meta_Box_Event_Teams::output', 'context' => 'side', 'priority' => 'default', ), 'results' => array( 'title' => esc_attr__( 'Results', 'sportspress' ), 'save' => 'SP_Meta_Box_Event_Results::save', 'output' => 'SP_Meta_Box_Event_Results::output', 'context' => 'normal', 'priority' => 'high', ), 'performance' => array( 'title' => esc_attr__( 'Box Score', 'sportspress' ), 'save' => 'SP_Meta_Box_Event_Performance::save', 'output' => 'SP_Meta_Box_Event_Performance::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_team' => array( 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Team_Details::save', 'output' => 'SP_Meta_Box_Team_Details::output', 'context' => 'side', 'priority' => 'default', ), 'staff' => array( 'title' => esc_attr__( 'Staff', 'sportspress' ), 'save' => 'SP_Meta_Box_Team_Staff::save', 'output' => 'SP_Meta_Box_Team_Staff::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_player' => array( 'shortcode' => array( 'title' => esc_attr__( 'Shortcodes', 'sportspress' ), 'output' => 'SP_Meta_Box_Player_Shortcode::output', 'context' => 'side', 'priority' => 'default', ), 'columns' => array( 'title' => esc_attr__( 'Columns', 'sportspress' ), 'save' => 'SP_Meta_Box_Player_Columns::save', 'output' => 'SP_Meta_Box_Player_Columns::output', 'context' => 'side', 'priority' => 'default', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Player_Details::save', 'output' => 'SP_Meta_Box_Player_Details::output', 'context' => 'side', 'priority' => 'default', ), 'metrics' => array( 'title' => esc_attr__( 'Metrics', 'sportspress' ), 'save' => 'SP_Meta_Box_Player_Metrics::save', 'output' => 'SP_Meta_Box_Player_Metrics::output', 'context' => 'side', 'priority' => 'default', ), 'statistics' => array( 'title' => esc_attr__( 'Statistics', 'sportspress' ), 'save' => 'SP_Meta_Box_Player_Statistics::save', 'output' => 'SP_Meta_Box_Player_Statistics::output', 'context' => 'normal', 'priority' => 'high', ), ), 'sp_staff' => array( 'shortcode' => array( 'title' => esc_attr__( 'Shortcode', 'sportspress' ), 'output' => 'SP_Meta_Box_Staff_Shortcode::output', 'context' => 'side', 'priority' => 'default', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Staff_Details::save', 'output' => 'SP_Meta_Box_Staff_Details::output', 'context' => 'side', 'priority' => 'default', ), ), ); $this->meta_boxes = apply_filters( 'sportspress_meta_boxes', $meta_boxes ); foreach ( $this->meta_boxes as $post_type => $meta_boxes ) { $i = 0; foreach ( $meta_boxes as $id => $meta_box ) { if ( array_key_exists( 'save', $meta_box ) ) { add_action( 'sportspress_process_' . $post_type . '_meta', $meta_box['save'], ( $i + 1 ) * 10, 2 ); } $i++; } } add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 ); add_action( 'add_meta_boxes', array( $this, 'rename_meta_boxes' ), 20 ); add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 30 ); add_action( 'save_post', array( $this, 'save_meta_boxes' ), 1, 2 ); } /** * Add SP Meta boxes */ public function add_meta_boxes() { foreach ( $this->meta_boxes as $post_type => $meta_boxes ) { foreach ( $meta_boxes as $id => $meta_box ) { if ( array_key_exists( 'output', $meta_box ) ) { add_meta_box( 'sp_' . $id . 'div', $meta_box['title'], $meta_box['output'], $post_type, $meta_box['context'], $meta_box['priority'] ); } } } } /** * Remove bloat */ public function remove_meta_boxes() { // Events remove_meta_box( 'sp_venuediv', 'sp_event', 'side' ); remove_meta_box( 'sp_leaguediv', 'sp_event', 'side' ); remove_meta_box( 'sp_seasondiv', 'sp_event', 'side' ); // Teams remove_meta_box( 'sp_leaguediv', 'sp_team', 'side' ); remove_meta_box( 'sp_seasondiv', 'sp_team', 'side' ); remove_meta_box( 'sp_venuediv', 'sp_team', 'side' ); // Players remove_meta_box( 'sp_seasondiv', 'sp_player', 'side' ); remove_meta_box( 'sp_leaguediv', 'sp_player', 'side' ); remove_meta_box( 'sp_positiondiv', 'sp_player', 'side' ); // Staff remove_meta_box( 'sp_rolediv', 'sp_staff', 'side' ); remove_meta_box( 'sp_seasondiv', 'sp_staff', 'side' ); remove_meta_box( 'sp_leaguediv', 'sp_staff', 'side' ); } /** * Rename core meta boxes */ public function rename_meta_boxes() { remove_meta_box( 'submitdiv', 'sp_event', 'side' ); add_meta_box( 'submitdiv', esc_attr__( 'Event', 'sportspress' ), 'post_submit_meta_box', 'sp_event', 'side', 'high' ); remove_meta_box( 'postimagediv', 'sp_team', 'side' ); add_meta_box( 'postimagediv', esc_attr__( 'Logo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_team', 'side', 'low' ); remove_meta_box( 'postimagediv', 'sp_player', 'side' ); add_meta_box( 'postimagediv', esc_attr__( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_player', 'side', 'low' ); remove_meta_box( 'postimagediv', 'sp_staff', 'side' ); add_meta_box( 'postimagediv', esc_attr__( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_staff', 'side', 'low' ); remove_meta_box( 'postimagediv', 'sp_performance', 'side' ); add_meta_box( 'postimagediv', esc_attr__( 'Icon', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_performance', 'side', 'low' ); remove_meta_box( 'postimagediv', 'sp_statistic', 'side' ); add_meta_box( 'postimagediv', esc_attr__( 'Icon', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_statistic', 'side', 'low' ); } /** * Check if we're saving, then trigger an action based on the post type * * @param int $post_id * @param object $post */ public function save_meta_boxes( $post_id, $post ) { if ( empty( $post_id ) || empty( $post ) ) { return; } if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } if ( is_int( wp_is_post_revision( $post ) ) ) { return; } if ( is_int( wp_is_post_autosave( $post ) ) ) { return; } if ( empty( $_POST['sportspress_meta_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['sportspress_meta_nonce'] ), 'sportspress_save_data' ) ) { return; } if ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) { return; } if ( ! is_sp_post_type( $post->post_type ) && ! is_sp_config_type( $post->post_type ) ) { return; } do_action( 'sportspress_process_' . $post->post_type . '_meta', $post_id, $post ); } } new SP_Admin_Meta_Boxes(); ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php ================================================ ID, 'sp_columns', true ); $title_format = get_option( 'sportspress_event_list_title_format', 'title' ); $time_format = get_option( 'sportspress_event_list_time_format', 'combined' ); if ( is_array( $selected ) ) { $selected = array_filter( $selected ); } $columns = array(); if ( 'teams' === $title_format ) { $columns['event'] = esc_attr__( 'Home', 'sportspress' ) . ' | ' . esc_attr__( 'Away', 'sportspress' ); } elseif ( 'homeaway' === $title_format ) { $columns['event'] = esc_attr__( 'Teams', 'sportspress' ); } else { $columns['event'] = esc_attr__( 'Title', 'sportspress' ); } if ( 'time' === $time_format || 'separate' === $time_format ) { $columns['time'] = esc_attr__( 'Time', 'sportspress' ); } elseif ( 'combined' === $time_format ) { $columns['time'] = esc_attr__( 'Time/Results', 'sportspress' ); } if ( 'results' === $time_format || 'separate' === $time_format ) { $columns['results'] = esc_attr__( 'Results', 'sportspress' ); } $columns['league'] = esc_attr__( 'League', 'sportspress' ); $columns['season'] = esc_attr__( 'Season', 'sportspress' ); $columns['venue'] = esc_attr__( 'Venue', 'sportspress' ); $columns['article'] = esc_attr__( 'Article', 'sportspress' ); $columns['day'] = esc_attr__( 'Match Day', 'sportspress' ); $columns = apply_filters( 'sportspress_calendar_columns', $columns ); ?>
      $label ) { ?>
    data(); $usecolumns = $calendar->columns; self::table( $data, $usecolumns ); } /** * Save meta box data */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'text' ) ); } /** * Admin edit table */ public static function table( $data = array(), $usecolumns = null ) { $title_format = get_option( 'sportspress_event_list_title_format', 'title' ); $time_format = get_option( 'sportspress_event_list_time_format', 'combined' ); if ( is_array( $usecolumns ) ) { $usecolumns = array_filter( $usecolumns ); } else { $usecolumns = array(); } ?>
    0 ) : $main_result = get_option( 'sportspress_primary_result', null ); $i = 0; foreach ( $data as $event ) : $teams = get_post_meta( $event->ID, 'sp_team' ); $results = get_post_meta( $event->ID, 'sp_results', true ); $video = get_post_meta( $event->ID, 'sp_video', true ); $main_results = array(); ?>
    post_title ); ?>
    ID, $team ); $main_results[] = $team_result; unset( $team_results['outcome'] ); $team_results = implode( ' | ', $team_results ); echo '' . esc_attr( $team_result ) . ' '; endif; echo esc_html( $name ) . '
    '; endif; endforeach; else : echo '—'; endif; ?>
    ID ) ); ?> ID ) ); endif; ?> ID, 'sp_league' ); ?> ID, 'sp_season' ); ?> ID, 'sp_venue' ); ?>
    ID ) ) : ?>
    post_content == null ) : esc_attr_e( 'None', 'sportspress' ); elseif ( $event->post_status == 'publish' ) : esc_attr_e( 'Recap', 'sportspress' ); else : esc_attr_e( 'Preview', 'sportspress' ); endif; ?>
    ID, 'sp_day', true ); if ( '' == $day ) { echo '—'; } else { echo esc_html( $day ); } ?>
    ID, 'sp_caption', true ); $status = get_post_meta( $post->ID, 'sp_status', true ); $date = get_post_meta( $post->ID, 'sp_date', true ); $date_from = get_post_meta( $post->ID, 'sp_date_from', true ); $date_to = get_post_meta( $post->ID, 'sp_date_to', true ); $date_past = get_post_meta( $post->ID, 'sp_date_past', true ); $date_future = get_post_meta( $post->ID, 'sp_date_future', true ); $date_relative = get_post_meta( $post->ID, 'sp_date_relative', true ); $event_format = get_post_meta( $post->ID, 'sp_event_format', true ); $day = get_post_meta( $post->ID, 'sp_day', true ); $teams = get_post_meta( $post->ID, 'sp_team', false ); $players = get_post_meta( $post->ID, 'sp_player', false ); $table_id = get_post_meta( $post->ID, 'sp_table', true ); $orderby = get_post_meta( $post->ID, 'sp_orderby', true ); $order = get_post_meta( $post->ID, 'sp_order', true ); ?>

    'sp_status', 'id' => 'sp_status', 'selected' => $status, ); sp_dropdown_statuses( $args ); ?>

    'sp_date', 'id' => 'sp_date', 'selected' => $date, ); sp_dropdown_dates( $args ); ?>

    :

    'sp_team', 'name' => 'sp_team[]', 'selected' => $teams, 'values' => 'ID', 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, 'placeholder' => esc_attr__( 'All', 'sportspress' ), ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_team', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    'sp_player', 'name' => 'sp_player[]', 'selected' => $players, 'values' => 'ID', 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, 'placeholder' => esc_attr__( 'All', 'sportspress' ), ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_player', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    calendar; ?>
    $formats ) { ?>

    ID, 'sp_format', true ); ?>
    formats->calendar as $key => $format ) : ?> >
    ID, 'sp_format', true ); if ( ! $the_format ) { $the_format = 'calendar'; } ?>

    ID, 'sp_equation', true ) ); $order = get_post_meta( $post->ID, 'sp_order', true ); $priority = get_post_meta( $post->ID, 'sp_priority', true ); $precision = get_post_meta( $post->ID, 'sp_precision', true ); // Defaults if ( $precision == '' ) { $precision = 0; } ?>

    ID, 'sp_equation', true ); self::builder( $post->post_title, $equation, array( 'team_event', 'outcome', 'result', 'subset', 'preset' ) ); } } ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-config.php ================================================ posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $title, $post['post_type'], $id ) ); if ( $post_name_check ) : wp_delete_post( $post_name_check, true ); $post['post_status'] = 'draft'; endif; return $post_name_check; } } ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php ================================================ esc_attr__( 'Attended', 'sportspress' ), '$eventsplayed' => esc_attr__( 'Played', 'sportspress' ), '$eventsstarted' => esc_attr__( 'Started', 'sportspress' ), '$eventssubbed' => esc_attr__( 'Substituted', 'sportspress' ), '$eventminutes' => esc_attr__( 'Minutes', 'sportspress' ), ); break; case 'team_event': $options['Events'] = array( '$eventsplayed' => esc_attr__( 'Played', 'sportspress' ), '$eventminutes' => esc_attr__( 'Minutes', 'sportspress' ), ); break; case 'result': $options['Results'] = self::optgroup( 'sp_result', array( 'for' => '(' . esc_attr__( 'for', 'sportspress' ) . ')', 'against' => '(' . esc_attr__( 'against', 'sportspress' ) . ')', ), null, false ); break; case 'outcome': $options['Outcomes'] = self::optgroup( 'sp_outcome' ); break; case 'preset': $options['Presets'] = array( '$gamesback' => esc_attr__( 'Games Back', 'sportspress' ), '$homerecord' => esc_attr__( 'Home Record', 'sportspress' ), '$awayrecord' => esc_attr__( 'Away Record', 'sportspress' ), '$streak' => esc_attr__( 'Streak', 'sportspress' ), '$form' => esc_attr__( 'Form', 'sportspress' ), '$last5' => esc_attr__( 'Last 5', 'sportspress' ), '$last10' => esc_attr__( 'Last 10', 'sportspress' ), ); break; case 'subset': $options['Subsets'] = array( '_home' => '@' . esc_attr__( 'Home', 'sportspress' ), '_away' => '@' . esc_attr__( 'Away', 'sportspress' ), '_venue' => '@' . esc_attr__( 'Venue', 'sportspress' ), ); break; case 'performance': $options['Performance'] = self::optgroup( 'sp_performance' ); break; case 'metric': $options['Metrics'] = self::optgroup( 'sp_metric' ); break; endswitch; endforeach; // Add operators to options $options['Operators'] = array( '+' => '+', '-' => '−', '*' => '×', '/' => '÷', '(' => '(', ')' => ')', ); // Create array of constants $max = 10; $constants = array(); for ( $i = 0; $i <= $max; $i ++ ) : $constants[ $i ] = $i; endfor; // Add 100 to constants $constants[100] = 100; // Add constants to options $options['Constants'] = (array) $constants; $options = apply_filters( 'sportspress_equation_options', $options ); ?>
    $option ) : ?> class="alternate">
    $value ) : $parts[ $key ] = $value; ?>
    = ×
    $type, 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_format', 'value' => 'number', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_format', 'value' => array( 'equation', 'text' ), 'compare' => 'NOT IN', ), ), ); $vars = get_posts( $args ); // Add extra vars to the array if ( isset( $defaults ) && is_array( $defaults ) ) : foreach ( $defaults as $key => $value ) : $arr[ $key ] = $value; endforeach; endif; // Add vars to the array if ( isset( $variations ) && is_array( $variations ) ) : foreach ( $vars as $var ) : if ( $totals ) { $arr[ '$' . $var->post_name ] = $var->post_title; } foreach ( $variations as $key => $value ) : $arr[ '$' . $var->post_name . $key ] = $var->post_title . ' ' . $value; endforeach; endforeach; else : foreach ( $vars as $var ) : $arr[ '$' . $var->post_name ] = $var->post_title; endforeach; endif; return (array) $arr; } /** * Equation part labels for localization * * @return null */ public static function equation_part_labels() { __( 'Presets', 'sportspress' ); __( 'Operators', 'sportspress' ); __( 'Subsets', 'sportspress' ); __( 'Constants', 'sportspress' ); } } ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php ================================================ ID, 'sp_day', true ); $taxonomies = get_object_taxonomies( 'sp_event' ); $minutes = get_post_meta( $post->ID, 'sp_minutes', true ); ?>

    ID, 'sp_venue' ); $args = array( 'taxonomy' => 'sp_venue', 'name' => 'tax_input[sp_venue][]', 'class' => 'sp-has-dummy', 'selected' => sp_get_the_term_id_or_meta( $post->ID, 'sp_venue' ), 'values' => 'term_id', 'show_option_none' => esc_attr__( '— Not set —', 'sportspress' ), 'chosen' => true, ); if ( in_array( 'sp_venue', apply_filters( 'sportspress_event_auto_taxonomies', array( 'sp_venue' ) ) ) ) { $args['show_option_all'] = esc_attr__( '(Auto)', 'sportspress' ); } if ( ! sp_dropdown_taxonomies( $args ) ) { sp_taxonomy_adder( 'sp_venue', 'sp_event', esc_attr__( 'Add New', 'sportspress' ) ); } ?>

    ID, 'sp_format', true ); ?>
    formats->event as $key => $format ) : ?> >
    ID ); ?>
    esc_attr__( 'Team vs team', 'sportspress' ), 'player' => esc_attr__( 'Player vs player', 'sportspress' ), ) as $key => $mode ) : ?> >
    * @author ThemeBoy * @category Admin * @package SportsPress/Admin/Meta_Boxes * @version 2.7.9 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } /** * SP_Meta_Box_Event_Officials */ class SP_Meta_Box_Event_Officials { /** * Output the metabox */ public static function output( $post ) { $duties = get_terms( array( 'taxonomy' => 'sp_duty', 'hide_empty' => false, 'orderby' => 'meta_value_num', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_order', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_order', 'compare' => 'EXISTS', ), ), ) ); $officials = (array) get_post_meta( $post->ID, 'sp_officials', true ); if ( is_array( $duties ) && sizeof( $duties ) ) { foreach ( $duties as $duty ) { ?>

    name ); ?>

    'sp_official', 'name' => 'sp_officials[' . $duty->term_id . '][]', 'selected' => sp_array_value( $officials, $duty->term_id, array() ), 'values' => 'ID', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Officials', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); if ( ! sp_dropdown_pages( $args ) ) { sp_post_adder( 'sp_official', esc_attr__( 'Add New', 'sportspress' ) ); } ?>

    performance( true ); if ( 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'no' ) ) { $timeline = $event->timeline( true ); } else { $timeline = false; } // Determine if columns are auto or manual if ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) ) { $manual = true; } else { $manual = false; } // Determine if we need checkboxes if ( $manual ) { $has_checkboxes = true; } else { $has_checkboxes = false; } // Get player number option $numbers = 'yes' == get_option( 'sportspress_event_show_player_numbers', 'yes' ) ? true : false; // Get positions $positions = array(); if ( 'yes' == get_option( 'sportspress_event_show_position', 'yes' ) && taxonomy_exists( 'sp_position' ) ) : $args = array( 'hide_empty' => false, 'parent' => 0, 'include_children' => true, ); $positions = get_terms( 'sp_position', $args ); endif; // Apply filters to labels $labels = apply_filters( 'sportspress_event_performance_labels_admin', $labels ); // Check if individual mode $is_individual = 'player' === sp_get_post_mode( $post->ID ); // Get status option $status = ! $is_individual; self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual, $timeline, $timed, $stars ); } /** * Save meta box data */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array(), 'text' ) ); update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array(), 'int' ) ); update_post_meta( $post_id, 'sp_timeline', sp_array_value( $_POST, 'sp_timeline', array(), 'text' ) ); update_post_meta( $post_id, 'sp_stars', sp_array_value( $_POST, 'sp_stars', array(), 'text' ) ); if ( isset( $_POST['sp_columns'] ) ) { $columns = array_filter( (array) sp_array_value( $_POST, 'sp_columns', array(), 'key' ) ); update_post_meta( $post_id, 'sp_columns', $columns ); } } /** * Admin edit tables */ public 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() ) { $sections = get_option( 'sportspress_event_performance_sections', -1 ); global $pagenow; if ( $pagenow === 'post-new.php' || $is_individual ) { ?>
    $team_id ) : if ( -1 == $team_id ) { continue; } // Get results for players in the team $players = sp_array_between( (array) get_post_meta( $post_id, 'sp_player', false ), 0, $key ); $players[] = -1; $data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) ); // Get team timeline if ( is_array( $timeline ) ) : $team_timeline = (array) sp_array_value( $timeline, $team_id, array() ); else : $team_timeline = false; endif; foreach ( $data as $player_id => $player_performance ) : // Get player timeline if ( is_array( $team_timeline ) ) : $player_timeline = (array) sp_array_value( $team_timeline, $player_id, array() ); else : $player_timeline = false; endif; self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, false, $numbers, -1, $formats, $player_timeline, $timed, $stars ); endforeach; endforeach; ?>
    $team_id ) : if ( -1 == $team_id ) { continue; } if ( -1 == $sections ) { // Get results for players in the team $players = sp_array_between( (array) get_post_meta( $post_id, 'sp_player', false ), 0, $key ); $players[] = -1; $data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) ); // Get team timeline if ( is_array( $timeline ) ) : $team_timeline = (array) sp_array_value( $timeline, $team_id, array() ); else : $team_timeline = false; endif; ?>

    'sp_performance', 'numberposts' => 100, 'posts_per_page' => 100, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_format', 'value' => 'number', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_format', 'value' => 'equation', 'compare' => '!=', ), ), ); $performances = get_posts( $args ); $labels = array( array(), array() ); foreach ( $performances as $performance ) : $section = get_post_meta( $performance->ID, 'sp_section', true ); if ( '' === $section ) { $section = -1; } switch ( $section ) : case 1: $labels[1][ $performance->post_name ] = $performance->post_title; break; default: $labels[0][ $performance->post_name ] = $performance->post_title; endswitch; endforeach; $offense = (array) get_post_meta( $post_id, 'sp_offense', false ); $defense = (array) get_post_meta( $post_id, 'sp_defense', false ); $data = array(); if ( sizeof( $offense ) || sizeof( $defense ) ) { // Get results for offensive players in the team $offense = sp_array_between( $offense, 0, $key ); $offense[] = -1; $data[0] = sp_array_combine( $offense, sp_array_value( $stats, $team_id, array() ) ); // Get results for defensive players in the team $defense = sp_array_between( $defense, 0, $key ); $defense[] = -1; $data[1] = sp_array_combine( $defense, sp_array_value( $stats, $team_id, array() ) ); } else { // Get results for all players in the team $players = sp_array_between( (array) get_post_meta( $post_id, 'sp_player', false ), 0, $key ); $players[] = -1; $data[0] = $data[1] = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) ); } // Get team timeline if ( is_array( $timeline ) ) : $team_timeline = (array) sp_array_value( $timeline, $team_id, array() ); else : $team_timeline = false; endif; // Determine order of sections if ( 1 == $sections ) { $section_order = array( 1 => esc_attr__( 'Defense', 'sportspress' ), 0 => esc_attr__( 'Offense', 'sportspress' ), ); } else { $section_order = array( esc_attr__( 'Offense', 'sportspress' ), esc_attr__( 'Defense', 'sportspress' ) ); } foreach ( $section_order as $section_id => $section_label ) { ?>

    $player ) { if ( ! array_key_exists( $key, $players ) ) { $players[ $key ] = $player; } } $data = $players; } foreach ( $data as $player_id => $player_performance ) : // Get player timeline if ( is_array( $team_timeline ) ) : $player_timeline = (array) sp_array_value( $team_timeline, $player_id, array() ); else : $player_timeline = false; endif; self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, true, $numbers, $section, $formats, $player_timeline, $timed, $stars ); endforeach; ?>
      # $label ) : ?>       $label ) : if ( 'equation' === sp_array_value( $formats, $column, 'number' ) ) { continue; } $player_id = 0; $player_performance = sp_array_value( $data, $player_id, array() ); $value = sp_array_value( $player_performance, $column, '' ); $format = sp_array_value( $formats, $column, 'number' ); $placeholder = sp_get_format_placeholder( $format ); ?>     'sp_position', 'name' => 'sp_players[' . $team_id . '][' . $player_id . '][position][]', 'values' => 'term_id', 'orderby' => 'meta_value_num', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_order', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_order', 'compare' => 'EXISTS', ), ), 'selected' => $selected, 'class' => 'sp-position', 'property' => 'multiple', 'chosen' => true, 'include_children' => ( 'no' == get_option( 'sportspress_event_hide_child_positions', 'no' ) ), ); sp_dropdown_taxonomies( $args ); ?> $label ) : if ( 'equation' === sp_array_value( $formats, $column, 'number' ) ) { continue; } $value = sp_array_value( $player_performance, $column, '' ); $intval = intval( $value ); $placeholder = sp_get_format_placeholder( sp_array_value( $formats, $column, 'number' ) ); ?> />
    array( 'class' => array(), 'name' => array() ), 'option' => array( 'value' => array(), 'selected' => array() ) ) ); ?>
    array( 'class' => array(), 'name' => array() ), 'option' => array( 'value' => array(), 'selected' => array() ) ) ); ?>
    '; break; default: echo ''; } ?> esc_attr__( 'Starting Lineup', 'sportspress' ), 'sub' => esc_attr__( 'Substitute', 'sportspress' ), ) ); $output = ''; return $output; } /** * Substitute selector */ public static function sub_select( $team_id, $player_id, $value, $data = array() ) { if ( ! $team_id || ! $player_id ) { return '—'; } $output = ''; return $output; } } ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php ================================================ results( true ); self::table( $columns, $usecolumns, $data, $has_checkboxes ); } /** * Save meta box data */ public static function save( $post_id, $post ) { $results = (array) sp_array_value( $_POST, 'sp_results', array(), 'text' ); $main_result = get_option( 'sportspress_primary_result', null ); // Get player performance $performance = sp_array_value( $_POST, 'sp_players', array(), 'text' ); // Initialize finished $finished = false; // Check if any results are recorded foreach ( $results as $team => $team_results ) { foreach ( $team_results as $result ) { if ( '' !== $result ) { $finished = true; break; } } } // Check if any performance is recorded if ( ! $finished ) { foreach ( $performance as $team => $players ) { foreach ( $players as $player => $pp ) { if ( 0 >= $player ) { continue; } foreach ( $pp as $pk => $pv ) { if ( in_array( $pk, apply_filters( 'sportspress_event_auto_result_bypass_keys', array( 'number', 'status', 'sub' ) ) ) ) { continue; } if ( is_array( $pv ) ) { continue; } $pv = trim( $pv ); if ( '' == $pv ) { continue; } if ( ! ctype_digit( $pv ) ) { continue; } $finished = true; break; } } } } if ( $finished ) { // Get results with equations $args = array( 'post_type' => 'sp_result', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => 'sp_equation', 'compare' => 'EXISTS', ), ), ); $dynamic_results = get_posts( $args ); $equations = array(); $precision = array(); foreach ( $dynamic_results as $result ) { $equations[ $result->post_name ] = get_post_meta( $result->ID, 'sp_equation', true ); $precision[ $result->post_name ] = (int) get_post_meta( $result->ID, 'sp_precision', true ); } // Apply equations to empty results foreach ( $equations as $key => $equation ) { if ( '' == $equation ) { continue; } foreach ( $results as $team => $team_results ) { if ( '' === sp_array_value( $team_results, $key, '' ) ) { $totals = array(); $players = sp_array_value( $performance, $team, array() ); foreach ( $players as $player => $pp ) { foreach ( $pp as $pk => $pv ) { $value = sp_array_value( $totals, $pk, 0 ); $value += floatval( $pv ); $totals[ $pk ] = $value; } } $totals['eventsplayed'] = 1; $totals = apply_filters( 'sportspress_event_result_equation_vars', $totals, $performance, $team ); $results[ $team ][ $key ] = sp_solve( $equation, $totals, sp_array_value( $precision, $key, 0 ), '' ); } } } } // Auto outcome $primary_results = array(); foreach ( $results as $team => $team_results ) { if ( $main_result ) { $primary_results[ $team ] = sp_array_value( $team_results, $main_result, null ); } else { if ( is_array( $team_results ) ) { end( $team_results ); $primary_results[ $team ] = prev( $team_results ); } else { $primary_results[ $team ] = null; } } } arsort( $primary_results ); if ( count( $primary_results ) && ! in_array( null, $primary_results ) ) { if ( count( array_unique( $primary_results ) ) === 1 ) { $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_key' => 'sp_condition', 'meta_value' => '=', ); $outcomes = get_posts( $args ); foreach ( $results as $team => $team_results ) { if ( array_key_exists( 'outcome', $team_results ) ) { continue; } if ( $outcomes ) { $results[ $team ]['outcome'] = array(); foreach ( $outcomes as $outcome ) { $results[ $team ]['outcome'][] = $outcome->post_name; } } } } else { // Get default outcomes $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_key' => 'sp_condition', 'meta_value' => 'else', ); $default_outcomes = get_posts( $args ); // Get greater than outcomes $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_condition', 'value' => '>', ), array( 'key' => 'sp_condition', 'value' => '>', ), ), ); $gt_outcomes = get_posts( $args ); if ( empty( $gt_outcomes ) ) { $gt_outcomes = $default_outcomes; } // Get less than outcomes $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_condition', 'value' => '<', ), array( 'key' => 'sp_condition', 'value' => '<', ), ), ); $lt_outcomes = get_posts( $args ); if ( empty( $lt_outcomes ) ) { $lt_outcomes = $default_outcomes; } // Get min and max values $min = min( $primary_results ); $max = max( $primary_results ); foreach ( $primary_results as $key => $value ) { if ( ! array_key_exists( 'outcome', $results[ $key ] ) ) { if ( $min == $value ) { $outcomes = $lt_outcomes; } elseif ( $max == $value ) { $outcomes = $gt_outcomes; } else { $outcomes = $default_outcomes; } $results[ $key ]['outcome'] = array(); foreach ( $outcomes as $outcome ) { $results[ $key ]['outcome'][] = $outcome->post_name; } } } } } // Update meta update_post_meta( $post_id, 'sp_results', $results ); update_post_meta( $post_id, 'sp_result_columns', sp_array_value( $_POST, 'sp_result_columns', array(), 'key' ) ); } /** * Admin edit table */ public static function table( $columns = array(), $usecolumns = array(), $data = array(), $has_checkboxes = false ) { // Get results with equations $args = array( 'post_type' => 'sp_result', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => 'sp_equation', 'compare' => 'NOT IN', 'value' => '', ), ), ); $dynamic_results = get_posts( $args ); $auto_columns = wp_list_pluck( $dynamic_results, 'post_name' ); ?>
    $label ) : ?> $team_results ) : if ( ! $team_id || -1 == $team_id ) { continue; } ?> $label ) : $value = sp_array_value( $team_results, $column, '' ); ?>
    placeholder="" /> 'sp_outcome', 'name' => 'sp_results[' . $team_id . '][outcome][]', 'option_none_value' => '', 'sort_order' => 'ASC', 'sort_column' => 'menu_order', 'selected' => $values, 'class' => 'sp-outcome', 'property' => 'multiple', 'chosen' => true, 'placeholder' => esc_attr__( '(Auto)', 'sportspress' ), ); sp_dropdown_pages( $args ); ?>
    esc_attr__( 'Results', 'sportspress' ), 'event_details' => esc_attr__( 'Details', 'sportspress' ), 'event_performance' => esc_attr__( 'Box Score', 'sportspress' ), 'event_venue' => esc_attr__( 'Venue', 'sportspress' ), 'event_officials' => esc_attr__( 'Officials', 'sportspress' ), 'event_teams' => esc_attr__( 'Teams', 'sportspress' ), 'event_full' => esc_attr__( 'Full Info', 'sportspress' ), ) ); if ( $shortcodes ) { ?>

    $label ) { ?>

    ID, 'sp_specs', true ); $args = array( 'post_type' => 'sp_spec', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $vars = get_posts( $args ); if ( $vars ) : foreach ( $vars as $var ) : ?>

    post_title ); ?>

    ID, 'sp_team', false ); $post_type = sp_get_post_mode_type( $post->ID ); if ( $limit && 'sp_player' !== $post_type ) { for ( $i = 0; $i < $limit; $i ++ ) : $team = array_shift( $teams ); ?>

    $post_type, 'name' => 'sp_team[]', 'class' => 'sportspress-pages', 'show_option_none' => esc_attr__( '— None —', 'sportspress' ), 'values' => 'ID', 'selected' => $team, 'chosen' => true, 'tax_query' => array(), ); if ( 'yes' == get_option( 'sportspress_event_filter_teams_by_league', 'no' ) ) { $league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 ); if ( $league_id ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'terms' => $league_id, ); } } if ( 'yes' == get_option( 'sportspress_event_filter_teams_by_season', 'no' ) ) { $season_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 ); if ( $season_id ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'terms' => $season_id, ); } } if ( ! sp_dropdown_pages( $args ) ) { unset( $args['tax_query'] ); sp_dropdown_pages( $args ); } ?>

    esc_attr__( 'Offense', 'sportspress' ), 'post_type' => 'sp_player', ); $tabs['sp_defense'] = array( 'label' => esc_attr__( 'Defense', 'sportspress' ), 'post_type' => 'sp_player', ); } elseif ( 1 == $sections ) { $tabs['sp_defense'] = array( 'label' => esc_attr__( 'Defense', 'sportspress' ), 'post_type' => 'sp_player', ); $tabs['sp_offense'] = array( 'label' => esc_attr__( 'Offense', 'sportspress' ), 'post_type' => 'sp_player', ); } else { $tabs['sp_player'] = array( 'label' => esc_attr__( 'Players', 'sportspress' ), 'post_type' => 'sp_player', ); } $tabs['sp_staff'] = array( 'label' => esc_attr__( 'Staff', 'sportspress' ), 'post_type' => 'sp_staff', ); ?>
      $tab ) { ?>
    $tab ) { do_action( 'sportspress_event_teams_meta_box_checklist', $post->ID, $tab['post_type'], ( 0 == $j ? 'block' : 'none' ), $team, $i, $slug ); $j++; } ?>

    ID ) ) ); ?>

    $post_type, 'name' => 'sp_team[]', 'selected' => $teams, 'values' => 'ID', 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, 'placeholder' => esc_attr__( 'None', 'sportspress' ), ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( $post_type, esc_attr__( 'Add New', 'sportspress' ) ); endif; } wp_nonce_field( 'sp-get-players', 'sp-get-players-nonce', false ); } /** * Save meta box data */ public static function save( $post_id, $post ) { $teams = sp_array_value( $_POST, 'sp_team', array(), 'int' ); sp_update_post_meta_recursive( $post_id, 'sp_team', $teams ); $post_type = sp_get_post_mode_type( $post->ID ); if ( 'sp_player' === $post_type ) { $players = array(); foreach ( $teams as $player ) { $players[] = array( 0, $player ); } sp_update_post_meta_recursive( $post_id, 'sp_player', $players ); } else { $tabs = array(); $sections = get_option( 'sportspress_event_performance_sections', -1 ); if ( -1 == $sections ) { sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array(), 'int' ) ); } else { $players = array_merge( sp_array_value( $_POST, 'sp_offense', array() ), sp_array_value( $_POST, 'sp_defense', array(), 'int' ) ); sp_update_post_meta_recursive( $post_id, 'sp_offense', sp_array_value( $_POST, 'sp_offense', array(), 'int' ) ); sp_update_post_meta_recursive( $post_id, 'sp_defense', sp_array_value( $_POST, 'sp_defense', array(), 'int' ) ); sp_update_post_meta_recursive( $post_id, 'sp_player', $players ); } sp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array(), 'int' ) ); } } } ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php ================================================ ID, 'sp_video', true ); if ( $video ) : ?>
    array( 'title' => array(), 'width' => array(), 'height' => array(), 'src' => array(), 'frameborder' => array(), 'allow' => array(), 'allowfullscreen' => array(), 'style' => array()) ) ); ?>

    ID, 'sp_columns', true ); $orderby = get_post_meta( $post->ID, 'sp_orderby', true ); ?>

    ID, 'sp_performance', 'block', $selected ); sp_column_checklist( $post->ID, 'sp_metric', 'none', $selected ); sp_column_checklist( $post->ID, 'sp_statistic', 'none', $selected ); ?>
    data( true ); $adjustments = $list->adjustments; self::table( $columns, $data, $placeholders, $adjustments, $orderby ); } } /** * Save meta box data */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_adjustments', sp_array_value( $_POST, 'sp_adjustments', array(), 'text' ) ); update_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array(), 'text' ) ); } /** * Admin edit table */ public static function table( $columns = array(), $data = array(), $placeholders = array(), $adjustments = array(), $orderby = 'number' ) { $show_player_photo = get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false; ?>
    • |
    $label ) : ?> 0 ) : $i = 0; foreach ( $data as $player_id => $player_stats ) : if ( ! $player_id ) { continue; } $teams = get_post_meta( $player_id, 'sp_team', false ); $div = get_term( $player_id, 'sp_season' ); $number = get_post_meta( $player_id, 'sp_number', true ); $default_name = sp_array_value( $player_stats, 'name', '' ); if ( $default_name == null ) { $default_name = get_the_title( $player_id ); } ?> $label ) : if ( in_array( $column, array( 'number', 'team', 'position' ) ) ) { continue; } $value = sp_array_value( $player_stats, $column, '' ); $placeholder = sp_array_value( sp_array_value( $placeholders, $player_id, array() ), $column, 0 ); ?>
    'sp_team', 'name' => 'sp_players[' . esc_attr( $player_id ) . '][team]', 'include' => $include, 'selected' => $selected, 'values' => 'ID', ); wp_dropdown_pages( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 'sp_position', 'name' => 'sp_players[' . $player_id . '][position]', 'show_option_blank' => esc_attr__( '(Auto)', 'sportspress' ), 'values' => 'term_id', 'orderby' => 'meta_value_num', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_order', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_order', 'compare' => 'EXISTS', ), ), 'selected' => $selected, 'include_children' => ( 'no' == get_option( 'sportspress_event_hide_child_positions', 'no' ) ), ); sp_dropdown_taxonomies( $args ); ?>
    ID, 'sp_caption', true ); $team_id = get_post_meta( $post->ID, 'sp_team', true ); $era = get_post_meta( $post->ID, 'sp_era', true ); $grouping = get_post_meta( $post->ID, 'sp_grouping', true ); $orderby = get_post_meta( $post->ID, 'sp_orderby', true ); $order = get_post_meta( $post->ID, 'sp_order', true ); $select = get_post_meta( $post->ID, 'sp_select', true ); $number = get_post_meta( $post->ID, 'sp_number', true ); $crop = get_post_meta( $post->ID, 'sp_crop', true ); $date = get_post_meta( $post->ID, 'sp_date', true ); $date_from = get_post_meta( $post->ID, 'sp_date_from', true ); $date_to = get_post_meta( $post->ID, 'sp_date_to', true ); $date_past = get_post_meta( $post->ID, 'sp_date_past', true ); $date_relative = get_post_meta( $post->ID, 'sp_date_relative', true ); $continents = SP()->countries->continents; $nationalities = get_post_meta( $post->ID, 'sp_nationality', false ); $default_nationality = get_option( 'sportspress_default_nationality', false ); ?>

    'sp_date', 'id' => 'sp_date', 'selected' => $date, ); sp_dropdown_dates( $args ); ?>

    'sp_team', 'name' => 'sp_team', 'show_option_all' => esc_attr__( 'All', 'sportspress' ), 'selected' => $team_id, 'values' => 'ID', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_team', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    array( 'number' => esc_attr__( 'Squad Number', 'sportspress' ), 'name' => esc_attr__( 'Name', 'sportspress' ), ), 'post_type' => array( 'sp_performance', 'sp_metric', 'sp_statistic' ), 'name' => 'sp_orderby', 'selected' => $orderby, 'values' => 'slug', ); sp_dropdown_pages( $args ); ?>

    ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), $player_filters ); sp_post_adder( 'sp_player', esc_attr__( 'Add New', 'sportspress' ) ); } else { ?>

    ID, 'sp_format', true ); ?>
    formats->list as $key => $format ) : ?> >
    ID, 'sp_format', true ); if ( ! $the_format ) { $the_format = 'list'; } ?>

    ID, 'sp_visible', true ); if ( '' === $visible ) { $visible = 1; } ?>

    ID, 'sp_abbreviation', true ); $color = get_post_meta( $post->ID, 'sp_color', true ); $condition = get_post_meta( $post->ID, 'sp_condition', true ); $main_result = get_option( 'sportspress_primary_result', null ); $result = get_page_by_path( $main_result, ARRAY_A, 'sp_result' ); $label = sp_array_value( $result, 'post_title', esc_attr__( 'Primary', 'sportspress' ) ); if ( '' === $color ) { $color = '#888888'; } ?>

    readonly="readonly">

    ID, 'sp_singular', true ); $section = get_post_meta( $post->ID, 'sp_section', true ); if ( '' === $section ) { $section = -1; } $format = get_post_meta( $post->ID, 'sp_format', true ); if ( '' === $format ) { $format = 'number'; } $precision = get_post_meta( $post->ID, 'sp_precision', true ); if ( '' === $precision ) { $precision = 0; } $timed = get_post_meta( $post->ID, 'sp_timed', true ); if ( '' === $timed ) { $timed = true; } $sendoff = get_post_meta( $post->ID, 'sp_sendoff', true ); if ( '' === $sendoff ) { $sendoff = false; } ?>

    readonly="readonly">

    ">

    ID, 'sp_visible', true ); if ( '' === $visible ) { $visible = 1; } ?>

    ID, 'sp_equation', true ); $groups = array( 'performance' ); self::builder( $post->post_title, $equation, $groups ); } } ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-columns.php ================================================ ID, 'sp_columns', true ); $tabs = apply_filters( 'sportspress_player_column_tabs', array( 'sp_performance', 'sp_statistic' ) ); ?>
    $post_type ) { sp_column_checklist( $post->ID, $post_type, ( 0 == $index ? 'block' : 'none' ), $selected ); } ?>
    countries->continents; $number = get_post_meta( $post->ID, 'sp_number', true ); $nationalities = get_post_meta( $post->ID, 'sp_nationality', false ); $default_nationality = get_option( 'sportspress_default_nationality', false ); if ( empty( $nationalities ) && $default_nationality ) { if ( $default_nationality != '' ) { $nationalities[] = $default_nationality; } } foreach ( $nationalities as $index => $nationality ) : if ( 2 == strlen( $nationality ) ) : $legacy = SP()->countries->legacy; $nationality = strtolower( $nationality ); $nationality = sp_array_value( $legacy, $nationality, null ); $nationalities[ $index ] = $nationality; endif; endforeach; if ( taxonomy_exists( 'sp_league' ) ) : $leagues = get_the_terms( $post->ID, 'sp_league' ); $league_ids = array(); if ( $leagues ) : foreach ( $leagues as $league ) : $league_ids[] = $league->term_id; endforeach; endif; endif; if ( taxonomy_exists( 'sp_season' ) ) : $seasons = get_the_terms( $post->ID, 'sp_season' ); $season_ids = array(); if ( $seasons ) : foreach ( $seasons as $season ) : $season_ids[] = $season->term_id; endforeach; endif; endif; if ( taxonomy_exists( 'sp_position' ) ) : $positions = get_the_terms( $post->ID, 'sp_position' ); $position_ids = array(); if ( $positions ) : foreach ( $positions as $position ) : $position_ids[] = $position->term_id; endforeach; endif; endif; $teams = get_posts( array( 'post_type' => 'sp_team', 'posts_per_page' => -1, ) ); $past_teams = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) ); $current_teams = array_filter( get_post_meta( $post->ID, 'sp_current_team', false ) ); ?>

    'sp_position', 'name' => 'tax_input[sp_position][]', 'selected' => $position_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Positions', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_taxonomies( $args ); ?>

    'sp_team', 'name' => 'sp_current_team[]', 'selected' => $current_teams, 'values' => 'ID', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Teams', 'sportspress' ) ), 'class' => 'sp-current-teams widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_pages( $args ); ?>

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

    'sp_league', 'name' => 'tax_input[sp_league][]', 'selected' => $league_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Leagues', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_taxonomies( $args ); ?>

    'sp_season', 'name' => 'tax_input[sp_season][]', 'selected' => $season_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Seasons', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_taxonomies( $args ); ?>

    ID, 'sp_metrics', true ); $args = array( 'post_type' => 'sp_metric', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $vars = get_posts( $args ); if ( $vars ) : foreach ( $vars as $var ) : ?>

    post_title ); ?>

    get_terms_sorted_by_sp_order( 'sp_league' ); if ( is_array( $leagues ) ) { $league_num = sizeof( $leagues ); } else { $league_num = 0; } $sections = get_option( 'sportspress_player_performance_sections', -1 ); $show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false; if ( $leagues ) { if ( -1 == $sections ) { // Loop through statistics for each league $i = 0; foreach ( $leagues as $league ) : ?>

    name ); ?>

    data( $league->term_id, true ); self::table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0, true, $formats, $total_types ); $i ++; endforeach; if ( $show_career_totals ) { ?>

    data( 0, true ); self::table( $post->ID, 0, $columns, $data, $placeholders, $merged, $seasons_teams, false, false, $formats, $total_types ); } } else { // Determine order of sections if ( 1 == $sections ) { $section_order = array( 1 => esc_attr__( 'Defense', 'sportspress' ), 0 => esc_attr__( 'Offense', 'sportspress' ), ); } else { $section_order = array( esc_attr__( 'Offense', 'sportspress' ), esc_attr__( 'Defense', 'sportspress' ) ); } $s = 0; foreach ( $section_order as $section_id => $section_label ) { // Loop through statistics for each league $i = 0; foreach ( $leagues as $league ) : ?>

    name ); ?> —

    data( $league->term_id, true, $section_id ); self::table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0 && $s == 0, $s == 0, $formats, $total_types ); $i ++; endforeach; if ( $show_career_totals ) { ?>

    data( 0, true, $section_id ); self::table( $post->ID, 0, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0 && $s == 0, $s == 0, $formats, $total_types ); } $s ++; } } } } /** * Save meta box data */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_leagues', sp_array_value( $_POST, 'sp_leagues', array(), 'int' ) ); update_post_meta( $post_id, 'sp_statistics', sp_array_value( $_POST, 'sp_statistics', array(), 'text' ) ); } /** * Admin edit table */ public 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() ) { $readonly = false; $teams = array_filter( get_post_meta( $id, 'sp_team', false ) ); $buffer = apply_filters( 'sportspress_meta_box_player_statistics_table_buffer', array( 'teams' => $teams, 'readonly' => $readonly, ), $id ); ?>
    $label ) : if ( $key == 'team' ) { continue;} ?> $label ) : if ( $column == 'team' ) { continue;} ?> $div_stats ) : if ( $div_id === 'statistics' ) { continue; } if ( $div_id === 0 ) { continue; } $div = get_term( $div_id, 'sp_season' ); ?> $columns, 'data' => $data, 'placeholders' => $placeholders, 'merged' => $merged, 'seasons_teams' => array(), 'has_checkboxes' => $has_checkboxes, 'formats' => $formats, 'total_types' => $total_types, 'buffer' => $buffer, ); list( $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 ) ); ?> $label ) : if ( $column == 'team' ) { continue;} ?>
      '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo ''; } else { echo ''; } } ?>
      'sp_team', 'name' => 'sp_leagues[' . $league_id . '][' . $div_id . ']', 'show_option_none' => esc_attr__( '— None —', 'sportspress' ), 'sort_order' => 'ASC', 'sort_column' => 'menu_order', 'selected' => $value, 'values' => 'ID', 'include' => $teams, 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'sp_league', 'terms' => $league_id, 'field' => 'term_id', ), array( 'taxonomy' => 'sp_season', 'terms' => $div_id, 'field' => 'term_id', ), ), ); if ( ! sp_dropdown_pages( $args ) ) : esc_attr_e( '— None —', 'sportspress' ); endif; ?> '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo ''; } else { echo ''; } } ?>
    ID, 'sp_precision', true ); global $pagenow; if ( 'post.php' == $pagenow && 'draft' !== get_post_status() ) { $readonly = true; } else { $readonly = false; } ?>

    readonly="readonly"> (for, against)

    ID, 'sp_equation', true ); $groups = array( 'performance' ); self::builder( $post->post_title, $equation, $groups ); } } ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php ================================================ ID, 'sp_visible', true ); if ( '' === $visible ) { $visible = 1; } ?>

    countries->continents; $nationalities = get_post_meta( $post->ID, 'sp_nationality', false ); foreach ( $nationalities as $index => $nationality ) : if ( 2 == strlen( $nationality ) ) : $legacy = SP()->countries->legacy; $nationality = strtolower( $nationality ); $nationality = sp_array_value( $legacy, $nationality, null ); $nationalities[ $index ] = $nationality; endif; endforeach; $leagues = get_the_terms( $post->ID, 'sp_league' ); $league_ids = array(); if ( $leagues ) : foreach ( $leagues as $league ) : $league_ids[] = $league->term_id; endforeach; endif; $seasons = get_the_terms( $post->ID, 'sp_season' ); $season_ids = array(); if ( $seasons ) : foreach ( $seasons as $season ) : $season_ids[] = $season->term_id; endforeach; endif; $roles = get_the_terms( $post->ID, 'sp_role' ); $role_ids = is_array( $roles ) ? wp_list_pluck( $roles, 'term_id' ) : array(); $teams = get_posts( array( 'post_type' => 'sp_team', 'posts_per_page' => -1, ) ); $past_teams = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) ); $current_teams = array_filter( get_post_meta( $post->ID, 'sp_current_team', false ) ); ?>

    'sp_role', 'name' => 'tax_input[sp_role][]', 'selected' => $role_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Jobs', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); if ( ! sp_dropdown_taxonomies( $args ) ) : sp_taxonomy_adder( 'sp_role', 'sp_staff', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    'sp_team', 'name' => 'sp_current_team[]', 'selected' => $current_teams, 'values' => 'ID', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Teams', 'sportspress' ) ), 'class' => 'sp-current-teams widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_pages( $args ); ?>

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

    'sp_league', 'name' => 'tax_input[sp_league][]', 'selected' => $league_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Leagues', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_taxonomies( $args ); ?>

    'sp_season', 'name' => 'tax_input[sp_season][]', 'selected' => $season_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Seasons', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_taxonomies( $args ); ?>

    ID, 'sp_precision', true ); $section = get_post_meta( $post->ID, 'sp_section', true ); $format = get_post_meta( $post->ID, 'sp_format', true ); $total = get_post_meta( $post->ID, 'sp_type', true ); $visible = get_post_meta( $post->ID, 'sp_visible', true ); // Defaults if ( '' === $precision ) { $precision = 0; } if ( '' === $section ) { $section = -1; } if ( '' === $format ) { $format = 'number'; } ?>

    ID, 'sp_visible', true ); if ( '' === $visible ) { $visible = 1; } ?>

    ID, 'sp_equation', true ); $groups = array( 'player_event', 'outcome', 'result', 'performance', 'metric' ); self::builder( $post->post_title, $equation, $groups ); } } ================================================ FILE: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php ================================================ data( true ); $adjustments = $table->adjustments; $highlight = get_post_meta( $table->ID, 'sp_highlight', true ); self::table( $table->ID, $columns, $usecolumns, $data, $placeholders, $adjustments, $highlight ); } } /** * Save meta box data */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_highlight', sp_array_value( $_POST, 'sp_highlight', array(), 'int' ) ); update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'text' ) ); update_post_meta( $post_id, 'sp_adjustments', sp_array_value( $_POST, 'sp_adjustments', array(), 'text' ) ); update_post_meta( $post_id, 'sp_teams', sp_array_value( $_POST, 'sp_teams', array(), 'text' ) ); } /** * Admin edit table */ public static function table( $id = 0, $columns = array(), $usecolumns = null, $data = array(), $placeholders = array(), $adjustments = array(), $highlight = null, $readonly = false ) { if ( is_array( $usecolumns ) ) { $usecolumns = array_filter( $usecolumns ); } $mode = sp_get_post_mode( $id ); if ( 'player' === $mode ) { $show_team_logo = get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false; $icon_class = 'sp-icon-tshirt'; } else { $show_team_logo = get_option( 'sportspress_table_show_logos', 'no' ) == 'yes' ? true : false; $icon_class = 'sp-icon-shield'; } ?>

    • |
    $label ) : ?> 0 ) : $i = 0; foreach ( $data as $team_id => $team_stats ) : if ( ! $team_id ) { continue; } $default_name = sp_array_value( $team_stats, 'name', '' ); if ( $default_name == null ) { $default_name = get_the_title( $team_id ); } ?> $label ) : $value = sp_array_value( $team_stats, $column, '' ); $placeholder = sp_array_value( sp_array_value( $placeholders, $team_id, array() ), $column, 0 ); $placeholder = wp_strip_all_tags( $placeholder ); ?>
    > />
    ID, 'sp_caption', true ); $select = get_post_meta( $post->ID, 'sp_select', true ); $post_type = sp_get_post_mode_type( $post->ID ); $date = get_post_meta( $post->ID, 'sp_date', true ); $date_from = get_post_meta( $post->ID, 'sp_date_from', true ); $date_to = get_post_meta( $post->ID, 'sp_date_to', true ); $date_past = get_post_meta( $post->ID, 'sp_date_past', true ); $date_relative = get_post_meta( $post->ID, 'sp_date_relative', true ); $orderby = get_post_meta( $post->ID, 'sp_orderby', true ); $order = get_post_meta( $post->ID, 'sp_order', true ); $event_status = get_post_meta( $post->ID, 'sp_event_status', true ); if ( empty( $event_status ) ) { $event_status = array( 'publish', 'future' ); } ?>

    'sp_date', 'id' => 'sp_date', 'selected' => $date, ); sp_dropdown_dates( $args ); ?>

    :

    ID ); ?>

    ID ) ); ?>

    ID, $post_type, ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season' ), null, 'sp_team' ); sp_post_adder( $post_type, esc_attr__( 'Add New', 'sportspress' ) ); } ?>

    > Published/Played
    > Scheduled/Future

    array( 'default' => esc_attr__( 'Default', 'sportspress' ), 'name' => esc_attr__( 'Name', 'sportspress' ), ), 'post_type' => array( 'sp_column' ), 'name' => 'sp_orderby', 'selected' => $orderby, 'values' => 'slug', ); sp_dropdown_pages( $args ); ?>

    >

    ID, 'sp_format', true ); ?>
    formats->table as $key => $format ) : ?> >
    ID ); ?>
    esc_attr__( 'Team vs team', 'sportspress' ), 'player' => esc_attr__( 'Player vs player', 'sportspress' ), ) as $key => $mode ) : ?> >
    ID, 'sp_format', true ); if ( ! $the_format ) { $the_format = 'standings'; } ?>

    ID, 'sp_league' ); $league_num = sizeof( $leagues ); // Loop through columns for each league if ( $leagues ) : foreach ( $leagues as $league ) : $league_id = $league->term_id; ?>

    name ); ?>

    columns( $league_id ); self::table( $league_id, $columns, $data, $placeholders ); endforeach; endif; ?>

    columns( 0 ); self::table( 0, $columns, $data, $placeholders ); } /** * Save meta box data */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'key' ) ); } /** * Admin edit table */ public static function table( $league_id, $columns = array(), $data = array(), $placeholders = array() ) { ?>
    $div_stats ) : $div = get_term( $div_id, 'sp_season' ); ?> $label ) : $value = sp_array_value( sp_array_value( $data, $div_id, array() ), $column, 0 ); ?>
    '; ?>
    ID, 'sp_league' ); $league_ids = array(); if ( $leagues ) : foreach ( $leagues as $league ) : $league_ids[] = $league->term_id; endforeach; endif; endif; if ( taxonomy_exists( 'sp_season' ) ) : $seasons = get_the_terms( $post->ID, 'sp_season' ); $season_ids = array(); if ( $seasons ) : foreach ( $seasons as $season ) : $season_ids[] = $season->term_id; endforeach; endif; endif; if ( taxonomy_exists( 'sp_venue' ) ) : $venues = get_the_terms( $post->ID, 'sp_venue' ); $venue_ids = array(); if ( $venues ) : foreach ( $venues as $venue ) : $venue_ids[] = $venue->term_id; endforeach; endif; endif; $short_name = get_post_meta( $post->ID, 'sp_short_name', true ); $abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true ); $redirect = get_post_meta( $post->ID, 'sp_redirect', true ); $url = get_post_meta( $post->ID, 'sp_url', true ); ?>

    'sp_league', 'name' => 'tax_input[sp_league][]', 'selected' => $league_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Leagues', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_taxonomies( $args ); ?>

    'sp_season', 'name' => 'tax_input[sp_season][]', 'selected' => $season_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Seasons', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_taxonomies( $args ); ?>

    'sp_venue', 'name' => 'tax_input[sp_venue][]', 'selected' => $venue_ids, 'values' => 'term_id', 'placeholder' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Venue', 'sportspress' ) ), 'class' => 'widefat', 'property' => 'multiple', 'chosen' => true, ); sp_dropdown_taxonomies( $args ); ?>

    lists( true ); self::table( $data, $checked ); else : printf( esc_attr__( 'No results found.', 'sportspress' ) ); endif; } /** * Save meta box data */ public static function save( $post_id, $post ) { sp_update_post_meta_recursive( $post_id, 'sp_list', sp_array_value( $_POST, 'sp_list', array(), 'int' ) ); } /** * Admin edit table */ public static function table( $data = array(), $checked = array() ) { ?>
    0 ) : $i = 0; foreach ( $data as $list ) : $players = array_filter( get_post_meta( $list->ID, 'sp_player' ) ); $format = get_post_meta( $list->ID, 'sp_format', true ); ?>
    ID, $checked ) ); ?>> post_title ); ?> ID, 'sp_league' ) ? wp_kses_post( the_terms( $list->ID, 'sp_league' ) ) : '—'; ?> ID, 'sp_season' ) ? wp_kses_post( the_terms( $list->ID, 'sp_season' ) ) : '—'; ?> formats->list, $format, '—' ) ); ?>
    staff( true ); self::table( $data, $checked ); else : printf( esc_attr__( 'No results found.', 'sportspress' ) ); endif; } /** * Save meta box data */ public static function save( $post_id, $post ) { sp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array(), 'int' ) ); } /** * Admin edit table */ public static function table( $data = array(), $checked = array() ) { ?>
    0 ) : $i = 0; foreach ( $data as $staff ) : $role = get_post_meta( $staff->ID, 'sp_role', true ); ?>
    ID, $checked ) ); ?>> post_title ); ?> ID, 'sp_role' ) ? wp_kses_post( the_terms( $staff->ID, 'sp_role' ) ) : '—'; ?> ID, 'sp_league' ) ? wp_kses_post( the_terms( $staff->ID, 'sp_league' ) ) : '—'; ?> ID, 'sp_season' ) ? wp_kses_post( the_terms( $staff->ID, 'sp_season' ) ) : '—'; ?>
    tables( true ); self::table( $data, $checked ); else : printf( esc_attr__( 'No results found.', 'sportspress' ) ); endif; } /** * Save meta box data */ public static function save( $post_id, $post ) { sp_update_post_meta_recursive( $post_id, 'sp_table', sp_array_value( $_POST, 'sp_table', array(), 'text' ) ); } /** * Admin edit table */ public static function table( $data = array(), $checked = array() ) { ?>
    0 ) : $i = 0; foreach ( $data as $table ) : $teams = array_filter( get_post_meta( $table->ID, 'sp_team' ) ); $format = get_post_meta( $table->ID, 'sp_format', true ); ?>
    ID, $checked ) ); ?>> post_title ); ?> ID, 'sp_league' ) ? wp_kses_post( the_terms( $table->ID, 'sp_league' ) ) : '—'; ?> ID, 'sp_season' ) ? wp_kses_post( the_terms( $table->ID, 'sp_season' ) ) : '—'; ?>
    id = 'events'; $this->label = esc_attr__( 'Events', 'sportspress' ); $this->template = 'event'; add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_admin_field_delimiter', array( $this, 'delimiter_setting' ) ); add_action( 'sportspress_admin_field_event_layout', array( $this, 'layout_setting' ) ); add_action( 'sportspress_admin_field_event_tabs', array( $this, 'tabs_setting' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get settings array * * @return array */ public function get_settings() { $settings = array_merge( array( array( 'title' => esc_attr__( 'Event Options', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'event_options', ), ), apply_filters( 'sportspress_event_options', array_merge( array( array( 'title' => esc_attr__( 'Link', 'sportspress' ), 'desc' => esc_attr__( 'Link events', 'sportspress' ), 'id' => 'sportspress_link_events', 'default' => 'yes', 'type' => 'checkbox', ), ), apply_filters( 'sportspress_event_template_options', array( array( 'type' => 'event_layout' ), array( 'type' => 'event_tabs' ), array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'desc' => esc_attr__( 'Date', 'sportspress' ), 'id' => 'sportspress_event_show_date', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Time', 'sportspress' ), 'id' => 'sportspress_event_show_time', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Match Day', 'sportspress' ), 'id' => 'sportspress_event_show_day', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Full Time', 'sportspress' ), 'id' => 'sportspress_event_show_full_time', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), ) ), array( array( 'title' => esc_attr__( 'Default mode', 'sportspress' ), 'id' => 'sportspress_mode', 'default' => 'team', 'type' => 'radio', 'options' => array( 'team' => esc_attr__( 'Team vs team', 'sportspress' ), 'player' => esc_attr__( 'Player vs player', 'sportspress' ), ), 'desc_tip' => _x( 'Who competes in events?', 'mode setting description', 'sportspress' ), ), array( 'title' => esc_attr__( 'Limit', 'sportspress' ), 'id' => 'sportspress_event_teams', 'class' => 'small-text', 'default' => '2', 'desc' => esc_attr__( 'teams', 'sportspress' ), 'type' => 'number', 'custom_attributes' => array( 'min' => 0, 'step' => 1, ), ), array( 'type' => 'delimiter' ), array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'desc' => esc_attr__( 'Filter by league', 'sportspress' ), 'id' => 'sportspress_event_filter_teams_by_league', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Filter by season', 'sportspress' ), 'id' => 'sportspress_event_filter_teams_by_season', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), array( 'title' => esc_attr__( 'Full Time', 'sportspress' ), 'id' => 'sportspress_event_minutes', 'class' => 'small-text', 'default' => '90', 'desc' => esc_attr__( 'mins', 'sportspress' ), 'type' => 'number', 'custom_attributes' => array( 'min' => 0, 'step' => 1, ), ), array( 'title' => esc_attr__( 'Comments', 'sportspress' ), 'desc' => esc_attr__( 'Allow people to post comments on new articles', 'sportspress' ), 'id' => 'sportspress_event_comment_status', 'default' => 'no', 'type' => 'checkbox', ), ) ) ), array( array( 'type' => 'sectionend', 'id' => 'event_options', ), ), array( array( 'title' => esc_attr__( 'Venues', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'venue_options', ), ), apply_filters( 'sportspress_venue_options', array( array( 'title' => esc_attr__( 'Link', 'sportspress' ), 'desc' => esc_attr__( 'Link venues', 'sportspress' ), 'id' => 'sportspress_link_venues', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Venue Map', 'sportspress' ), 'desc' => esc_attr__( 'Display venue map', 'sportspress' ), 'id' => 'sportspress_event_show_maps', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Type', 'sportspress' ), 'id' => 'sportspress_map_type', 'default' => 'ROADMAP', 'type' => 'radio', 'options' => array( 'ROADMAP' => esc_attr__( 'Default', 'sportspress' ), 'SATELLITE' => esc_attr__( 'Satellite', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Zoom', 'sportspress' ), 'id' => 'sportspress_map_zoom', 'class' => 'small-text', 'default' => '15', 'desc' => '0 - 21', 'type' => 'number', 'custom_attributes' => array( 'min' => 0, 'max' => 21, 'step' => 1, ), ), ) ), array( array( 'type' => 'sectionend', 'id' => 'venue_options', ), ), array( array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'event_logo_options', ), ), apply_filters( 'sportspress_event_logo_options', array( array( 'title' => esc_attr__( 'Order', 'sportspress' ), 'desc' => esc_attr__( 'Reverse order', 'sportspress' ), 'id' => 'sportspress_event_reverse_teams', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Layout', 'sportspress' ), 'id' => 'sportspress_event_logos_format', 'default' => 'inline', 'type' => 'radio', 'options' => array( 'inline' => esc_attr__( 'Inline', 'sportspress' ), 'block' => esc_attr__( 'Block', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Display', 'sportspress' ), 'desc' => esc_attr__( 'Name', 'sportspress' ), 'id' => 'sportspress_event_logos_show_team_names', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Time', 'sportspress' ), 'id' => 'sportspress_event_logos_show_time', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Results', 'sportspress' ), 'id' => 'sportspress_event_logos_show_results', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), ) ), array( array( 'type' => 'sectionend', 'id' => 'event_logo_options', ), ), array( array( 'title' => esc_attr__( 'Players', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'eventplayer_options', ), ), apply_filters( 'sportspress_eventplayer_options', array( array( 'title' => esc_attr__( 'Order', 'sportspress' ), 'id' => 'sportspress_event_player_sort', 'default' => 'jersey', 'type' => 'radio', 'options' => array( 'jersey' => esc_attr__( 'Jersey (e.g. "33. John Doe")', 'sportspress' ), 'name' => esc_attr__( 'Name (e.g. "John Doe (33)")', 'sportspress' ), ), '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.', ), ) ), array( array( 'type' => 'sectionend', 'id' => 'eventplayer_options', ), ), array( array( 'title' => esc_attr__( 'Event Results', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'result_options', ), ), apply_filters( 'sportspress_result_options', array( array( 'title' => esc_attr__( 'Columns', 'sportspress' ), 'id' => 'sportspress_event_result_columns', 'default' => 'auto', 'type' => 'radio', 'options' => array( 'auto' => esc_attr__( 'Auto', 'sportspress' ), 'manual' => esc_attr__( 'Manual', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Outcome', 'sportspress' ), 'desc' => esc_attr__( 'Display outcome', 'sportspress' ), 'id' => 'sportspress_event_show_outcome', 'default' => 'no', 'type' => 'checkbox', ), ) ), array( array( 'type' => 'sectionend', 'id' => 'result_options', ), ), array( array( 'title' => esc_attr__( 'Box Score', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'performance_options', ), ), apply_filters( 'sportspress_performance_options', array_merge( array( array( 'title' => esc_attr__( 'Rows', 'sportspress' ), 'desc' => esc_attr__( 'Staff', 'sportspress' ), 'id' => 'sportspress_event_show_staff', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Players', 'sportspress' ), 'id' => 'sportspress_event_show_players', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Total', 'sportspress' ), 'id' => 'sportspress_event_show_total', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), array( 'title' => esc_attr__( 'Columns', 'sportspress' ), 'id' => 'sportspress_event_performance_columns', 'default' => 'auto', 'type' => 'radio', 'options' => array( 'auto' => esc_attr__( 'Auto', 'sportspress' ), 'manual' => esc_attr__( 'Manual', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Mode', 'sportspress' ), 'id' => 'sportspress_event_performance_mode', 'default' => 'values', 'type' => 'radio', 'options' => array( 'values' => esc_attr__( 'Values', 'sportspress' ), 'icons' => esc_attr__( 'Icons', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Awards', 'sportspress' ), 'id' => 'sportspress_event_performance_stars_type', 'default' => 0, 'type' => 'radio', 'options' => array( __( 'None', 'sportspress' ), __( 'Player of the Match', 'sportspress' ), __( 'Stars', 'sportspress' ), __( 'Star Number', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Positions', 'sportspress' ), 'desc' => esc_attr__( 'Top-level only', 'sportspress' ), 'id' => 'sportspress_event_hide_child_positions', 'default' => 'no', 'type' => 'checkbox', ), ), apply_filters( 'sportspress_event_performance_display_options', array( array( 'title' => esc_attr__( 'Display', 'sportspress' ), 'desc' => esc_attr__( 'Squad Number', 'sportspress' ), 'id' => 'sportspress_event_show_player_numbers', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Position', 'sportspress' ), 'id' => 'sportspress_event_show_position', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Minutes', 'sportspress' ), 'id' => 'sportspress_event_performance_show_minutes', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), ) ), array( array( 'title' => esc_attr__( 'Performance', 'sportspress' ), 'id' => 'sportspress_event_performance_sections', 'default' => -1, 'type' => 'radio', 'options' => array( -1 => esc_attr__( 'Combined', 'sportspress' ), 0 => esc_attr__( 'Offense', 'sportspress' ) . ' → ' . esc_attr__( 'Defense', 'sportspress' ), 1 => esc_attr__( 'Defense', 'sportspress' ) . ' → ' . esc_attr__( 'Offense', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Total', 'sportspress' ), 'id' => 'sportspress_event_total_performance', 'default' => 'all', 'type' => 'radio', 'options' => array( 'all' => esc_attr__( 'All', 'sportspress' ), 'primary' => esc_attr__( 'Primary', 'sportspress' ), ), ), ) ) ), array( array( 'type' => 'sectionend', 'id' => 'performance_options', ), ) ); return apply_filters( 'sportspress_event_settings', $settings ); } /** * Save settings */ public function save() { parent::save(); if ( isset( $_POST['sportspress_event_teams_delimiter'] ) ) { update_option( 'sportspress_event_teams_delimiter', sanitize_text_field( wp_unslash( $_POST['sportspress_event_teams_delimiter'] ) ) ); } } /** * Delimiter settings * * @access public * @return void */ public function delimiter_setting() { $selection = get_option( 'sportspress_event_teams_delimiter', 'vs' ); $limit = get_option( 'sportspress_event_teams', 2 ); // Cast to integer and ensure it's a valid positive number. $limit = absint( $limit ); if ( 0 == $limit ) { $limit = 2; } if ( 3 >= $limit ) { $example = str_repeat( esc_attr__( 'Team', 'sportspress' ) . ' %1$s ', $limit ); } else { $example = str_repeat( esc_attr__( 'Team', 'sportspress' ) . ' %1$s ', 3 ) . '…'; } $example = rtrim( $example, ' %1$s ' ); ?>

    id = 'general'; $this->label = esc_attr__( 'General', 'sportspress' ); add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_admin_field_timezone', array( $this, 'timezone_setting' ) ); add_action( 'sportspress_admin_field_colors', array( $this, 'colors_setting' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get settings array * * @return array */ public function get_settings() { $presets = SP_Admin_Sports::get_preset_options(); $leagues = array( '' => esc_attr__( '— Select —', 'sportspress' ) ); $terms = get_terms( array( 'taxonomy' => 'sp_league', 'hide_empty' => false, ) ); if ( $terms ) { foreach ( $terms as $term ) { $leagues[ $term->term_id ] = $term->name; } } $seasons = array( '' => esc_attr__( '— Select —', 'sportspress' ) ); $terms = get_terms( array( 'taxonomy' => 'sp_season', 'hide_empty' => false, ) ); if ( $terms ) { foreach ( $terms as $term ) { $seasons[ $term->term_id ] = $term->name; } } $settings = array_merge( array( array( 'title' => esc_attr__( 'General Options', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options', ), ), apply_filters( 'sportspress_general_options', array( array( 'type' => 'timezone' ), array( 'title' => esc_attr__( 'Sport', 'sportspress' ), 'id' => 'sportspress_sport', 'default' => 'none', 'type' => 'sport', 'options' => $presets, ), array( 'title' => esc_attr__( 'Main League', 'sportspress' ), 'id' => 'sportspress_league', 'default' => null, 'type' => 'select', 'options' => $leagues, ), array( 'title' => esc_attr__( 'Current Season', 'sportspress' ), 'id' => 'sportspress_season', 'default' => null, 'type' => 'select', 'options' => $seasons, ), ) ), array( array( 'type' => 'sectionend', 'id' => 'general_options', ), array( 'title' => esc_attr__( 'Styles and Scripts', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'script_styling_options', ), ) ); $options = array( array( 'type' => 'colors' ), ); if ( ( $styles = SP_Frontend_Scripts::get_styles() ) && array_key_exists( 'sportspress-general', $styles ) ) : $options = array_merge( $options, array( array( 'title' => esc_attr__( 'Align', 'sportspress' ), 'id' => 'sportspress_table_text_align', 'default' => 'default', 'type' => 'radio', 'options' => array( 'default' => esc_attr__( 'Default', 'sportspress' ), 'left' => esc_attr__( 'Left', 'sportspress' ), 'center' => esc_attr__( 'Center', 'sportspress' ), 'right' => esc_attr__( 'Right', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Padding', 'sportspress' ), 'id' => 'sportspress_table_padding', 'class' => 'small-text', 'default' => null, 'placeholder' => esc_attr__( 'Auto', 'sportspress' ), 'desc' => 'px', 'type' => 'number', 'custom_attributes' => array( 'step' => 1, ), ), ) ); endif; $options = array_merge( $options, array( array( 'title' => esc_attr__( 'Custom CSS', 'sportspress' ), 'id' => 'sportspress_custom_css', 'css' => 'width:100%; height: 130px;', 'type' => 'textarea', ), ), apply_filters( 'sportspress_general_script_options', array( array( 'title' => esc_attr__( 'Scripts', 'sportspress' ), 'desc' => esc_attr__( 'Live countdowns', 'sportspress' ), 'id' => 'sportspress_enable_live_countdowns', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', 'desc_tip' => esc_attr__( 'This will enable a script allowing the countdowns to be animated.', 'sportspress' ), ), array( 'desc' => esc_attr__( 'Shortcode menu', 'sportspress' ), 'id' => 'sportspress_rich_editing', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end', 'desc_tip' => esc_attr__( 'This will enable a shortcode menu to be displayed in the visual editor.', 'sportspress' ), ), ) ), array( array( 'title' => esc_attr__( 'Tables', 'sportspress' ), 'desc' => esc_attr__( 'Responsive', 'sportspress' ), 'id' => 'sportspress_enable_responsive_tables', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Scrollable', 'sportspress' ), 'id' => 'sportspress_enable_scrollable_tables', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Sortable', 'sportspress' ), 'id' => 'sportspress_enable_sortable_tables', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), array( 'title' => esc_attr__( 'Widgets', 'sportspress' ), 'desc' => esc_attr__( 'Unique', 'sportspress' ), 'id' => 'sportspress_widget_unique', 'default' => 'no', 'type' => 'checkbox', 'desc_tip' => esc_attr__( 'Hide widget when same as content.', 'sportspress' ), ), ) ); if ( apply_filters( 'sportspress_enable_header', false ) ) { $options[] = array( 'title' => esc_attr__( 'Header Offset', 'sportspress' ), 'id' => 'sportspress_header_offset', 'class' => 'small-text', 'default' => null, 'placeholder' => esc_attr__( 'Auto', 'sportspress' ), 'desc' => 'px', 'type' => 'number', 'custom_attributes' => array( 'step' => 1, ), ); } $settings = array_merge( $settings, apply_filters( 'sportspress_script_styling_options', $options ), array( array( 'type' => 'sectionend', 'id' => 'script_styling_options', ), ) ); return apply_filters( 'sportspress_general_settings', $settings ); // End general settings } /** * Save settings */ public function save() { if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) !== $_POST['sportspress_sport'] ) : $sport = sanitize_key( $_POST['sportspress_sport'] ); SP_Admin_Sports::apply_preset( $sport ); delete_option( '_sp_needs_welcome' ); update_option( 'sportspress_installed', 1 ); endif; if ( isset( $_POST['add_sample_data'] ) ) : SP_Admin_Sample_Data::delete_posts(); SP_Admin_Sample_Data::insert_posts(); endif; $settings = $this->get_settings(); SP_Admin_Settings::save_fields( $settings ); // Map UTC+- timezones to gmt_offsets and set timezone_string to empty. if ( ! empty( $_POST['timezone_string'] ) && preg_match( '/^UTC[+-]/', $_POST['timezone_string'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput $_POST['gmt_offset'] = preg_replace( '/UTC\+?/', '', sanitize_text_field( wp_unslash( $_POST['timezone_string'] ) ) ); $_POST['timezone_string'] = ''; } if ( isset( $_POST['timezone_string'] ) ) { update_option( 'timezone_string', sanitize_option( 'timezone_string', wp_unslash( $_POST['timezone_string'] ) ) ); } if ( isset( $_POST['gmt_offset'] ) ) { update_option( 'gmt_offset', sanitize_option( 'gmt_offset', wp_unslash( $_POST['gmt_offset'] ) ) ); } if ( isset( $_POST['sportspress_frontend_css_primary'] ) ) { // Save settings $primary = ( ! empty( $_POST['sportspress_frontend_css_primary'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_primary'] ) ) ) : ''; $background = ( ! empty( $_POST['sportspress_frontend_css_background'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_background'] ) ) ) : ''; $text = ( ! empty( $_POST['sportspress_frontend_css_text'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_text'] ) ) ) : ''; $heading = ( ! empty( $_POST['sportspress_frontend_css_heading'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_heading'] ) ) ) : ''; $link = ( ! empty( $_POST['sportspress_frontend_css_link'] ) ) ? sp_format_hex( sanitize_text_field( wp_unslash( $_POST['sportspress_frontend_css_link'] ) ) ) : ''; $customize = ( ! empty( $_POST['sportspress_frontend_css_customize'] ) ) ? 1 : ''; $colors = array( 'primary' => $primary, 'background' => $background, 'text' => $text, 'heading' => $heading, 'link' => $link, 'customize' => $customize, ); // Merge with existing options if available $options = get_option( 'themeboy' ); if ( is_array( $options ) ) { $colors = array_merge( $options, $colors ); } update_option( 'themeboy', $colors ); } } /** * Timezone settings * * @access public * @return void */ public function timezone_setting() { $current_offset = get_option( 'gmt_offset' ); $tzstring = get_option( 'timezone_string' ); $check_zone_info = true; // Remove old Etc mappings. Fallback to gmt_offset. if ( false !== strpos( $tzstring, 'Etc/GMT' ) ) { $tzstring = ''; } if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists $check_zone_info = false; if ( 0 == $current_offset ) { $tzstring = 'UTC+0'; } elseif ( $current_offset < 0 ) { $tzstring = 'UTC' . $current_offset; } else { $tzstring = 'UTC+' . $current_offset; } } $class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' ); ?> array( '2b353e', 'f4f4f4', '222222', 'ffffff', '00a69c' ), 'Gold' => array( '333333', 'f7f7f7', '333333', 'd8bf94', '9f8958' ), 'Denim' => array( '0e2440', 'eae5e0', '0e2440', 'ffffff', '2b6291' ), 'Patriot' => array( '0d4785', 'ecedee', '333333', 'ffffff', 'c51d27' ), 'Metro' => array( '3a7895', '223344', 'ffffff', 'ffffff', 'ffa800' ), 'Stellar' => array( '313150', '050528', 'ffffff', 'ffffff', 'e00034' ), 'Carbon' => array( '353535', '191919', 'ededed', 'ffffff', 'f67f17' ), 'Avocado' => array( '00241e', '013832', 'ffffff', 'ffffff', 'efb11e' ), ) ); ?>
    $colors ) { ?>
         

    color_picker( esc_attr__( 'Primary', 'sportspress' ), 'sportspress_frontend_css_primary', $colors['primary'] ); $this->color_picker( esc_attr__( 'Background', 'sportspress' ), 'sportspress_frontend_css_background', $colors['background'] ); $this->color_picker( esc_attr__( 'Text', 'sportspress' ), 'sportspress_frontend_css_text', $colors['text'] ); $this->color_picker( esc_attr__( 'Heading', 'sportspress' ), 'sportspress_frontend_css_heading', $colors['heading'] ); $this->color_picker( esc_attr__( 'Link', 'sportspress' ), 'sportspress_frontend_css_link', $colors['link'] ); if ( ( $styles = SP_Frontend_Scripts::get_styles() ) && array_key_exists( 'sportspress-general', $styles ) ) : ?>
    ' . esc_html( $name ) . '
    '; } } endif; return new SP_Settings_General(); ================================================ FILE: includes/admin/settings/class-sp-settings-licenses.php ================================================ id = 'licenses'; $this->label = esc_attr__( 'Licenses', 'sportspress' ); $this->licenses = apply_filters( 'sportspress_licenses', array( 'pro' => array( 'name' => 'SportsPress Pro', 'url' => 'https://account.themeboy.com', ), ) ); if ( sizeof( $this->licenses ) <= 1 ) { return; } add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Output licenses * * @access public * @return void */ public function output() { ?>
    licenses as $id => $license ) { $key = get_site_option( 'sportspress_' . $id . '_license_key' ); $key = trim( $key ); $status = get_site_option( 'sportspress_' . $id . '_license_status', false ); ?>

    $value ) { if ( 'sp_license_activate_' === substr( $name, 0, 20 ) ) { $this->activate( substr( $name, 20 ) ); } elseif ( 'sp_license_deactivate_' === substr( $name, 0, 22 ) ) { $this->deactivate( substr( $name, 22 ) ); } } } /** * Activate license */ public function activate( $id ) { // return if a license key isn't set if ( ! isset( $_POST[ 'sp_license_key_' . $id ] ) ) { return; } // retrieve the license key $license = trim( sanitize_text_field( wp_unslash( $_POST[ 'sp_license_key_' . $id ] ) ) ); // get the name of the product $name = $this->licenses[ $id ]['name']; // data to send in our API request $api_params = array( 'edd_action' => 'activate_license', 'license' => $license, 'item_name' => urlencode( $name ), // the name of our product in EDD 'url' => home_url(), ); // Call the custom API. $response = wp_remote_post( $this->licenses[ $id ]['url'], array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params, ) ); // Make sure the response came back okay if ( is_wp_error( $response ) ) { SP_Admin_Settings::add_error( esc_attr__( 'Sorry, there has been an error.', 'sportspress' ) ); return false; } // Decode the license data $license_data = json_decode( wp_remote_retrieve_body( $response ) ); // Update license status update_site_option( 'sportspress_' . $id . '_license_status', $license_data->license ); // Update License or display error if ( 'valid' == $license_data->license ) { update_site_option( 'sportspress_' . $id . '_license_key', $license ); SP_Admin_Settings::add_override( esc_attr__( 'License activated.', 'sportspress' ) ); } else { SP_Admin_Settings::add_error( esc_attr__( 'License invalid.', 'sportspress' ) ); } } /** * Deactivate license */ public function deactivate( $id ) { // return if a license key isn't set if ( ! isset( $_POST[ 'sp_license_key_' . $id ] ) ) { return; } // retrieve the license key $license = trim( sanitize_text_field( wp_unslash( $_POST[ 'sp_license_key_' . $id ] ) ) ); // get the name of the product $name = $this->licenses[ $id ]['name']; // data to send in our API request $api_params = array( 'edd_action' => 'deactivate_license', 'license' => $license, 'item_name' => urlencode( $name ), // the name of our product in EDD 'url' => home_url(), ); // Call the custom API. $response = wp_remote_post( $this->licenses[ $id ]['url'], array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params, ) ); // make sure the response came back okay if ( is_wp_error( $response ) ) { SP_Admin_Settings::add_error( esc_attr__( 'Sorry, there has been an error.', 'sportspress' ) ); return false; } // decode the license data $license_data = json_decode( wp_remote_retrieve_body( $response ) ); // $license_data->license will be either "deactivated" or "failed" if ( $license_data->license == 'deactivated' ) { delete_site_option( 'sportspress_' . $id . '_license_status' ); SP_Admin_Settings::add_override( esc_attr__( 'License deactivated.', 'sportspress' ) ); } else { SP_Admin_Settings::add_error( esc_attr__( 'Sorry, there has been an error.', 'sportspress' ) ); } } } endif; return new SP_Settings_Licenses(); ================================================ FILE: includes/admin/settings/class-sp-settings-modules.php ================================================ id = 'modules'; $this->label = esc_attr__( 'Modules', 'sportspress' ); $this->sections = apply_filters( 'sportspress_module_sections', array( 'general' => esc_attr__( 'General', 'sportspress' ), 'event' => esc_attr__( 'Events', 'sportspress' ), 'team' => esc_attr__( 'Teams', 'sportspress' ), 'player_staff' => esc_attr__( 'Players', 'sportspress' ) . ' & ' . esc_attr__( 'Staff', 'sportspress' ), 'admin' => esc_attr__( 'Dashboard', 'sportspress' ), 'other' => esc_attr__( 'Other', 'sportspress' ), ) ); add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Output modules * * @access public * @return void */ public function output() { ?>
    <?php esc_html_e( 'SportsPress Pro', 'sportspress' ); ?>

    stylesheet ) { ?>

    array( 'icon' => 'sp-icon-book', 'label' => esc_attr__( 'Documentation', 'sportspress' ), 'links' => array( 'http://tboy.co/installation' => esc_attr__( 'Getting Started', 'sportspress' ), 'http://tboy.co/manuals' => esc_attr__( 'Manuals', 'sportspress' ), 'http://tboy.co/videos' => esc_attr__( 'Videos', 'sportspress' ), ), ), 'help' => array( 'icon' => 'dashicons dashicons-heart', 'label' => esc_attr__( 'Help', 'sportspress' ), 'links' => array( 'http://tboy.co/forums' => esc_attr__( 'Support Forums', 'sportspress' ), 'http://tboy.co/ideas' => esc_attr__( 'Feature Requests', 'sportspress' ), ), ), 'social' => array( 'icon' => 'dashicons dashicons-share', 'label' => esc_attr__( 'Connect', 'sportspress' ), 'links' => array( 'http://tboy.co/twitter' => esc_attr__( 'Twitter', 'sportspress' ), 'http://tboy.co/facebook' => esc_attr__( 'Facebook', 'sportspress' ), 'http://tboy.co/youtube' => esc_attr__( 'YouTube', 'sportspress' ), 'http://tboy.co/gplus' => esc_attr__( 'Google+', 'sportspress' ), ), ), 'developers' => array( 'icon' => 'dashicons dashicons-editor-code', 'label' => esc_attr__( 'Developers', 'sportspress' ), 'links' => array( 'http://tboy.co/developers' => esc_attr__( 'Reference', 'sportspress' ), 'http://tboy.co/slack' => esc_attr__( 'Slack', 'sportspress' ), 'http://tboy.co/github' => esc_attr__( 'GitHub', 'sportspress' ), ), ), ); if ( class_exists( 'SportsPress_Pro' ) ) { $categories['help']['links']['http://support.themeboy.com/'] = esc_attr__( 'Premium Support', 'sportspress' ); } else { $categories['help']['links'][ apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ) ] = '' . esc_attr__( 'Premium Support', 'sportspress' ) . ''; } $categories = apply_filters( 'sportspress_modules_welcome_links', $categories ); if ( sizeof( $categories ) ) { ?>
    $category ) { ?>

    modules->data as $section => $modules ) { ?> $module ) { ?>
    sections, $section, esc_attr__( 'Modules', 'sportspress' ) ) ); ?>
    >

    modules->data as $sections => $modules ) { foreach ( $modules as $id => $module ) { $name = 'sportspress_load_' . $id . '_module'; update_option( $name, isset( $_POST[ $name ] ) ? 'yes' : 'no' ); } } flush_rewrite_rules(); } } endif; return new SP_Settings_Modules(); ================================================ FILE: includes/admin/settings/class-sp-settings-page.php ================================================ id ] = $this->label; return $pages; } /** * Get settings array * * @return array */ public function get_settings() { return array(); } /** * Templates * * @return array */ public function templates() { if ( ! isset( $this->template ) ) { return array(); } $template = $this->template; return SP()->templates->$template; } /** * Output the settings */ public function output() { $settings = $this->get_settings(); SP_Admin_Settings::output_fields( $settings ); } /** * Save settings */ public function save() { global $current_section; $settings = $this->get_settings(); SP_Admin_Settings::save_fields( $settings ); if ( $current_section ) { do_action( 'sportspress_update_options_' . $this->template . '_' . $current_section ); } $templates = $this->templates(); if ( ! empty( $templates ) ) { update_option( 'sportspress_' . $this->template . '_template_order', sp_array_value( $_POST, 'sportspress_' . $this->template . '_template_order', false, 'key' ) ); } if ( isset( $_POST['sportspress_template_visibility'] ) && is_array( $_POST['sportspress_template_visibility'] ) ) { foreach ( $_POST['sportspress_template_visibility'] as $option => $toggled ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput if ( $toggled ) { update_option( $option, 'yes' ); } else { update_option( $option, 'no' ); } } } } /** * Layout settings * * @access public * @return void */ public function layout_setting() { $templates = $this->templates(); $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $templates ); $layout = get_option( 'sportspress_' . $this->template . '_template_order' ); if ( false === $layout ) { $layout = array_keys( $templates ); } $templates = array_merge( array_flip( (array) $layout ), $templates ); $slice = array_search( 'tabs', array_keys( $templates ) ); if ( $slice ) { $templates = array_slice( $templates, 0, $slice ); } ?>

      $details ) { if ( ! is_array( $details ) ) { continue; } $option = sp_array_value( $details, 'option', 'sportspress_' . $this->template . '_show_' . $template ); $visibility = get_option( $option, sp_array_value( $details, 'default', 'yes' ) ); ?>
    • >
    templates(); $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $templates ); $layout = get_option( 'sportspress_' . $this->template . '_template_order' ); if ( false === $layout ) { $layout = array_keys( $templates ); } $templates = array_merge( array_flip( (array) $layout ), $templates ); $slice = array_search( 'tabs', array_keys( $templates ) ); if ( $slice ) { $templates = array_slice( $templates, $slice ); } else { $templates = array(); } ?>

      $details ) { if ( ! is_array( $details ) ) { continue; } $option = sp_array_value( $details, 'option', 'sportspress_' . $this->template . '_show_' . $template ); $visibility = get_option( $option, sp_array_value( $details, 'default', 'yes' ) ); ?>
    • >
    id = 'players'; $this->label = esc_attr__( 'Players', 'sportspress' ); $this->template = 'player'; add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_admin_field_player_layout', array( $this, 'layout_setting' ) ); add_action( 'sportspress_admin_field_player_tabs', array( $this, 'tabs_setting' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get settings array * * @return array */ public function get_settings() { $settings = array_merge( array( array( 'title' => esc_attr__( 'Player Options', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'player_options', ), ), apply_filters( 'sportspress_player_options', array( array( 'type' => 'player_layout' ), array( 'type' => 'player_tabs' ), array( 'title' => esc_attr__( 'Link', 'sportspress' ), 'desc' => esc_attr__( 'Link players', 'sportspress' ), 'id' => 'sportspress_link_players', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'desc' => esc_attr__( 'Squad Number', 'sportspress' ), 'id' => 'sportspress_player_show_number', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Name', 'sportspress' ), 'id' => 'sportspress_player_show_name', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Nationality', 'sportspress' ), 'id' => 'sportspress_player_show_nationality', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Position', 'sportspress' ), 'id' => 'sportspress_player_show_positions', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Current Team', 'sportspress' ), 'id' => 'sportspress_player_show_current_teams', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Past Teams', 'sportspress' ), 'id' => 'sportspress_player_show_past_teams', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Leagues', 'sportspress' ), 'id' => 'sportspress_player_show_leagues', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Seasons', 'sportspress' ), 'id' => 'sportspress_player_show_seasons', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), array( 'title' => esc_attr__( 'Nationality', 'sportspress' ), 'desc' => esc_attr__( 'Display national flags', 'sportspress' ), 'id' => 'sportspress_player_show_flags', 'default' => 'yes', 'type' => 'checkbox', ), ) ), array( array( 'type' => 'sectionend', 'id' => 'player_options', ), ), array( array( 'title' => esc_attr__( 'Statistics', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'player_statistic_options', ), array( 'title' => esc_attr__( 'Columns', 'sportspress' ), 'id' => 'sportspress_player_columns', 'default' => 'auto', 'type' => 'radio', 'options' => array( 'auto' => esc_attr__( 'Auto', 'sportspress' ), 'manual' => esc_attr__( 'Manual', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Mode', 'sportspress' ), 'id' => 'sportspress_player_statistics_mode', 'default' => 'values', 'type' => 'radio', 'options' => array( 'values' => esc_attr__( 'Values', 'sportspress' ), 'icons' => esc_attr__( 'Icons', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Categories', 'sportspress' ), 'id' => 'sportspress_player_performance_sections', 'default' => -1, 'type' => 'radio', 'options' => array( -1 => esc_attr__( 'Combined', 'sportspress' ), 0 => esc_attr__( 'Offense', 'sportspress' ) . ' → ' . esc_attr__( 'Defense', 'sportspress' ), 1 => esc_attr__( 'Defense', 'sportspress' ) . ' → ' . esc_attr__( 'Offense', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Display', 'sportspress' ), 'desc' => esc_attr__( 'Total', 'sportspress' ), 'id' => 'sportspress_player_show_total', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Career Total', 'sportspress' ), 'id' => 'sportspress_player_show_career_total', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), ), apply_filters( 'sportspress_player_statistic_options', array() ), array( array( 'type' => 'sectionend', 'id' => 'player_statistic_options', ), ) ); return apply_filters( 'sportspress_player_settings', $settings ); } } endif; return new SP_Settings_Players(); ================================================ FILE: includes/admin/settings/class-sp-settings-staff.php ================================================ id = 'staff'; $this->label = esc_attr__( 'Staff', 'sportspress' ); $this->template = 'staff'; add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_admin_field_staff_layout', array( $this, 'layout_setting' ) ); add_action( 'sportspress_admin_field_staff_tabs', array( $this, 'tabs_setting' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get settings array * * @return array */ public function get_settings() { return apply_filters( 'sportspress_staff_settings', array_merge( array( array( 'title' => esc_attr__( 'Staff Options', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'staff_options', ), ), apply_filters( 'sportspress_staff_options', array( array( 'type' => 'staff_layout' ), array( 'type' => 'staff_tabs' ), array( 'title' => esc_attr__( 'Link', 'sportspress' ), 'desc' => esc_attr__( 'Link staff', 'sportspress' ), 'id' => 'sportspress_link_staff', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'desc' => esc_attr__( 'Nationality', 'sportspress' ), 'id' => 'sportspress_staff_show_nationality', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Current Team', 'sportspress' ), 'id' => 'sportspress_staff_show_current_teams', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Past Teams', 'sportspress' ), 'id' => 'sportspress_staff_show_past_teams', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), array( 'title' => esc_attr__( 'Nationality', 'sportspress' ), 'desc' => esc_attr__( 'Display national flags', 'sportspress' ), 'id' => 'sportspress_staff_show_flags', 'default' => 'yes', 'type' => 'checkbox', ), ) ), array( array( 'type' => 'sectionend', 'id' => 'staff_options', ), ) ) ); // End staff settings } } endif; return new SP_Settings_Staff(); ================================================ FILE: includes/admin/settings/class-sp-settings-status.php ================================================ id = 'status'; $this->label = esc_attr__( 'System Status', 'sportspress' ); if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG && current_user_can( 'manage_options' ) ) { add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 99 ); } add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); } /** * Output system status * * @access public * @return void */ public function output() { ?>


    '; $posting['fsockopen_curl']['success'] = false; } // SOAP $posting['soap_client']['name'] = esc_attr__( 'SOAP Client', 'sportspress' ); if ( class_exists( 'SoapClient' ) ) { $posting['soap_client']['note'] = esc_attr__( 'Your server has the SOAP Client class enabled.', 'sportspress' ); $posting['soap_client']['success'] = true; } else { $posting['soap_client']['note'] = wp_kses_post( sprintf( __( 'Your server does not have the SOAP Client class enabled - some gateway plugins which use SOAP may not work as expected.', 'sportspress' ), 'http://php.net/manual/en/class.soapclient.php' ) ) . ''; $posting['soap_client']['success'] = false; } $posting = apply_filters( 'sportspress_debug_posting', $posting ); foreach ( $posting as $post ) { $mark = ( isset( $post['success'] ) && $post['success'] == true ) ? 'yes' : 'error'; ?> {'Author URI'} == 'http://themeboy.com' ) : $theme_dir = substr( strtolower( str_replace( ' ', '', $active_theme->Name ) ), 0, 45 ); if ( false === ( $theme_version_data = get_transient( $theme_dir . '_version_data' ) ) ) : $theme_changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt' ); $cl_lines = explode( "\n", wp_remote_retrieve_body( $theme_changelog ) ); if ( ! empty( $cl_lines ) ) : foreach ( $cl_lines as $line_num => $cl_line ) { if ( preg_match( '/^[0-9]/', $cl_line ) ) : $theme_date = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) ); $theme_version = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) ); $theme_update = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) ); $theme_version_data = array( 'date' => $theme_date, 'version' => $theme_version, 'update' => $theme_update, 'changelog' => $theme_changelog, ); set_transient( $theme_dir . '_version_data', $theme_version_data, 60 * 60 * 12 ); break; endif; } endif; endif; endif; ?> plugin_path() . '/includes/admin/class-sp-admin-status.php'; $template_paths = apply_filters( 'sportspress_template_overrides_scan_paths', array( 'SportsPress' => SP()->plugin_path() . '/templates/' ) ); $found_files = array(); foreach ( $template_paths as $plugin_name => $template_path ) { $scanned_files[ $plugin_name ] = $status->scan_template_files( $template_path ); } foreach ( $scanned_files as $plugin_name => $files ) { foreach ( $files as $file ) { if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/' . $file; } elseif ( file_exists( get_stylesheet_directory() . '/sportspress/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/sportspress/' . $file; } elseif ( file_exists( get_template_directory() . '/' . $file ) ) { $theme_file = get_template_directory() . '/' . $file; } elseif ( file_exists( get_template_directory() . '/sportspress/' . $file ) ) { $theme_file = get_template_directory() . '/sportspress/' . $file; } else { $theme_file = false; } if ( $theme_file ) { $core_version = $status->get_file_version( SP()->plugin_path() . '/templates/' . $file ); $theme_version = $status->get_file_version( $theme_file ); if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) { $found_files[ $plugin_name ][] = wp_kses_post( sprintf( __( '%1$s version %2$s is out of date. The core version is %3$s', 'sportspress' ), basename( $theme_file ), $theme_version ? $theme_version : '-', $core_version ) ); } else { $found_files[ $plugin_name ][] = sprintf( '%s', basename( $theme_file ) ); } } } } if ( $found_files ) { foreach ( $found_files as $plugin_name => $found_plugin_files ) { ?>
    :
    :
    : version ); ?>
    :
    :
    :
    :
    : ' . wp_kses_post( sprintf( __( '%1$s - We recommend setting memory to at least 64MB. See: Increasing memory allocated to PHP', 'sportspress' ), esc_html( size_format( $memory ) ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) ) . ''; } else { echo '' . esc_html( size_format( $memory ) ) . ''; } ?>
    : ' . esc_html__( 'Yes', 'sportspress' ) . ''; } else { echo '' . esc_html__( 'No', 'sportspress' ) . ''; } ?>
    :
    :
    :
    :
    :
    :
    : ' . sprintf( esc_html__( 'Default timezone is %s - it should be UTC', 'sportspress' ), esc_attr( $default_timezone ) ) . ''; } else { echo '' . sprintf( esc_html__( 'Default timezone is %s', 'sportspress' ), esc_attr( $default_timezone ) ) . ''; } ?>
    :
    : ' . $plugin_name . ''; } if ( strstr( $dirname, 'sportspress' ) ) { if ( false === ( $version_data = get_transient( md5( $plugin ) . '_version_data' ) ) ) { $changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' ); $cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) ); if ( ! empty( $cl_lines ) ) { foreach ( $cl_lines as $line_num => $cl_line ) { if ( preg_match( '/^[0-9]/', $cl_line ) ) { $date = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) ); $version = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) ); $update = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) ); $version_data = array( 'date' => $date, 'version' => $version, 'update' => $update, 'changelog' => $changelog, ); set_transient( md5( $plugin ) . '_version_data', $version_data, 60 * 60 * 12 ); break; } } } } if ( ! empty( $version_data['version'] ) && version_compare( $version_data['version'], $plugin_data['Version'], '>' ) ) { $version_string = ' – ' . $version_data['version'] . ' ' . esc_attr__( 'is available', 'sportspress' ) . ''; } } $sp_plugins[] = $plugin_name . ' ' . esc_attr__( 'by', 'sportspress' ) . ' ' . $plugin_data['Author'] . ' ' . esc_attr__( 'version', 'sportspress' ) . ' ' . $plugin_data['Version'] . $version_string; } } if ( sizeof( $sp_plugins ) == 0 ) { echo '-'; } else { echo implode( ',
    ', array_map( 'wp_kses_post', $sp_plugins ) ); } ?>
    :
    : 'sp_outcome', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_result', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_performance', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_column', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $sort_order = sp_get_post_order( $post->ID ); $display_posts[] = $post->post_title . ' (' . $post->post_name . ' = ' . get_post_meta( $post->ID, 'sp_equation', true ) . ') [' . $post->menu_order . ']' . ( '—' == $sort_order ? '' : ' {' . $sort_order . '}' ); } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_metric', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_statistic', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ' = ' . get_post_meta( $post->ID, 'sp_equation', true ) . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 0 ) ); foreach ( $terms as $term ) { $display_terms[] = $term->name . ' (' . $term->slug . ')'; } echo implode( ', ', array_map( 'esc_html', $display_terms ) ); ?>
    : 0 ) ); foreach ( $terms as $term ) { $display_terms[] = $term->name . ' (' . $term->slug . ')'; } echo implode( ', ', array_map( 'esc_html', $display_terms ) ); ?>
    : 0 ) ); foreach ( $terms as $term ) { $display_terms[] = $term->name . ' (' . $term->slug . ')'; } echo implode( ', ', array_map( 'esc_html', $display_terms ) ); ?>
    : 0 ) ); foreach ( $terms as $term ) { $display_terms[] = $term->name . ' (' . $term->slug . ')'; } echo implode( ', ', array_map( 'esc_html', $display_terms ) ); ?>
    labels->name ); ?> : publish ); ?> publish, future ); ?> future, draft ); ?> draft, private ); ?> private, trash ); ?> trash, {'auto-draft'} ); ?> auto-draft, inherit ); ?> inherit
    : Name ); ?>
    : Version ); if ( ! empty( $theme_version_data['version'] ) && version_compare( $theme_version_data['version'], $active_theme->Version, '!=' ) ) { echo ' – ' . esc_html( $theme_version_data['version'] ) . ' ' . esc_html__( 'is available', 'sportspress' ) . ''; } ?>
    : {'Author URI'} ); ?>
    (): ', array_map( 'wp_kses_post', $found_plugin_files ) ); ?> :
    id = 'teams'; $this->label = esc_attr__( 'Teams', 'sportspress' ); $this->template = 'team'; add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_admin_field_team_layout', array( $this, 'layout_setting' ) ); add_action( 'sportspress_admin_field_team_tabs', array( $this, 'tabs_setting' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get settings array * * @return array */ public function get_settings() { $settings = array_merge( array( array( 'title' => esc_attr__( 'Team Options', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'team_options', ), ), apply_filters( 'sportspress_team_options', array( array( 'type' => 'team_layout' ), array( 'type' => 'team_tabs' ), array( 'title' => esc_attr__( 'Staff', 'sportspress' ), 'desc' => esc_attr__( 'Link staff', 'sportspress' ), 'id' => 'sportspress_team_link_staff', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Link', 'sportspress' ), 'desc' => esc_attr__( 'Link teams', 'sportspress' ), 'id' => 'sportspress_link_teams', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Venue', 'sportspress' ), 'desc' => esc_attr__( 'Link venues', 'sportspress' ), 'id' => 'sportspress_team_link_venues', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Visit Site', 'sportspress' ), 'desc' => esc_attr__( 'Open link in a new window/tab', 'sportspress' ), 'id' => 'sportspress_team_site_target_blank', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Comments', 'sportspress' ), 'desc' => esc_attr__( 'Allow people to post comments on Team page', 'sportspress' ), 'id' => 'sportspress_team_comment_status', 'default' => 'no', 'type' => 'checkbox', ), ) ), array( array( 'type' => 'sectionend', 'id' => 'team_options', ), ) ); return apply_filters( 'sportspress_team_settings', $settings ); } } endif; return new SP_Settings_Teams(); ================================================ FILE: includes/admin/settings/class-sp-settings-text.php ================================================ id = 'text'; $this->label = esc_attr__( 'Text', 'sportspress' ); add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get settings array * * @return array */ public function get_settings() { $settings = array( array( 'title' => esc_attr__( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => esc_attr__( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options', ), ); $strings = sp_get_text_options(); $options = get_option( 'sportspress_text' ); $options = array(); foreach ( $strings as $string ) : $options[] = array( 'title' => $string, 'id' => 'sportspress_text[' . $string . ']', 'default' => '', 'placeholder' => $string, 'value' => sp_array_value( $options, $string, null ), 'type' => 'text', ); endforeach; $settings = array_merge( $settings, apply_filters( 'sportspress_text_options', $options ), array( array( 'type' => 'sectionend', 'id' => 'text_options', ), ) ); return apply_filters( 'sportspress_text_settings', $settings ); // End event settings } /** * Save settings */ public function save() { if ( isset( $_POST['sportspress_text'] ) ) { update_option( 'sportspress_text', array_map( 'sanitize_text_field', array_map( 'wp_unslash', $_POST['sportspress_text'] ) ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput } } } endif; return new SP_Settings_Text(); ================================================ FILE: includes/admin/sp-admin-functions.php ================================================ 'css' ) ); // Bail if user disabled CodeMirror. if ( false === $settings ) { return; } wp_add_inline_script( 'code-editor', sprintf( 'jQuery( function() { wp.codeEditor.initialize( "sportspress_custom_css", %s ); } );', wp_json_encode( $settings ) ) ); } if ( function_exists( 'wp_enqueue_code_editor' ) ) { add_action( 'sportspress_settings_general', 'add_codemirror_to_custom_css' ); } ================================================ FILE: includes/admin/views/html-admin-config.php ================================================

    'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $data = get_posts( $args ); ?>

    >
    post_title ); ?> post_name ); ?> ID ) ); ?> ID ) ); ?>

    post_excerpt ); ?>


    'sp_result', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $data = get_posts( $args ); ?>

    >
    >
    post_name ); ?>> post_name ); ?>for, post_name ); ?>against ID ) ); ?> ID ) ); ?>

    post_excerpt ); ?>


    'sp_performance', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $data = get_posts( $args ); ?>

    ID, 'sp_visible', true ); if ( '' === $visible ) { $visible = 1; } ?> >
    >  
    post_name ); ?>> ID ) ) { $icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' ); } else { $icon = ' '; } echo wp_kses_post( apply_filters( 'sportspress_performance_icon', $icon, $row->ID ) ); ?> post_title ); ?> post_name ); ?> ID ) ); ?> ID ) ); ?>  

    post_excerpt ); ?>


    'sp_column', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $data = get_posts( $args ); ?>

    >
    post_title ); ?> ID ) ); ?> ID ) ); ?> ID ) ); ?>

    post_excerpt ); ?>


    'sp_metric', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $data = get_posts( $args ); ?>

    >
    post_title ); ?> post_name ); ?>

    post_excerpt ); ?>


    'sp_statistic', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $data = get_posts( $args ); $colspan = 6; if ( 'auto' === $columns ) { $colspan ++; } ?>

    ID, 'sp_visible', true ); if ( '' === $visible ) { $visible = 1; } ?> >
    post_title ); ?> ID ) ) { $icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' ); } else { $icon = ' '; } echo wp_kses_post( apply_filters( 'sportspress_performance_icon', $icon, $row->ID ) ); ?> ID ) ); ?> ID ) ); ?> ID ) ); ?>  

    post_excerpt ); ?>


    ================================================ FILE: includes/admin/views/html-admin-page-status.php ================================================


    '; $posting['fsockopen_curl']['success'] = false; } // SOAP $posting['soap_client']['name'] = esc_attr__( 'SOAP Client', 'sportspress' ); if ( class_exists( 'SoapClient' ) ) { $posting['soap_client']['note'] = esc_attr__( 'Your server has the SOAP Client class enabled.', 'sportspress' ); $posting['soap_client']['success'] = true; } else { $posting['soap_client']['note'] = sprintf( esc_attr__( 'Your server does not have the SOAP Client class enabled - some gateway plugins which use SOAP may not work as expected.', 'sportspress' ), 'http://php.net/manual/en/class.soapclient.php' ) . ''; $posting['soap_client']['success'] = false; } $posting = apply_filters( 'sportspress_debug_posting', $posting ); foreach ( $posting as $post ) { $mark = ( isset( $post['success'] ) && $post['success'] == true ) ? 'yes' : 'error'; ?> {'Author URI'} == 'http://themeboy.com' ) : $theme_dir = substr( strtolower( str_replace( ' ', '', $active_theme->Name ) ), 0, 45 ); if ( false === ( $theme_version_data = get_transient( $theme_dir . '_version_data' ) ) ) : $theme_changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt' ); $cl_lines = explode( "\n", wp_remote_retrieve_body( $theme_changelog ) ); if ( ! empty( $cl_lines ) ) : foreach ( $cl_lines as $line_num => $cl_line ) { if ( preg_match( '/^[0-9]/', $cl_line ) ) : $theme_date = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) ); $theme_version = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) ); $theme_update = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) ); $theme_version_data = array( 'date' => $theme_date, 'version' => $theme_version, 'update' => $theme_update, 'changelog' => $theme_changelog, ); set_transient( $theme_dir . '_version_data', $theme_version_data, 60 * 60 * 12 ); break; endif; } endif; endif; endif; ?> SP()->plugin_path() . '/templates/' ) ); $found_files = array(); foreach ( $template_paths as $plugin_name => $template_path ) { $scanned_files[ $plugin_name ] = $this->scan_template_files( $template_path ); } foreach ( $scanned_files as $plugin_name => $files ) { foreach ( $files as $file ) { if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/' . $file; } elseif ( file_exists( get_stylesheet_directory() . '/sportspress/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/sportspress/' . $file; } elseif ( file_exists( get_template_directory() . '/' . $file ) ) { $theme_file = get_template_directory() . '/' . $file; } elseif ( file_exists( get_template_directory() . '/sportspress/' . $file ) ) { $theme_file = get_template_directory() . '/sportspress/' . $file; } else { $theme_file = false; } if ( $theme_file ) { $core_version = $this->get_file_version( SP()->plugin_path() . '/templates/' . $file ); $theme_version = $this->get_file_version( $theme_file ); if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) { $found_files[ $plugin_name ][] = wp_kses_post( sprintf( __( '%1$s version %2$s is out of date. The core version is %3$s', 'sportspress' ), basename( $theme_file ), $theme_version ? $theme_version : '-', $core_version ) ); } else { $found_files[ $plugin_name ][] = sprintf( '%s', basename( $theme_file ) ); } } } } if ( $found_files ) { foreach ( $found_files as $plugin_name => $found_plugin_files ) { ?>
    :
    :
    : version ); ?>
    :
    :
    :
    :
    : ' . wp_kses_post( sprintf( __( '%1$s - We recommend setting memory to at least 64MB. See: Increasing memory allocated to PHP', 'sportspress' ), esc_html( size_format( $memory ) ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) ) . ''; } else { echo '' . esc_html( size_format( $memory ) ) . ''; } ?>
    : ' . esc_html__( 'Yes', 'sportspress' ) . ''; } else { echo '' . esc_html__( 'No', 'sportspress' ) . ''; } ?>
    :
    :
    :
    :
    :
    :
    : ' . sprintf( esc_html__( 'Default timezone is %s - it should be UTC', 'sportspress' ), esc_html( $default_timezone ) ) . ''; } else { echo '' . sprintf( esc_html__( 'Default timezone is %s', 'sportspress' ), esc_html( $default_timezone ) ) . ''; } ?>
    :
    : ' . $plugin_name . ''; } if ( strstr( $dirname, 'sportspress' ) ) { if ( false === ( $version_data = get_transient( md5( $plugin ) . '_version_data' ) ) ) { $changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' ); $cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) ); if ( ! empty( $cl_lines ) ) { foreach ( $cl_lines as $line_num => $cl_line ) { if ( preg_match( '/^[0-9]/', $cl_line ) ) { $date = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) ); $version = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) ); $update = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) ); $version_data = array( 'date' => $date, 'version' => $version, 'update' => $update, 'changelog' => $changelog, ); set_transient( md5( $plugin ) . '_version_data', $version_data, 60 * 60 * 12 ); break; } } } } if ( ! empty( $version_data['version'] ) && version_compare( $version_data['version'], $plugin_data['Version'], '>' ) ) { $version_string = ' – ' . $version_data['version'] . ' ' . esc_attr__( 'is available', 'sportspress' ) . ''; } } $sp_plugins[] = $plugin_name . ' ' . esc_attr__( 'by', 'sportspress' ) . ' ' . $plugin_data['Author'] . ' ' . esc_attr__( 'version', 'sportspress' ) . ' ' . $plugin_data['Version'] . $version_string; } } if ( sizeof( $sp_plugins ) == 0 ) { echo '-'; } else { echo wp_kses_post( implode( ',
    ', $sp_plugins ) ); } ?>
    :
    : 'sp_outcome', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_result', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_performance', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_column', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ' = ' . get_post_meta( $post->ID, 'sp_equation', true ) . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_metric', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 'sp_statistic', 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $posts as $post ) { $display_posts[] = $post->post_title . ' (' . $post->post_name . ' = ' . get_post_meta( $post->ID, 'sp_equation', true ) . ') [' . $post->menu_order . ']'; } echo implode( ', ', array_map( 'esc_html', $display_posts ) ); ?>
    : 0 ) ); foreach ( $terms as $term ) { $display_terms[] = $term->name . ' (' . $term->slug . ')'; } echo implode( ', ', array_map( 'esc_html', $display_terms ) ); ?>
    : 0 ) ); foreach ( $terms as $term ) { $display_terms[] = $term->name . ' (' . $term->slug . ')'; } echo implode( ', ', array_map( 'esc_html', $display_terms ) ); ?>
    : 0 ) ); foreach ( $terms as $term ) { $display_terms[] = $term->name . ' (' . $term->slug . ')'; } echo implode( ', ', array_map( 'esc_html', $display_terms ) ); ?>
    : 0 ) ); foreach ( $terms as $term ) { $display_terms[] = $term->name . ' (' . $term->slug . ')'; } echo implode( ', ', array_map( 'esc_html', $display_terms ) ); ?>
    labels->name ); ?> : publish ); ?> publish, future ); ?> future, draft ); ?> draft, private ); ?> private, trash ); ?> trash, {'auto-draft'} ); ?> auto-draft, inherit ); ?> inherit
    : Name ); ?>
    : Version ); if ( ! empty( $theme_version_data['version'] ) && version_compare( $theme_version_data['version'], $active_theme->Version, '!=' ) ) { echo ' – ' . esc_html( $theme_version_data['version'] ) . ' ' . esc_html__( 'is available', 'sportspress' ) . ''; } ?>
    : {'Author URI'} ); ?>
    (): ', $found_plugin_files ) ); ?> :
    ================================================ FILE: includes/admin/views/html-admin-settings.php ================================================

    ' ) ); ?>

    ================================================ FILE: includes/admin/views/html-notice-install.php ================================================

    ================================================ FILE: includes/admin/views/html-notice-no-access.php ================================================

    ================================================ FILE: includes/admin/views/html-notice-template-check.php ================================================

    Your theme has bundled outdated copies of SportsPress template files – 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' ) ); ?>

    ================================================ FILE: includes/admin/views/html-notice-theme-support.php ================================================

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

    ================================================ FILE: includes/api/class-sp-rest-api.php ================================================ 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Teams', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'main_results', array( 'get_callback' => 'SP_REST_API::get_post_data', 'schema' => array( 'description' => esc_attr__( 'Main Results', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'outcome', array( 'get_callback' => 'SP_REST_API::get_post_data', 'schema' => array( 'description' => esc_attr__( 'Outcome', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'winner', array( 'get_callback' => 'SP_REST_API::get_post_data', 'schema' => array( 'description' => esc_attr__( 'Winner', 'sportspress' ), 'type' => 'integer', 'context' => array( 'view', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'format', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Format', 'sportspress' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), ) ); register_rest_field( 'sp_event', 'mode', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Mode', 'sportspress' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), ) ); register_rest_field( 'sp_event', 'day', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Match Day', 'sportspress' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), ) ); register_rest_field( 'sp_event', 'minutes', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Full Time', 'sportspress' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'absint', ), ), ) ); register_rest_field( 'sp_event', 'players', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Players', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'offense', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Offense', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'defense', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Defense', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'staff', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Staff', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'results', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_arrays', 'schema' => array( 'description' => esc_attr__( 'Results', 'sportspress' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_event', 'performance', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_arrays_multi', 'schema' => array( 'description' => esc_attr__( 'Box Score', 'sportspress' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_team', 'staff', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Staff', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_team', 'tables', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'League Tables', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_team', 'lists', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Player Lists', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_team', 'events', array( 'get_callback' => 'SP_REST_API::get_post_ids_with_meta', 'schema' => array( 'description' => esc_attr__( 'Events', 'sportspress' ), 'type' => 'array', 'context' => array( 'view' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_team', 'abbreviation', array( 'get_callback' => 'SP_REST_API::get_post_meta', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Abbreviation', 'sportspress' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), ) ); register_rest_field( 'sp_team', 'url', array( 'get_callback' => 'SP_REST_API::get_post_meta', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Site URL', 'sportspress' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), ) ); register_rest_field( 'sp_player', 'number', array( 'get_callback' => 'SP_REST_API::get_post_meta', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Squad Number', 'sportspress' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'absint', ), ), ) ); register_rest_field( 'sp_player', 'teams', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Teams', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_player', 'current_teams', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Current Teams', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_player', 'past_teams', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Past Teams', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_player', 'nationalities', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Nationalities', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_player', 'metrics', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_array', 'schema' => array( 'description' => esc_attr__( 'Metrics', 'sportspress' ), 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_player', 'statistics', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_arrays_multi', 'schema' => array( 'description' => esc_attr__( 'Statistics', 'sportspress' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_staff', 'teams', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Teams', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_staff', 'current_teams', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Current Teams', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_staff', 'past_teams', array( 'get_callback' => 'SP_REST_API::get_post_meta_recursive', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Past Teams', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_staff', 'nationalities', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_recursive', 'schema' => array( 'description' => esc_attr__( 'Nationalities', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); do_action( 'sportspress_register_rest_fields' ); } /** * Get the value of a single SportsPress meta field. * * @param array $object Details of current post. * @param string $field_name Name of field. * @param WP_REST_Request $request Current request * * @return mixed */ public static function get_post_meta( $object, $field_name, $request ) { $meta = get_post_meta( $object['id'], self::meta_key( $field_name ), true ); if ( ctype_digit( $meta ) ) { $meta = intval( $meta ); } return $meta; } /** * Handler for updating custom field data. * * @param mixed $value The value of the field * @param object $object The object from the response * @param string $field_name Name of field * * @return bool|int */ public static function update_post_meta( $value, $object, $field_name ) { return update_post_meta( $object->ID, self::meta_key( $field_name ), strip_tags( $value ) ); } /** * Handler for updating array values by merging with the existing array. * * @param mixed $value The value of the field * @param object $object The object from the response * @param string $field_name Name of field * * @return bool|int */ public static function update_post_meta_array( $value, $object, $field_name ) { // Convert PHP object to array if ( is_object( $value ) ) { $value = (array) $value; } if ( ! is_array( $value ) ) { return false; } $type = $object->post_type; $meta = get_post_meta( $object->ID, self::meta_key( $field_name, $type ), true ); if ( ! is_array( $meta ) ) { $meta = array(); } $meta = array_merge( $meta, $value ); return update_post_meta( $object->ID, self::meta_key( $field_name, $type ), $meta ); } /** * Handler for updating array values by merging with the existing multidimentional array. * * @param mixed $value The value of the field * @param object $object The object from the response * @param string $field_name Name of field * * @return bool|int */ public static function update_post_meta_arrays( $value, $object, $field_name ) { if ( ! is_array( $value ) ) { return false; } $type = $object->post_type; $meta = get_post_meta( $object->ID, self::meta_key( $field_name, $type ), true ); if ( ! is_array( $meta ) ) { $meta = array(); } foreach ( $value as $index => $array ) { if ( ! is_array( $array ) ) { continue; } if ( ! isset( $meta[ $index ] ) || ! is_array( $meta[ $index ] ) ) { $meta[ $index ] = array(); } $meta[ $index ] = array_merge( $meta[ $index ], $array ); } return update_post_meta( $object->ID, self::meta_key( $field_name, $type ), $meta ); } /** * Handler for updating array values by merging with existing multidimensional arrays. * * @param mixed $value The value of the field * @param object $object The object from the response * @param string $field_name Name of field * * @return bool|int */ public static function update_post_meta_arrays_multi( $value, $object, $field_name ) { if ( ! is_array( $value ) ) { return false; } $type = $object->post_type; $meta = get_post_meta( $object->ID, self::meta_key( $field_name, $type ), true ); if ( ! is_array( $meta ) ) { $meta = array(); } foreach ( $value as $key => $arrays ) { if ( ! is_array( $arrays ) ) { continue; } if ( ! isset( $meta[ $key ] ) || ! is_array( $meta[ $key ] ) ) { $meta[ $key ] = array(); } foreach ( $arrays as $index => $array ) { if ( ! is_array( $array ) ) { continue; } if ( ! isset( $meta[ $key ][ $index ] ) || ! is_array( $meta[ $key ][ $index ] ) ) { $meta[ $key ][ $index ] = array(); } $meta[ $key ][ $index ] = array_merge( $meta[ $key ][ $index ], $array ); } } return update_post_meta( $object->ID, self::meta_key( $field_name, $type ), $meta ); } /** * Get an array of SportsPress meta field values. * * @param array $object Details of current post. * @param string $field_name Name of field. * @param WP_REST_Request $request Current request * * @return mixed */ public static function get_post_meta_recursive( $object, $field_name, $request ) { $meta = get_post_meta( $object['id'], self::meta_key( $field_name ), false ); return array_map( 'intval', $meta ); } /** * Handler for updating multiple custom field values. * * @param array $values The values of the field * @param object $object The object from the response * @param string $field_name Name of field * * @return bool|int */ public static function update_post_meta_recursive( $values, $object, $field_name ) { delete_post_meta( $object->ID, self::meta_key( $field_name ) ); $response = true; foreach ( $values as $value ) { $response = add_post_meta( $object->ID, self::meta_key( $field_name ), $value ); } return $response; } /** * Get an array of SportsPress meta field values and split into separate arrays based on placeholder zeroes. * * @param array $object Details of current post. * @param string $field_name Name of field. * @param WP_REST_Request $request Current request * * @return mixed */ public static function get_post_meta_recursive_split( $object, $field_name, $request ) { $array = self::get_post_meta_recursive( $object, $field_name, $request ); $meta = array(); $i = 0; foreach ( $array as $value ) { if ( $value ) { $meta[ $i ][] = $value; } else { $i ++; } } return $meta; } /** * Get a list of posts with a meta value of the given field name. * * @param array $object Details of current post. * @param string $field_name Name of field. * @param WP_REST_Request $request Current request * * @return mixed */ public static function get_post_ids_with_meta( $object, $field_name, $request ) { $meta_key = self::meta_key( $field_name ); $query_args = array( 'post_type' => $meta_key, 'posts_per_page' => 2000, 'meta_query' => array( 'key' => $object['type'], 'value' => $object['id'], 'compare' => 'IN', ), ); if ( 'sp_event' === $meta_key ) { $query_args['orderby'] = 'date'; $query_args['order'] = 'DESC'; $query_args['post_status'] = array( 'publish', 'future' ); } else { $query_args['orderby'] = 'title'; $query_args['order'] = 'ASC'; $query_args['post_status'] = 'publish'; } $posts_query = new WP_Query(); $query_result = $posts_query->query( $query_args ); return wp_list_pluck( $query_result, 'ID' ); } /** * Get custom SportsPress data based on post type and field name. * * @param array $object Details of current post. * @param string $field_name Name of field. * @param WP_REST_Request $request Current request * * @return mixed */ public static function get_post_data( $object, $field_name, $request ) { //$type = $object['type']; $type = get_post_type( $object['id'] ); $post = new $type( $object['id'] ); return $post->$field_name(); } /** * Get meta key of a field */ public static function meta_key( $field_name, $type = null ) { $names = array( 'current_teams' => 'sp_current_team', 'events' => 'sp_event', 'lists' => 'sp_list', 'nationalities' => 'sp_nationality', 'past_teams' => 'sp_past_team', 'performance' => 'sp_players', 'players' => 'sp_player', 'offense' => 'sp_offense', 'defense' => 'sp_defense', 'table' => 'sp_teams', 'tables' => 'sp_table', 'teams' => 'sp_team', ); if ( isset( $type ) ) { switch ( $type ) { case 'sp_table': $names['data'] = 'sp_teams'; break; case 'sp_list': $names['data'] = 'sp_players'; break; } } $names = apply_filters( 'sportspress_rest_meta_keys', $names, $type ); if ( array_key_exists( $field_name, $names ) ) { $field_name = $names[ $field_name ]; } else { $field_name = 'sp_' . $field_name; } return $field_name; } /** * Enable meta query vars */ public static function meta_query( $valid_vars ) { $valid_vars = array_merge( $valid_vars, array( 'meta_key', 'meta_value', 'meta_query' ) ); return $valid_vars; } /** * Add scheduled events to query */ public static function event_query( $args ) { $args['post_status'] = array( 'publish', 'future' ); return $args; } /** * Enable post status in events query */ public static function query_vars( $vars ) { global $wp; $vars[] = 'post_status'; return $vars; } } endif; return new SP_REST_API(); ================================================ FILE: includes/api/class-sp-rest-posts-controller.php ================================================ namespace = 'sportspress/v2'; } public function check_read_permission( $post ) { if ( 'sp_event' === $post->post_type ) { if ( in_array( $post->post_status, array( 'publish', 'future' ) ) || current_user_can( 'read_post', $post->ID ) ) { return true; } } else { return WP_REST_Posts_Controller::check_read_permission( $post ); } } } } ================================================ FILE: includes/api/class-sp-rest-terms-controller.php ================================================ namespace = 'sportspress/v2'; } } } ================================================ FILE: includes/class-sp-ajax.php ================================================ nopriv $ajax_events = array( 'event_countdown_shortcode' => false, 'event_details_shortcode' => false, 'event_results_shortcode' => false, 'event_performance_shortcode' => false, 'event_venue_shortcode' => false, 'event_officials_shortcode' => false, 'event_teams_shortcode' => false, 'event_full_shortcode' => false, 'event_calendar_shortcode' => false, 'event_list_shortcode' => false, 'event_blocks_shortcode' => false, 'team_standings_shortcode' => false, 'team_gallery_shortcode' => false, 'player_details_shortcode' => false, 'player_statistics_shortcode' => false, 'player_list_shortcode' => false, 'player_gallery_shortcode' => false, ); foreach ( $ajax_events as $ajax_event => $nopriv ) { add_action( 'wp_ajax_sportspress_' . $ajax_event, array( $this, $ajax_event ) ); if ( $nopriv ) { add_action( 'wp_ajax_nopriv_sportspress_' . $ajax_event, array( $this, $ajax_event ) ); } } } /** * AJAX event_countdown shortcode */ public function event_countdown_shortcode() { ?>

    'date', 'id' => 'date', // 'selected' => $date, ); sp_dropdown_dates( $args ); ?>

    :

    'date', 'id' => 'date', // 'selected' => $date, ); sp_dropdown_dates( $args ); ?>

    :


    esc_attr__( 'Event', 'sportspress' ), 'teams' => esc_attr__( 'Teams', 'sportspress' ), 'time' => esc_attr__( 'Time', 'sportspress' ), 'league' => esc_attr__( 'League', 'sportspress' ), 'season' => esc_attr__( 'Season', 'sportspress' ), 'venue' => esc_attr__( 'Venue', 'sportspress' ), 'article' => esc_attr__( 'Article', 'sportspress' ), 'event_specs' => esc_attr__( 'Specs', 'sportspress' ), ); $field_name = 'columns[]'; $field_id = 'columns'; ?> $label ) : ?>

    'date', 'id' => 'date', // 'selected' => $date, ); sp_dropdown_dates( $args ); ?>

    :


    'sp_column', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $the_columns = get_posts( $args ); $field_name = 'columns[]'; $field_id = 'columns'; ?>




    array( 'sp_metric', 'sp_performance', 'sp_statistic' ), 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $the_columns = get_posts( $args ); $field_name = 'columns[]'; $field_id = 'columns'; ?>

    ID = absint( $post->ID ); $this->post = $post; else : $this->ID = absint( $post ); $this->post = get_post( $this->ID ); endif; $this->status = $this->__get( 'status' ); $this->date = $this->__get( 'date' ); $this->orderby = $this->__get( 'orderby' ); $this->order = $this->__get( 'order' ); $this->number = $this->__get( 'number' ); if ( ! $this->status ) { $this->status = 'any'; } if ( ! $this->date ) { $this->date = 0; } if ( ! $this->order ) { $this->order = 'ASC'; } if ( ! $this->orderby ) { $this->orderby = 'post_date'; } if ( 'range' == $this->date ) { $this->relative = get_post_meta( $this->ID, 'sp_date_relative', true ); if ( $this->relative ) { $this->past = get_post_meta( $this->ID, 'sp_date_past', true ); $this->future = get_post_meta( $this->ID, 'sp_date_future', true ); } else { $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); } } if ( ! $this->day ) { $this->day = get_post_meta( $this->ID, 'sp_day', true ); } if ( ! $this->event_format ) { $this->event_format = get_post_meta( $this->ID, 'sp_event_format', true ); } if ( ! $this->number ) { $this->number = -1; } } /** * Returns formatted data * * @access public * @return array */ public function data() { global $pagenow; $weekday = array( 0 => 'Sunday', 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', ); $start_of_week = get_option( 'start_of_week' ); $firstday = $weekday[ $start_of_week ]; if ( $start_of_week != 0 ) { $lastday = $weekday[ ( $start_of_week - 1 ) ]; } else { $lastday = $weekday[6]; } $today = date( 'l' ); $args = array( 'post_type' => 'sp_event', 'posts_per_page' => $this->number, 'orderby' => $this->orderby, 'order' => $this->order, 'meta_query' => array( 'relation' => 'AND', ), 'tax_query' => array( 'relation' => 'AND', ), ); if ( $this->date !== 0 ) : switch ( $this->date ) : case '-day': $date = new DateTime( date_i18n( 'Y-m-d' ) ); $date->modify( '-1 day' ); $args['year'] = $date->format( 'Y' ); $args['day'] = $date->format( 'j' ); $args['monthnum'] = $date->format( 'n' ); break; case 'day': $args['year'] = date_i18n( 'Y' ); $args['day'] = date_i18n( 'j' ); $args['monthnum'] = date_i18n( 'n' ); break; case '+day': $date = new DateTime( date_i18n( 'Y-m-d' ) ); $date->modify( '+1 day' ); $args['year'] = $date->format( 'Y' ); $args['day'] = $date->format( 'j' ); $args['monthnum'] = $date->format( 'n' ); break; case '-w': if ( $start_of_week != '1' ) { // If start of week is not Monday if ( $today == $firstday ) { // If today is start of Week $after = date_i18n( 'Y-m-d', strtotime( "last $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "last $lastday" ) ) . ' 23:59:59'; } else { $after = date_i18n( 'Y-m-d', strtotime( "-2 $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "last $lastday" ) ) . ' 23:59:59'; } $args['date_query'] = array( array( 'after' => $after, 'before' => $before, 'inclusive' => true, ), ); } else { $date = new DateTime( date_i18n( 'Y-m-d' ) ); $date->modify( '-1 week' ); $args['year'] = $date->format( 'Y' ); $args['w'] = $date->format( 'W' ); } break; case 'w': if ( $start_of_week != '1' ) { // If start of week is not Monday if ( $today == $firstday ) { // If today is start of Week $after = date_i18n( 'Y-m-d' ); $before = date_i18n( 'Y-m-d', strtotime( "next $lastday" ) ) . ' 23:59:59'; } elseif ( $today == $lastday ) { // If today is the end of Week $after = date_i18n( 'Y-m-d', strtotime( "last $firstday" ) ); $before = date_i18n( 'Y-m-d' ) . ' 23:59:59'; } else { $after = date_i18n( 'Y-m-d', strtotime( "last $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "next $lastday" ) ) . ' 23:59:59'; } $args['date_query'] = array( array( 'after' => $after, 'before' => $before, 'inclusive' => true, ), ); } else { $args['year'] = date_i18n( 'Y' ); $args['w'] = date_i18n( 'W' ); } break; case '+w': if ( $start_of_week != '1' ) { // If start of week is not Monday if ( $today == $lastday ) { // If today is the end of Week $after = date_i18n( 'Y-m-d', strtotime( "next $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "next $lastday" ) ) . ' 23:59:59'; } else { $after = date_i18n( 'Y-m-d', strtotime( "next $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "+2 $lastday" ) ) . ' 23:59:59'; } $args['date_query'] = array( array( 'after' => $after, 'before' => $before, 'inclusive' => true, ), ); } else { $date = new DateTime( date_i18n( 'Y-m-d' ) ); $date->modify( '+1 week' ); $args['year'] = $date->format( 'Y' ); $args['w'] = $date->format( 'W' ); } break; case 'range': if ( $this->relative ) : add_filter( 'posts_where', array( $this, 'relative' ) ); else : add_filter( 'posts_where', array( $this, 'range' ) ); endif; break; endswitch; endif; if ( $this->league ) : $league_ids = array( $this->league ); endif; if ( $this->season ) : $season_ids = array( $this->season ); endif; if ( $this->venue ) : $venue_ids = array( $this->venue ); endif; if ( $this->team ) : $args['meta_query'][] = array( 'key' => 'sp_team', 'value' => array( $this->team ), 'compare' => 'IN', ); endif; // If we are showing past meetings filter by team's id and current event date if ( $this->teams_past ) : foreach ( $this->teams_past as $team_past ) : $args['meta_query'][] = array( 'key' => 'sp_team', 'value' => $team_past, 'compare' => '=', ); endforeach; $args['date_query'] = array( array( 'before' => $this->date_before, 'inclusive' => false, ), ); endif; if ( $this->player ) : $args['meta_query'][] = array( 'key' => 'sp_player', 'value' => array( $this->player ), 'compare' => 'IN', ); endif; if ( $this->event_format && 'all' != $this->event_format ) : $args['meta_query'][] = array( 'key' => 'sp_format', 'value' => $this->event_format, ); endif; if ( $this->day ) : $args['meta_query'][] = array( 'key' => 'sp_day', 'value' => $this->day, ); endif; if ( 'day' == $this->orderby ) : $args['orderby'] = 'meta_value_num'; $args['meta_key'] = 'sp_day'; endif; if ( $pagenow != 'post-new.php' ) : if ( $this->ID ) : $leagues = get_the_terms( $this->ID, 'sp_league' ); $seasons = get_the_terms( $this->ID, 'sp_season' ); $venues = get_the_terms( $this->ID, 'sp_venue' ); $teams = array_filter( get_post_meta( $this->ID, 'sp_team', false ) ); $players = array_filter( get_post_meta( $this->ID, 'sp_player', false ) ); $table = get_post_meta( $this->ID, 'sp_table', true ); if ( ! isset( $league_ids ) ) { $league_ids = array(); } if ( empty( $league_ids ) && $leagues ) : foreach ( $leagues as $league ) : $league_ids[] = $league->term_id; endforeach; endif; $league_ids = sp_add_auto_term( $league_ids, $this->ID, 'sp_league' ); if ( empty( $league_ids ) ) { unset( $league_ids ); } if ( ! isset( $season_ids ) ) { $season_ids = array(); } if ( empty( $season_ids ) && $seasons ) : foreach ( $seasons as $season ) : $season_ids[] = $season->term_id; endforeach; endif; $season_ids = sp_add_auto_term( $season_ids, $this->ID, 'sp_season' ); if ( empty( $season_ids ) ) { unset( $season_ids ); } if ( ! isset( $venue_ids ) && $venues ) : $venue_ids = array(); foreach ( $venues as $venue ) : $venue_ids[] = $venue->term_id; endforeach; endif; endif; if ( isset( $league_ids ) ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ); } if ( isset( $season_ids ) ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season_ids, ); } if ( isset( $venue_ids ) ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_venue', 'field' => 'term_id', 'terms' => $venue_ids, ); } if ( ! empty( $teams ) ) { $args['meta_query'][] = array( 'key' => 'sp_team', 'value' => $teams, 'compare' => 'IN', ); } if ( ! empty( $players ) ) { $args['meta_query'][] = array( 'key' => 'sp_player', 'value' => $players, 'compare' => 'IN', ); } if ( $this->event ) { $args['p'] = $this->event; $args['post_status'] = array( 'publish', 'future' ); } if ( 'auto' === $this->date && 'any' === $this->status ) { $args['post_status'] = 'publish'; $args['order'] = 'DESC'; $args['posts_per_page'] = ceil( $this->number / 2 ); $results = get_posts( $args ); $results = array_reverse( $results, true ); $args['post_status'] = 'future'; $args['order'] = 'ASC'; $args['posts_per_page'] = floor( $this->number / 2 ); $fixtures = get_posts( $args ); $events = array_merge_recursive( $results, $fixtures ); } else { $args['post_status'] = $this->status == 'any' ? array( 'publish', 'future' ) : explode( ',', $this->status ); $events = get_posts( $args ); } else : $events = null; endif; // Remove any calendar selection filters remove_filter( 'posts_where', array( $this, 'range' ) ); remove_filter( 'posts_where', array( $this, 'relative' ) ); return $events; } } ================================================ FILE: includes/class-sp-countries.php ================================================ array( 'alg', 'ang', 'bdi', 'ben', 'bfa', 'bot', 'cgo', 'cha', 'civ', 'cmr', 'cod', 'com', 'cpv', 'cta', 'dji', 'egy', 'eqg', 'eri', 'esh', 'eth', 'gab', 'gam', 'gha', 'gnb', 'gui', 'ken', 'lbr', 'lby', 'les', 'mad', 'mar', 'mli', 'moz', 'mri', 'mtn', 'nam', 'nga', 'nig', 'reu', 'rsa', 'rwa', 'sdn', 'sen', 'sey', 'sle', 'som', 'ssd', 'stp', 'swz', 'tan', 'tog', 'tun', 'uga', 'zam', 'zim', ), __( 'Asia', 'sportspress' ) => array( 'afg', 'arm', 'aze', 'ban', 'bhr', 'bhu', 'bru', 'cam', 'chn', 'cyp', 'geo', 'hkg', 'ind', 'irn', 'irq', 'isr', 'jor', 'jpn', 'kaz', 'kgz', 'kor', 'ksa', 'kuw', 'lao', 'lib', 'mac', 'mas', 'mdv', 'mng', 'mya', 'nep', 'oma', 'pak', 'phi', 'ple', 'prk', 'qat', 'sin', 'sri', 'syr', 'tha', 'tjk', 'tkm', 'tpe', 'uae', 'uzb', 'vie', 'yem', ), __( 'Europe', 'sportspress' ) => array( 'alb', 'and', 'aut', 'bel', 'bih', 'blr', 'bul', 'cro', 'cze', 'den', 'end', 'eng', 'esp', 'est', 'fin', 'fra', 'fro', 'gbr', 'ger', 'gib', 'gre', 'hun', 'irl', 'isl', 'ita', 'kos', 'lie', 'ltu', 'lux', 'lva', 'mco', 'mda', 'mkd', 'mlt', 'mne', 'mwi', 'ned', 'nir', 'nor', 'pol', 'por', 'rou', 'rus', 'sco', 'smr', 'srb', 'svk', 'svn', 'sui', 'swe', 'swz', 'tur', 'ukr', 'vat', 'wal', ), __( 'North America', 'sportspress' ) => array( 'atg', 'aia', 'aru', 'bah', 'ber', 'blz', 'brb', 'can', 'cay', 'crc', 'cub', 'cuw', 'dma', 'dom', 'glp', 'grl', 'grn', 'gua', 'hai', 'hon', 'jam', 'lca', 'mex', 'mtq', 'msr', 'nca', 'pan', 'pur', 'skn', 'slv', 'sxm', 'tca', 'usa', 'vgb', 'vin', 'vir', 'wif', ), __( 'Oceania', 'sportspress' ) => array( 'asa', 'aus', 'cok', 'fij', 'fsm', 'gum', 'idn', 'kir', 'mhl', 'ncl', 'nru', 'nzl', 'plw', 'png', 'pyf', 'sam', 'sol', 'tah', 'tga', 'tls', 'tuv', 'van', ), __( 'South America', 'sportspress' ) => array( 'arg', 'bol', 'bra', 'chi', 'col', 'ecu', 'guf', 'guy', 'par', 'per', 'sur', 'tri', 'uru', 'ven', ), ); $this->countries = apply_filters( 'sportspress_countries', array( 'afg' => esc_attr__( 'Afghanistan', 'sportspress' ), 'aia' => esc_attr__( 'Anguilla', 'sportspress' ), 'alb' => esc_attr__( 'Albania', 'sportspress' ), 'alg' => esc_attr__( 'Algeria', 'sportspress' ), 'and' => esc_attr__( 'Andorra', 'sportspress' ), 'ang' => esc_attr__( 'Angola', 'sportspress' ), 'arg' => esc_attr__( 'Argentina', 'sportspress' ), 'arm' => esc_attr__( 'Armenia', 'sportspress' ), 'aru' => esc_attr__( 'Aruba', 'sportspress' ), 'asa' => esc_attr__( 'American Samoa', 'sportspress' ), 'atg' => esc_attr__( 'Antigua and Barbuda', 'sportspress' ), 'aus' => esc_attr__( 'Australia', 'sportspress' ), 'aut' => esc_attr__( 'Austria', 'sportspress' ), 'aze' => esc_attr__( 'Azerbaijan', 'sportspress' ), 'bah' => esc_attr__( 'Bahamas', 'sportspress' ), 'ban' => esc_attr__( 'Bangladesh', 'sportspress' ), 'bdi' => esc_attr__( 'Burundi', 'sportspress' ), 'bel' => esc_attr__( 'Belgium', 'sportspress' ), 'ben' => esc_attr__( 'Benin', 'sportspress' ), 'ber' => esc_attr__( 'Bermuda', 'sportspress' ), 'bfa' => esc_attr__( 'Burkina Faso', 'sportspress' ), 'bhr' => esc_attr__( 'Bahrain', 'sportspress' ), 'bhu' => esc_attr__( 'Bhutan', 'sportspress' ), 'bih' => esc_attr__( 'Bosnia and Herzegovina', 'sportspress' ), 'blr' => esc_attr__( 'Belarus', 'sportspress' ), 'blz' => esc_attr__( 'Belize', 'sportspress' ), 'bol' => esc_attr__( 'Bolivia', 'sportspress' ), 'bot' => esc_attr__( 'Botswana', 'sportspress' ), 'bra' => esc_attr__( 'Brazil', 'sportspress' ), 'brb' => esc_attr__( 'Barbados', 'sportspress' ), 'bru' => esc_attr__( 'Brunei', 'sportspress' ), 'bul' => esc_attr__( 'Bulgaria', 'sportspress' ), 'cam' => esc_attr__( 'Cambodia', 'sportspress' ), 'can' => esc_attr__( 'Canada', 'sportspress' ), 'cay' => esc_attr__( 'Cayman Islands', 'sportspress' ), 'cgo' => esc_attr__( 'Republic of the Congo', 'sportspress' ), 'cha' => esc_attr__( 'Chad', 'sportspress' ), 'chi' => esc_attr__( 'Chile', 'sportspress' ), 'chn' => esc_attr__( 'China', 'sportspress' ), 'civ' => esc_attr__( 'Ivory Coast', 'sportspress' ), 'cmr' => esc_attr__( 'Cameroon', 'sportspress' ), 'cod' => esc_attr__( 'Democratic Republic of the Congo', 'sportspress' ), 'cok' => esc_attr__( 'Cook Islands', 'sportspress' ), 'col' => esc_attr__( 'Colombia', 'sportspress' ), 'com' => esc_attr__( 'Comoros', 'sportspress' ), 'cpv' => esc_attr__( 'Cape Verde', 'sportspress' ), 'crc' => esc_attr__( 'Costa Rica', 'sportspress' ), 'cro' => esc_attr__( 'Croatia', 'sportspress' ), 'cta' => esc_attr__( 'Central African Republic', 'sportspress' ), 'cub' => esc_attr__( 'Cuba', 'sportspress' ), 'cuw' => esc_attr__( 'Curacao', 'sportspress' ), 'cyp' => esc_attr__( 'Cyprus', 'sportspress' ), 'cze' => esc_attr__( 'Czechia', 'sportspress' ), 'den' => esc_attr__( 'Denmark', 'sportspress' ), 'dji' => esc_attr__( 'Djibouti', 'sportspress' ), 'dma' => esc_attr__( 'Dominica', 'sportspress' ), 'dom' => esc_attr__( 'Dominican Republic', 'sportspress' ), 'ecu' => esc_attr__( 'Ecuador', 'sportspress' ), 'egy' => esc_attr__( 'Egypt', 'sportspress' ), 'eng' => esc_attr__( 'England', 'sportspress' ), 'eqg' => esc_attr__( 'Equatorial Guinea', 'sportspress' ), 'eri' => esc_attr__( 'Eritrea', 'sportspress' ), 'esh' => esc_attr__( 'Western Sahara', 'sportspress' ), 'esp' => esc_attr__( 'Spain', 'sportspress' ), 'est' => esc_attr__( 'Estonia', 'sportspress' ), 'eth' => esc_attr__( 'Ethiopia', 'sportspress' ), 'fij' => esc_attr__( 'Fiji', 'sportspress' ), 'fin' => esc_attr__( 'Finland', 'sportspress' ), 'fra' => esc_attr__( 'France', 'sportspress' ), 'fro' => esc_attr__( 'Faroe Islands', 'sportspress' ), 'guf' => esc_attr__( 'French Guiana', 'sportspress' ), 'pyf' => esc_attr__( 'French Polynesia', 'sportspress' ), 'fsm' => esc_attr__( 'Micronesia', 'sportspress' ), 'gab' => esc_attr__( 'Gabon', 'sportspress' ), 'gam' => esc_attr__( 'Gambia', 'sportspress' ), 'gbr' => esc_attr__( 'United Kingdom', 'sportspress' ), 'geo' => esc_attr__( 'Georgia', 'sportspress' ), 'ger' => esc_attr__( 'Germany', 'sportspress' ), 'gha' => esc_attr__( 'Ghana', 'sportspress' ), 'gib' => esc_attr__( 'Gibraltar', 'sportspress' ), 'glp' => esc_attr__( 'Guadeloupe', 'sportspress' ), 'gnb' => esc_attr__( 'Guinea-Bissau', 'sportspress' ), 'gre' => esc_attr__( 'Greece', 'sportspress' ), 'grl' => esc_attr__( 'Greenland', 'sportspress' ), 'grn' => esc_attr__( 'Grenada', 'sportspress' ), 'gua' => esc_attr__( 'Guatemala', 'sportspress' ), 'gui' => esc_attr__( 'Guinea', 'sportspress' ), 'gum' => esc_attr__( 'Guam', 'sportspress' ), 'guy' => esc_attr__( 'Guyana', 'sportspress' ), 'hai' => esc_attr__( 'Haiti', 'sportspress' ), 'hkg' => esc_attr__( 'Hong Kong', 'sportspress' ), 'hon' => esc_attr__( 'Honduras', 'sportspress' ), 'hun' => esc_attr__( 'Hungary', 'sportspress' ), 'idn' => esc_attr__( 'Indonesia', 'sportspress' ), 'ind' => esc_attr__( 'India', 'sportspress' ), 'irl' => esc_attr__( 'Ireland', 'sportspress' ), 'irn' => esc_attr__( 'Iran', 'sportspress' ), 'irq' => esc_attr__( 'Iraq', 'sportspress' ), 'isl' => esc_attr__( 'Iceland', 'sportspress' ), 'isr' => esc_attr__( 'Israel', 'sportspress' ), 'ita' => esc_attr__( 'Italy', 'sportspress' ), 'jam' => esc_attr__( 'Jamaica', 'sportspress' ), 'jor' => esc_attr__( 'Jordan', 'sportspress' ), 'jpn' => esc_attr__( 'Japan', 'sportspress' ), 'kaz' => esc_attr__( 'Kazakhstan', 'sportspress' ), 'ken' => esc_attr__( 'Kenya', 'sportspress' ), 'kos' => esc_attr__( 'Kosovo', 'sportspress' ), 'kgz' => esc_attr__( 'Kyrgyzstan', 'sportspress' ), 'kir' => esc_attr__( 'Kiribati', 'sportspress' ), 'mtq' => esc_attr__( 'Martinique', 'sportspress' ), 'kor' => esc_attr__( 'South Korea', 'sportspress' ), 'ksa' => esc_attr__( 'Saudi Arabia', 'sportspress' ), 'kuw' => esc_attr__( 'Kuwait', 'sportspress' ), 'lao' => esc_attr__( 'Laos', 'sportspress' ), 'lbr' => esc_attr__( 'Liberia', 'sportspress' ), 'lby' => esc_attr__( 'Libya', 'sportspress' ), 'lca' => esc_attr__( 'Saint Lucia', 'sportspress' ), 'les' => esc_attr__( 'Lesotho', 'sportspress' ), 'lib' => esc_attr__( 'Lebanon', 'sportspress' ), 'lie' => esc_attr__( 'Liechtenstein', 'sportspress' ), 'ltu' => esc_attr__( 'Lithuania', 'sportspress' ), 'lux' => esc_attr__( 'Luxembourg', 'sportspress' ), 'lva' => esc_attr__( 'Latvia', 'sportspress' ), 'mac' => esc_attr__( 'Macau', 'sportspress' ), 'mad' => esc_attr__( 'Madagascar', 'sportspress' ), 'mar' => esc_attr__( 'Morocco', 'sportspress' ), 'mas' => esc_attr__( 'Malaysia', 'sportspress' ), 'mco' => esc_attr__( 'Monaco', 'sportspress' ), 'mda' => esc_attr__( 'Moldova', 'sportspress' ), 'mdv' => esc_attr__( 'Maldives', 'sportspress' ), 'mex' => esc_attr__( 'Mexico', 'sportspress' ), 'mhl' => esc_attr__( 'Marshall Islands', 'sportspress' ), 'mkd' => esc_attr__( 'North Macedonia', 'sportspress' ), 'mli' => esc_attr__( 'Mali', 'sportspress' ), 'mlt' => esc_attr__( 'Malta', 'sportspress' ), 'mne' => esc_attr__( 'Montenegro', 'sportspress' ), 'mng' => esc_attr__( 'Mongolia', 'sportspress' ), 'moz' => esc_attr__( 'Mozambique', 'sportspress' ), 'mri' => esc_attr__( 'Mauritius', 'sportspress' ), 'msr' => esc_attr__( 'Montserrat', 'sportspress' ), 'mtn' => esc_attr__( 'Mauritania', 'sportspress' ), 'mwi' => esc_attr__( 'Malawi', 'sportspress' ), 'mya' => esc_attr__( 'Myanmar', 'sportspress' ), 'nam' => esc_attr__( 'Namibia', 'sportspress' ), 'nca' => esc_attr__( 'Nicaragua', 'sportspress' ), 'ncl' => esc_attr__( 'New Caledonia', 'sportspress' ), 'ned' => esc_attr__( 'Netherlands', 'sportspress' ), 'nep' => esc_attr__( 'Nepal', 'sportspress' ), 'nga' => esc_attr__( 'Nigeria', 'sportspress' ), 'nig' => esc_attr__( 'Niger', 'sportspress' ), 'nir' => esc_attr__( 'Northern Ireland', 'sportspress' ), 'nor' => esc_attr__( 'Norway', 'sportspress' ), 'nru' => esc_attr__( 'Nauru', 'sportspress' ), 'nzl' => esc_attr__( 'New Zealand', 'sportspress' ), 'oma' => esc_attr__( 'Oman', 'sportspress' ), 'pak' => esc_attr__( 'Pakistan', 'sportspress' ), 'pan' => esc_attr__( 'Panama', 'sportspress' ), 'par' => esc_attr__( 'Paraguay', 'sportspress' ), 'per' => esc_attr__( 'Peru', 'sportspress' ), 'phi' => esc_attr__( 'Philippines', 'sportspress' ), 'ple' => esc_attr__( 'Palestine', 'sportspress' ), 'plw' => esc_attr__( 'Palau', 'sportspress' ), 'png' => esc_attr__( 'Papua New Guinea', 'sportspress' ), 'pol' => esc_attr__( 'Poland', 'sportspress' ), 'por' => esc_attr__( 'Portugal', 'sportspress' ), 'prk' => esc_attr__( 'North Korea', 'sportspress' ), 'pur' => esc_attr__( 'Puerto Rico', 'sportspress' ), 'qat' => esc_attr__( 'Qatar', 'sportspress' ), 'rou' => esc_attr__( 'Romania', 'sportspress' ), 'rsa' => esc_attr__( 'South Africa', 'sportspress' ), 'reu' => esc_attr__( 'Reunion', 'sportspress' ), 'rus' => esc_attr__( 'Russia', 'sportspress' ), 'rwa' => esc_attr__( 'Rwanda', 'sportspress' ), 'sam' => esc_attr__( 'Samoa', 'sportspress' ), 'sco' => esc_attr__( 'Scotland', 'sportspress' ), 'sdn' => esc_attr__( 'Sudan', 'sportspress' ), 'sen' => esc_attr__( 'Senegal', 'sportspress' ), 'sey' => esc_attr__( 'Seychelles', 'sportspress' ), 'sin' => esc_attr__( 'Singapore', 'sportspress' ), 'skn' => esc_attr__( 'Saint Kitts and Nevis', 'sportspress' ), 'sle' => esc_attr__( 'Sierra Leone', 'sportspress' ), 'slv' => esc_attr__( 'El Salvador', 'sportspress' ), 'smr' => esc_attr__( 'San Marino', 'sportspress' ), 'sol' => esc_attr__( 'Solomon Islands', 'sportspress' ), 'som' => esc_attr__( 'Somalia', 'sportspress' ), 'srb' => esc_attr__( 'Serbia', 'sportspress' ), 'sri' => esc_attr__( 'Sri Lanka', 'sportspress' ), 'ssd' => esc_attr__( 'South Sudan', 'sportspress' ), 'stp' => esc_attr__( 'Sao Tome and Principe', 'sportspress' ), 'sui' => esc_attr__( 'Switzerland', 'sportspress' ), 'sur' => esc_attr__( 'Suriname', 'sportspress' ), 'svk' => esc_attr__( 'Slovakia', 'sportspress' ), 'svn' => esc_attr__( 'Slovenia', 'sportspress' ), 'swe' => esc_attr__( 'Sweden', 'sportspress' ), 'swz' => esc_attr__( 'Eswatini', 'sportspress' ), 'sxm' => esc_attr__( 'Sint Maarten', 'sportspress' ), 'syr' => esc_attr__( 'Syria', 'sportspress' ), 'tah' => esc_attr__( 'Tahiti', 'sportspress' ), 'tan' => esc_attr__( 'Tanzania', 'sportspress' ), 'tca' => esc_attr__( 'Turks and Caicos Islands', 'sportspress' ), 'tga' => esc_attr__( 'Tonga', 'sportspress' ), 'tha' => esc_attr__( 'Thailand', 'sportspress' ), 'tjk' => esc_attr__( 'Tajikistan', 'sportspress' ), 'tkm' => esc_attr__( 'Turkmenistan', 'sportspress' ), 'tls' => esc_attr__( 'East Timor', 'sportspress' ), 'tog' => esc_attr__( 'Togo', 'sportspress' ), 'tpe' => esc_attr__( 'Taiwan', 'sportspress' ), 'tri' => esc_attr__( 'Trinidad and Tobago', 'sportspress' ), 'tun' => esc_attr__( 'Tunisia', 'sportspress' ), 'tur' => esc_attr__( 'Turkey', 'sportspress' ), 'tuv' => esc_attr__( 'Tuvalu', 'sportspress' ), 'uae' => esc_attr__( 'United Arab Emirates', 'sportspress' ), 'uga' => esc_attr__( 'Uganda', 'sportspress' ), 'ukr' => esc_attr__( 'Ukraine', 'sportspress' ), 'uru' => esc_attr__( 'Uruguay', 'sportspress' ), 'usa' => esc_attr__( 'United States', 'sportspress' ), 'uzb' => esc_attr__( 'Uzbekistan', 'sportspress' ), 'van' => esc_attr__( 'Vanuatu', 'sportspress' ), 'vat' => esc_attr__( 'Vatican City', 'sportspress' ), 'ven' => esc_attr__( 'Venezuela', 'sportspress' ), 'vgb' => esc_attr__( 'British Virgin Islands', 'sportspress' ), 'vie' => esc_attr__( 'Vietnam', 'sportspress' ), 'vin' => esc_attr__( 'Saint Vincent and the Grenadines', 'sportspress' ), 'vir' => esc_attr__( 'US Virgin Islands', 'sportspress' ), 'wal' => esc_attr__( 'Wales', 'sportspress' ), 'wif' => esc_attr__( 'West Indies', 'sportspress' ), 'yem' => esc_attr__( 'Yemen', 'sportspress' ), 'zam' => esc_attr__( 'Zambia', 'sportspress' ), 'zim' => esc_attr__( 'Zimbabwe', 'sportspress' ), ) ); $this->legacy = array( 'ad' => 'and', 'ae' => 'uae', 'af' => 'afg', 'ag' => 'atg', 'al' => 'alb', 'am' => 'arm', 'ao' => 'ang', 'ar' => 'arg', 'at' => 'aut', 'au' => 'aus', 'az' => 'aze', 'ba' => 'bih', 'bb' => 'brb', 'bd' => 'ban', 'be' => 'bel', 'bf' => 'bfa', 'bg' => 'bul', 'bh' => 'bhr', 'bi' => 'bdi', 'bj' => 'ben', 'bn' => 'bru', 'bo' => 'bol', 'br' => 'bra', 'bs' => 'bah', 'bt' => 'bhu', 'bw' => 'bot', 'by' => 'blr', 'bz' => 'blz', 'ca' => 'can', 'cd' => 'cod', 'cf' => 'cta', 'cg' => 'cgo', 'ch' => 'swz', 'ci' => 'civ', 'cl' => 'chi', 'cm' => 'cmr', 'cn' => 'chn', 'co' => 'col', 'cr' => 'crc', 'cu' => 'cub', 'cv' => 'cpv', 'cy' => 'cyp', 'cz' => 'cze', 'de' => 'ger', 'dj' => 'dji', 'dk' => 'den', 'dm' => 'dma', 'do' => 'dom', 'dz' => 'alg', 'ec' => 'ecu', 'ee' => 'est', 'eg' => 'egy', 'eh' => 'esh', 'el' => 'gre', 'en' => 'end', 'er' => 'eri', 'es' => 'esp', 'et' => 'eth', 'fi' => 'fin', 'fj' => 'fij', 'fm' => 'fsm', 'fr' => 'fra', 'ga' => 'gab', 'gb' => 'gbr', 'gd' => 'grn', 'ge' => 'geo', 'gh' => 'gha', 'gm' => 'gam', 'gn' => 'gui', 'gq' => 'eqg', 'gr' => 'gre', 'gt' => 'gua', 'gw' => 'gnb', 'gy' => 'guy', 'hk' => 'hkg', 'hn' => 'hon', 'hr' => 'cro', 'ht' => 'hai', 'hu' => 'hun', 'id' => 'idn', 'ie' => 'irl', 'il' => 'isr', 'in' => 'ind', 'iq' => 'irq', 'ir' => 'irn', 'is' => 'isl', 'it' => 'ita', 'jm' => 'jam', 'jo' => 'jor', 'jp' => 'jpn', 'ke' => 'ken', 'kg' => 'kgz', 'kh' => 'cam', 'ki' => 'kir', 'km' => 'com', 'kn' => 'skn', 'kp' => 'prk', 'kr' => 'kor', 'kw' => 'kuw', 'kz' => 'kaz', 'la' => 'lao', 'lb' => 'lib', 'lc' => 'lca', 'li' => 'lie', 'lk' => 'sri', 'lr' => 'lbr', 'ls' => 'les', 'lt' => 'ltu', 'lu' => 'lux', 'lv' => 'lva', 'ly' => 'lby', 'ma' => 'mar', 'mc' => 'mco', 'md' => 'mda', 'me' => 'mne', 'mg' => 'mad', 'mh' => 'mhl', 'mk' => 'mkd', 'ml' => 'mli', 'mm' => 'mya', 'mn' => 'mng', 'mo' => 'mac', 'mr' => 'mtn', 'mt' => 'mlt', 'mu' => 'mri', 'mv' => 'mdv', 'mw' => 'mwi', 'mx' => 'mex', 'my' => 'mas', 'mz' => 'moz', 'na' => 'nam', 'nb' => 'nir', 'ne' => 'nig', 'ng' => 'nga', 'ni' => 'nca', 'nl' => 'ned', 'no' => 'nor', 'np' => 'nep', 'nr' => 'nru', 'nz' => 'nzl', 'om' => 'oma', 'pa' => 'pan', 'pe' => 'per', 'pg' => 'png', 'ph' => 'phi', 'pk' => 'pak', 'pl' => 'pol', 'pr' => 'pur', 'ps' => 'ple', 'pt' => 'por', 'pw' => 'plw', 'py' => 'par', 'qa' => 'qat', 'ro' => 'rou', 'rs' => 'srb', 'ru' => 'rus', 'rw' => 'rwa', 'sa' => 'ksa', 'sb' => 'sol', 'sc' => 'sey', 'sd' => 'sdn', 'se' => 'swe', 'sf' => 'sco', 'sg' => 'sin', 'si' => 'svn', 'sk' => 'svk', 'sl' => 'sle', 'sm' => 'smr', 'sn' => 'sen', 'so' => 'som', 'sr' => 'sur', 'st' => 'stp', 'sv' => 'slv', 'sy' => 'syr', 'sz' => 'swz', 'td' => 'cha', 'tg' => 'tog', 'th' => 'tha', 'tj' => 'tjk', 'tl' => 'tls', 'tm' => 'tkm', 'tn' => 'tun', 'to' => 'tga', 'tr' => 'tur', 'tt' => 'tri', 'tv' => 'tuv', 'tw' => 'tpw', 'tz' => 'tan', 'ua' => 'ukr', 'uk' => 'gbr', 'ug' => 'uga', 'us' => 'usa', 'uy' => 'uru', 'uz' => 'uzb', 'va' => 'vat', 'vc' => 'vin', 've' => 'ven', 'vn' => 'vie', 'vu' => 'van', 'wl' => 'wal', 'ws' => 'sam', 'ye' => 'yem', 'za' => 'rsa', 'zm' => 'zam', 'zw' => 'zim', ); foreach ( $continents as $continent => $codes ) : $countries = array_intersect_key( $this->countries, array_flip( $codes ) ); asort( $countries ); $continents[ $continent ] = $countries; endforeach; $this->continents = apply_filters( 'sportspress_continents', $continents ); } /** * Get the base country. * * @access public * @return string */ public function get_base_country() { $default = get_option( 'sportspress_default_country' ); $country = ( ( $pos = strrpos( $default, ':' ) ) === false ) ? $default : substr( $default, 0, $pos ); return apply_filters( 'sportspress_countries_base_country', $country ); } /** * Outputs the list of continents and countries for use in dropdown boxes. * * @access public * @param string $selected_country (default: '') * @param bool $escape (default: false) * @return void */ public function country_dropdown_options( $selected_country = '', $escape = false ) { if ( $this->continents ) { foreach ( $this->continents as $continent => $countries ) : ?> $country ) : ?> post->post_status; $results = get_post_meta( $this->ID, 'sp_results', true ); if ( is_array( $results ) ) { foreach ( $results as $result ) { $result = is_array( $result ) ? array_filter( $result ) : array(); if ( count( $result ) > 0 ) { return 'results'; } } } return $post_status; } public function format() { $format = get_post_meta( $this->ID, 'sp_format', true ); return $format; } public function day() { $day = get_post_meta( $this->ID, 'sp_day', true ); return $day; } public function mode() { $mode = get_post_meta( $this->ID, 'sp_mode', true ); return $mode; } public function minutes() { $minutes = get_post_meta( $this->ID, 'sp_minutes', true ); if ( '' === $minutes ) { $minutes = get_option( 'sportspress_event_minutes', 90 ); } return $minutes; } public function results( $admin = false ) { $teams = (array) get_post_meta( $this->ID, 'sp_team', false ); $results = (array) get_post_meta( $this->ID, 'sp_results', true ); // Get columns from result variables $columns = sp_get_var_labels( 'sp_result' ); // Get result columns to display $usecolumns = get_post_meta( $this->ID, 'sp_result_columns', true ); // Get results for all teams $data = sp_array_combine( $teams, $results, true ); if ( $admin ) : return array( $columns, $usecolumns, $data ); else : // Add outcome to result columns $columns['outcome'] = esc_attr__( 'Outcome', 'sportspress' ); if ( is_array( $usecolumns ) ) : if ( 'manual' == get_option( 'sportspress_event_result_columns', 'auto' ) ) : foreach ( $columns as $key => $label ) : if ( ! in_array( $key, $usecolumns ) ) : unset( $columns[ $key ] ); endif; endforeach; else : $active_columns = array(); foreach ( $data as $team_results ) : foreach ( $team_results as $key => $result ) : if ( is_string( $result ) && strlen( $result ) ) : $active_columns[ $key ] = $key; endif; endforeach; endforeach; $columns = array_intersect_key( $columns, $active_columns ); endif; if ( 'yes' == get_option( 'sportspress_event_show_outcome', 'no' ) ) : $columns['outcome'] = esc_attr__( 'Outcome', 'sportspress' ); endif; endif; $data[0] = $columns; return $data; endif; } public function performance( $admin = false ) { $teams = get_post_meta( $this->ID, 'sp_team', false ); $performance = (array) get_post_meta( $this->ID, 'sp_players', true ); $args = array( 'post_type' => 'sp_performance', 'numberposts' => 100, 'posts_per_page' => 100, 'orderby' => 'menu_order', 'order' => 'ASC', ); $vars = get_posts( $args ); $labels = array(); $formats = array(); $timed = array(); $stars = array(); $equations = array(); foreach ( $vars as $var ) { $labels[ $var->post_name ] = $var->post_title; $format = get_post_meta( $var->ID, 'sp_format', true ); if ( '' === $format ) { $format = 'number'; } $formats[ $var->post_name ] = $format; if ( 'number' === $format ) { $is_timed = get_post_meta( $var->ID, 'sp_timed', true ); if ( '' === $is_timed || $is_timed ) { $timed[] = $var->post_name; } } elseif ( 'equation' === $format ) { $equation = get_post_meta( $var->ID, 'sp_equation', true ); $precision = get_post_meta( $var->ID, 'sp_precision', true ); if ( empty( $equation ) ) { $equation = 0; } if ( empty( $precision ) ) { $precision = 0; } $equations[ $var->post_name ] = array( 'equation' => $equation, 'precision' => $precision, ); } } $order = (array) get_post_meta( $this->ID, 'sp_order', true ); if ( get_option( 'sportspress_event_performance_stars_type', 0 ) ) { $stars = (array) get_post_meta( $this->ID, 'sp_stars', true ); } $labels = apply_filters( 'sportspress_event_performance_labels', $labels, $this ); $columns = get_post_meta( $this->ID, 'sp_columns', true ); if ( is_array( $teams ) ) : foreach ( $teams as $i => $team_id ) : $players = sp_array_between( (array) get_post_meta( $this->ID, 'sp_player', false ), 0, $i ); $data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) ); foreach ( $data as $player_id => $player_performance ) : if ( ! $player_id ) { continue; } if ( ! array_key_exists( 'number', $player_performance ) ) : $performance[ $team_id ][ $player_id ]['number'] = apply_filters( 'sportspress_event_performance_default_squad_number', get_post_meta( $player_id, 'sp_number', true ) ); endif; if ( ! array_key_exists( 'position', $player_performance ) || $player_performance['position'] == null ) : $performance[ $team_id ][ $player_id ]['position'] = sp_get_the_term_id( $player_id, 'sp_position', null ); endif; endforeach; endforeach; endif; if ( $admin ) : return array( $labels, $columns, $performance, $teams, $formats, $order, $timed, $stars ); else : // Add position to performance labels if ( taxonomy_exists( 'sp_position' ) ) : $labels = array_merge( array( 'position' => esc_attr__( 'Position', 'sportspress' ) ), $labels ); endif; if ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) && is_array( $columns ) ) : foreach ( $labels as $key => $label ) : if ( ! in_array( $key, $columns ) ) : unset( $labels[ $key ] ); endif; endforeach; endif; if ( 'no' == get_option( 'sportspress_event_show_position', 'yes' ) ) : unset( $labels['position'] ); endif; if ( 'no' == get_option( 'sportspress_event_show_player_numbers', 'yes' ) ) : unset( $labels['number'] ); endif; // Calculate equation-based performance if ( sizeof( $equations ) ) : foreach ( $performance as $team => $players ) : if ( ! is_array( $players ) ) { continue; } foreach ( $players as $player => $player_performance ) : if ( ! is_array( $player_performance ) ) { continue; } // Prepare existing values for equation calculation $vars = $player_performance; foreach ( $vars as $key => $var ) : if ( empty( $var ) ) { $vars[ $key ] = 0; } endforeach; $vars = array_merge( $vars, array( 'eventsplayed' => 1 ) ); foreach ( $equations as $key => $equation ) : $performance[ $team ][ $player ][ $key ] = sp_solve( $equation['equation'], $vars, $equation['precision'] ); endforeach; endforeach; endforeach; endif; // Convert to time notation if ( in_array( 'time', $formats ) ) : foreach ( $performance as $team => $players ) : if ( ! is_array( $players ) ) { continue; } foreach ( $players as $player => $player_performance ) : if ( ! $player ) { continue; } foreach ( $player_performance as $performance_key => $performance_value ) : // Continue if not time format if ( 'time' !== sp_array_value( $formats, $performance_key ) ) { continue; } $intval = intval( $performance_value ); $timeval = gmdate( 'i:s', $intval ); $hours = floor( $intval / 3600 ); if ( '00' != $hours ) { $timeval = $hours . ':' . $timeval; } $timeval = preg_replace( '/^0/', '', $timeval ); $performance[ $team ][ $player ][ $performance_key ] = $timeval; endforeach; endforeach; endforeach; endif; // Add minutes to box score values if ( in_array( 'number', $formats ) && 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'no' ) ) : $timeline = $this->timeline(); if ( ! empty( $timeline ) ) : foreach ( $performance as $team => $players ) : // Get team timeline $team_timeline = sp_array_value( $timeline, $team, array() ); if ( empty( $team_timeline ) ) { continue; } foreach ( $players as $player => $player_performance ) : if ( ! $player ) { continue; } // Get player timeline $player_timeline = sp_array_value( $team_timeline, $player, array() ); if ( empty( $player_timeline ) ) { continue; } foreach ( $player_performance as $performance_key => $performance_value ) : // Continue if not timed if ( ! in_array( $performance_key, $timed ) ) { continue; } // Get performance times $times = sp_array_value( $player_timeline, $performance_key, array() ); $times = array_filter( $times ); if ( empty( $times ) ) { continue; } $performance[ $team ][ $player ][ $performance_key ] .= ' (' . implode( '\', ', $times ) . '\')'; endforeach; endforeach; endforeach; endif; endif; // Add labels to box score $performance[0] = $labels; return apply_filters( 'sportspress_get_event_performance', $performance ); endif; } public function timeline( $admin = false, $linear = false ) { $timeline = (array) get_post_meta( $this->ID, 'sp_timeline', true ); if ( ! $linear ) { return $timeline; } $performance = (array) get_post_meta( $this->ID, 'sp_players', true ); if ( empty( $timeline ) ) { return array(); } $stats = array(); $player_ids = array(); $performance_keys = array(); // Clean up timeline foreach ( $timeline as $team => $players ) { if ( ! $team ) { continue; } // Set home team if ( ! isset( $home_team ) ) { $home_team = $team; } // Determine side if ( $home_team === $team ) { $side = 'home'; } else { $side = 'away'; } $stats[] = array( 'time' => -1, 'id' => $team, 'team' => $team, 'side' => $side, 'key' => 'team', ); if ( ! is_array( $players ) ) { continue; } foreach ( $players as $player => $keys ) { if ( ! $player ) { continue; } if ( ! is_array( $keys ) ) { continue; } $player_ids[] = $player; foreach ( $keys as $key => $times ) { if ( ! is_array( $times ) || empty( $times ) ) { continue; } foreach ( $times as $time ) { if ( '' === $time ) { continue; } $entry = array( 'time' => $time, 'id' => $player, 'team' => $team, 'side' => $side, 'key' => $key, ); if ( 'sub' === $key ) { $sub = sp_array_value( sp_array_value( sp_array_value( $performance, $team ), $player ), 'sub', 0 ); $entry['sub'] = $sub; $player_ids[] = $sub; } $stats[] = $entry; } $performance_keys[] = $key; } } } // Filter out duplicate player IDs and performance keys $player_ids = array_unique( $player_ids ); $performance_keys = array_unique( $performance_keys ); // Get player names and numbers $posts = get_posts( array( 'post_type' => 'sp_player', 'posts_per_page' => -1, 'post__in' => $player_ids, ) ); $player_names = array(); $player_numbers = array(); if ( $posts ) { foreach ( $posts as $post ) { $player_names[ $post->ID ] = $post->post_title; $player_numbers[ $post->ID ] = get_post_meta( $post->ID, 'sp_number', true ); } } // Get performance labels and icons $posts = get_posts( array( 'post_type' => 'sp_performance', 'posts_per_page' => -1, 'post_name__in' => $performance_keys, ) ); $performance_labels = array(); $performance_icons = array(); if ( $posts ) { foreach ( $posts as $post ) { $performance_labels[ $post->post_name ] = $post->post_title; $icon = ''; if ( has_post_thumbnail( $post->ID ) ) { $icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post->ID ) ) ); } $performance_icons[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 ); } } // Add missing info to stats foreach ( $stats as $index => $details ) { $stats[ $index ]['name'] = sp_array_value( $player_names, $details['id'] ); $stats[ $index ]['number'] = sp_array_value( $player_numbers, $details['id'] ); if ( 'team' === $details['key'] ) { $name = sp_team_short_name( $details['team'] ); $stats[ $index ]['name'] = $name; $stats[ $index ]['label'] = $name; $stats[ $index ]['icon'] = sp_get_logo( $details['team'] ); } elseif ( 'sub' === $details['key'] ) { $sub_name = sp_array_value( $player_names, $details['sub'], esc_attr__( 'Substitute', 'sportspress' ) ); $sub_number = sp_array_value( $player_numbers, $details['sub'] ); if ( '' !== $sub_number ) { $icon_title = $sub_number . '. ' . $sub_name; } else { $icon_title = $sub_name; } $stats[ $index ]['sub_name'] = $sub_name; $stats[ $index ]['sub_number'] = $sub_number; $stats[ $index ]['label'] = esc_attr__( 'Substitute', 'sportspress' ); $stats[ $index ]['icon'] = ''; } else { $stats[ $index ]['label'] = sp_array_value( $performance_labels, $details['key'] ); $stats[ $index ]['icon'] = sp_array_value( $performance_icons, $details['key'] ); } } usort( $stats, array( $this, 'sort_timeline' ) ); return $stats; } public function main_results() { // Get main result option $main_result = get_option( 'sportspress_primary_result', null ); // Get teams from event $teams = get_post_meta( $this->ID, 'sp_team', false ); // Initialize output $output = array(); // Return empty array if there are no teams if ( ! $teams ) { return $output; } // Get results from event $results = get_post_meta( $this->ID, 'sp_results', true ); // Loop through teams foreach ( $teams as $team_id ) { // Skip if not a team if ( ! $team_id ) { continue; } // Get team results from all results $team_results = sp_array_value( $results, $team_id, null ); // Get main or last result if ( $main_result ) { // Get main result from team results $team_result = sp_array_value( $team_results, $main_result, null ); } else { // If there are any team results available if ( is_array( $team_results ) ) { // Get last result that is not outcome unset( $team_results['outcome'] ); $team_result = end( $team_results ); } else { // Give team null result $team_result = null; } } if ( null != $team_result ) { $output[] = $team_result; } } return $output; } public function outcome( $single = true ) { // Get teams from event $teams = get_post_meta( $this->ID, 'sp_team', false ); // Initialize output $output = array(); // Return empty array if there are no teams if ( ! $teams ) { return $output; } // Get results from event $results = get_post_meta( $this->ID, 'sp_results', true ); // Loop through teams foreach ( $teams as $team_id ) { // Skip if not a team if ( ! $team_id ) { continue; } // Get team results from all results $team_results = sp_array_value( $results, $team_id, null ); // Get outcome from team results $team_outcome = sp_array_value( $team_results, 'outcome', null ); if ( null != $team_outcome ) { // Make sure that we have an array of outcomes $team_outcome = (array) $team_outcome; // Use only first outcome if single if ( $single ) { $team_outcome = reset( $team_outcome ); } // Add outcome to output $output[ $team_id ] = $team_outcome; } } return $output; } public function winner() { // Get the first configured outcome $outcome = get_posts( array( 'post_type' => 'sp_outcome', 'post_status' => 'publish', 'posts_per_page' => 1, 'orderby' => 'menu_order', 'order' => 'ASC', ) ); // Return if no outcomes available if ( ! $outcome ) { return null; } $outcome = reset( $outcome ); // Get event outcomes $outcomes = self::outcome( false ); // Look for a team that meets the criteria foreach ( $outcomes as $team_id => $team_outcomes ) { if ( in_array( $outcome->post_name, $team_outcomes ) ) { return $team_id; } } // Return if no teams meet criteria return null; } public function appointments( $include_empty = false, $placeholder = '-' ) { $officials = (array) get_post_meta( $this->ID, 'sp_officials', true ); $officials = array_filter( $officials ); if ( ! $include_empty && empty( $officials ) ) { return null; } $duties = get_terms( array( 'taxonomy' => 'sp_duty', 'hide_empty' => false, 'orderby' => 'meta_value_num', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_order', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_order', 'compare' => 'EXISTS', ), ), ) ); if ( ! is_array( $duties ) ) { return array(); } if ( ! $include_empty && empty( $duties ) ) { return null; } $labels = array(); $appointments = array(); foreach ( $duties as $duty ) { $duty_appointments = sp_array_value( $officials, $duty->term_id, array() ); if ( ! $include_empty && empty( $duty_appointments ) ) { continue; } $appointed_officials = array(); foreach ( $duty_appointments as $duty_appointment ) { $appointed_officials[ $duty_appointment ] = get_the_title( $duty_appointment ); } if ( $include_empty && empty( $appointed_officials ) ) { $appointed_officials[] = $placeholder; } $appointments[ $duty->slug ] = $appointed_officials; $labels[ $duty->slug ] = $duty->name; } $appointments[0] = $labels; return $appointments; } public function update_main_results( $results ) { $main_result = sp_get_main_result_option(); if ( ! $this->ID || ! is_array( $results ) || null === $main_result ) { return false; } // Get current results meta $meta = (array) get_post_meta( $this->ID, 'sp_results', true ); $primary_results = array(); foreach ( $results as $id => $result ) { $primary_results[ $id ] = $result; if ( ! $id ) { continue; } $meta[ $id ][ $main_result ] = $result; } arsort( $primary_results ); if ( count( $primary_results ) && ! in_array( null, $primary_results ) ) { if ( count( array_unique( $primary_results ) ) === 1 ) { $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_key' => 'sp_condition', 'meta_value' => '=', ); $outcomes = get_posts( $args ); foreach ( $meta as $team => $team_results ) { if ( $outcomes ) { if ( empty( $meta[ $team ] ) ) { $meta[ $team ] = array(); } $meta[ $team ]['outcome'] = array(); foreach ( $outcomes as $outcome ) { $meta[ $team ]['outcome'][] = $outcome->post_name; } } } } else { // Get default outcomes $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_key' => 'sp_condition', 'meta_value' => 'else', ); $default_outcomes = get_posts( $args ); // Get greater than outcomes $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_condition', 'value' => '>', ), array( 'key' => 'sp_condition', 'value' => '>', ), ), ); $gt_outcomes = get_posts( $args ); if ( empty( $gt_outcomes ) ) { $gt_outcomes = $default_outcomes; } // Get less than outcomes $args = array( 'post_type' => 'sp_outcome', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_condition', 'value' => '<', ), array( 'key' => 'sp_condition', 'value' => '<', ), ), ); $lt_outcomes = get_posts( $args ); if ( empty( $lt_outcomes ) ) { $lt_outcomes = $default_outcomes; } // Get min and max values $min = min( $primary_results ); $max = max( $primary_results ); foreach ( $primary_results as $key => $value ) { if ( $min == $value ) { $outcomes = $lt_outcomes; } elseif ( $max == $value ) { $outcomes = $gt_outcomes; } else { $outcomes = $default_outcomes; } $meta[ $key ]['outcome'] = array(); foreach ( $outcomes as $outcome ) { $meta[ $key ]['outcome'][] = $outcome->post_name; } } } } // Update results update_post_meta( $this->ID, 'sp_results', $meta ); } public function stars() { return get_post_meta( $this->ID, 'sp_stars', true ); } public function lineup_filter( $v ) { return sp_array_value( $v, 'status', 'lineup' ) == 'lineup'; } public function sub_filter( $v ) { return sp_array_value( $v, 'status', 'lineup' ) == 'sub'; } public function sort_timeline( $a, $b ) { return (float) $a['time'] - (float) $b['time']; } /** * Returns formatted event specs * * @access public * @return array */ public function specs( $neg = null ) { $specs = (array) get_post_meta( $this->ID, 'sp_specs', true ); $spec_labels = (array) sp_get_var_labels( 'sp_spec', $neg, false ); $data = array(); foreach ( $spec_labels as $key => $value ) : $spec = sp_array_value( $specs, $key, null ); if ( $spec == null ) { continue; } $data[ $value ] = sp_array_value( $specs, $key, ' ' ); endforeach; return $data; } } ================================================ FILE: includes/class-sp-feeds.php ================================================ array( 'ical' => array( 'apple' => array( 'name' => esc_attr__( 'Apple Calendar', 'sportspress' ), 'protocol' => 'webcal', ), 'outlook' => array( 'name' => esc_attr__( 'Outlook', 'sportspress' ), 'protocol' => 'webcal', ), 'google' => array( 'name' => esc_attr__( 'Google', 'sportspress' ), 'protocol' => 'webcal', 'prefix' => 'http://www.google.com/calendar/render?cid=', ), ), ), ); $this->data = apply_filters( 'sportspress_feeds', $data ); foreach ( $data as $post_type => $feeds ) { foreach ( $feeds as $slug => $formats ) { add_feed( 'sp-' . $slug, array( $this, $slug . '_feed' ) ); } } } public function __get( $key ) { return ( array_key_exists( $key, $this->data ) ? $this->data[ $key ] : null ); } public function __set( $key, $value ) { $this->data[ $key ] = $value; } public static function ical_feed() { $feed_template = SP()->plugin_path() . '/feeds/ical.php'; load_template( $feed_template ); } } ================================================ FILE: includes/class-sp-formats.php ================================================ data = apply_filters( 'sportspress_formats', array( 'event' => array( 'league' => esc_attr__( 'Competitive', 'sportspress' ), 'friendly' => esc_attr__( 'Friendly', 'sportspress' ), ), 'calendar' => array( 'calendar' => esc_attr__( 'Calendar', 'sportspress' ), 'list' => esc_attr__( 'List', 'sportspress' ), 'blocks' => esc_attr__( 'Blocks', 'sportspress' ), ), 'table' => array( 'standings' => esc_attr__( 'Standings', 'sportspress' ), 'gallery' => esc_attr__( 'Gallery', 'sportspress' ), ), 'list' => array( 'list' => esc_attr__( 'List', 'sportspress' ), 'gallery' => esc_attr__( 'Gallery', 'sportspress' ), ), ) ); } public function __get( $key ) { return ( array_key_exists( $key, $this->data ) ? $this->data[ $key ] : null ); } public function __set( $key, $value ) { $this->data[ $key ] = $value; } } ================================================ FILE: includes/class-sp-frontend-scripts.php ================================================ array( 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress.css', 'deps' => '', 'version' => SP_VERSION, 'media' => 'all', ), ); if ( is_rtl() ) : $styles['sportspress-rtl'] = array( 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-rtl.css', 'deps' => '', 'version' => SP_VERSION, 'media' => 'all', ); endif; return apply_filters( 'sportspress_enqueue_styles', $styles ); } /** * Add theme-specific styles to the frontend * * @return array */ public function add_theme_styles( $styles ) { return array_merge( $styles, array( 'sportspress-' . $this->theme => array( 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/themes/' . $this->theme . '.css', 'deps' => '', 'version' => SP_VERSION, 'media' => 'all', ), ) ); } /** * Register/queue frontend scripts. * * @access public * @return void */ public function load_scripts() { global $typenow; // Scripts wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery-datatables', plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/js/jquery.dataTables.min.js', array( 'jquery' ), '1.10.4', true ); wp_enqueue_script( 'sportspress', plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/js/sportspress.js', array( 'jquery' ), SP()->version, true ); // Localize scripts wp_localize_script( 'sportspress', 'localized_strings', array( 'days' => esc_attr__( 'days', 'sportspress' ), 'hrs' => esc_attr__( 'hrs', 'sportspress' ), 'mins' => esc_attr__( 'mins', 'sportspress' ), 'secs' => esc_attr__( 'secs', 'sportspress' ), 'previous' => esc_attr__( 'Previous', 'sportspress' ), 'next' => esc_attr__( 'Next', 'sportspress' ), ) ); // Theme styles $theme = wp_get_theme(); $this->theme = $theme->stylesheet; $dir = scandir( SP()->plugin_path() . '/assets/css/themes' ); $files = array(); if ( $dir ) { foreach ( $dir as $key => $value ) { if ( preg_replace( '/\\.[^.\\s]{3,4}$/', '', $value ) == $this->theme ) { add_filter( 'sportspress_enqueue_styles', array( $this, 'add_theme_styles' ) ); break; } } } // CSS Styles wp_enqueue_style( 'dashicons' ); $enqueue_styles = $this->get_styles(); if ( $enqueue_styles ) : add_action( 'wp_print_scripts', array( $this, 'custom_css' ), 30 ); foreach ( $enqueue_styles as $handle => $args ) { wp_enqueue_style( $handle, $args['src'], $args['deps'], $args['version'], $args['media'] ); } endif; } /** * SP requires jQuery 1.8 since it uses functions like .on() for events and .parseHTML. * If, by the time wp_print_scrips is called, jQuery is outdated (i.e not * using the version in core) we need to deregister it and register the * core version of the file. * * @access public * @return void */ public function check_jquery() { global $wp_scripts; // Enforce minimum version of jQuery if ( ! empty( $wp_scripts->registered['jquery']->ver ) && ! empty( $wp_scripts->registered['jquery']->src ) && 0 >= version_compare( $wp_scripts->registered['jquery']->ver, '1.8' ) ) { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', '/wp-includes/js/jquery/jquery.js', array(), '1.8' ); wp_enqueue_script( 'jquery' ); } } /** * Output custom CSS. * * @access public * @return void */ public function custom_css() { $colors = array_map( 'esc_attr', (array) get_option( 'themeboy', array() ) ); $custom = get_option( 'sportspress_custom_css', null ); $align = get_option( 'sportspress_table_text_align', 'default' ); $padding = get_option( 'sportspress_table_padding', null ); $offset = get_option( 'sportspress_header_offset', '' ); if ( $offset === '' ) { $template = get_option( 'template' ); $offset = ( 'twentyfourteen' == $template ? 48 : 0 ); } if ( empty( $colors ) ) { $colors = array_map( 'esc_attr', (array) get_option( 'sportspress_frontend_css_colors', array() ) ); } // Fallback if ( ! isset( $colors['customize'] ) ) { $colors['customize'] = ( 'yes' == get_option( 'sportspress_enable_frontend_css', 'no' ) ); } // Defaults if ( empty( $colors['primary'] ) ) { $colors['primary'] = '#2b353e'; } if ( empty( $colors['background'] ) ) { $colors['background'] = '#f4f4f4'; } if ( empty( $colors['text'] ) ) { $colors['text'] = '#222222'; } if ( empty( $colors['heading'] ) ) { $colors['heading'] = '#ffffff'; } if ( empty( $colors['link'] ) ) { $colors['link'] = '#00a69c'; } // Calculate colors $colors['highlight'] = sp_hex_lighter( $colors['background'], 30, true ); echo ''; } } new SP_Frontend_Scripts(); ================================================ FILE: includes/class-sp-install.php ================================================ version ) { $this->install(); do_action( 'sportspress_updated' ); } } /** * Basic setup when a button is clicked. */ public function install_actions() { if ( ! empty( $_GET['skip_install_sportspress'] ) ) { // We no longer need to install configs delete_option( '_sp_needs_welcome' ); update_option( 'sportspress_installed', 1 ); update_option( 'sportspress_completed_setup', 1 ); delete_transient( '_sp_activation_redirect' ); } } /** * Install SP */ public function install() { $this->remove_roles(); $this->create_roles(); // Register post types include_once 'class-sp-post-types.php'; SP_Post_types::register_post_types(); SP_Post_types::register_taxonomies(); $this->create_options(); // Queue upgrades $current_version = get_option( 'sportspress_version', null ); // Do upgrades $this->upgrades( $current_version ); // Update version update_option( 'sportspress_version', SP()->version ); // Flush rules after install flush_rewrite_rules(); // Get current major version $version = explode( '.', $current_version, 3 ); unset( $version[2] ); $major_current_version = implode( '.', $version ); // Get new major version $version = explode( '.', SP()->version, 3 ); unset( $version[2] ); $major_version = implode( '.', $version ); // Redirect to welcome screen if major version has changed if ( $major_current_version !== $major_version ) { set_transient( '_sp_activation_redirect', 1, 60 * 60 ); } } /** * Default options * * Sets up the default options used on the settings page * * @access public */ function create_options() { // Include settings so that we can run through defaults include_once 'admin/class-sp-admin-settings.php'; $settings = SP_Admin_Settings::get_settings_pages(); foreach ( $settings as $section ) { if ( ! is_object( $section ) || ! method_exists( $section, 'get_settings' ) ) { continue; } foreach ( $section->get_settings() as $value ) { if ( isset( $value['default'] ) && isset( $value['id'] ) ) { $autoload = isset( $value['autoload'] ) ? (bool) $value['autoload'] : true; add_option( $value['id'], $value['default'], '', ( $autoload ? 'yes' : 'no' ) ); } } } // Default color scheme add_option( 'sportspress_frontend_css_primary', '#2b353e' ); add_option( 'sportspress_frontend_css_background', '#f4f4f4' ); add_option( 'sportspress_frontend_css_text', '#222222' ); add_option( 'sportspress_frontend_css_heading', '#ffffff' ); add_option( 'sportspress_frontend_css_link', '#00a69c' ); } /** * Create roles and capabilities */ public function create_roles() { global $wp_roles; if ( class_exists( 'WP_Roles' ) ) : if ( ! isset( $wp_roles ) ) : $wp_roles = new WP_Roles(); endif; endif; if ( is_object( $wp_roles ) ) : add_role( 'sp_player', __( 'Player', 'sportspress' ), array( 'level_1' => true, 'level_0' => true, 'read' => true, 'delete_posts' => true, 'edit_posts' => true, 'upload_files' => true, 'edit_sp_player' => true, 'read_sp_player' => true, 'edit_sp_players' => true, 'edit_published_sp_players' => true, 'assign_sp_player_terms' => true, 'edit_sp_event' => true, 'read_sp_event' => true, 'edit_sp_events' => true, 'edit_published_sp_events' => true, 'assign_sp_event_terms' => true, 'edit_sp_team' => true, 'read_sp_team' => true, 'edit_sp_teams' => true, 'edit_published_sp_teams' => true, 'assign_sp_team_terms' => true, ) ); add_role( 'sp_staff', __( 'Staff', 'sportspress' ), array( 'level_1' => true, 'level_0' => true, 'read' => true, 'delete_posts' => true, 'edit_posts' => true, 'upload_files' => true, 'edit_sp_staff' => true, 'read_sp_staff' => true, 'edit_sp_staffs' => true, 'edit_published_sp_staffs' => true, 'assign_sp_staff_terms' => true, 'edit_sp_event' => true, 'read_sp_event' => true, 'edit_sp_events' => true, 'edit_published_sp_events' => true, 'assign_sp_event_terms' => true, 'edit_sp_team' => true, 'read_sp_team' => true, 'edit_sp_teams' => true, 'edit_published_sp_teams' => true, 'assign_sp_team_terms' => true, 'edit_sp_player' => true, 'read_sp_player' => true, 'edit_sp_players' => true, 'edit_published_sp_players' => true, 'assign_sp_player_terms' => true, ) ); add_role( 'sp_event_manager', __( 'Event Manager', 'sportspress' ), array( 'level_1' => true, 'level_0' => true, 'read' => true, 'delete_posts' => true, 'edit_posts' => true, 'upload_files' => true, 'manage_categories' => true, 'edit_sp_event' => true, 'read_sp_event' => true, 'delete_sp_event' => true, 'edit_sp_events' => true, 'edit_others_sp_events' => true, 'publish_sp_events' => true, 'delete_sp_events' => true, 'delete_published_sp_events' => true, 'edit_published_sp_events' => true, 'manage_sp_event_terms' => true, 'edit_sp_event_terms' => true, 'delete_sp_event_terms' => true, 'assign_sp_event_terms' => true, 'edit_sp_team' => true, 'read_sp_team' => true, 'edit_sp_teams' => true, 'edit_published_sp_teams' => true, 'assign_sp_team_terms' => true, 'edit_sp_player' => true, 'read_sp_player' => true, 'edit_sp_players' => true, 'edit_published_sp_players' => true, 'assign_sp_player_terms' => true, 'edit_sp_staff' => true, 'read_sp_staff' => true, 'edit_sp_staffs' => true, 'edit_published_sp_staffs' => true, 'assign_sp_staff_terms' => true, ) ); add_role( 'sp_team_manager', __( 'Team Manager', 'sportspress' ), array( 'level_2' => true, 'level_1' => true, 'level_0' => true, 'read' => true, 'delete_posts' => true, 'edit_posts' => true, 'delete_published_posts' => true, 'publish_posts' => true, 'upload_files' => true, 'edit_published_posts' => true, 'edit_sp_player' => true, 'read_sp_player' => true, 'delete_sp_player' => true, 'edit_sp_players' => true, 'edit_others_sp_players' => true, 'publish_sp_players' => true, 'delete_sp_players' => true, 'delete_published_sp_players' => true, 'edit_published_sp_players' => true, 'assign_sp_player_terms' => true, 'edit_sp_staff' => true, 'read_sp_staff' => true, 'delete_sp_staff' => true, 'edit_sp_staffs' => true, 'edit_others_sp_staffs' => true, 'publish_sp_staffs' => true, 'delete_sp_staffs' => true, 'delete_published_sp_staffs' => true, 'edit_published_sp_staffs' => true, 'assign_sp_staff_terms' => true, 'edit_sp_event' => true, 'read_sp_event' => true, 'delete_sp_event' => true, 'edit_sp_events' => true, 'edit_others_sp_events' => true, 'publish_sp_events' => true, 'delete_sp_events' => true, 'delete_published_sp_events' => true, 'edit_published_sp_events' => true, 'manage_sp_event_terms' => true, 'edit_sp_event_terms' => true, 'delete_sp_event_terms' => true, 'assign_sp_event_terms' => true, 'edit_sp_team' => true, 'read_sp_team' => true, 'edit_sp_teams' => true, 'edit_published_sp_teams' => true, 'assign_sp_team_terms' => true, 'edit_sp_list' => true, 'read_sp_list' => true, 'delete_sp_list' => true, 'edit_sp_lists' => true, 'publish_sp_lists' => true, 'delete_sp_lists' => true, 'delete_published_sp_lists' => true, 'edit_published_sp_lists' => true, 'assign_sp_list_terms' => true, ) ); add_role( 'sp_league_manager', __( 'League Manager', 'sportspress' ), array( 'level_7' => true, 'level_6' => true, 'level_5' => true, 'level_4' => true, 'level_3' => true, 'level_2' => true, 'level_1' => true, 'level_0' => true, 'read' => true, 'read_private_pages' => true, 'read_private_posts' => true, 'edit_users' => true, 'edit_posts' => true, 'edit_pages' => true, 'edit_published_posts' => true, 'edit_published_pages' => true, 'edit_private_pages' => true, 'edit_private_posts' => true, 'edit_others_posts' => true, 'edit_others_pages' => true, 'publish_posts' => true, 'publish_pages' => true, 'delete_posts' => true, 'delete_pages' => true, 'delete_private_pages' => true, 'delete_private_posts' => true, 'delete_published_pages' => true, 'delete_published_posts' => true, 'delete_others_posts' => true, 'delete_others_pages' => true, 'manage_categories' => true, 'manage_links' => true, 'moderate_comments' => true, 'unfiltered_html' => true, 'upload_files' => true, 'export' => true, 'import' => true, 'list_users' => true, ) ); $capabilities = $this->get_core_capabilities(); foreach ( $capabilities as $cap_group ) : foreach ( $cap_group as $cap ) : $wp_roles->add_cap( 'sp_league_manager', $cap ); $wp_roles->add_cap( 'administrator', $cap ); endforeach; endforeach; endif; } /** * Make adjustments based on current version of the plugin * * @access public * @return void */ public function upgrades( $version = null ) { if ( empty( $version ) ) { return; } if ( version_compare( $version, '2.0', '<' ) ) { update_option( 'sportspress_player_columns', 'manual' ); } if ( version_compare( $version, '2.1', '<' ) ) { update_option( 'sportspress_player_show_selector', 'no' ); update_option( 'sportspress_event_performance_show_minutes', 'no' ); } if ( version_compare( $version, '2.1.3', '<' ) ) { $layout = get_option( 'sportspress_player_template_order' ); if ( is_array( $layout ) ) { array_unshift( $layout, 'selector' ); update_option( 'sportspress_player_template_order', $layout ); } $layout = get_option( 'sportspress_staff_template_order' ); if ( is_array( $layout ) ) { array_unshift( $layout, 'selector' ); update_option( 'sportspress_staff_template_order', $layout ); } } if ( version_compare( $version, '2.2', '<' ) ) { update_option( 'sportspress_frontend_styles', 'no' ); update_option( 'sportspress_event_show_timeline', 'no' ); update_option( 'sportspress_event_logos_show_team_names', 'no' ); } if ( version_compare( $version, '2.2.3', '<' ) ) { $option = get_option( 'sportspress_player_show_total', 'no' ); update_option( 'sportspress_player_show_career_total', $option ); } if ( version_compare( $version, '2.2.11', '<' ) ) { update_option( 'sportspress_completed_setup', 1 ); update_option( 'sportspress_registration_name_inputs', 'no' ); update_option( 'sportspress_registration_add_player', 'no' ); $individual_mode = get_option( 'sportspress_load_individual_mode_module', 'no' ); if ( 'yes' === $individual_mode ) { update_option( 'sportspress_mode', 'player' ); } else { update_option( 'sportspress_mode', 'team' ); } } if ( version_compare( $version, '2.5.5', '<' ) ) { update_option( 'sportspress_enable_responsive_tables', 'no' ); } } /** * Get capabilities for SportsPress - these are assigned during installation or reset * * @access public * @return array */ public function get_core_capabilities() { include_once 'sp-conditional-functions.php'; $capabilities = array(); $capabilities['core'] = array( 'manage_sportspress', 'view_sportspress_reports', ); $post_types = sp_post_types(); array_unshift( $post_types, 'sp_config' ); $capability_types = apply_filters( 'sportspress_post_types', $post_types ); foreach ( $capability_types as $capability_type ) { $capabilities[ $capability_type ] = array( // Post type "edit_{$capability_type}", "read_{$capability_type}", "delete_{$capability_type}", "edit_{$capability_type}s", "edit_others_{$capability_type}s", "publish_{$capability_type}s", "read_private_{$capability_type}s", "delete_{$capability_type}s", "delete_private_{$capability_type}s", "delete_published_{$capability_type}s", "delete_others_{$capability_type}s", "edit_private_{$capability_type}s", "edit_published_{$capability_type}s", // Terms "manage_{$capability_type}_terms", "edit_{$capability_type}_terms", "delete_{$capability_type}_terms", "assign_{$capability_type}_terms", ); } return $capabilities; } /** * sportspress_remove_roles function. * * @access public * @return void */ public function remove_roles() { global $wp_roles; if ( class_exists( 'WP_Roles' ) ) { if ( ! isset( $wp_roles ) ) { $wp_roles = new WP_Roles(); } } if ( is_object( $wp_roles ) ) { $capabilities = $this->get_core_capabilities(); foreach ( $capabilities as $cap_group ) { foreach ( $cap_group as $cap ) { $wp_roles->remove_cap( 'sp_player', $cap ); $wp_roles->remove_cap( 'sp_staff', $cap ); $wp_roles->remove_cap( 'sp_event_manager', $cap ); $wp_roles->remove_cap( 'sp_team_manager', $cap ); $wp_roles->remove_cap( 'sp_league_manager', $cap ); $wp_roles->remove_cap( 'administrator', $cap ); } } remove_role( 'sp_player' ); remove_role( 'sp_staff' ); remove_role( 'sp_event_manager' ); remove_role( 'sp_team_manager' ); remove_role( 'sp_league_manager' ); } } /** * Active plugins pre update option filter * * @param string $new_value * @return string */ function pre_update_option_active_plugins( $new_value ) { $old_value = (array) get_option( 'active_plugins' ); if ( $new_value !== $old_value && in_array( W3TC_FILE, (array) $new_value ) && in_array( W3TC_FILE, (array) $old_value ) ) { $this->_config->set( 'notes.plugins_updated', true ); try { $this->_config->save(); } catch ( Exception $ex ) { } } return $new_value; } /** * Show plugin changes. Code adapted from W3 Total Cache. * * @return void */ function in_plugin_update_message() { $response = wp_remote_get( 'https://plugins.svn.wordpress.org/sportspress/trunk/readme.txt' ); if ( ! is_wp_error( $response ) && ! empty( $response['body'] ) ) { // Output Upgrade Notice $matches = null; $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( SP_VERSION ) . '\s*=|$)~Uis'; if ( preg_match( $regexp, $response['body'], $matches ) ) { $version = trim( $matches[1] ); $notices = (array) preg_split( '~[\r\n]+~', trim( $matches[2] ) ); if ( version_compare( SP_VERSION, $version, '<' ) ) { echo '
    '; foreach ( $notices as $index => $line ) { echo '

    ' . wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '${1}', $line ) ) . '

    '; } echo '
    '; } } // Output Changelog $matches = null; $regexp = '~==\s*Changelog\s*==\s*=\s*[0-9.]+\s*-(.*)=(.*)(=\s*' . preg_quote( SP_VERSION ) . '\s*-(.*)=|$)~Uis'; if ( preg_match( $regexp, $response['body'], $matches ) ) { $changelog = (array) preg_split( '~[\r\n]+~', trim( $matches[2] ) ); esc_attr_e( 'What\'s new:', 'sportspress' ) . '
    '; $ul = false; foreach ( $changelog as $index => $line ) { if ( preg_match( '~^\s*\*\s*~', $line ) ) { if ( ! $ul ) { echo '
      '; $ul = true; } $line = preg_replace( '~^\s*\*\s*~', '', htmlspecialchars( $line ) ); echo '
    • ' . esc_html( $line ) . '
    • '; } else { $version = trim( current( explode( '-', str_replace( '=', '', $line ) ) ) ); if ( version_compare( SP_VERSION, $version, '>=' ) ) { break; } if ( $ul ) { echo '
    '; $ul = false; } echo '

    ' . esc_html( htmlspecialchars( $line ) ) . '

    '; } } if ( $ul ) { echo ''; } echo '
    '; } } } } endif; return new SP_Install(); ================================================ FILE: includes/class-sp-league-table.php ================================================ ID, 'sp_league' ); $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' ); $table_stats = (array) get_post_meta( $this->ID, 'sp_teams', true ); $usecolumns = get_post_meta( $this->ID, 'sp_columns', true ); $adjustments = get_post_meta( $this->ID, 'sp_adjustments', true ); $select = get_post_meta( $this->ID, 'sp_select', true ); $this->orderby = get_post_meta( $this->ID, 'sp_orderby', true ); $this->orderbyorder = get_post_meta( $this->ID, 'sp_order', true ); $link_events = get_option( 'sportspress_link_events', 'yes' ) === 'yes' ? true : false; $form_limit = (int) get_option( 'sportspress_form_limit', 5 ); $this->date = $this->__get( 'date' ); if ( ! $this->date ) { $this->date = 0; } // Apply defaults if ( empty( $this->orderby ) ) { $this->orderby = 'default'; } if ( empty( $this->orderbyorder ) ) { $this->orderbyorder = 'ASC'; } if ( empty( $select ) ) { $select = 'auto'; } if ( 'range' == $this->date ) { $this->relative = get_post_meta( $this->ID, 'sp_date_relative', true ); if ( $this->relative ) { $this->past = get_post_meta( $this->ID, 'sp_date_past', true ); } else { $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); } } // Get labels from result variables $result_labels = (array) sp_get_var_labels( 'sp_result' ); // Get labels from outcome variables $outcome_labels = (array) sp_get_var_labels( 'sp_outcome' ); // Get post type $post_type = sp_get_post_mode_type( $this->ID ); // Determine if main loop if ( $team_ids ) { $is_main_loop = false; } else { // Get teams automatically if set to auto if ( 'auto' == $select ) { $team_ids = array(); $args = array( 'post_type' => $post_type, 'numberposts' => -1, 'posts_per_page' => -1, 'order' => 'ASC', 'tax_query' => array( 'relation' => 'AND', ), 'fields' => 'ids', ); if ( $league_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ); endif; if ( $season_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season_ids, ); endif; $team_ids = get_posts( $args ); } else { $team_ids = (array) get_post_meta( $this->ID, 'sp_team', false ); } $is_main_loop = true; } // Get all leagues populated with stats where available $tempdata = sp_array_combine( $team_ids, $table_stats ); // Create entry for each team in totals $totals = array(); $placeholders = array(); // Initialize incremental counter $this->pos = 0; $this->counter = 0; // Initialize team compare $this->compare = null; // Initialize streaks counter $streaks = array(); // Initialize form counter $forms = array(); // Initialize last counters $last5s = array(); $last10s = array(); // Initialize record counters $homerecords = array(); $awayrecords = array(); foreach ( $team_ids as $team_id ) : if ( ! $team_id ) { continue; } // Initialize team streaks counter $streaks[ $team_id ] = array( 'name' => '', 'count' => 0, 'fire' => 1, ); // Initialize team form counter $forms[ $team_id ] = array(); // Initialize team last counters $last5s[ $team_id ] = array(); $last10s[ $team_id ] = array(); // Initialize team record counters $homerecords[ $team_id ] = array(); $awayrecords[ $team_id ] = array(); // Add outcome types to team last and record counters foreach ( $outcome_labels as $key => $value ) : $last5s[ $team_id ][ $key ] = 0; $last10s[ $team_id ][ $key ] = 0; $homerecords[ $team_id ][ $key ] = 0; $awayrecords[ $team_id ][ $key ] = 0; endforeach; // Initialize team totals $totals[ $team_id ] = array( 'eventsplayed' => 0, 'eventsplayed_home' => 0, 'eventsplayed_away' => 0, 'eventsplayed_venue' => 0, 'eventminutes' => 0, 'eventminutes_home' => 0, 'eventminutes_away' => 0, 'eventminutes_venue' => 0, 'streak' => 0, 'streak_home' => 0, 'streak_away' => 0, 'streak_venue' => 0, ); foreach ( $result_labels as $key => $value ) : $totals[ $team_id ][ $key . 'for' ] = 0; $totals[ $team_id ][ $key . 'for_home' ] = 0; $totals[ $team_id ][ $key . 'for_away' ] = 0; $totals[ $team_id ][ $key . 'for_venue' ] = 0; $totals[ $team_id ][ $key . 'against' ] = 0; $totals[ $team_id ][ $key . 'against_home' ] = 0; $totals[ $team_id ][ $key . 'against_away' ] = 0; $totals[ $team_id ][ $key . 'against_venue' ] = 0; endforeach; foreach ( $outcome_labels as $key => $value ) : $totals[ $team_id ][ $key ] = 0; $totals[ $team_id ][ $key . '_home' ] = 0; $totals[ $team_id ][ $key . '_away' ] = 0; $totals[ $team_id ][ $key . '_venue' ] = 0; endforeach; // Get static stats $static = get_post_meta( $team_id, 'sp_columns', true ); if ( 'yes' == get_option( 'sportspress_team_column_editing', 'no' ) && $league_ids && $season_ids ) : // Add static stats to placeholders foreach ( $league_ids as $league_id ) : foreach ( $season_ids as $season_id ) : $placeholders[ $team_id ] = (array) sp_array_value( sp_array_value( $static, $league_id, array() ), $season_id, array() ); endforeach; endforeach; endif; endforeach; // Get which event status to include $event_status = get_post_meta( $this->ID, 'sp_event_status', true ); if ( empty( $event_status ) ) { $event_status = array( 'publish', 'future' ); } if ( isset( $this->show_published_events ) ) { // If an attribute was pass through shortcode if ( $this->show_published_events == '1' ) { $event_status[] = 'publish'; } else { if ( ( $status_key = array_search( 'publish', $event_status ) ) !== false ) { unset( $event_status[ $status_key ] ); } } } if ( isset( $this->show_future_events ) ) { // If an attribute was pass through shortcode if ( $this->show_future_events == '1' ) { $event_status[] = 'future'; } else { if ( ( $status_key = array_search( 'future', $event_status ) ) !== false ) { unset( $event_status[ $status_key ] ); } } } // Make sure to have unique values in the array $event_status = array_unique( $event_status ); $args = array( 'post_type' => 'sp_event', 'post_status' => $event_status, 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'post_date', 'order' => 'DESC', 'meta_query' => array( array( 'key' => 'sp_format', 'value' => apply_filters( 'sportspress_competitive_event_formats', array( 'league' ) ), 'compare' => 'IN', ), ), 'tax_query' => array( 'relation' => 'AND', ), ); if ( $league_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ); endif; if ( $season_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season_ids, ); endif; if ( $this->date !== 0 ) : if ( $this->date == 'w' ) : $args['year'] = date_i18n( 'Y' ); $args['w'] = date_i18n( 'W' ); elseif ( $this->date == 'day' ) : $args['year'] = date_i18n( 'Y' ); $args['day'] = date_i18n( 'j' ); $args['monthnum'] = date_i18n( 'n' ); elseif ( $this->date == 'range' ) : if ( $this->relative ) : add_filter( 'posts_where', array( $this, 'relative' ) ); else : add_filter( 'posts_where', array( $this, 'range' ) ); endif; endif; endif; $args = apply_filters( 'sportspress_table_data_event_args', $args ); if ( ! $is_main_loop ) : if ( sizeof( $team_ids ) ) : $args['meta_query'][] = array( 'key' => 'sp_team', 'value' => $team_ids, 'compare' => 'IN', ); endif; endif; $events = get_posts( $args ); // Remove range filters remove_filter( 'posts_where', array( $this, 'range' ) ); remove_filter( 'posts_where', array( $this, 'relative' ) ); $e = 0; // Event loop foreach ( $events as $event ) : $teams = (array) get_post_meta( $event->ID, 'sp_team', false ); $teams = array_filter( $teams ); if ( ! $is_main_loop && sizeof( array_diff( $teams, $team_ids ) ) ) { continue; } $results = (array) get_post_meta( $event->ID, 'sp_results', true ); $minutes = (int) get_post_meta( $event->ID, 'sp_minutes', true ); $minutes = $minutes ? $minutes : (int) get_option( 'sportspress_event_minutes', 90 ); $i = 0; foreach ( $results as $team_id => $team_result ) : if ( ! in_array( $team_id, $teams ) ) { continue; } if ( ! in_array( $team_id, $team_ids ) ) { $i++; continue; } if ( $team_result ) : foreach ( $team_result as $key => $value ) : if ( $key == 'outcome' ) : if ( ! is_array( $value ) ) : $value = array( $value ); endif; foreach ( $value as $outcome ) : // Increment events played and outcome count if ( array_key_exists( $team_id, $totals ) && is_array( $totals[ $team_id ] ) && array_key_exists( $outcome, $totals[ $team_id ] ) ) : $totals[ $team_id ]['eventsplayed'] ++; $totals[ $team_id ]['eventminutes'] = (int) $totals[ $team_id ]['eventminutes'] + $minutes; $totals[ $team_id ][ $outcome ] ++; // Add to home or away stats if ( 0 === $i ) : $totals[ $team_id ]['eventsplayed_home'] ++; $totals[ $team_id ]['eventminutes_home'] = (int) $totals[ $team_id ]['eventminutes_home'] + $minutes; $totals[ $team_id ][ $outcome . '_home' ] ++; else : $totals[ $team_id ]['eventsplayed_away'] ++; $totals[ $team_id ]['eventminutes_away'] = (int) $totals[ $team_id ]['eventminutes_away'] + $minutes; $totals[ $team_id ][ $outcome . '_away' ] ++; endif; // Add to venue stats if ( sp_is_home_venue( $team_id, $event->ID ) ) : $totals[ $team_id ]['eventsplayed_venue'] ++; $totals[ $team_id ]['eventminutes_venue'] = (int) $totals[ $team_id ]['eventminutes_venue'] + $minutes; $totals[ $team_id ][ $outcome . '_venue' ] ++; endif; endif; if ( $outcome && $outcome != '-1' ) : // Add to streak counter if ( $streaks[ $team_id ]['fire'] && ( $streaks[ $team_id ]['name'] == '' || $streaks[ $team_id ]['name'] == $outcome ) ) : $streaks[ $team_id ]['name'] = $outcome; $streaks[ $team_id ]['count'] ++; else : $streaks[ $team_id ]['fire'] = 0; endif; // Add to form counter $forms[ $team_id ][] = array( 'id' => $event->ID, 'outcome' => $outcome, ); // Add to last 5 counter if sum is less than 5 if ( array_key_exists( $team_id, $last5s ) && array_key_exists( $outcome, $last5s[ $team_id ] ) && array_sum( $last5s[ $team_id ] ) < 5 ) : $last5s[ $team_id ][ $outcome ] ++; endif; // Add to last 10 counter if sum is less than 10 if ( array_key_exists( $team_id, $last10s ) && array_key_exists( $outcome, $last10s[ $team_id ] ) && array_sum( $last10s[ $team_id ] ) < 10 ) : $last10s[ $team_id ][ $outcome ] ++; endif; // Add to home or away record if ( 0 === $i ) { if ( array_key_exists( $team_id, $homerecords ) && array_key_exists( $outcome, $homerecords[ $team_id ] ) ) { $homerecords[ $team_id ][ $outcome ] ++; } } else { if ( array_key_exists( $team_id, $awayrecords ) && array_key_exists( $outcome, $awayrecords[ $team_id ] ) ) { $awayrecords[ $team_id ][ $outcome ] ++; } } endif; endforeach; else : if ( array_key_exists( $team_id, $totals ) && is_array( $totals[ $team_id ] ) && array_key_exists( $key . 'for', $totals[ $team_id ] ) ) : // Get numeric value $value = floatval( $value ); $totals[ $team_id ][ $key . 'for' ] += $value; $totals[ $team_id ][ $key . 'for' . ( $e + 1 ) ] = $value; // Add to home or away stats if ( 0 === $i ) : $totals[ $team_id ][ $key . 'for_home' ] += $value; else : $totals[ $team_id ][ $key . 'for_away' ] += $value; endif; // Add to venue stats if ( sp_is_home_venue( $team_id, $event->ID ) ) : $totals[ $team_id ][ $key . 'for_venue' ] += $value; endif; foreach ( $results as $other_team_id => $other_result ) : if ( $other_team_id != $team_id && array_key_exists( $key . 'against', $totals[ $team_id ] ) ) : // Get numeric value of other team's result $value = floatval( sp_array_value( $other_result, $key, 0 ) ); $totals[ $team_id ][ $key . 'against' ] += $value; $totals[ $team_id ][ $key . 'against' . ( $e + 1 ) ] = $value; // Add to home or away stats if ( 0 === $i ) : $totals[ $team_id ][ $key . 'against_home' ] += $value; else : $totals[ $team_id ][ $key . 'against_away' ] += $value; endif; // Add to venue stats if ( sp_is_home_venue( $team_id, $event->ID ) ) : $totals[ $team_id ][ $key . 'against_venue' ] += $value; endif; endif; endforeach; endif; endif; endforeach; endif; $i++; endforeach; $e++; endforeach; // Get outcomes $outcomes = array(); $args = array( 'post_type' => 'sp_outcome', 'post_status' => 'publish', 'posts_per_page' => -1, ); $posts = get_posts( $args ); if ( $posts ) : foreach ( $posts as $post ) : // Get ID $id = $post->ID; // Get title $title = $post->post_title; // Get abbreviation $abbreviation = get_post_meta( $id, 'sp_abbreviation', true ); if ( ! $abbreviation ) : $abbreviation = substr( $title, 0, 1 ); endif; // Get color $color = get_post_meta( $id, 'sp_color', true ); if ( '' === $color ) { $color = '#888888'; } $outcomes[ $post->post_name ] = array( 'id' => $id, 'title' => $title, 'abbreviation' => $abbreviation, 'color' => $color, ); endforeach; endif; foreach ( $streaks as $team_id => $streak ) : // Compile streaks counter and add to totals if ( $streak['name'] ) : $outcome = sp_array_value( $outcomes, $streak['name'], false ); if ( $outcome ) : $color = $outcome['color']; $totals[ $team_id ]['streak'] = '' . $outcome['abbreviation'] . $streak['count'] . ''; else : $totals[ $team_id ]['streak'] = null; endif; else : $totals[ $team_id ]['streak'] = null; endif; endforeach; foreach ( $forms as $team_id => $form ) : // Apply form limit if ( $form_limit && sizeof( $form ) > $form_limit ) : $form = array_slice( $form, 0, $form_limit ); endif; // Initialize team form array $team_form = array(); // Reverse form array to display in chronological order $form = array_reverse( $form ); // Loop through event form foreach ( $form as $form_event ) : if ( $form_event['id'] ) : $outcome = sp_array_value( $outcomes, $form_event['outcome'], false ); if ( $outcome ) : $abbreviation = $outcome['abbreviation']; $color = $outcome['color']; if ( $link_events ) : $abbreviation = '' . $abbreviation . ''; else : $abbreviation = '' . $abbreviation . ''; endif; // Add to team form $team_form[] = $abbreviation; endif; endif; endforeach; // Append to totals if ( sizeof( $team_form ) ) : $totals[ $team_id ]['form'] = '
    ' . implode( ' ', $team_form ) . '
    '; else : $totals[ $team_id ]['form'] = null; endif; endforeach; foreach ( $last5s as $team_id => $last5 ) : // Add last 5 to totals $totals[ $team_id ]['last5'] = $last5; endforeach; foreach ( $last10s as $team_id => $last10 ) : // Add last 10 to totals $totals[ $team_id ]['last10'] = $last10; endforeach; foreach ( $homerecords as $team_id => $homerecord ) : // Add home record to totals $totals[ $team_id ]['homerecord'] = $homerecord; endforeach; foreach ( $awayrecords as $team_id => $awayrecord ) : // Add away record to totals $totals[ $team_id ]['awayrecord'] = $awayrecord; endforeach; $args = array( 'post_type' => 'sp_column', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $stats = get_posts( $args ); $columns = array(); $this->priorities = array(); foreach ( $stats as $stat ) : // Get post meta $meta = get_post_meta( $stat->ID ); // Add equation to object $stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, null ); $stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ); // Add column name to columns $columns[ $stat->post_name ] = $stat->post_title; // Add order to priorities if priority is set and does not exist in array already $priority = sp_array_value( sp_array_value( $meta, 'sp_priority', array() ), 0, 0 ); if ( $priority && ! array_key_exists( $priority, $this->priorities ) ) : $this->priorities[ $priority ] = array( 'column' => $stat->post_name, 'order' => sp_array_value( sp_array_value( $meta, 'sp_order', array() ), 0, 'DESC' ), ); endif; endforeach; // Sort priorities in descending order ksort( $this->priorities ); // Initialize games back column variable $gb_column = null; // Fill in empty placeholder values for each team foreach ( $team_ids as $team_id ) : if ( ! $team_id ) { continue; } $placeholders[ $team_id ] = array(); foreach ( $stats as $stat ) : if ( sp_array_value( sp_array_value( $placeholders, $team_id, array() ), $stat->post_name, '' ) == '' ) : if ( $stat->equation == null ) : $placeholder = sp_array_value( sp_array_value( $adjustments, $team_id, array() ), $stat->post_name, null ); if ( $placeholder == null ) : $placeholder = '-'; endif; else : // Solve $placeholder = sp_solve( $stat->equation, sp_array_value( $totals, $team_id, array() ), $stat->precision, 0, $team_id ); if ( '$gamesback' == $stat->equation ) { $gb_column = $stat->post_name; } if ( ! in_array( $stat->equation, apply_filters( 'sportspress_equation_presets', array( '$gamesback', '$streak', '$form', '$last5', '$last10', '$homerecord', '$awayrecord' ) ) ) ) : // Adjustments $adjustment = sp_array_value( $adjustments, $team_id, array() ); if ( $adjustment != 0 ) : $value = floatval( sp_array_value( $adjustment, $stat->post_name, 0 ) ); $placeholder += $value; $placeholder = number_format( $placeholder, $stat->precision, '.', '' ); endif; endif; endif; $placeholders[ $team_id ][ $stat->post_name ] = $placeholder; endif; endforeach; endforeach; // Find win and loss variables for games back $w = $l = null; if ( $gb_column ) { $args = array( 'post_type' => 'sp_outcome', 'numberposts' => 1, 'posts_per_page' => 1, 'meta_query' => array( array( 'key' => 'sp_condition', 'value' => '>', ), ), ); $outcomes = get_posts( $args ); if ( $outcomes ) { $outcome = reset( $outcomes ); if ( is_array( $stats ) ) { foreach ( $stats as $stat ) { if ( '$' . $outcome->post_name == $stat->equation ) { $w = $stat->post_name; } } } } // Calculate games back $args = array( 'post_type' => 'sp_outcome', 'numberposts' => 1, 'posts_per_page' => 1, 'meta_query' => array( array( 'key' => 'sp_condition', 'value' => '<', ), ), ); $outcomes = get_posts( $args ); if ( $outcomes ) { $outcome = reset( $outcomes ); if ( is_array( $stats ) ) { foreach ( $stats as $stat ) { if ( '$' . $outcome->post_name == $stat->equation ) { $l = $stat->post_name; } } } } } // Merge the data and placeholders arrays $merged = array(); foreach ( $placeholders as $team_id => $team_data ) : // Add team name to row $merged[ $team_id ] = array(); $team_data['name'] = sp_team_short_name( $team_id ); foreach ( $team_data as $key => $value ) : // Use static data if key exists and value is not empty, else use placeholder if ( array_key_exists( $team_id, $tempdata ) && array_key_exists( $key, $tempdata[ $team_id ] ) && $tempdata[ $team_id ][ $key ] != '' ) : $value = $tempdata[ $team_id ][ $key ]; endif; $merged[ $team_id ][ $key ] = $value; endforeach; endforeach; uasort( $merged, array( $this, 'sort' ) ); // Calculate position of teams for ties foreach ( $merged as $team_id => $team_columns ) { $merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns, $team_id ); } // Head to head table sorting if ( $is_main_loop && 'h2h' == get_option( 'sportspress_table_tiebreaker', 'none' ) ) { $order = array(); foreach ( $this->tiebreakers as $pos => $teams ) { if ( sizeof( $teams ) === 1 ) { $order[] = reset( $teams ); } else { $standings = $this->data( false, $teams ); $teams = array_keys( $standings ); foreach ( $teams as $team ) { $order[] = $team; } } } $head_to_head = array(); foreach ( $order as $team ) { $head_to_head[ $team ] = sp_array_value( $merged, $team, array() ); } $merged = $head_to_head; // Recalculate position of teams after head to head $this->pos = 0; $this->counter = 0; foreach ( $merged as $team_id => $team_columns ) { $merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns, $team_id, false ); } } // Rearrange the table if Default ordering is not selected if ( $this->orderby != 'default' ) { uasort( $merged, array( $this, 'simple_order' ) ); // Recalculate position of teams $this->pos = 0; $this->counter = 0; foreach ( $merged as $team_id => $team_columns ) { $merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns, $team_id, false ); } } // Rearrange data array to reflect values $data = array(); foreach ( $merged as $key => $value ) : $data[ $key ] = $tempdata[ $key ]; endforeach; if ( ! $is_main_loop ) : return $merged; elseif ( $admin ) : $this->add_gb( $placeholders, $w, $l, $gb_column ); return array( $columns, $usecolumns, $data, $placeholders, $merged ); else : $this->add_gb( $merged, $w, $l, $gb_column ); if ( ! is_array( $usecolumns ) ) { $usecolumns = array(); } $labels = array_merge( array( 'pos' => esc_attr__( 'Pos', 'sportspress' ), 'name' => esc_attr__( 'Team', 'sportspress' ), ), $columns ); $merged[0] = $labels; return $merged; endif; } /** * Sort the table by priorities. * * @param array $a * @param array $b * @return int */ public function sort( $a, $b ) { // Loop through priorities foreach ( $this->priorities as $priority ) : // Proceed if columns are not equal if ( sp_array_value( $a, $priority['column'], 0 ) != sp_array_value( $b, $priority['column'], 0 ) ) : // Compare column values $output = (float) sp_array_value( $a, $priority['column'], 0 ) - (float) sp_array_value( $b, $priority['column'], 0 ); // Flip value if descending order if ( $priority['order'] == 'DESC' ) { $output = 0 - $output; } return ( $output > 0 ? 1 : -1 ); endif; endforeach; // Default sort by alphabetical return strcmp( sp_array_value( $a, 'name', '' ), sp_array_value( $b, 'name', '' ) ); } /** * Sort the table by ordering. * * @param array $a * @param array $b * @return int */ public function simple_order( $a, $b ) { if ( $this->orderbyorder == 'DESC' ) { if ( $this->orderby == 'name' ) { return strcmp( sp_array_value( $b, 'name', '' ), sp_array_value( $a, 'name', '' ) ); } else { return (float) $b[ $this->orderby ] - (float) $a[ $this->orderby ]; } } else { if ( $this->orderby == 'name' ) { return strcmp( sp_array_value( $a, 'name', '' ), sp_array_value( $b, 'name', '' ) ); } else { return (float) $a[ $this->orderby ] - (float) $b[ $this->orderby ]; } } } /** * Find accurate position of teams. * * @param array $columns * @param int $id * @return int */ public function calculate_pos( $columns, $id = 0, $add_tiebreakers = true ) { $this->counter++; $pos = $this->increment( $columns ); if ( $add_tiebreakers ) { // Initialize tiebreaker position if ( ! array_key_exists( $this->pos, $this->tiebreakers ) ) { $this->tiebreakers[ $this->pos ] = array(); } // Add to tiebreakers if ( ! in_array( $id, $this->tiebreakers[ $this->pos ] ) ) { $this->tiebreakers[ $this->pos ][] = $id; } } return $pos; } /** * Increment position as needed. * * @param array $columns * @return int */ public function increment( $columns ) { // Replace compare data and use last set $compare = $this->compare; $this->compare = $columns; // Loop through priorities foreach ( $this->priorities as $priority ) : // Proceed if columns are not equal if ( sp_array_value( $columns, $priority['column'], 0 ) !== sp_array_value( $compare, $priority['column'], 0 ) ) : // Increment if not equal $this->pos = $this->counter; return $this->counter; endif; endforeach; if ( 'yes' == get_option( 'sportspress_table_increment', 'no' ) ) { return $this->counter; } // Repeat position if equal return $this->pos; } /** * Calculate and add games back. * * @param array $a * @param string $w * @param string $l * @param string $column * @return null */ public function add_gb( &$a, $w = null, $l = null, $column = null ) { if ( ! is_array( $a ) ) { return; } if ( ! $w && ! $l ) { return; } foreach ( $a as $team_id => $values ) { if ( isset( $leader ) ) { $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; if ( 0 == sp_array_value( $values, $column ) && 0 !== $gb ) { $a[ $team_id ][ $column ] = $gb; } } else { $leader = $values; } } } } ================================================ FILE: includes/class-sp-modules.php ================================================ data = apply_filters( 'sportspress_modules', array( 'event' => array( 'calendars' => array( 'label' => esc_attr__( 'Calendars', 'sportspress' ), 'icon' => 'sp-icon-calendar', 'desc' => esc_attr__( 'Organize and publish calendars using different layouts.', 'sportspress' ), ), 'results_matrix' => array( 'label' => esc_attr__( 'Results Matrix', 'sportspress' ), 'class' => 'SportsPress_Results_Matrix', 'icon' => 'sp-icon-matrix', 'link' => 'https://www.themeboy.com/sportspress-extensions/results-matrix/', 'desc' => esc_attr__( 'Display fixtures and results between teams in a grid layout.', 'sportspress' ), ), 'scoreboard' => array( 'label' => esc_attr__( 'Scoreboard', 'sportspress' ), 'class' => 'SportsPress_Scoreboard', 'icon' => 'sp-icon-scoreboard', 'link' => 'https://www.themeboy.com/sportspress-extensions/scoreboard/', 'desc' => esc_attr__( 'Display multiple event results in a horizontal scoreboard.', 'sportspress' ), ), 'google_maps' => array( 'label' => esc_attr__( 'Google Maps', 'sportspress' ), 'class' => 'SportsPress_Google_Maps', 'icon' => 'sp-icon-location', 'link' => 'https://www.themeboy.com/sportspress-extensions/google-maps/', 'desc' => esc_attr__( 'Use Google Maps instead of OpenStreetMap for venues.', 'sportspress' ), ), 'user_scores' => array( 'label' => esc_attr__( 'User Scores', 'sportspress' ), 'class' => 'SportsPress_User_Scores', 'icon' => 'sp-icon-user-scores', 'link' => 'https://www.themeboy.com/sportspress-extensions/user-scores/', 'desc' => esc_attr__( 'Let players, staff, and visitors submit event scores for review.', 'sportspress' ), ), 'match_stats' => array( 'label' => esc_attr__( 'Match Stats', 'sportspress' ), 'class' => 'SportsPress_Match_Stats', 'icon' => 'sp-icon-statistics', 'link' => 'https://www.themeboy.com/sportspress-extensions/match-stats/', 'desc' => esc_attr__( 'Display head-to-head team comparison charts in events.', 'sportspress' ), ), 'past_meetings' => array( 'label' => esc_attr__( 'Past Meetings', 'sportspress' ), 'class' => 'SportsPress_Past_Meetings', 'icon' => 'sp-icon-history', 'link' => 'https://www.themeboy.com/sportspress-extensions/past-meetings/', 'desc' => esc_attr__( 'Display previous events between teams in list or blocks layout.', 'sportspress' ), ), 'timelines' => array( 'label' => esc_attr__( 'Timelines', 'sportspress' ), 'class' => 'SportsPress_Timelines', 'icon' => 'sp-icon-timeline', 'link' => 'https://www.themeboy.com/sportspress-extensions/timelines/', 'desc' => esc_attr__( 'Display a visual timeline of player performance in events.', 'sportspress' ), ), 'tournaments' => array( 'label' => esc_attr__( 'Tournaments', 'sportspress' ), 'class' => 'SportsPress_Tournaments', 'icon' => 'sp-icon-tournament', 'link' => 'https://www.themeboy.com/sportspress-extensions/tournaments/', 'desc' => esc_attr__( 'Schedule tournaments and create interactive playoff brackets.', 'sportspress' ), ), ), 'team' => array( 'league_tables' => array( 'label' => esc_attr__( 'League Tables', 'sportspress' ), 'icon' => 'sp-icon-chart', 'desc' => esc_attr__( 'Create automated league tables to keep track of team standings.', 'sportspress' ), ), 'league_menu' => array( 'label' => esc_attr__( 'League Menu', 'sportspress' ), 'class' => 'SportsPress_League_Menu', 'icon' => 'sp-icon-menu', 'link' => 'https://www.themeboy.com/sportspress-extensions/league-menu/', 'desc' => esc_attr__( 'Add a global navigation bar to display logos that link to each team.', 'sportspress' ), ), 'team_colors' => array( 'label' => esc_attr__( 'Team Colors', 'sportspress' ), 'class' => 'SportsPress_Team_Colors', 'icon' => 'sp-icon-color', 'link' => 'https://www.themeboy.com/sportspress-extensions/team-colors/', 'desc' => esc_attr__( 'Create a custom color palette for each team.', 'sportspress' ), ), 'team_access' => array( 'label' => esc_attr__( 'Team Access', 'sportspress' ), 'class' => 'SportsPress_Team_Access', 'icon' => 'sp-icon-key', 'link' => 'https://www.themeboy.com/sportspress-extensions/team-access/', 'desc' => esc_attr__( 'Limit user access to data that is related to their team.', 'sportspress' ), ), ), 'player_staff' => array( 'player_lists' => array( 'label' => esc_attr__( 'Player Lists', 'sportspress' ), 'icon' => 'sp-icon-list', 'desc' => esc_attr__( 'Create team rosters, player galleries, and ranking charts.', 'sportspress' ), ), 'midseason_transfers' => array( 'label' => esc_attr__( 'Midseason Transfers', 'sportspress' ), 'class' => 'SportsPress_Midseason_Transfers', 'icon' => 'sp-icon-sub', 'link' => 'https://www.themeboy.com/sportspress-extensions/midseason-transfers/', 'desc' => esc_attr__( 'Statistics for players who transferred between teams during a season.', 'sportspress' ), 'default' => 'yes', ), 'staff_directories' => array( 'label' => esc_attr__( 'Directories', 'sportspress' ), 'class' => 'SportsPress_Staff_Directories', 'icon' => 'sp-icon-archive', 'link' => 'https://www.themeboy.com/sportspress-extensions/directories/', 'desc' => esc_attr__( 'Organize and display staff in list and gallery layouts.', 'sportspress' ), ), 'officials' => array( 'label' => esc_attr__( 'Officials', 'sportspress' ), 'icon' => 'sp-icon-whistle', 'desc' => esc_attr__( 'Manage referees, umpires, judges, timekeepers, and other officials.', 'sportspress' ), 'default' => 'no', ), ), 'admin' => array( 'tutorials' => array( 'label' => esc_attr__( 'Tutorials', 'sportspress' ), 'icon' => 'dashicons dashicons-video-alt3', 'desc' => esc_attr__( 'Display a dashboard page with SportsPress video tutorials.', 'sportspress' ), ), 'branding' => array( 'label' => esc_attr__( 'Branding', 'sportspress' ), 'class' => 'SportsPress_Branding', 'icon' => 'sp-icon-sportspress', 'link' => 'https://www.themeboy.com/sportspress-extensions/branding/', 'desc' => esc_attr__( 'Instantly rebrand the dashboard with your own logo and colors.', 'sportspress' ), ), 'duplicator' => array( 'label' => esc_attr__( 'Duplicator', 'sportspress' ), 'class' => 'SportsPress_Duplicator', 'icon' => 'sp-icon-copy', 'link' => 'https://www.themeboy.com/sportspress-extensions/duplicator/', 'desc' => esc_attr__( 'Clone anything with just one click. Great for creating multiple events.', 'sportspress' ), ), ), 'other' => array( 'twitter' => array( 'label' => esc_attr__( 'Twitter', 'sportspress' ), 'class' => 'SportsPress_Twitter', 'icon' => 'dashicons dashicons-twitter', 'link' => 'https://www.themeboy.com/sportspress-extensions/twitter/', 'desc' => esc_attr__( 'Add a Twitter feed to team, player, and staff pages.', 'sportspress' ), 'tip' => esc_attr__( 'Free', 'sportspress' ), ), 'facebook' => array( 'label' => esc_attr__( 'Facebook', 'sportspress' ), 'class' => 'SportsPress_Facebook', 'icon' => 'dashicons dashicons-facebook', 'link' => 'https://www.themeboy.com/sportspress-extensions/facebook/', 'desc' => esc_attr__( 'Add a Facebook Page widget to embed and promote each team.', 'sportspress' ), 'tip' => esc_attr__( 'Free', 'sportspress' ), ), 'sponsors' => array( 'label' => esc_attr__( 'Sponsors', 'sportspress' ), 'class' => 'SportsPress_Sponsors', 'icon' => 'sp-icon-megaphone', 'link' => 'https://www.themeboy.com/sportspress-extensions/sponsors/', 'desc' => esc_attr__( 'Attract sponsors by offering them advertising space on your website.', 'sportspress' ), ), ), ) ); if ( class_exists( 'BuddyPress' ) ) { $this->data['other']['buddypress'] = array( 'label' => esc_attr__( 'BuddyPress', 'sportspress' ), 'class' => 'BP_SportsPress_Component', 'icon' => 'sp-icon-buddypress', 'link' => 'https://www.themeboy.com/sportspress-extensions/buddypress/', 'desc' => esc_attr__( 'Easily display SportsPress player information in BuddyPress profiles.', 'sportspress' ), 'tip' => esc_attr__( 'Premium', 'sportspress' ), ); } if ( class_exists( 'WooCommerce' ) ) { $this->data['other']['woocommerce'] = array( 'label' => esc_attr__( 'WooCommerce', 'sportspress' ), 'class' => 'WooCommerce_SportsPress', 'icon' => 'sp-icon-woo', 'link' => 'https://www.themeboy.com/sportspress-extensions/woocommerce/', 'desc' => esc_attr__( 'Sell team merchandise by integrating WooCommerce with SportsPress.', 'sportspress' ), 'tip' => esc_attr__( 'Premium', 'sportspress' ), ); } if ( defined( 'WPSEO_FILE' ) ) { $this->data['other']['yoast_seo'] = array( 'label' => esc_attr__( 'Yoast SEO', 'sportspress' ), 'class' => 'Yoast_SEO_SportsPress', 'icon' => 'sp-icon-yoast', 'link' => 'https://www.themeboy.com/sportspress-extensions/yoast-seo/', 'desc' => esc_attr__( 'Generate custom titles for SportsPress pages using Yoast SEO.', 'sportspress' ), 'tip' => esc_attr__( 'Free', 'sportspress' ), ); } if ( is_multisite() ) { $this->data['other']['multisite'] = array( 'label' => esc_attr__( 'Multisite', 'sportspress' ), 'class' => 'SportsPress_Multisite', 'icon' => 'sp-icon-globe', 'link' => 'https://www.themeboy.com/sportspress-extensions/multisite/', 'desc' => esc_attr__( 'Manage multiple sports and display different widgets all on one site.', 'sportspress' ), ); } } public function __set( $key, $value ) { $this->data[ $key ] = $value; } } ================================================ FILE: includes/class-sp-player-list.php ================================================ columns = get_post_meta( $this->ID, 'sp_columns', true ); if ( is_array( $this->columns ) ) { $this->columns = array_filter( $this->columns ); } else { $this->columns = array( 'number', 'team', 'position' ); } } /** * Returns formatted data * * @access public * @param bool $admin * @return array */ public function data( $admin = false, $leagues = null, $seasons = null, $team_id = null ) { if ( ! is_null( $leagues ) && '0' != $leagues ) { $league_ids = explode( ',', $leagues ); } else { $league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' ); } if ( ! is_null( $seasons ) && '0' != $seasons ) { $season_ids = explode( ',', $seasons ); } else { $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' ); } $position_ids = sp_get_the_term_ids( $this->ID, 'sp_position' ); if ( ! is_null( $team_id ) && '0' != $team_id ) { $team = $team_id; } else { $team = get_post_meta( $this->ID, 'sp_team', true ); } $era = get_post_meta( $this->ID, 'sp_era', true ); $list_stats = (array) get_post_meta( $this->ID, 'sp_players', true ); $adjustments = get_post_meta( $this->ID, 'sp_adjustments', true ); $orderby = get_post_meta( $this->ID, 'sp_orderby', true ); $crop = get_post_meta( $this->ID, 'sp_crop', true ); $order = get_post_meta( $this->ID, 'sp_order', true ); $select = get_post_meta( $this->ID, 'sp_select', true ); $nationalities = get_post_meta( $this->ID, 'sp_nationality', false ); $showdob = get_option( 'sportspress_player_show_birthday', 'no' ); $showage = get_option( 'sportspress_player_show_age', 'no' ); $this->date = $this->__get( 'date' ); if ( ! $this->date ) { $this->date = 0; } // Apply defaults if ( empty( $orderby ) ) { $orderby = 'number'; } if ( empty( $order ) ) { $order = 'ASC'; } if ( empty( $select ) ) { $select = 'auto'; } if ( 'range' == $this->date ) { $this->relative = get_post_meta( $this->ID, 'sp_date_relative', true ); if ( $this->relative ) { $this->past = get_post_meta( $this->ID, 'sp_date_past', true ); } else { $this->from = get_post_meta( $this->ID, 'sp_date_from', true ); $this->to = get_post_meta( $this->ID, 'sp_date_to', true ); } } $weekday = array( 0 => 'Sunday', 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', ); $start_of_week = get_option( 'start_of_week' ); $firstday = $weekday[ $start_of_week ]; if ( $start_of_week != 0 ) { $lastday = $weekday[ ( $start_of_week - 1 ) ]; } else { $lastday = $weekday[6]; } $today = date( 'l' ); // Get labels from performance variables $performance_labels = (array) sp_get_var_labels( 'sp_performance' ); // Get labels from outcome variables $outcome_labels = (array) sp_get_var_labels( 'sp_outcome' ); // Get labels from result variables $result_labels = (array) sp_get_var_labels( 'sp_result' ); // Get players automatically if set to auto if ( 'auto' == $select ) { $player_ids = array(); $args = array( 'post_type' => 'sp_player', 'numberposts' => -1, 'posts_per_page' => -1, 'meta_key' => 'sp_number', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'tax_query' => array( 'relation' => 'AND', ), 'meta_query' => array( 'relation' => 'AND', ), ); if ( $league_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ); endif; if ( $season_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season_ids, ); endif; $team_key = 'sp_team'; if ( $team ) : switch ( $era ) : case 'current': $team_key = 'sp_current_team'; break; case 'past': $team_key = 'sp_past_team'; break; endswitch; $args['meta_query'][] = array( array( 'key' => $team_key, 'value' => $team, ), ); endif; if ( $position_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_position', 'field' => 'term_id', 'terms' => $position_ids, ); endif; if ( $nationalities ) : $args['meta_query'][] = array( array( 'key' => 'sp_nationality', 'value' => $nationalities, 'compare' => 'IN', ), ); endif; $args = apply_filters( 'sportspress_player_list_args', $args, $team ); $players = (array) get_posts( $args ); $players = apply_filters( 'sportspress_player_list_players', $players, $args, $team, $team_key ); if ( $players && is_array( $players ) ) { foreach ( $players as $player ) { $player_ids[] = $player->ID; } } } else { $player_ids = (array) get_post_meta( $this->ID, 'sp_player', false ); } // Get all leagues populated with stats where available $tempdata = sp_array_combine( $player_ids, $list_stats ); // Create entry for each player in totals $totals = array(); $placeholders = array(); // Initialize columns $columns = array(); $args = array( 'post_type' => array( 'sp_performance', 'sp_metric', 'sp_statistic' ), 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_format', 'value' => 'number', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_format', 'value' => array( 'equation', 'text' ), 'compare' => 'NOT IN', ), ), ); $stats = get_posts( $args ); $formats = array(); $sendoffs = array(); $data = array(); $merged = array(); $column_order = array(); $ordered_columns = array(); if ( $stats ) : foreach ( $stats as $stat ) : // Get post meta $meta = get_post_meta( $stat->ID ); // Add equation to object if ( $stat->post_type == 'sp_metric' ) : $stat->equation = null; else : $stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, 0 ); endif; // Add precision to object $stat->precision = (int) sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ) + 0; // Add column icons to columns were is available if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' && ( $stat->post_type == 'sp_performance' || $stat->post_type == 'sp_statistic' ) ) { $icon = apply_filters( 'sportspress_event_performance_icons', '', $stat->ID, 1 ); if ( $icon != '' ) { $columns[ $stat->post_name ] = $icon; } else { if ( has_post_thumbnail( $stat ) ) { $icon = get_the_post_thumbnail( $stat, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $stat ) ) ); $columns[ $stat->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $stat->ID, 1 ); } else { $columns[ $stat->post_name ] = $stat->post_title; } } } else { $columns[ $stat->post_name ] = $stat->post_title; } // Add format $format = get_post_meta( $stat->ID, 'sp_format', true ); if ( '' === $format ) { $format = 'number'; } $formats[ $stat->post_name ] = $format; // Add sendoffs $sendoff = get_post_meta( $stat->ID, 'sp_sendoff', true ); if ( $sendoff ) { $sendoffs[] = $stat->post_name; } $column_order[] = $stat->post_name; endforeach; endif; foreach ( $column_order as $slug ) : if ( ! in_array( $slug, $this->columns ) ) { continue; } $ordered_columns[] = $slug; endforeach; $diff = array_diff( $this->columns, $ordered_columns ); $this->columns = array_merge( $diff, $ordered_columns ); foreach ( $player_ids as $player_id ) : if ( ! $player_id ) { continue; } // Initialize player totals $totals[ $player_id ] = array( 'eventsattended' => 0, 'eventsplayed' => 0, 'eventsstarted' => 0, 'eventssubbed' => 0, 'eventminutes' => 0, ); foreach ( $performance_labels as $key => $value ) : $totals[ $player_id ][ $key ] = 0; endforeach; foreach ( $outcome_labels as $key => $value ) : $totals[ $player_id ][ $key ] = 0; endforeach; foreach ( $result_labels as $key => $value ) : $totals[ $player_id ][ $key . 'for' ] = $totals[ $player_id ][ $key . 'against' ] = 0; endforeach; // Get metrics $metrics = (array) get_post_meta( $player_id, 'sp_metrics', true ); foreach ( $metrics as $key => $value ) : $adjustment = sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $key, null ); if ( $adjustment != null ) { $metrics[ $key ] += $adjustment; } endforeach; // Get static stats $static = get_post_meta( $player_id, 'sp_statistics', true ); // Get league and season arrays for static stats $static_league_ids = ( empty( $league_ids ) ? array( 0 ) : $league_ids ); $static_season_ids = ( empty( $season_ids ) ? array( 0 ) : $season_ids ); // Add static stats to placeholders if ( $static_league_ids && $static_season_ids ) : foreach ( $static_league_ids as $league_id ) : foreach ( $static_season_ids as $season_id ) : $player_league_season_stats = sp_array_value( sp_array_value( $static, $league_id, array() ), $season_id, array() ); if ( is_array( $player_league_season_stats ) ) : foreach ( $player_league_season_stats as $key => $value ) : $current_value = sp_array_value( sp_array_value( $placeholders, $player_id, array() ), $key, 0 ); $value = floatval( $value ); $placeholders[ $player_id ][ $key ] = $current_value + $value; endforeach; endif; endforeach; endforeach; else : $placeholders[ $player_id ] = sp_array_value( sp_array_value( $static, 0, array() ), 0, array() ); endif; // Add metrics to placeholders $placeholders[ $player_id ] = array_merge( $metrics, sp_array_value( $placeholders, $player_id, array() ) ); endforeach; $args = array( 'post_type' => 'sp_event', 'numberposts' => -1, 'posts_per_page' => -1, 'order' => 'DESC', 'meta_query' => array( array( 'key' => 'sp_format', 'value' => apply_filters( 'sportspress_competitive_event_formats', array( 'league' ) ), 'compare' => 'IN', ), ), 'tax_query' => array( 'relation' => 'AND', ), ); if ( $league_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ); endif; if ( $season_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season_ids, ); endif; $team_key = 'sp_team'; if ( $team ) : $args['meta_query'][] = array( array( 'key' => $team_key, 'value' => $team, 'compare' => 'IN', ), ); endif; if ( $this->date !== 0 ) : switch ( $this->date ) : case '-day': $date = new DateTime( date_i18n( 'Y-m-d' ) ); $date->modify( '-1 day' ); $args['year'] = $date->format( 'Y' ); $args['day'] = $date->format( 'j' ); $args['monthnum'] = $date->format( 'n' ); break; case 'day': $args['year'] = date_i18n( 'Y' ); $args['day'] = date_i18n( 'j' ); $args['monthnum'] = date_i18n( 'n' ); break; case '+day': $date = new DateTime( date_i18n( 'Y-m-d' ) ); $date->modify( '+1 day' ); $args['year'] = $date->format( 'Y' ); $args['day'] = $date->format( 'j' ); $args['monthnum'] = $date->format( 'n' ); break; case '-w': if ( $start_of_week != '1' ) { // If start of week is not Monday if ( $today == $firstday ) { // If today is start of Week $after = date_i18n( 'Y-m-d', strtotime( "last $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "last $lastday" ) ) . ' 23:59:59'; } else { $after = date_i18n( 'Y-m-d', strtotime( "-2 $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "last $lastday" ) ) . ' 23:59:59'; } $args['date_query'] = array( array( 'after' => $after, 'before' => $before, 'inclusive' => true, ), ); } else { $date = new DateTime( date_i18n( 'Y-m-d' ) ); $date->modify( '-1 week' ); $args['year'] = $date->format( 'Y' ); $args['w'] = $date->format( 'W' ); } break; case 'w': if ( $start_of_week != '1' ) { // If start of week is not Monday if ( $today == $firstday ) { // If today is start of Week $after = date_i18n( 'Y-m-d' ); $before = date_i18n( 'Y-m-d', strtotime( "next $lastday" ) ) . ' 23:59:59'; } elseif ( $today == $lastday ) { // If today is the end of Week $after = date_i18n( 'Y-m-d', strtotime( "last $firstday" ) ); $before = date_i18n( 'Y-m-d' ) . ' 23:59:59'; } else { $after = date_i18n( 'Y-m-d', strtotime( "last $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "next $lastday" ) ) . ' 23:59:59'; } $args['date_query'] = array( array( 'after' => $after, 'before' => $before, 'inclusive' => true, ), ); } else { $args['year'] = date_i18n( 'Y' ); $args['w'] = date_i18n( 'W' ); } break; case '+w': if ( $start_of_week != '1' ) { // If start of week is not Monday if ( $today == $lastday ) { // If today is the end of Week $after = date_i18n( 'Y-m-d', strtotime( "next $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "next $lastday" ) ) . ' 23:59:59'; } else { $after = date_i18n( 'Y-m-d', strtotime( "next $firstday" ) ); $before = date_i18n( 'Y-m-d', strtotime( "+2 $lastday" ) ) . ' 23:59:59'; } $args['date_query'] = array( array( 'after' => $after, 'before' => $before, 'inclusive' => true, ), ); } else { $date = new DateTime( date_i18n( 'Y-m-d' ) ); $date->modify( '+1 week' ); $args['year'] = $date->format( 'Y' ); $args['w'] = $date->format( 'W' ); } break; case 'range': if ( $this->relative ) : add_filter( 'posts_where', array( $this, 'relative' ) ); else : add_filter( 'posts_where', array( $this, 'range' ) ); endif; break; endswitch; endif; $args = apply_filters( 'sportspress_list_data_event_args', $args ); $events = get_posts( $args ); // Remove range filters remove_filter( 'posts_where', array( $this, 'range' ) ); remove_filter( 'posts_where', array( $this, 'relative' ) ); // Event loop foreach ( $events as $i => $event ) : $results = (array) get_post_meta( $event->ID, 'sp_results', true ); $team_performance = get_post_meta( $event->ID, 'sp_players', true ); $timeline = (array) get_post_meta( $event->ID, 'sp_timeline', true ); $minutes = get_post_meta( $event->ID, 'sp_minutes', true ); if ( $minutes === '' ) { $minutes = get_option( 'sportspress_event_minutes', 90 ); } // Add all team performance if ( is_array( $team_performance ) ) : foreach ( $team_performance as $team_id => $players ) : if ( $team && $team_id != $team ) { continue; } if ( is_array( $players ) ) : foreach ( $players as $player_id => $player_performance ) : if ( array_key_exists( $player_id, $totals ) && is_array( $totals[ $player_id ] ) ) : $player_performance = sp_array_value( $players, $player_id, array() ); foreach ( $player_performance as $key => $value ) : if ( 'outcome' == $key ) : // Increment events attended, played, and started $totals[ $player_id ]['eventsattended'] ++; $totals[ $player_id ]['eventsplayed'] ++; $totals[ $player_id ]['eventsstarted'] ++; $totals[ $player_id ]['eventminutes'] += $minutes; // Convert to array if ( ! is_array( $value ) ) : $value = array( $value ); endif; foreach ( $value as $outcome ) : if ( $outcome && $outcome != '-1' ) : // Increment events attended and outcome count if ( array_key_exists( $outcome, $totals[ $player_id ] ) ) : $totals[ $player_id ][ $outcome ] ++; endif; endif; endforeach; elseif ( array_key_exists( $key, $totals[ $player_id ] ) ) : $add = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key ); $totals[ $player_id ][ $key ] += $add; endif; endforeach; $team_results = sp_array_value( $results, $team_id, array() ); // Loop through home team foreach ( $team_results as $result_slug => $team_result ) : if ( 'outcome' == $result_slug ) : // Increment events attended $totals[ $player_id ]['eventsattended'] ++; // Continue with incrementing values if active in event if ( sp_array_value( $player_performance, 'status' ) != 'sub' || sp_array_value( $player_performance, 'sub', 0 ) ) : $totals[ $player_id ]['eventsplayed'] ++; // Initialize played minutes $played_minutes = $minutes; // Adjust for sendoffs and substitution time if ( sp_array_value( $player_performance, 'status' ) === 'sub' ) : // Substituted for another player $timeline_performance = sp_array_value( sp_array_value( $timeline, $team_id, array() ), $player_id, array() ); if ( empty( $timeline_performance ) ) { continue; } foreach ( $sendoffs as $sendoff_key ) : if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) { continue; } $sendoff_times = (array) sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), $sendoff_key, array() ); $sendoff_times = array_filter( $sendoff_times ); $sendoff_time = end( $sendoff_times ); if ( ! $sendoff_time ) { $sendoff_time = 0; } // Count minutes until being sent off $played_minutes = $sendoff_time; endforeach; // Subtract minutes prior to substitution $substitution_time = (int) sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), 'sub' ), 0, 0 ); $played_minutes = is_numeric($played_minutes) ? (int) $played_minutes : 0; $played_minutes -= $substitution_time; else : // Starting lineup with possible substitution $subbed_out = false; foreach ( $timeline as $timeline_team => $timeline_players ) : if ( ! is_array( $timeline_players ) ) { continue; } foreach ( $timeline_players as $timeline_player => $timeline_performance ) : if ( '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 ) ) : $substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 ); if ( $substitution_time ) : // Count minutes until substitution $played_minutes = $substitution_time; $subbed_out = true; endif; endif; endforeach; // No need to check for sendoffs if subbed out if ( $subbed_out ) { continue; } // Check for sendoffs $timeline_performance = sp_array_value( $timeline_players, $player_id, array() ); if ( empty( $timeline_performance ) ) { continue; } foreach ( $sendoffs as $sendoff_key ) : if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) { continue; } if ( ! sp_array_value( $player_performance, $sendoff_key, 0 ) ) { continue; } $sendoff_times = sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), $sendoff_key ); $sendoff_times = array_filter( $sendoff_times ); $sendoff_time = end( $sendoff_times ); if ( false === $sendoff_time ) { continue; } // Count minutes until being sent off $played_minutes = $sendoff_time; endforeach; endforeach; endif; // Make sure that is a number (i.e. convert 90+2' to 90') $played_minutes = (float) $played_minutes; $totals[ $player_id ]['eventminutes'] += max( 0, $played_minutes ); if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ) : $totals[ $player_id ]['eventsstarted'] ++; elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ) : $totals[ $player_id ]['eventssubbed'] ++; endif; $value = $team_result; // Convert to array if ( ! is_array( $value ) ) : $value = array( $value ); endif; foreach ( $value as $outcome ) : if ( $outcome && $outcome != '-1' ) : // Increment events attended and outcome count if ( array_key_exists( $outcome, $totals[ $player_id ] ) ) : $totals[ $player_id ][ $outcome ] ++; endif; endif; endforeach; endif; else : // Add to total $value = sp_array_value( $totals[ $player_id ], $result_slug . 'for', 0 ); $value += floatval( $team_result ); $totals[ $player_id ][ $result_slug . 'for' ] = $value; // Add subset $totals[ $player_id ][ $result_slug . 'for' . ( $i + 1 ) ] = $team_result; endif; endforeach; // Loop through away teams if ( sizeof( $results ) ) : foreach ( $results as $id => $team_results ) : if ( $team_id == $id ) { continue; } if ( is_array( $team_results ) ) : unset( $team_results['outcome'] ); foreach ( $team_results as $result_slug => $team_result ) : // Add to total $value = sp_array_value( $totals[ $player_id ], $result_slug . 'against', 0 ); $value += floatval( $team_result ); $totals[ $player_id ][ $result_slug . 'against' ] = $value; // Add subset $totals[ $player_id ][ $result_slug . 'against' . ( $i + 1 ) ] = $team_result; endforeach; endif; endforeach; endif; endif; endforeach; endif; endforeach; endif; $i++; endforeach; // Fill in empty placeholder values for each player foreach ( $player_ids as $player_id ) : if ( ! $player_id ) { continue; } // Sum manual stats with auto-calculated stats $auto_stats = sp_array_value( $totals, $player_id, array() ); $manual_stats = sp_array_value( $placeholders, $player_id, array() ); $combined = array(); // Get all unique keys from both arrays $all_keys = array_unique( array_merge( array_keys( $auto_stats ), array_keys( $manual_stats ) ) ); foreach ( $all_keys as $key ) { // Check if this key refers to an sp_metric. $post = get_page_by_path( $key, OBJECT, 'sp_metric' ); $is_metric = $post && $post->post_type === 'sp_metric'; if ( $is_metric ) { $manual_value = $manual_stats[ $key ]; $combined[ $key ] = $manual_value; } else { $auto_value = isset( $auto_stats[ $key ] ) ? floatval( $auto_stats[ $key ] ) : 0; $manual_value = isset( $manual_stats[ $key ] ) ? floatval( $manual_stats[ $key ] ) : 0; // Sum both values $combined[ $key ] = $auto_value + $manual_value; } } $placeholders[ $player_id ] = $combined; // Player adjustments $player_adjustments = sp_array_value( $adjustments, $player_id, array() ); foreach ( $stats as $stat ) : if ( $stat->equation === null ) : $placeholder = sp_array_value( $player_adjustments, $stat->post_name, null ); if ( $placeholder == null ) : $placeholder = '-'; endif; else : // Solve $placeholder = sp_solve( $stat->equation, $placeholders[ $player_id ], $stat->precision ); // Adjustment $adjustment = (float) sp_array_value( $player_adjustments, $stat->post_name, 0 ); // Apply adjustment if ( $adjustment != 0 ) : $placeholder += $adjustment; $placeholder = number_format( $placeholder, $stat->precision ? $stat->precision : 0, '.', '' ); endif; endif; if ( ! $stat->equation ) { if ( $placeholder !== '' && is_numeric( $placeholder ) ) : $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder; else : $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' ); endif; } if ( is_numeric( $placeholder ) && $stat->precision ) : $placeholder = number_format( $placeholder, $stat->precision, '.', '' ); endif; $placeholders[ $player_id ][ $stat->post_name ] = apply_filters( 'sportspress_player_performance_table_placeholder', $placeholder, $stat->post_name ); endforeach; endforeach; // Merge the data and placeholders arrays foreach ( $placeholders as $player_id => $player_data ) : if ( in_array( 'dob', $this->columns ) ) : $player_data['dob'] = get_the_date( get_option( 'date_format' ), $player_id ); endif; if ( in_array( 'age', $this->columns ) ) : $birthdayclass = new SportsPress_Birthdays(); $player_data['age'] = $birthdayclass->get_age( get_the_date( 'm-d-Y', $player_id ) ); endif; $player_data = array_merge( $column_order, $player_data ); $placeholders[ $player_id ] = $player_data; // Add player number and name to row $merged[ $player_id ] = array(); if ( in_array( 'number', $this->columns ) ) : $player_data['number'] = get_post_meta( $player_id, 'sp_number', true ); endif; $player_data['name'] = get_the_title( $player_id ); if ( in_array( 'team', $this->columns ) ) : $player_data['team'] = get_post_meta( $player_id, 'sp_team', true ); endif; if ( in_array( 'position', $this->columns ) ) : $player_data['position'] = null; endif; foreach ( $player_data as $key => $value ) : // Use static data if key exists and value is not empty, else use placeholder if ( array_key_exists( $player_id, $tempdata ) && array_key_exists( $key, $tempdata[ $player_id ] ) && $tempdata[ $player_id ][ $key ] != '' ) : $value = $tempdata[ $player_id ][ $key ]; endif; $merged[ $player_id ][ $key ] = $value; endforeach; endforeach; if ( $orderby != 'number' || $order != 'ASC' ) : $this->priorities = array( array( 'key' => $orderby, 'order' => $order, ), ); uasort( $merged, array( $this, 'sort' ) ); endif; // Rearrange data array to reflect values foreach ( $merged as $key => $value ) : if ( $crop && ! (float) sp_array_value( $value, $orderby, 0 ) ) { // Crop unset( $merged[ $key ] ); } else { // Add to main data array $data[ $key ] = $tempdata[ $key ]; } endforeach; if ( $admin ) : // Convert to time notation if ( in_array( 'time', $formats ) ) : foreach ( $placeholders as $player => $stats ) : if ( ! is_array( $stats ) ) { continue; } foreach ( $stats as $key => $value ) : // Continue if not time format if ( 'time' !== sp_array_value( $formats, $key ) ) { continue; } $intval = intval( $value ); $timeval = gmdate( 'i:s', $intval ); $hours = floor( $intval / 3600 ); if ( '00' != $hours ) { $timeval = $hours . ':' . $timeval; } $timeval = preg_replace( '/^0/', '', $timeval ); $placeholders[ $player ][ $key ] = $timeval; endforeach; endforeach; endif; $labels = array(); foreach ( $this->columns as $key ) : if ( $key == 'number' ) : $labels[ $key ] = '#'; elseif ( $key == 'team' ) : $labels[ $key ] = esc_attr__( 'Team', 'sportspress' ); elseif ( $key == 'position' ) : $labels[ $key ] = esc_attr__( 'Position', 'sportspress' ); elseif ( $key == 'dob' && $showdob ) : $labels[ $key ] = esc_attr__( 'Date of Birth', 'sportspress' ); elseif ( $key == 'age' && $showage ) : $labels[ $key ] = esc_attr__( 'Age', 'sportspress' ); elseif ( array_key_exists( $key, $columns ) ) : $labels[ $key ] = $columns[ $key ]; endif; endforeach; return array( $labels, $data, $placeholders, $merged, $orderby ); else : // Convert to time notation if ( in_array( 'time', $formats ) ) : foreach ( $merged as $player => $stats ) : if ( ! is_array( $stats ) ) { continue; } foreach ( $stats as $key => $value ) : // Continue if not time format if ( 'time' !== sp_array_value( $formats, $key ) ) { continue; } $intval = intval( $value ); $timeval = gmdate( 'i:s', $intval ); $hours = floor( $intval / 3600 ); if ( '00' != $hours ) { $timeval = $hours . ':' . $timeval; } $timeval = preg_replace( '/^0/', '', $timeval ); $merged[ $player ][ $key ] = $timeval; endforeach; endforeach; endif; if ( ! is_array( $this->columns ) ) { $this->columns = array(); } foreach ( $columns as $key => $label ) : if ( ! in_array( $key, $this->columns ) ) : unset( $columns[ $key ] ); endif; endforeach; $labels = array(); if ( in_array( 'number', $this->columns ) ) { $labels['number'] = '#'; } $labels['name'] = esc_attr__( 'Player', 'sportspress' ); if ( in_array( 'team', $this->columns ) ) { $labels['team'] = esc_attr__( 'Team', 'sportspress' ); } if ( in_array( 'position', $this->columns ) ) { $labels['position'] = esc_attr__( 'Position', 'sportspress' ); } if ( in_array( 'dob', $this->columns ) && $showdob ) { $labels['dob'] = esc_attr__( 'Date of Birth', 'sportspress' ); } if ( in_array( 'age', $this->columns ) && $showage ) { $labels['age'] = esc_attr__( 'Age', 'sportspress' ); } $merged[0] = array_merge( $labels, $columns ); return $merged; endif; } /** * Sort the table by priorities. * * @param array $a * @param array $b * @return int */ public function sort( $a, $b ) { // Loop through priorities if ( is_array( $this->priorities ) ) : foreach ( $this->priorities as $priority ) : // Proceed if columns are not equal if ( sp_array_value( $a, $priority['key'], 0 ) != sp_array_value( $b, $priority['key'], 0 ) ) : if ( $priority['key'] == 'name' ) : $output = strcmp( sp_array_value( $a, 'name', null ), sp_array_value( $b, 'name', null ) ); else : // Compare performance values $output = floatval( sp_array_value( $a, $priority['key'], 0 ) ) - floatval( sp_array_value( $b, $priority['key'], 0 ) ); endif; // Flip value if descending order if ( $priority['order'] == 'DESC' ) { $output = 0 - $output; } return ( $output > 0 ? 1 : -1 ); endif; endforeach; endif; // Default sort by number return floatval( sp_array_value( $a, 'number', 0 ) ) - floatval( sp_array_value( $b, 'number', 0 ) ); } } ================================================ FILE: includes/class-sp-player.php ================================================ get_terms_sorted_by_sp_order( 'sp_position' ); } /** * Returns leagues sorted by `sp_order`. * * @access public * @return array */ public function leagues() { return $this->get_terms_sorted_by_sp_order( 'sp_league' ); } /** * Returns seasons sorted by `sp_order`. * * @access public * @return array */ public function seasons() { return $this->get_terms_sorted_by_sp_order( 'sp_season' ); } /** * Returns current teams * * @access public * @return array */ public function current_teams() { return get_post_meta( $this->ID, 'sp_current_team', false ); } /** * Returns past teams * * @access public * @return array */ public function past_teams() { return get_post_meta( $this->ID, 'sp_past_team', false ); } /** * Returns nationalities * * @access public * @return array */ public function nationalities() { $nationalities = get_post_meta( $this->ID, 'sp_nationality', false ); if ( empty( $nationalities ) ) { return array(); } foreach ( $nationalities as $nationality ) : if ( 2 == strlen( $nationality ) ) : $legacy = SP()->countries->legacy; $nationality = strtolower( $nationality ); $nationality = sp_array_value( $legacy, $nationality, null ); endif; endforeach; return $nationalities; } /** * Returns formatted player metrics * * @access public * @return array */ public function metrics( $neg = null ) { $metrics = (array) get_post_meta( $this->ID, 'sp_metrics', true ); $metric_labels = (array) sp_get_var_labels( 'sp_metric', $neg, false ); $data = array(); foreach ( $metric_labels as $key => $value ) : $metric = sp_array_value( $metrics, $key, null ); if ( $metric == null ) { continue; } $data[ $value ] = sp_array_value( $metrics, $key, ' ' ); endforeach; return $data; } /** * Returns formatted data * * @access public * @param int $league_id * @param bool $admin * @return array */ public function data( $league_id, $admin = false, $section = -1 ) { $seasons = (array) $this->get_terms_sorted_by_sp_order( 'sp_season' ); $metrics = (array) get_post_meta( $this->ID, 'sp_metrics', true ); $stats = (array) get_post_meta( $this->ID, 'sp_statistics', true ); $leagues = (array) sp_array_value( (array) get_post_meta( $this->ID, 'sp_leagues', true ), $league_id ); uksort( $leagues, 'sp_sort_terms' ); $manual_columns = 'manual' == get_option( 'sportspress_player_columns', 'auto' ) ? true : false; $season_ids = array_filter( wp_list_pluck( $seasons, 'term_id' ) ); $season_order = array_flip( $season_ids ); foreach ( $season_order as $season_id => $val ) { $season_order[ $season_id ] = null; } $leagues = array_replace( $season_order, $leagues ); // Get performance labels $args = array( 'post_type' => array( 'sp_performance' ), 'numberposts' => 100, 'posts_per_page' => 100, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_format', 'value' => 'number', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_format', 'value' => array( 'equation', 'text' ), 'compare' => 'NOT IN', ), ), ); $posts = get_posts( $args ); if ( $manual_columns ) { $usecolumns = (array) get_post_meta( $this->ID, 'sp_columns', true ); $has_checkboxes = true; } else { $usecolumns = array(); if ( is_array( $posts ) ) { foreach ( $posts as $post ) { // Get visibility $visible = get_post_meta( $post->ID, 'sp_visible', true ); if ( '' === $visible || $visible ) { $usecolumns[] = $post->post_name; } } } $has_checkboxes = false; } $performance_labels = array(); $formats = array(); $sendoffs = array(); foreach ( $posts as $post ) : if ( -1 === $section ) { if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) { $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 ); if ( $icon != '' ) { $performance_labels[ $post->post_name ] = $icon; } else { if ( has_post_thumbnail( $post ) ) { $icon = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) ); $performance_labels[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 ); } else { $performance_labels[ $post->post_name ] = $post->post_title; } } } else { $performance_labels[ $post->post_name ] = $post->post_title; } } else { $post_section = get_post_meta( $post->ID, 'sp_section', true ); if ( '' === $post_section ) { $post_section = -1; } if ( $section == $post_section || -1 == $post_section ) { if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) { $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 ); if ( $icon != '' ) { $performance_labels[ $post->post_name ] = $icon; } else { if ( has_post_thumbnail( $post ) ) { $icon = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) ); $performance_labels[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 ); } else { $performance_labels[ $post->post_name ] = $post->post_title; } } } else { $performance_labels[ $post->post_name ] = $post->post_title; } } } $format = get_post_meta( $post->ID, 'sp_format', true ); if ( '' === $format ) { $format = 'number'; } $formats[ $post->post_name ] = $format; $sendoff = get_post_meta( $post->ID, 'sp_sendoff', true ); if ( $sendoff ) { $sendoffs[] = $post->post_name; } endforeach; // Get statistic labels $args = array( 'post_type' => array( 'sp_statistic' ), 'numberposts' => 100, 'posts_per_page' => 100, 'orderby' => 'menu_order', 'order' => 'ASC', ); $posts = get_posts( $args ); if ( $manual_columns ) { $usecolumns = array_merge( $usecolumns, (array) get_post_meta( $this->ID, 'sp_columns', true ) ); $usecolumns = array_filter( $usecolumns ); } else { if ( is_array( $posts ) ) { foreach ( $posts as $post ) { // Get visibility $visible = get_post_meta( $post->ID, 'sp_visible', true ); if ( '' === $visible || $visible ) { $usecolumns[] = $post->post_name; } } } } // Get labels from outcome variables $outcome_labels = (array) sp_get_var_labels( 'sp_outcome' ); // Get labels from result variables $result_labels = (array) sp_get_var_labels( 'sp_result' ); // Generate array of all season ids and season names $div_ids = array(); $season_names = array(); foreach ( $seasons as $season ) : if ( is_object( $season ) && property_exists( $season, 'term_id' ) && property_exists( $season, 'name' ) ) : $div_ids[] = $season->term_id; $season_names[ $season->term_id ] = $season->name; endif; endforeach; $div_ids[] = 0; $season_names[0] = esc_attr__( 'Total', 'sportspress' ); $data = array(); $league_stats = sp_array_value( $stats, $league_id, array() ); $div_ids = apply_filters( 'sportspress_player_data_season_ids', $div_ids, $league_stats ); // Get all seasons populated with data where available $data = sp_array_combine( $div_ids, $league_stats, true ); // Get equations from statistic variables $equations = sp_get_var_equations( 'sp_statistic' ); // Initialize placeholders array $placeholders = array(); foreach ( $div_ids as $div_id ) : $totals = array( 'eventsattended' => 0, 'eventsplayed' => 0, 'eventsstarted' => 0, 'eventssubbed' => 0, 'eventminutes' => 0, 'streak' => 0, 'last5' => null, 'last10' => null, ); foreach ( $performance_labels as $key => $value ) : $totals[ $key ] = 0; endforeach; foreach ( $outcome_labels as $key => $value ) : $totals[ $key ] = 0; endforeach; foreach ( $result_labels as $key => $value ) : $totals[ $key . 'for' ] = $totals[ $key . 'against' ] = 0; endforeach; // Initialize streaks counter $streak = array( 'name' => '', 'count' => 0, 'fire' => 1, ); // Initialize last counters $last5 = array(); $last10 = array(); // Add outcome types to last counters foreach ( $outcome_labels as $key => $value ) : $last5[ $key ] = 0; $last10[ $key ] = 0; endforeach; // Get all events involving the player in current season $args = array( 'post_type' => 'sp_event', 'numberposts' => -1, 'posts_per_page' => -1, 'order' => 'DESC', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'sp_player', 'value' => $this->ID, ), array( 'key' => 'sp_format', 'value' => apply_filters( 'sportspress_competitive_event_formats', array( 'league' ) ), 'compare' => 'IN', ), ), 'tax_query' => array( 'relation' => 'AND', ), ); if ( -1 !== $section ) : $args['meta_query'][] = array( 'key' => ( 1 === $section ? 'sp_defense' : 'sp_offense' ), 'value' => $this->ID, ); endif; if ( $league_id ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_id, ); endif; if ( $div_id ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $div_id, ); endif; // Check if there is a selected team and return the team id or return a -1 value. $selected_team = sp_array_value( $leagues, $div_id, '-1' ); $args = apply_filters( 'sportspress_player_data_event_args', $args, $data, $div_id, $selected_team ); $events = get_posts( $args ); // Event loop foreach ( $events as $i => $event ) : $results = (array) get_post_meta( $event->ID, 'sp_results', true ); $team_performance = (array) get_post_meta( $event->ID, 'sp_players', true ); $timeline = (array) get_post_meta( $event->ID, 'sp_timeline', true ); $minutes = get_post_meta( $event->ID, 'sp_minutes', true ); if ( $minutes === '' ) { $minutes = get_option( 'sportspress_event_minutes', 90 ); } // Add all team performance foreach ( $team_performance as $team_id => $players ) : if ( is_array( $players ) && array_key_exists( $this->ID, $players ) ) : $player_performance = sp_array_value( $players, $this->ID, array() ); foreach ( $player_performance as $key => $value ) : if ( array_key_exists( $key, $totals ) ) : $add = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key ); $totals[ $key ] += $add; endif; endforeach; $team_results = sp_array_value( $results, $team_id, array() ); unset( $results[ $team_id ] ); // Loop through home team foreach ( $team_results as $result_slug => $team_result ) : if ( 'outcome' == $result_slug ) : // Increment events attended $totals['eventsattended'] ++; // Continue with incrementing values if active in event if ( sp_array_value( $player_performance, 'status' ) != 'sub' || sp_array_value( $player_performance, 'sub', 0 ) ) : $totals['eventsplayed'] ++; $played_minutes = $minutes; // Adjust for substitution time if ( sp_array_value( $player_performance, 'status' ) === 'sub' ) : // Substituted for another player $timeline_performance = sp_array_value( sp_array_value( $timeline, $team_id, array() ), $this->ID, array() ); if ( empty( $timeline_performance ) ) { continue; } foreach ( $sendoffs as $sendoff_key ) : if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) { continue; } $sendoff_times = sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), $sendoff_key ); $sendoff_times = array_filter( $sendoff_times ); $sendoff_time = end( $sendoff_times ); if ( ! $sendoff_time ) { $sendoff_time = 0; } // Count minutes until being sent off $played_minutes = $sendoff_time; endforeach; // Subtract minutes prior to substitution $substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), 'sub' ), 0, 0 ); $played_minutes -= (int) $substitution_time; else : // Starting lineup with possible substitution $subbed_out = false; foreach ( $timeline as $timeline_team => $timeline_players ) : if ( ! is_array( $timeline_players ) ) { continue; } foreach ( $timeline_players as $timeline_player => $timeline_performance ) : if ( '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 ) ) : $substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 ); if ( $substitution_time ) : // Count minutes until substitution $played_minutes = $substitution_time; $subbed_out = true; endif; endif; endforeach; // No need to check for sendoffs if subbed out if ( $subbed_out ) { continue; } // Check for sendoffs $timeline_performance = sp_array_value( $timeline_players, $this->ID, array() ); if ( empty( $timeline_performance ) ) { continue; } foreach ( $sendoffs as $sendoff_key ) : if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) { continue; } $sendoff_times = (array) sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), $sendoff_key, array() ); $sendoff_times = array_filter( $sendoff_times ); $sendoff_time = end( $sendoff_times ); if ( false === $sendoff_time ) { continue; } // Count minutes until being sent off $played_minutes = $sendoff_time; endforeach; endforeach; endif; // Make sure that is a number (i.e. convert 90+2' to 90') $played_minutes = (float) $played_minutes; $totals['eventminutes'] += max( 0, $played_minutes ); if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ) : $totals['eventsstarted'] ++; elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ) : $totals['eventssubbed'] ++; endif; $value = $team_result; // Convert to array if ( ! is_array( $value ) ) : $value = array( $value ); endif; foreach ( $value as $outcome ) : if ( $outcome && $outcome != '-1' ) : // Increment outcome count if ( array_key_exists( $outcome, $totals ) ) : $totals[ $outcome ] ++; endif; // Add to streak counter if ( $streak['fire'] && ( $streak['name'] == '' || $streak['name'] == $outcome ) ) : $streak['name'] = $outcome; $streak['count'] ++; else : $streak['fire'] = 0; endif; // Add to last 5 counter if sum is less than 5 if ( array_key_exists( $outcome, $last5 ) && array_sum( $last5 ) < 5 ) : $last5[ $outcome ] ++; endif; // Add to last 10 counter if sum is less than 10 if ( array_key_exists( $outcome, $last10 ) && array_sum( $last10 ) < 10 ) : $last10[ $outcome ] ++; endif; endif; endforeach; endif; else : // Add to total $value = sp_array_value( $totals, $result_slug . 'for', 0 ); $value += floatval( $team_result ); $totals[ $result_slug . 'for' ] = $value; // Add subset $totals[ $result_slug . 'for' . ( $i + 1 ) ] = $team_result; endif; endforeach; // Loop through away teams if ( sizeof( $results ) ) : foreach ( $results as $team_results ) : if ( is_array( $team_results ) ) : unset( $team_results['outcome'] ); foreach ( $team_results as $result_slug => $team_result ) : // Add to total $value = sp_array_value( $totals, $result_slug . 'against', 0 ); $value += floatval( $team_result ); $totals[ $result_slug . 'against' ] = $value; // Add subset $totals[ $result_slug . 'against' . ( $i + 1 ) ] = $team_result; endforeach; endif; endforeach; endif; endif; endforeach; $i++; endforeach; // Compile streaks counter and add to totals $args = array( 'name' => $streak['name'], 'post_type' => 'sp_outcome', 'post_status' => 'publish', 'posts_per_page' => 1, ); $outcomes = get_posts( $args ); if ( $outcomes ) : $outcome = reset( $outcomes ); $abbreviation = sp_get_abbreviation( $outcome->ID ); if ( empty( $abbreviation ) ) { $abbreviation = sp_strtoupper( sp_substr( $outcome->post_title, 0, 1 ) ); } $totals['streak'] = $abbreviation . $streak['count']; endif; // Add last counters to totals $totals['last5'] = $last5; $totals['last10'] = $last10; // Add metrics to totals $totals = array_merge( $metrics, $totals ); // Generate array of placeholder values for each league $placeholders[ $div_id ] = array(); foreach ( $equations as $key => $value ) : $placeholders[ $div_id ][ $key ] = sp_solve( $value['equation'], $totals, $value['precision'] ); endforeach; foreach ( $performance_labels as $key => $label ) : $placeholders[ $div_id ][ $key ] = apply_filters( 'sportspress_player_performance_table_placeholder', sp_array_value( $totals, $key, 0 ), $key ); endforeach; endforeach; // Get labels by section $args = array( 'post_type' => 'sp_statistic', 'numberposts' => 100, 'posts_per_page' => 100, 'orderby' => 'menu_order', 'order' => 'ASC', ); $posts = get_posts( $args ); $stats = array(); foreach ( $posts as $post ) : if ( -1 === $section ) { if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) { $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 ); if ( $icon != '' ) { $stats[ $post->post_name ] = $icon; } else { if ( has_post_thumbnail( $post ) ) { $icon = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) ); $stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 ); } else { $stats[ $post->post_name ] = $post->post_title; } } } else { $stats[ $post->post_name ] = $post->post_title; } } else { $post_section = get_post_meta( $post->ID, 'sp_section', true ); if ( '' === $post_section ) { $post_section = -1; } if ( $admin ) { if ( 1 == $section ) { if ( 1 == $post_section ) { if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) { $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 ); if ( $icon != '' ) { $stats[ $post->post_name ] = $icon; } else { if ( has_post_thumbnail( $post ) ) { $icon = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) ); $stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 ); } else { $stats[ $post->post_name ] = $post->post_title; } } } else { $stats[ $post->post_name ] = $post->post_title; } } } else { if ( 1 != $post_section ) { if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) { $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 ); if ( $icon != '' ) { $stats[ $post->post_name ] = $icon; } else { if ( has_post_thumbnail( $post ) ) { $icon = get_the_post_thumbnail( $post, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post ) ) ); $stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 ); } else { $stats[ $post->post_name ] = $post->post_title; } } } else { $stats[ $post->post_name ] = $post->post_title; } } } } elseif ( $section == $post_section || -1 == $post_section ) { if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) { $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 ); if ( $icon != '' ) { $stats[ $post->post_name ] = $icon; } else { $stats[ $post->post_name ] = $post->post_title; } } else { $stats[ $post->post_name ] = $post->post_title; } } } endforeach; // Merge the data and placeholders arrays $merged = array(); foreach ( $placeholders as $season_id => $season_data ) : $team_id = sp_array_value( $leagues, $season_id, -1 ); if ( -1 == $team_id ) { continue; } $season_name = sp_array_value( $season_names, (int) $season_id, ' ' ); if ( $team_id ) : $team_name = sp_team_short_name( $team_id ); if ( get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false ) : $team_permalink = get_permalink( $team_id ); $team_name = '' . $team_name . ''; endif; else : $team_name = esc_attr__( 'Total', 'sportspress' ); endif; // Add season name to row $merged[ $season_id ] = array( 'name' => $season_name, 'team' => $team_name, ); foreach ( $season_data as $key => $value ) : // Use static data if key exists and value is not empty, else use placeholder if ( array_key_exists( $season_id, $data ) && array_key_exists( $key, $data[ $season_id ] ) && $data[ $season_id ][ $key ] != '' ) : $value = $data[ $season_id ][ $key ]; endif; $merged[ $season_id ][ $key ] = $value; endforeach; endforeach; $columns = array_merge( $performance_labels, $stats ); $formats = array(); $total_types = array(); $args = array( 'post_type' => array( 'sp_performance', 'sp_statistic' ), 'numberposts' => 100, 'posts_per_page' => 100, 'orderby' => 'menu_order', 'order' => 'ASC', ); $posts = get_posts( $args ); if ( $posts ) { $column_order = array(); $usecolumn_order = array(); foreach ( $posts as $post ) { if ( array_key_exists( $post->post_name, $columns ) ) { $column_order[ $post->post_name ] = $columns[ $post->post_name ]; } if ( in_array( $post->post_name, $usecolumns ) ) { $usecolumn_order[] = $post->post_name; } $format = get_post_meta( $post->ID, 'sp_format', true ); if ( '' === $format ) { $format = 'number'; } $formats[ $post->post_name ] = $format; $total_type = get_post_meta( $post->ID, 'sp_type', true ); if ( '' === $total_type ) { $total_type = 'total'; } $total_types[ $post->post_name ] = $total_type; } $columns = array_merge( $column_order, $columns ); $usecolumns = array_merge( $usecolumn_order, $usecolumns ); } // Calculate total statistics $career = array( 'name' => esc_attr__( 'Total', 'sportspress' ), 'team' => '-', ); // Add values from all seasons for total-based statistics foreach ( $merged as $season => $stats ) : if ( ! is_array( $stats ) ) { continue; } foreach ( $stats as $key => $value ) : if ( in_array( $key, array( 'name', 'team' ) ) ) { continue; } $value = floatval( $value ); $add = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key ); $career[ $key ] = sp_array_value( $career, $key, 0 ) + $add; endforeach; endforeach; // Calculate average-based statistics from performance foreach ( $posts as $post ) { $type = get_post_meta( $post->ID, 'sp_type', 'total' ); if ( 'average' !== $type ) { continue; } $value = sp_array_value( $equations, $post->post_name, null ); if ( null === $value || ! isset( $value['equation'] ) ) { continue; } $precision = sp_array_value( $value, 'precision', 0 ); $career[ $post->post_name ] = sp_solve( $value['equation'], $totals, $precision ); } // Filter career total placeholders $career = apply_filters( 'sportspress_player_performance_table_placeholders', $career ); // Get manually entered career totals $manual_career = sp_array_value( $data, 0, array() ); $manual_career = array_filter( $manual_career, 'sp_filter_non_empty' ); // Add career totals to merged array $merged[-1] = array_merge( $career, $manual_career ); if ( $admin ) : $labels = array(); if ( is_array( $usecolumns ) ) : foreach ( $usecolumns as $key ) : if ( $key == 'team' ) : $labels[ $key ] = esc_attr__( 'Team', 'sportspress' ); elseif ( array_key_exists( $key, $columns ) ) : $labels[ $key ] = $columns[ $key ]; endif; endforeach; endif; $placeholders[0] = $merged[-1]; return array( $labels, $data, $placeholders, $merged, $leagues, $has_checkboxes, $formats, $total_types ); else : if ( is_array( $usecolumns ) ) : foreach ( $columns as $key => $label ) : if ( ! in_array( $key, $usecolumns ) ) : unset( $columns[ $key ] ); endif; endforeach; endif; $labels = array(); $labels['name'] = esc_attr__( 'Season', 'sportspress' ); $labels['team'] = esc_attr__( 'Team', 'sportspress' ); if ( 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) { unset( $merged[-1] ); } // Convert to time notation if ( in_array( 'time', $formats ) ) : foreach ( $merged as $season => $season_performance ) : foreach ( $season_performance as $performance_key => $performance_value ) : // Continue if not time format if ( 'time' !== sp_array_value( $formats, $performance_key ) ) { continue; } $merged[ $season ][ $performance_key ] = sp_time_value( $performance_value ); endforeach; endforeach; endif; $merged[0] = array_merge( $labels, $columns ); return $merged; endif; } /** * Returns formatted data for all leagues * * @access public * @param int $league_id * @param bool $admin * @return array */ public function statistics() { $terms = get_the_terms( $this->ID, 'sp_league' ); $statistics = array(); if ( is_array( $terms ) ) { foreach ( $terms as $term ) { $statistics[ $term->term_id ] = $this->data( $term->term_id ); } } return $statistics; } } ================================================ FILE: includes/class-sp-post-types.php ================================================ esc_attr__( 'Leagues', 'sportspress' ), 'singular_name' => esc_attr__( 'League', 'sportspress' ), 'all_items' => esc_attr__( 'All', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit League', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'update_item' => esc_attr__( 'Update', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New', 'sportspress' ), 'new_item_name' => esc_attr__( 'Name', 'sportspress' ), 'parent_item' => esc_attr__( 'Parent', 'sportspress' ), 'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), ); $args = apply_filters( 'sportspress_register_taxonomy_league', array( 'label' => esc_attr__( 'Leagues', 'sportspress' ), 'labels' => $labels, 'public' => true, 'show_ui' => $show, 'show_in_menu' => $show, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'hierarchical' => true, 'rewrite' => array( 'slug' => get_option( 'sportspress_league_slug', 'league' ) ), 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Terms_Controller', 'rest_base' => 'leagues', ) ); $object_types = apply_filters( 'sportspress_league_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ); register_taxonomy( 'sp_league', $object_types, $args ); foreach ( $object_types as $object_type ) : register_taxonomy_for_object_type( 'sp_league', $object_type ); endforeach; endif; if ( apply_filters( 'sportspress_has_seasons', true ) ) : $labels = array( 'name' => esc_attr__( 'Seasons', 'sportspress' ), 'singular_name' => esc_attr__( 'Season', 'sportspress' ), 'all_items' => esc_attr__( 'All', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Season', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'update_item' => esc_attr__( 'Update', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New', 'sportspress' ), 'new_item_name' => esc_attr__( 'Name', 'sportspress' ), 'parent_item' => esc_attr__( 'Parent', 'sportspress' ), 'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), ); $args = apply_filters( 'sportspress_register_taxonomy_season', array( 'label' => esc_attr__( 'Seasons', 'sportspress' ), 'labels' => $labels, 'public' => true, 'show_ui' => $show, 'show_in_menu' => $show, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'hierarchical' => true, 'rewrite' => array( 'slug' => get_option( 'sportspress_season_slug', 'season' ) ), 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Terms_Controller', 'rest_base' => 'seasons', ) ); $object_types = apply_filters( 'sportspress_season_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ); register_taxonomy( 'sp_season', $object_types, $args ); foreach ( $object_types as $object_type ) : register_taxonomy_for_object_type( 'sp_season', $object_type ); endforeach; endif; if ( apply_filters( 'sportspress_has_venues', true ) ) : $labels = array( 'name' => esc_attr__( 'Venues', 'sportspress' ), 'singular_name' => esc_attr__( 'Venue', 'sportspress' ), 'all_items' => esc_attr__( 'All', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Venue', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'update_item' => esc_attr__( 'Update', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New', 'sportspress' ), 'new_item_name' => esc_attr__( 'Name', 'sportspress' ), 'parent_item' => esc_attr__( 'Parent', 'sportspress' ), 'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), ); $args = apply_filters( 'sportspress_register_taxonomy_venue', array( 'label' => esc_attr__( 'Venues', 'sportspress' ), 'labels' => $labels, 'public' => true, 'show_ui' => $show, 'show_in_menu' => $show, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'hierarchical' => true, 'rewrite' => array( 'slug' => get_option( 'sportspress_venue_slug', 'venue' ) ), 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Terms_Controller', 'rest_base' => 'venues', ) ); $object_types = apply_filters( 'sportspress_event_object_types', array( 'sp_event', 'sp_calendar', 'sp_team' ) ); register_taxonomy( 'sp_venue', $object_types, $args ); foreach ( $object_types as $object_type ) : register_taxonomy_for_object_type( 'sp_venue', $object_type ); endforeach; endif; if ( apply_filters( 'sportspress_has_positions', true ) ) : $labels = array( 'name' => esc_attr__( 'Positions', 'sportspress' ), 'singular_name' => esc_attr__( 'Position', 'sportspress' ), 'all_items' => esc_attr__( 'All', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Position', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'update_item' => esc_attr__( 'Update', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New', 'sportspress' ), 'new_item_name' => esc_attr__( 'Name', 'sportspress' ), 'parent_item' => esc_attr__( 'Parent', 'sportspress' ), 'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), ); $args = apply_filters( 'sportspress_register_taxonomy_position', array( 'label' => esc_attr__( 'Positions', 'sportspress' ), 'labels' => $labels, 'public' => true, 'show_ui' => $show, 'show_in_menu' => $show, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'hierarchical' => true, 'rewrite' => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ), 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Terms_Controller', 'rest_base' => 'positions', ) ); $object_types = apply_filters( 'sportspress_position_object_types', array( 'sp_player', 'sp_list' ) ); register_taxonomy( 'sp_position', $object_types, $args ); foreach ( $object_types as $object_type ) : register_taxonomy_for_object_type( 'sp_position', $object_type ); endforeach; endif; if ( apply_filters( 'sportspress_has_roles', true ) ) : $labels = array( 'name' => esc_attr__( 'Jobs', 'sportspress' ), 'singular_name' => esc_attr__( 'Job', 'sportspress' ), 'all_items' => esc_attr__( 'All', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Job', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'update_item' => esc_attr__( 'Update', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New', 'sportspress' ), 'new_item_name' => esc_attr__( 'Name', 'sportspress' ), 'parent_item' => esc_attr__( 'Parent', 'sportspress' ), 'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), ); $args = apply_filters( 'sportspress_register_taxonomy_role', array( 'label' => esc_attr__( 'Jobs', 'sportspress' ), 'labels' => $labels, 'public' => true, 'show_ui' => $show, 'show_in_menu' => $show, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'hierarchical' => true, 'rewrite' => array( 'slug' => get_option( 'sportspress_role_slug', 'role' ) ), 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Terms_Controller', 'rest_base' => 'roles', ) ); $object_types = apply_filters( 'sportspress_role_object_types', array( 'sp_staff' ) ); register_taxonomy( 'sp_role', $object_types, $args ); foreach ( $object_types as $object_type ) : register_taxonomy_for_object_type( 'sp_role', $object_type ); endforeach; endif; do_action( 'sportspress_after_register_taxonomy' ); } /** * Register core post types */ public static function register_post_types() { do_action( 'sportspress_register_post_type' ); register_post_type( 'sp_result', apply_filters( 'sportspress_register_post_type_result', array( 'labels' => array( 'name' => esc_attr__( 'Event Results', 'sportspress' ), 'singular_name' => esc_attr__( 'Result', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Result', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Result', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => false, 'show_ui' => true, 'capability_type' => 'sp_config', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'supports' => array( 'title', 'page-attributes', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => false, 'can_export' => false, 'show_in_menu' => false, ) ) ); register_post_type( 'sp_outcome', apply_filters( 'sportspress_register_post_type_outcome', array( 'labels' => array( 'name' => esc_attr__( 'Event Outcomes', 'sportspress' ), 'singular_name' => esc_attr__( 'Outcome', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Outcome', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Outcome', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => false, 'show_ui' => true, 'capability_type' => 'sp_config', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'supports' => array( 'title', 'page-attributes', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => false, 'can_export' => false, 'show_in_menu' => false, ) ) ); register_post_type( 'sp_column', apply_filters( 'sportspress_register_post_type_column', array( 'labels' => array( 'name' => esc_attr__( 'Table Columns', 'sportspress' ), 'singular_name' => esc_attr__( 'Column', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Column', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Column', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => false, 'show_ui' => true, 'capability_type' => 'sp_config', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'supports' => array( 'title', 'page-attributes', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => false, 'can_export' => false, 'show_in_menu' => false, ) ) ); register_post_type( 'sp_metric', apply_filters( 'sportspress_register_post_type_metric', array( 'labels' => array( 'name' => esc_attr__( 'Player Metrics', 'sportspress' ), 'singular_name' => esc_attr__( 'Metric', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Metric', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Metric', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => false, 'show_ui' => true, 'capability_type' => 'sp_config', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'supports' => array( 'title', 'page-attributes', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => false, 'can_export' => false, 'show_in_menu' => false, ) ) ); register_post_type( 'sp_performance', apply_filters( 'sportspress_register_post_type_performance', array( 'labels' => array( 'name' => esc_attr__( 'Player Performance', 'sportspress' ), 'menu_name' => esc_attr__( 'Performance', 'sportspress' ), 'singular_name' => esc_attr__( 'Player Performance', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Performance', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Performance', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), 'featured_image' => esc_attr__( 'Icon', 'sportspress' ), 'set_featured_image' => esc_attr__( 'Select Icon', 'sportspress' ), 'remove_featured_image' => esc_attr__( 'Remove icon', 'sportspress' ), 'use_featured_image' => esc_attr__( 'Add icon', 'sportspress' ), ), 'public' => false, 'show_ui' => true, 'capability_type' => 'sp_config', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'supports' => array( 'title', 'thumbnail', 'page-attributes', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => false, 'can_export' => false, 'show_in_menu' => false, ) ) ); register_post_type( 'sp_statistic', apply_filters( 'sportspress_register_post_type_statistic', array( 'labels' => array( 'name' => esc_attr__( 'Player Statistics', 'sportspress' ), 'menu_name' => esc_attr__( 'Statistics', 'sportspress' ), 'singular_name' => esc_attr__( 'Statistic', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Statistic', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Statistic', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), 'featured_image' => esc_attr__( 'Icon', 'sportspress' ), 'set_featured_image' => esc_attr__( 'Select Icon', 'sportspress' ), 'remove_featured_image' => esc_attr__( 'Remove icon', 'sportspress' ), 'use_featured_image' => esc_attr__( 'Add icon', 'sportspress' ), ), 'public' => false, 'show_ui' => true, 'capability_type' => 'sp_config', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'supports' => array( 'title', 'thumbnail', 'page-attributes', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => false, 'can_export' => false, 'show_in_menu' => false, ) ) ); $args = array( 'labels' => array( 'name' => esc_attr__( 'Events', 'sportspress' ), 'singular_name' => esc_attr__( 'Event', 'sportspress' ), 'add_new' => esc_attr__( 'Add New Event', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Event', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Event', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View Event', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => true, 'show_ui' => true, 'capability_type' => 'sp_event', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array( 'slug' => get_option( 'sportspress_event_slug', 'event' ) ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => true, 'menu_icon' => 'dashicons-calendar', 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Posts_Controller', 'rest_base' => 'events', ); if ( get_option( 'sportspress_event_comment_status', 'no' ) == 'yes' ) : $args['supports'][] = 'comments'; endif; register_post_type( 'sp_event', apply_filters( 'sportspress_register_post_type_event', $args ) ); $args = array( 'labels' => array( 'name' => esc_attr__( 'Teams', 'sportspress' ), 'singular_name' => esc_attr__( 'Team', 'sportspress' ), 'add_new' => esc_attr__( 'Add New Team', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Team', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Team', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View Team', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), 'featured_image' => esc_attr__( 'Logo', 'sportspress' ), 'set_featured_image' => esc_attr__( 'Select Logo', 'sportspress' ), 'remove_featured_image' => esc_attr__( 'Remove Logo', 'sportspress' ), 'use_featured_image' => esc_attr__( 'Select Logo', 'sportspress' ), ), 'public' => true, 'show_ui' => true, 'capability_type' => 'sp_team', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => true, 'rewrite' => array( 'slug' => get_option( 'sportspress_team_slug', 'team' ) ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => true, 'menu_icon' => 'dashicons-shield-alt', 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Posts_Controller', 'rest_base' => 'teams', ); if ( get_option( 'sportspress_team_comment_status', 'no' ) == 'yes' ) : $args['supports'][] = 'comments'; endif; register_post_type( 'sp_team', apply_filters( 'sportspress_register_post_type_team', $args ) ); register_post_type( 'sp_player', apply_filters( 'sportspress_register_post_type_player', array( 'labels' => array( 'name' => esc_attr__( 'Players', 'sportspress' ), 'singular_name' => esc_attr__( 'Player', 'sportspress' ), 'add_new' => esc_attr__( 'Add New Player', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Player', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Player', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View Player', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), 'featured_image' => esc_attr__( 'Photo', 'sportspress' ), 'set_featured_image' => esc_attr__( 'Select Photo', 'sportspress' ), 'remove_featured_image' => esc_attr__( 'Remove Photo', 'sportspress' ), 'use_featured_image' => esc_attr__( 'Select Photo', 'sportspress' ), ), 'public' => true, 'show_ui' => true, 'capability_type' => 'sp_player', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array( 'slug' => get_option( 'sportspress_player_slug', 'player' ) ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'page-attributes' ), 'has_archive' => false, 'show_in_nav_menus' => true, 'menu_icon' => 'dashicons-groups', 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Posts_Controller', 'rest_base' => 'players', ) ) ); register_post_type( 'sp_staff', apply_filters( 'sportspress_register_post_type_staff', array( 'labels' => array( 'name' => esc_attr__( 'Staff', 'sportspress' ), 'singular_name' => esc_attr__( 'Staff', 'sportspress' ), 'add_new' => esc_attr__( 'Add New Staff', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Staff', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Staff', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View Staff', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), 'featured_image' => esc_attr__( 'Photo', 'sportspress' ), 'set_featured_image' => esc_attr__( 'Select Photo', 'sportspress' ), 'remove_featured_image' => esc_attr__( 'Remove Photo', 'sportspress' ), 'use_featured_image' => esc_attr__( 'Select Photo', 'sportspress' ), ), 'public' => true, 'show_ui' => true, 'capability_type' => 'sp_staff', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array( 'slug' => get_option( 'sportspress_staff_slug', 'staff' ) ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => true, 'menu_icon' => 'dashicons-businessman', 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Posts_Controller', 'rest_base' => 'staff', ) ) ); do_action( 'sportspress_after_register_post_type' ); } public function delete_config_post( $post_id ) { $post_type = get_post_type( $post_id ); if ( is_sp_config_type( $post_type ) ) { wp_delete_post( $post_id, true ); } } public function display_scheduled_events( $post_status, $post ) { if ($post->post_type == 'sp_event' && $post_status == 'future') { return "publish"; } return $post_status; } } new SP_Post_types(); ================================================ FILE: includes/class-sp-shortcodes.php ================================================ __CLASS__ . '::event_results', 'event_details' => __CLASS__ . '::event_details', 'event_performance' => __CLASS__ . '::event_performance', 'event_venue' => __CLASS__ . '::event_venue', 'event_officials' => __CLASS__ . '::event_officials', 'event_teams' => __CLASS__ . '::event_teams', 'event_full' => __CLASS__ . '::event_full', 'countdown' => __CLASS__ . '::countdown', 'player_details' => __CLASS__ . '::player_details', 'player_statistics' => __CLASS__ . '::player_statistics', 'staff' => __CLASS__ . '::staff', 'staff_profile' => __CLASS__ . '::staff_profile', 'event_calendar' => __CLASS__ . '::event_calendar', 'event_list' => __CLASS__ . '::event_list', 'event_blocks' => __CLASS__ . '::event_blocks', 'league_table' => __CLASS__ . '::league_table', 'team_standings' => __CLASS__ . '::league_table', 'team_gallery' => __CLASS__ . '::team_gallery', 'player_list' => __CLASS__ . '::player_list', 'player_gallery' => __CLASS__ . '::player_gallery', ); foreach ( $shortcodes as $shortcode => $function ) { add_shortcode( $shortcode, $function ); } } /** * Shortcode Wrapper * * @param mixed $function * @param array $atts (default: array()) * @return string */ public static function shortcode_wrapper( $function, $atts = array(), $wrapper = array( 'class' => 'sportspress', 'before' => null, 'after' => null, ) ) { $wrapper = apply_filters( 'sportspress_shortcode_wrapper', $wrapper, $function, $atts ); ob_start(); $before = empty( $wrapper['before'] ) ? '
    ' : $wrapper['before']; $after = empty( $wrapper['after'] ) ? '
    ' : $wrapper['after']; echo wp_kses_post( $before ); call_user_func( $function, $atts ); echo wp_kses_post( $after ); return ob_get_clean(); } /** * Event results shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_results( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Results', 'output' ), $atts ); } /** * Event details shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_details( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Details', 'output' ), $atts ); } /** * Event performance shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_performance( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Performance', 'output' ), $atts ); } /** * Event venue shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_venue( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Venue', 'output' ), $atts ); } /** * Event officials shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_officials( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Officials', 'output' ), $atts ); } /** * Event teams shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_teams( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Teams', 'output' ), $atts ); } /** * Event full info shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_full( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Full', 'output' ), $atts ); } /** * Countdown shortcode. * * @access public * @param mixed $atts * @return string */ public static function countdown( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Countdown', 'output' ), $atts ); } /** * Event calendar shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_calendar( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Calendar', 'output' ), $atts ); } /** * Event list shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_list( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_List', 'output' ), $atts ); } /** * Event blocks shortcode. * * @access public * @param mixed $atts * @return string */ public static function event_blocks( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Event_Blocks', 'output' ), $atts ); } /** * League table (team standings) shortcode. * * @access public * @param mixed $atts * @return string */ public static function league_table( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_League_Table', 'output' ), $atts ); } /** * Team gallery shortcode. * * @access public * @param mixed $atts * @return string */ public static function team_gallery( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Team_Gallery', 'output' ), $atts ); } /** * Player details shortcode. * * @access public * @param mixed $atts * @return string */ public static function player_details( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Player_Details', 'output' ), $atts ); } /** * Player statistics shortcode. * * @access public * @param mixed $atts * @return string */ public static function player_statistics( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Player_Statistics', 'output' ), $atts ); } /** * Player performance shortcode. * * @access public * @param mixed $atts * @return string */ public static function player_performance( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Player_Performance', 'output' ), $atts ); } /** * Player list shortcode. * * @access public * @param mixed $atts * @return string */ public static function player_list( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Player_List', 'output' ), $atts ); } /** * Player gallery shortcode. * * @access public * @param mixed $atts * @return string */ public static function player_gallery( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Player_Gallery', 'output' ), $atts ); } /** * Staff shortcode. * * @access public * @param mixed $atts * @return string */ public static function staff( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Staff', 'output' ), $atts ); } /** * Staff profile shortcode. * * @access public * @param mixed $atts * @return string */ public static function staff_profile( $atts ) { return self::shortcode_wrapper( array( 'SP_Shortcode_Staff_Profile', 'output' ), $atts ); } } ================================================ FILE: includes/class-sp-staff.php ================================================ ID, 'sp_current_team', false ); } /** * Returns past teams * * @access public * @return array */ public function past_teams() { return get_post_meta( $this->ID, 'sp_past_team', false ); } /** * Returns nationalities * * @access public * @return array */ public function nationalities() { return get_post_meta( $this->ID, 'sp_nationality', false ); } /** * Returns role * * @access public * @return array */ public function role() { $roles = $this->get_roles(); if ( $roles && ! is_wp_error( $roles ) ) : return array_shift( $roles ); else : return false; endif; } /** * Returns roles * * @access public * @return array */ public function roles() { $roles = $this->get_roles(); if ( $roles && ! is_wp_error( $roles ) ) : return (array) $roles; else : return array(); endif; } public function get_roles() { $roles = get_the_terms( $this->ID, 'sp_role' ); if ( ! is_array( $roles ) || ! sizeof( $roles ) ) { return array(); } $include = wp_list_pluck( $roles, 'term_id' ); return get_terms( array( 'taxonomy' => 'sp_role', 'hide_empty' => false, 'orderby' => 'meta_value_num', 'include' => $include, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_order', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_order', 'compare' => 'EXISTS', ), ), ) ); } } ================================================ FILE: includes/class-sp-team.php ================================================ 'sp_event', 'numberposts' => 1, 'posts_per_page' => 1, 'order' => 'DESC', 'post_status' => 'future', 'meta_query' => array( array( 'key' => 'sp_team', 'value' => $this->ID, ), ), ); $events = get_posts( $args ); if ( count( $events ) ) { return array_shift( $events ); } return false; } /** * Returns formatted data * * @access public * @param bool $admin * @return array */ public function columns( $league_id ) { $seasons = (array) get_the_terms( $this->ID, 'sp_season' ); $columns = (array) get_post_meta( $this->ID, 'sp_columns', true ); // Get labels from result variables $result_labels = (array) sp_get_var_labels( 'sp_result' ); // Get labels from outcome variables $outcome_labels = (array) sp_get_var_labels( 'sp_outcome' ); // Generate array of all season ids and season names $div_ids = array(); $season_names = array(); foreach ( $seasons as $season ) : if ( is_object( $season ) && property_exists( $season, 'term_id' ) && property_exists( $season, 'name' ) ) : $div_ids[] = $season->term_id; $season_names[ $season->term_id ] = $season->name; endif; endforeach; $div_ids[] = 0; $season_names[0] = esc_attr__( 'Total', 'sportspress' ); $data = array(); // Get all seasons populated with data where available $data = sp_array_combine( $div_ids, sp_array_value( $columns, $league_id, array() ) ); // Get equations from column variables $equations = sp_get_var_equations( 'sp_column' ); // Initialize placeholders array $placeholders = array(); foreach ( $div_ids as $div_id ) : $totals = array( 'eventsplayed' => 0, 'eventsplayed_home' => 0, 'eventsplayed_away' => 0, 'eventsplayed_venue' => 0, 'eventminutes' => 0, 'eventminutes_home' => 0, 'eventminutes_away' => 0, 'eventminutes_venue' => 0, 'streak' => 0, 'streak_home' => 0, 'streak_away' => 0, 'streak_venue' => 0, 'last5' => null, 'last10' => null, 'homerecord' => null, 'awayrecord' => null, ); foreach ( $result_labels as $key => $value ) : $totals[ $key . 'for' ] = 0; $totals[ $key . 'for_home' ] = 0; $totals[ $key . 'for_away' ] = 0; $totals[ $key . 'for_venue' ] = 0; $totals[ $key . 'against' ] = 0; $totals[ $key . 'against_home' ] = 0; $totals[ $key . 'against_away' ] = 0; $totals[ $key . 'against_venue' ] = 0; endforeach; foreach ( $outcome_labels as $key => $value ) : $totals[ $key ] = 0; $totals[ $key . '_home' ] = 0; $totals[ $key . '_away' ] = 0; $totals[ $key . '_venue' ] = 0; endforeach; // Initialize streaks counter $streak = array( 'name' => '', 'count' => 0, 'fire' => 1, ); // Initialize last counters $last5 = array(); $last10 = array(); // Initialize record counters $homerecord = array(); $awayrecord = array(); // Add outcome types to last and record counters foreach ( $outcome_labels as $key => $value ) : $last5[ $key ] = 0; $last10[ $key ] = 0; $homerecord[ $key ] = 0; $awayrecord[ $key ] = 0; endforeach; // Get all events involving the team in current season $args = array( 'post_type' => 'sp_event', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'post_date', 'order' => 'DESC', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'sp_team', 'value' => $this->ID, ), array( 'key' => 'sp_format', 'value' => apply_filters( 'sportspress_competitive_event_formats', array( 'league' ) ), 'compare' => 'IN', ), ), 'tax_query' => array( 'relation' => 'AND', ), ); if ( $league_id ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_id, ); endif; if ( $div_id ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $div_id, ); endif; $args = apply_filters( 'sportspress_team_data_event_args', $args ); $events = get_posts( $args ); $e = 0; foreach ( $events as $event ) : $results = (array) get_post_meta( $event->ID, 'sp_results', true ); $minutes = get_post_meta( $event->ID, 'sp_minutes', true ); if ( $minutes === '' ) { $minutes = get_option( 'sportspress_event_minutes', 90 ); } $i = 0; foreach ( $results as $team_id => $team_result ) : if ( is_array( $team_result ) ) : foreach ( $team_result as $key => $value ) : if ( $team_id == $this->ID ) : if ( $key == 'outcome' ) : // Convert to array if ( ! is_array( $value ) ) : $value = array( $value ); endif; foreach ( $value as $outcome ) : // Increment events played and outcome count if ( array_key_exists( $outcome, $totals ) ) : $totals['eventsplayed'] ++; $totals['eventminutes'] += $minutes; $totals[ $outcome ] ++; // Add to home or away stats if ( 0 === $i ) : $totals['eventsplayed_home'] ++; $totals['eventminutes_home'] += $minutes; $totals[ $outcome . '_home' ] ++; else : $totals['eventsplayed_away'] ++; $totals['eventminutes_away'] += $minutes; $totals[ $outcome . '_away' ] ++; endif; // Add to venue stats if ( sp_is_home_venue( $team_id, $event->ID ) ) : $totals['eventsplayed_venue'] ++; $totals['eventminutes_venue'] += $minutes; $totals[ $outcome . '_venue' ] ++; endif; endif; if ( $outcome && $outcome != '-1' ) : // Add to streak counter if ( $streak['fire'] && ( $streak['name'] == '' || $streak['name'] == $outcome ) ) : $streak['name'] = $outcome; $streak['count'] ++; else : $streak['fire'] = 0; endif; // Add to last 5 counter if sum is less than 5 if ( array_key_exists( $outcome, $last5 ) && array_sum( $last5 ) < 5 ) : $last5[ $outcome ] ++; endif; // Add to last 10 counter if sum is less than 10 if ( array_key_exists( $outcome, $last10 ) && array_sum( $last10 ) < 10 ) : $last10[ $outcome ] ++; endif; // Add to home or away record if ( 0 === $i ) { if ( array_key_exists( $outcome, $homerecord ) ) { $homerecord[ $outcome ] ++; } } else { if ( array_key_exists( $outcome, $awayrecord ) ) { $awayrecord[ $outcome ] ++; } } endif; endforeach; else : $value = floatval( $value ); if ( array_key_exists( $key . 'for', $totals ) ) : $totals[ $key . 'for' ] += $value; $totals[ $key . 'for' . ( $e + 1 ) ] = $value; // Add to home or away stats if ( 0 === $i ) : $totals[ $key . 'for_home' ] += $value; else : $totals[ $key . 'for_away' ] += $value; endif; // Add to venue stats if ( sp_is_home_venue( $team_id, $event->ID ) ) : $totals[ $key . 'for_venue' ] += $value; endif; endif; endif; else : if ( $key != 'outcome' ) : $value = floatval( $value ); if ( array_key_exists( $key . 'against', $totals ) ) : $totals[ $key . 'against' ] += $value; $totals[ $key . 'against' . ( $e + 1 ) ] = $value; // Add to home or away stats if ( 0 === $i ) : $totals[ $key . 'against_home' ] += $value; else : $totals[ $key . 'against_away' ] += $value; endif; // Add to venue stats if ( sp_is_home_venue( $team_id, $event->ID ) ) : $totals[ $key . 'against_venue' ] += $value; endif; endif; endif; endif; endforeach; endif; $i++; endforeach; $e++; endforeach; // Compile streaks counter and add to totals $args = array( 'name' => $streak['name'], 'post_type' => 'sp_outcome', 'post_status' => 'publish', 'posts_per_page' => 1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $outcomes = get_posts( $args ); if ( $outcomes ) : $outcome = reset( $outcomes ); $abbreviation = get_post_meta( $outcome->ID, 'sp_abbreviation', true ); if ( ! $abbreviation ) { $abbreviation = sp_substr( $outcome->post_title, 0, 1 ); } $totals['streak'] = $abbreviation . $streak['count']; endif; // Add last and record counters to totals $totals['last5'] = $last5; $totals['last10'] = $last10; $totals['homerecord'] = $homerecord; $totals['awayrecord'] = $awayrecord; // Generate array of placeholder values for each league $placeholders[ $div_id ] = array(); foreach ( $equations as $key => $value ) : if ( '$gamesback' == $value['equation'] ) { $placeholders[ $div_id ][ $key ] = esc_attr__( '(Auto)', 'sportspress' ); } else { $placeholders[ $div_id ][ $key ] = sp_solve( $value['equation'], $totals, $value['precision'] ); } endforeach; endforeach; // Get columns from column variables $columns = sp_get_var_labels( 'sp_column' ); return array( $columns, $data, $placeholders ); } /** * Returns staff members * * @access public * @return array */ public function staff( $admin = false ) { if ( ! $this->ID ) { return null; } $args = array( 'post_type' => 'sp_staff', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_key' => 'sp_team', 'meta_value' => $this->ID, ); $members = get_posts( $args ); $checked = (array) get_post_meta( $this->ID, 'sp_staff' ); if ( $admin ) : return array( $members, $checked ); else : foreach ( $members as $key => $member ) : if ( ! in_array( $member->ID, $checked ) ) : unset( $members[ $key ] ); endif; endforeach; return $members; endif; } /** * Returns player lists * * @access public * @return array */ public function lists( $admin = false ) { if ( ! $this->ID ) { return null; } $args = array( 'post_type' => 'sp_list', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_team', 'value' => $this->ID, ), array( 'key' => 'sp_team', 'value' => '0', ), ), ); $lists = get_posts( $args ); $checked = (array) get_post_meta( $this->ID, 'sp_list' ); if ( $admin ) : return array( $lists, $checked ); else : foreach ( $lists as $key => $list ) : if ( ! in_array( $list->ID, $checked ) ) : unset( $lists[ $key ] ); endif; endforeach; return $lists; endif; } /** * Returns league tables * * @access public * @return array */ public function tables( $admin = false ) { if ( ! $this->ID ) { return null; } $league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' ); $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' ); $args = array( 'post_type' => 'sp_table', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'sp_select', 'value' => 'manual', ), array( 'key' => 'sp_team', 'value' => $this->ID, ), ), ); $tables_by_id = get_posts( $args ); $args = array( 'post_type' => 'sp_table', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'sp_select', 'value' => 'auto', ), ), 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ), array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season_ids, ), ), ); $tables_by_terms = get_posts( $args ); $tables = array_merge( $tables_by_terms, $tables_by_id ); $checked = (array) get_post_meta( $this->ID, 'sp_table' ); if ( $admin ) : return array( $tables, $checked ); else : foreach ( $tables as $key => $table ) : if ( ! in_array( $table->ID, $checked ) ) : unset( $tables[ $key ] ); endif; endforeach; return $tables; endif; } } ================================================ FILE: includes/class-sp-template-loader.php ================================================ ' . $caption . '' . $content; } $content = '
    ' . $content . '
    '; } // Get layout setting $layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() ); // Get templates $templates = SP()->templates->$type; // Combine layout setting with available templates $templates = array_merge( array_flip( $layout ), $templates ); $templates = apply_filters( 'sportspress_' . $type . '_templates', $templates ); // Split templates into sections and tabs $slice = array_search( 'tabs', array_keys( $templates ) ); if ( $slice ) { $section_templates = array_slice( $templates, 0, $slice ); $tab_templates = array_slice( $templates, $slice ); } else { $section_templates = $templates; $tab_templates = array(); } ob_start(); // Before template hook do_action( 'sportspress_before_single_' . $type ); // Loop through sections if ( ! empty( $section_templates ) ) { foreach ( $section_templates as $key => $template ) { // Ignore templates that are unavailable or that have been turned off if ( ! is_array( $template ) ) { continue; } if ( ! isset( $template['option'] ) ) { continue; } if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) { continue; } // Render the template echo '
    '; if ( 'content' === $key ) { echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped // Template content hook do_action( 'sportspress_single_' . $type . '_content' ); } else { call_user_func( $template['action'] ); } echo '
    '; } } // After template hook do_action( 'sportspress_after_single_' . $type ); $ob = ob_get_clean(); $tabs = ''; if ( ! empty( $tab_templates ) ) { $i = 0; $tab_content = ''; foreach ( $tab_templates as $key => $template ) { // Ignore templates that are unavailable or that have been turned off if ( ! is_array( $template ) ) { continue; } if ( ! isset( $template['option'] ) ) { continue; } if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) { continue; } // Put tab content into buffer ob_start(); if ( 'content' === $key ) { echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { call_user_func( $template['action'] ); } $buffer = ob_get_clean(); // Trim whitespace from buffer $buffer = trim( $buffer ); // Continue if tab content is empty if ( empty( $buffer ) ) { continue; } // Get template label $label = sp_array_value( $template, 'label', $template['title'] ); // Add to tabs $tabs .= '
  • ' . apply_filters( 'gettext', $label, $label, 'sportspress' ) . '
  • '; // Render the template $tab_content .= '
    ' . $buffer . '
    '; $i++; } $ob .= '
    '; if ( ! empty( $tabs ) ) { $ob .= '
      ' . $tabs . '
    '; } $ob .= $tab_content; $ob .= '
    '; } return $ob; } public function event_content( $content ) { if ( is_singular( 'sp_event' ) ) { $status = sp_get_status( get_the_ID() ); if ( 'results' == $status ) { $caption = esc_attr__( 'Recap', 'sportspress' ); } else { $caption = esc_attr__( 'Preview', 'sportspress' ); } $content = self::add_content( $content, 'event', apply_filters( 'sportspress_event_content_priority', 10 ), $caption ); } return $content; } public function calendar_content( $content ) { if ( is_singular( 'sp_calendar' ) ) { $content = self::add_content( $content, 'calendar', apply_filters( 'sportspress_calendar_content_priority', 10 ) ); } return $content; } public function team_content( $content ) { if ( is_singular( 'sp_team' ) ) { $content = self::add_content( $content, 'team', apply_filters( 'sportspress_team_content_priority', 10 ) ); } return $content; } public function table_content( $content ) { if ( is_singular( 'sp_table' ) ) { $content = self::add_content( $content, 'table', apply_filters( 'sportspress_table_content_priority', 10 ) ); } return $content; } public function player_content( $content ) { if ( is_singular( 'sp_player' ) ) { $content = self::add_content( $content, 'player', apply_filters( 'sportspress_player_content_priority', 10 ) ); } return $content; } public function list_content( $content ) { if ( is_singular( 'sp_list' ) ) { $content = self::add_content( $content, 'list', apply_filters( 'sportspress_list_content_priority', 10 ) ); } return $content; } public function staff_content( $content ) { if ( is_singular( 'sp_staff' ) ) { $content = self::add_content( $content, 'staff', apply_filters( 'sportspress_staff_content_priority', 10 ) ); } return $content; } /** * Load a template. * * Handles template usage so that we can use our own templates instead of the themes. * * Templates are in the 'templates' folder. sportspress looks for theme * overrides in /theme/sportspress/ by default * * For beginners, it also looks for a sportspress.php template last. If the user adds * this to the theme (containing a sportspress() inside) this will be used as a * fallback for all sportspress templates. * * @param mixed $template * @return string */ public function template_loader( $template ) { $find = array(); $file = ''; if ( is_single() ) : $post_type = get_post_type(); if ( is_sp_post_type( $post_type ) ) : $file = 'single-' . str_replace( 'sp_', '', $post_type ) . '.php'; $find[] = $file; $find[] = SP_TEMPLATE_PATH . $file; endif; elseif ( is_tax() ) : $term = get_queried_object(); switch ( $term->taxonomy ) : case 'sp_venue': $file = 'taxonomy-venue.php'; $find[] = 'taxonomy-venue-' . $term->slug . '.php'; $find[] = SP_TEMPLATE_PATH . 'taxonomy-venue-' . $term->slug . '.php'; $find[] = $file; $find[] = SP_TEMPLATE_PATH . $file; endswitch; endif; $find[] = 'sportspress.php'; if ( $file ) : $located = locate_template( $find ); if ( $located ) : $template = $located; endif; endif; return $template; } } new SP_Template_Loader(); ================================================ FILE: includes/class-sp-templates.php ================================================ data = array( 'event' => array_merge( apply_filters( 'sportspress_before_event_template', array( 'logos' => array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'option' => 'sportspress_event_show_logos', 'action' => 'sportspress_output_event_logos', 'default' => 'yes', ), 'excerpt' => array( 'title' => esc_attr__( 'Excerpt', 'sportspress' ), 'option' => 'sportspress_event_show_excerpt', 'action' => 'sportspress_output_post_excerpt', 'default' => 'yes', ), ) ), array( 'content' => array( 'title' => esc_attr__( 'Article', 'sportspress' ), 'option' => 'sportspress_event_show_content', 'action' => 'sportspress_output_event_content', 'default' => 'yes', ), ), apply_filters( 'sportspress_after_event_template', array( 'video' => array( 'title' => esc_attr__( 'Video', 'sportspress' ), 'option' => 'sportspress_event_show_video', 'action' => 'sportspress_output_event_video', 'default' => 'yes', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'option' => 'sportspress_event_show_details', 'action' => 'sportspress_output_event_details', 'default' => 'yes', ), 'venue' => array( 'title' => esc_attr__( 'Venue', 'sportspress' ), 'option' => 'sportspress_event_show_venue', 'action' => 'sportspress_output_event_venue', 'default' => 'yes', ), 'results' => array( 'title' => esc_attr__( 'Results', 'sportspress' ), 'option' => 'sportspress_event_show_results', 'action' => 'sportspress_output_event_results', 'default' => 'yes', ), 'performance' => array( 'title' => esc_attr__( 'Box Score', 'sportspress' ), 'option' => 'sportspress_event_show_performance', 'action' => 'sportspress_output_event_performance', 'default' => 'yes', ), ) ) ), 'calendar' => array_merge( apply_filters( 'sportspress_before_calendar_template', array() ), array( 'content' => array( 'title' => esc_attr__( 'Description', 'sportspress' ), 'option' => 'sportspress_calendar_show_content', 'action' => 'sportspress_output_calendar_content', 'default' => 'yes', ), ), apply_filters( 'sportspress_after_calendar_template', array( 'data' => array( 'title' => esc_attr__( 'Calendar', 'sportspress' ), 'option' => 'sportspress_calendar_show_data', 'action' => 'sportspress_output_calendar', 'default' => 'yes', ), ) ) ), 'team' => array_merge( apply_filters( 'sportspress_before_team_template', array( 'logo' => array( 'title' => esc_attr__( 'Logo', 'sportspress' ), 'option' => 'sportspress_team_show_logo', 'action' => 'sportspress_output_team_logo', 'default' => 'yes', ), 'excerpt' => array( 'title' => esc_attr__( 'Excerpt', 'sportspress' ), 'option' => 'sportspress_team_show_excerpt', 'action' => 'sportspress_output_post_excerpt', 'default' => 'yes', ), ) ), array( 'content' => array( 'title' => esc_attr__( 'Profile', 'sportspress' ), 'option' => 'sportspress_team_show_content', 'action' => 'sportspress_output_team_content', 'default' => 'yes', ), ), apply_filters( 'sportspress_after_team_template', array( 'link' => array( 'title' => esc_attr__( 'Visit Site', 'sportspress' ), 'label' => esc_attr__( 'Link', 'sportspress' ), 'option' => 'sportspress_team_show_link', 'action' => 'sportspress_output_team_link', 'default' => 'no', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'option' => 'sportspress_team_show_details', 'action' => 'sportspress_output_team_details', 'default' => 'no', ), 'staff' => array( 'title' => esc_attr__( 'Staff', 'sportspress' ), 'option' => 'sportspress_team_show_staff', 'action' => 'sportspress_output_team_staff', 'default' => 'yes', ), ) ) ), 'table' => array_merge( apply_filters( 'sportspress_before_table_template', array() ), array( 'content' => array( 'title' => esc_attr__( 'Description', 'sportspress' ), 'option' => 'sportspress_table_show_content', 'action' => 'sportspress_output_table_content', 'default' => 'yes', ), ), apply_filters( 'sportspress_after_table_template', array( 'data' => array( 'title' => esc_attr__( 'League Table', 'sportspress' ), 'option' => 'sportspress_table_show_data', 'action' => 'sportspress_output_league_table', 'default' => 'yes', ), ) ) ), 'player' => array_merge( apply_filters( 'sportspress_before_player_template', array( 'selector' => array( 'title' => esc_attr__( 'Dropdown', 'sportspress' ), 'label' => esc_attr__( 'Players', 'sportspress' ), 'option' => 'sportspress_player_show_selector', 'action' => 'sportspress_output_player_selector', 'default' => 'yes', ), 'photo' => array( 'title' => esc_attr__( 'Photo', 'sportspress' ), 'option' => 'sportspress_player_show_photo', 'action' => 'sportspress_output_player_photo', 'default' => 'yes', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'option' => 'sportspress_player_show_details', 'action' => 'sportspress_output_player_details', 'default' => 'yes', ), 'excerpt' => array( 'title' => esc_attr__( 'Excerpt', 'sportspress' ), 'option' => 'sportspress_player_show_excerpt', 'action' => 'sportspress_output_post_excerpt', 'default' => 'yes', ), ) ), array( 'content' => array( 'title' => esc_attr__( 'Profile', 'sportspress' ), 'option' => 'sportspress_player_show_content', 'action' => 'sportspress_output_player_content', 'default' => 'yes', ), ), apply_filters( 'sportspress_after_player_template', array( 'statistics' => array( 'title' => esc_attr__( 'Statistics', 'sportspress' ), 'option' => 'sportspress_player_show_statistics', 'action' => 'sportspress_output_player_statistics', 'default' => 'yes', ), ) ) ), 'list' => array_merge( apply_filters( 'sportspress_before_list_template', array() ), array( 'content' => array( 'title' => esc_attr__( 'Description', 'sportspress' ), 'option' => 'sportspress_list_show_content', 'action' => 'sportspress_output_list_content', 'default' => 'yes', ), ), apply_filters( 'sportspress_after_list_template', array( 'data' => array( 'title' => esc_attr__( 'Player List', 'sportspress' ), 'option' => 'sportspress_list_show_data', 'action' => 'sportspress_output_player_list', 'default' => 'yes', ), ) ) ), 'staff' => array_merge( apply_filters( 'sportspress_before_staff_template', array( 'selector' => array( 'title' => esc_attr__( 'Dropdown', 'sportspress' ), 'label' => esc_attr__( 'Staff', 'sportspress' ), 'option' => 'sportspress_staff_show_selector', 'action' => 'sportspress_output_staff_selector', 'default' => 'yes', ), 'photo' => array( 'title' => esc_attr__( 'Photo', 'sportspress' ), 'option' => 'sportspress_staff_show_photo', 'action' => 'sportspress_output_staff_photo', 'default' => 'yes', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'option' => 'sportspress_staff_show_details', 'action' => 'sportspress_output_staff_details', 'default' => 'yes', ), 'excerpt' => array( 'title' => esc_attr__( 'Excerpt', 'sportspress' ), 'option' => 'sportspress_staff_show_excerpt', 'action' => 'sportspress_output_post_excerpt', 'default' => 'yes', ), ) ), array( 'content' => array( 'title' => esc_attr__( 'Profile', 'sportspress' ), 'option' => 'sportspress_staff_show_content', 'action' => 'sportspress_output_staff_content', 'default' => 'yes', ), ), apply_filters( 'sportspress_after_staff_template', array() ) ), ); } public function __get( $key ) { return ( array_key_exists( $key, $this->data ) ? $this->data[ $key ] : array() ); } public function __set( $key, $value ) { $this->data[ $key ] = $value; } } ================================================ FILE: includes/class-sp-wpml.php ================================================ init(); add_filter( 'the_title', array( $this, 'the_title' ), 5, 2 ); add_filter( 'post_type_link', array( $this, 'post_type_link' ), 5, 3 ); add_filter( 'icl_ls_languages', array( $this, 'ls' ) ); } public function init() { if ( function_exists( 'icl_get_languages' ) ) { $this->languages = icl_get_languages(); } } public static function the_title( $title, $id = null ) { if ( self::can_localize( $id, $id ) ) : // Get translated post ID $translated_id = icl_object_id( $id, 'any', false, ICL_LANGUAGE_CODE ); if ( $translated_id ) : $post = get_post( $translated_id ); if ( $post ) { $title = $post->post_title; } endif; endif; return $title; } public static function post_type_link( $url, $post = null, $leavename = false, $sample = false ) { if ( self::can_localize( $post ) ) : if ( ! $post ) { global $post; } // Get post ID $id = $post->ID; // Get translated post ID $translated_id = icl_object_id( $id, 'any', false, ICL_LANGUAGE_CODE ); if ( $translated_id && $translated_id != $id && get_the_ID() != $translated_id ) : return get_post_permalink( $translated_id, $leavename, $sample ); endif; endif; return $url; } public function ls( $languages ) { if ( ! function_exists( 'icl_object_id' ) || ! is_singular( 'sp_event' ) ) { return $languages; } // Get post ID $id = get_the_ID(); if ( get_post_status( $id ) != 'future' ) { return $languages; } $active_languages = array(); foreach ( $this->languages as $k => $v ) : global $wpdb; // Get language code $code = sp_array_value( $v, 'code' ); // Get URL $translated_id = icl_object_id( $id, 'any', false, $code ); if ( ! $translated_id ) { continue; } $url = get_post_permalink( $translated_id, false, true ); // Get native name; $native_name = sp_array_value( $v, 'native_name' ); // Get encode URL $encode_url = $wpdb->get_var( $wpdb->prepare( "SELECT encode_url FROM {$wpdb->prefix}icl_languages WHERE code=%s", $code ) ); // Get flag $flag = $wpdb->get_row( "SELECT flag, from_template FROM {$wpdb->prefix}icl_flags WHERE lang_code='{$code}'" ); if ( $flag->from_template ) { $wp_upload_dir = wp_upload_dir(); $flag_url = $wp_upload_dir['baseurl'] . '/flags/' . $flag->flag; } else { $flag_url = ICL_PLUGIN_URL . '/res/flags/' . $flag->flag; } // Add language $active_languages[ $k ] = array_merge( $v, array( 'language_code' => $code, 'active' => ICL_LANGUAGE_CODE == $code ? '1' : 0, 'translated_name' => $native_name, 'encode_url' => $encode_url, 'country_flag_url' => $flag_url, 'url' => $url, ) ); endforeach; // Add if translations exist if ( sizeof( $active_languages ) > 1 ) { $languages = array_merge( $languages, $active_languages ); } return $languages; } public static function can_localize( $post, $id = null ) { return function_exists( 'icl_object_id' ) && is_sp_post_type( get_post_type( $post ) ); } } endif; return new SP_WPML(); ================================================ FILE: includes/libraries/class-eqeos.php ================================================ * Licensed under LGPL 2.1 License */ /** * Equation Operating System Classes. * * This class was created for the safe parsing of mathematical equations * in PHP. There is a need for a way to successfully parse equations * in PHP that do NOT require the use of `eval`. `eval` at its core * opens the system using it to so many security vulnerabilities it is oft * suggested /never/ to use it, and for good reason. This class set will * successfully take an equation, parse it, and provide solutions to the * developer. It is a safe way to evaluate expressions without putting * the system at risk. * * Modified as per https://github.com/jlawrence11/eos/issues/2 * * 2013/04 UPDATE: * - Moved to native class functions for PHP5 * - Removed deprecated `eregi` calls to `preg_match` * - Updated to PHPDoc comment syntax * - Added Exception throwing instead of silent exits * - Added additional variable prefix of '$', '&' is still allowed as well * - Fixed small implied multiplication problem * * TODO: * - Add factorial support. (ie 5! = 120) * * @author Jon Lawrence * @copyright Copyright ©2005-2013, Jon Lawrence * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License * @package EOS * @version 2.0 */ // The following are defines for thrown exceptions /** * No matching Open/Close pair */ define( 'EQEOS_E_NO_SET', 5500 ); /** * Division by 0 */ define( 'EQEOS_E_DIV_ZERO', 5501 ); /** * No Equation */ define( 'EQEOS_E_NO_EQ', 5502 ); /** * No variable replacement available */ define( 'EQEOS_E_NO_VAR', 5503 ); if ( ! defined( 'DEBUG' ) ) { define( 'DEBUG', false ); } /** * Equation Operating System (EOS) Parser * * An EOS that can safely parse equations from unknown sources returning * the calculated value of it. Can also handle solving equations with * variables, if the variables are defined (useful for the Graph creation * that the second and extended class in this file provides. {@see eqGraph}) * This class was created for PHP4 in 2005, updated to fully PHP5 in 2013. * * @author Jon Lawrence * @copyright Copyright ©2005-2013, Jon Lawrence * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License * @package Math * @subpackage EOS * @version 2.0 */ class eqEOS { /**#@+ * Private variables */ private $postFix; private $inFix; /**#@-*/ /**#@+ * Protected variables */ // What are opening and closing selectors protected $SEP = array( 'open' => array( '(', '[' ), 'close' => array( ')', ']' ), ); // Top presedence following operator - not in use protected $SGL = array( '!' ); // Order of operations arrays follow protected $ST = array( '^' ); protected $ST1 = array( '/', '*', '%' ); protected $ST2 = array( '+', '-' ); // Allowed functions protected $FNC = array( 'sin', 'cos', 'tan', 'csc', 'sec', 'cot' ); /**#@-*/ /** * Construct method * * Will initiate the class. If variable given, will assign to * internal variable to solve with this::solveIF() without needing * additional input. Initializing with a variable is not suggested. * * @see eqEOS::solveIF() * @param String $inFix Standard format equation */ public function __construct( $inFix = null ) { $this->inFix = ( isset( $inFix ) ) ? $inFix : null; $this->postFix = array(); } /** * Check Infix for opening closing pair matches. * * This function is meant to solely check to make sure every opening * statement has a matching closing one, and throws an exception if * it doesn't. * * @param String $infix Equation to check * @throws Exception if malformed. * @return Bool true if passes - throws an exception if not. */ private function checkInfix( $infix ) { if ( trim( $infix ) == '' ) { return 0; } // Make sure we have the same number of '(' as we do ')' // and the same # of '[' as we do ']' if ( substr_count( $infix, '(' ) != substr_count( $infix, ')' ) ) { throw new Exception( "Mismatched parenthesis in '{$infix}'", EQEOS_E_NO_SET ); return false; } elseif ( substr_count( $infix, '[' ) != substr_count( $infix, ']' ) ) { throw new Exception( "Mismatched brackets in '{$infix}'", EQEOS_E_NO_SET ); return false; } $this->inFix = $infix; return true; } /** * Infix to Postfix * * Converts an infix (standard) equation to postfix (RPN) notation. * Sets the internal variable $this->postFix for the eqEOS::solvePF() * function to use. * * @link http://en.wikipedia.org/wiki/Infix_notation Infix Notation * @link http://en.wikipedia.org/wiki/Reverse_Polish_notation Reverse Polish Notation * @param String $infix A standard notation equation * @return Array Fully formed RPN Stack */ public function in2post( $infix = null ) { // if an equation was not passed, use the one that was passed in the constructor $infix = ( isset( $infix ) ) ? $infix : $this->inFix; // check to make sure 'valid' equation $this->checkInfix( $infix ); $pf = array(); $ops = new phpStack(); $vars = new phpStack(); // remove all white-space preg_replace( '/\s/', '', $infix ); // Create postfix array index $pfIndex = 0; // what was the last character? (useful for decerning between a sign for negation and subtraction) $lChar = ''; // loop through all the characters and start doing stuff ^^ for ( $i = 0;$i < strlen( $infix );$i++ ) { // pull out 1 character from the string $chr = substr( $infix, $i, 1 ); // if the character is numerical if ( preg_match( '/[0-9.]/i', $chr ) ) { // if the previous character was not a '-' or a number if ( ( ! preg_match( '/[0-9.]/i', $lChar ) && ( $lChar != '' ) ) && ( array_key_exists( $pfIndex, @$pf ) && @$pf[ $pfIndex ] != '-' ) ) { $pfIndex++; // increase the index so as not to overlap anything } // if the array key doesn't exist if ( ! array_key_exists( $pfIndex, @$pf ) ) { @$pf[ $pfIndex ] = null; // add index to the array } // Add the number character to the array @$pf[ $pfIndex ] .= $chr; } // If the character opens a set e.g. '(' or '[' elseif ( in_array( $chr, $this->SEP['open'] ) ) { // if the last character was a number, place an assumed '*' on the stack if ( preg_match( '/[0-9.]/i', $lChar ) ) { $ops->push( '*' ); } $ops->push( $chr ); } // if the character closes a set e.g. ')' or ']' elseif ( in_array( $chr, $this->SEP['close'] ) ) { // find what set it was i.e. matches ')' with '(' or ']' with '[' $key = array_search( $chr, $this->SEP['close'] ); // while the operator on the stack isn't the matching pair...pop it off while ( $ops->peek() != $this->SEP['open'][ $key ] ) { $nchr = $ops->pop(); if ( $nchr ) { $pf[ ++$pfIndex ] = $nchr; } else { throw new Exception( "Error while searching for '" . $this->SEP['open'][ $key ] . "' in '{$infix}'.", EQEOS_E_NO_SET ); return false; } } $ops->pop(); } // If a special operator that has precedence over everything else elseif ( in_array( $chr, $this->ST ) ) { $ops->push( $chr ); $pfIndex++; } // Any other operator other than '+' and '-' elseif ( in_array( $chr, $this->ST1 ) ) { while ( in_array( $ops->peek(), $this->ST1 ) || in_array( $ops->peek(), $this->ST ) ) { $pf[ ++$pfIndex ] = $ops->pop(); } $ops->push( $chr ); $pfIndex++; } // if a '+' or '-' elseif ( in_array( $chr, $this->ST2 ) ) { // if it is a '-' and the character before it was an operator or nothingness (e.g. it negates a number) if ( ( in_array( $lChar, array_merge( $this->ST1, $this->ST2, $this->ST, $this->SEP['open'] ) ) || $lChar == '' ) && $chr == '-' ) { // increase the index because there is no reason that it shouldn't.. $pfIndex++; $pf[ $pfIndex ] = $chr; } // Otherwise it will function like a normal operator else { while ( in_array( $ops->peek(), array_merge( $this->ST1, $this->ST2, $this->ST ) ) ) { $pf[ ++$pfIndex ] = $ops->pop(); } $ops->push( $chr ); $pfIndex++; } } // make sure we record this character to be refered to by the next one $lChar = $chr; } // if there is anything on the stack after we are done...add it to the back of the RPN array while ( ( $tmp = $ops->pop() ) !== false ) { $pf[ ++$pfIndex ] = $tmp; } // re-index the array at 0 $pf = array_values( $pf ); // set the private variable for later use if needed $this->postFix = $pf; // return the RPN array in case developer wants to use it fro some insane reason (bug testing ;] return $pf; } //end function in2post /** * Solve Postfix (RPN) * * This function will solve a RPN array. Default action is to solve * the RPN array stored in the class from eqEOS::in2post(), can take * an array input to solve as well, though default action is prefered. * * @link http://en.wikipedia.org/wiki/Reverse_Polish_notation Postix Notation * @param Array $pfArray RPN formatted array. Optional. * @return Float Result of the operation. */ public function solvePF( $pfArray = null ) { // if no RPN array is passed - use the one stored in the private var $pf = ( ! is_array( $pfArray ) ) ? $this->postFix : $pfArray; // create our temporary function variables $temp = array(); $tot = 0; $hold = 0; // Loop through each number/operator for ( $i = 0;$i < count( $pf ); $i++ ) { // If the string isn't an operator, add it to the temp var as a holding place if ( ! in_array( $pf[ $i ], array_merge( $this->ST, $this->ST1, $this->ST2 ) ) ) { $temp[ $hold++ ] = $pf[ $i ]; } // ...Otherwise perform the operator on the last two numbers else { switch ( $pf[ $i ] ) { case '+': if ( isset( $temp[ $hold - 2 ] ) && isset( $temp[ $hold - 1 ] ) ) { $temp[ $hold - 2 ] = $temp[ $hold - 2 ] + $temp[ $hold - 1 ]; } else { return 0; } break; case '-': if ( isset( $temp[ $hold - 2 ] ) && isset( $temp[ $hold - 1 ] ) ) { $temp[ $hold - 2 ] = $temp[ $hold - 2 ] - $temp[ $hold - 1 ]; } else { return 0; } break; case '*': if ( isset( $temp[ $hold - 2 ] ) && isset( $temp[ $hold - 1 ] ) ) { $temp[ $hold - 2 ] = $temp[ $hold - 2 ] * $temp[ $hold - 1 ]; } else { return 0; } break; case '/': if ( $temp[ $hold - 1 ] == 0 ) { return 0; } $temp[ $hold - 2 ] = $temp[ $hold - 2 ] / $temp[ $hold - 1 ]; break; case '^': $temp[ $hold - 2 ] = pow( $temp[ $hold - 2 ], $temp[ $hold - 1 ] ); break; case '%': if ( $temp[ $hold - 1 ] == 0 ) { return 0; } $temp[ $hold - 2 ] = bcmod( $temp[ $hold - 2 ], $temp[ $hold - 1 ] ); break; } // Decrease the hold var to one above where the last number is $hold = $hold - 1; } } // return the last number in the array return $temp[ $hold - 1 ]; } //end function solvePF /** * Solve Infix (Standard) Notation Equation * * Will take a standard equation with optional variables and solve it. Variables * must begin with '&' will expand to allow variables to begin with '$' (TODO) * The variable array must be in the format of 'variable' => value. If * variable array is scalar (ie 5), all variables will be replaced with it. * * @param String $infix Standard Equation to solve * @param String|Array $vArray Variable replacement * @return Float Solved equation */ function solveIF( $infix, $vArray = null ) { $infix = ( $infix != '' ) ? $infix : $this->inFix; // Check to make sure a 'valid' expression $this->checkInfix( $infix ); $ops = new phpStack(); $vars = new phpStack(); // remove all white-space preg_replace( '/\s/', '', $infix ); // Find all the variables that were passed and replaces them while ( ( preg_match( '/(.){0,1}[&$]([a-zA-Z0-9_]+)(.){0,1}/', $infix, $match ) ) != 0 ) { // remove notices by defining if undefined. if ( ! isset( $match[3] ) ) { $match[3] = ''; } // Ensure that the variable has an operator or something of that sort in front and back - if it doesn't, add an implied '*' if ( ( ! 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 $front = '*'; } else { $front = ''; } if ( ( ! 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 $back = '*'; } else { $back = ''; } // Make sure that the variable does have a replacement if ( ! isset( $vArray[ $match[2] ] ) && ( ! is_array( $vArray != '' ) && ! is_numeric( $vArray ) ) ) { throw new Exception( "Variable replacement does not exist for '" . substr( $match[0], 1, -1 ) . "' in {$this->inFix}", EQEOS_E_NO_VAR ); return false; } elseif ( ! isset( $vArray[ $match[2] ] ) && ( ! is_array( $vArray != '' ) && is_numeric( $vArray ) ) ) { $infix = str_replace( $match[0], $match[1] . $front . $vArray . $back . $match[3], $infix ); } elseif ( isset( $vArray[ $match[2] ] ) ) { $infix = str_replace( $match[0], $match[1] . $front . $vArray[ $match[2] ] . $back . $match[3], $infix ); } } // Finds all the 'functions' within the equation and calculates them // NOTE - when using function, only 1 set of paranthesis will be found, instead use brackets for sets within functions!! while ( ( preg_match( '/(' . implode( '|', $this->FNC ) . ')\(([^\)\(]*(\([^\)]*\)[^\(\)]*)*[^\)\(]*)\)/', $infix, $match ) ) != 0 ) { $func = $this->solveIF( $match[2] ); switch ( $match[1] ) { case 'cos': $ans = cos( $func ); break; case 'sin': $ans = sin( $func ); break; case 'tan': $ans = tan( $func ); break; case 'sec': $tmp = cos( $func ); if ( $tmp == 0 ) { return 0; } $ans = 1 / $tmp; break; case 'csc': $tmp = sin( $func ); if ( $tmp == 0 ) { return 0; } $ans = 1 / $tmp; break; case 'cot': $tmp = tan( $func ); if ( $tmp == 0 ) { return 0; } $ans = 1 / $tmp; break; default: break; } $infix = str_replace( $match[0], $ans, $infix ); } return $this->solvePF( $this->in2post( $infix ) ); } //end function solveIF } //end class 'eqEOS' ================================================ FILE: includes/libraries/class-phpstack.php ================================================ * @copyright Copyright ©2005-2013 Jon Lawrence * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License * @package eos.class.php * @version 2.0 */ class phpStack { private $index; private $locArray; /** * Constructor * * Initializes the stack */ public function __construct() { // define the private vars $this->locArray = array(); $this->index = -1; } /** * Peek * * Will view the last element of the stack without removing it * * @return Mixed An element of the array or false if none exist */ public function peek() { if ( $this->index > -1 ) { return $this->locArray[ $this->index ]; } else { return false; } } /** * Poke * * Will add an element to the end of the stack * * @param Mixed Element to add */ public function poke( $data ) { $this->locArray[ ++$this->index ] = $data; } /** * Push * * Alias of {@see phpStack::poke()} * Adds element to the stack * * @param Mixed Element to add */ public function push( $data ) { // allias for 'poke' $this->poke( $data ); } /** * Pop * * Retrives an element from the end of the stack, and removes it from * the stack at the same time. If no elements, returns boolean false * * @return Mixed Element at end of stack or false if none exist */ public function pop() { if ( $this->index > -1 ) { $this->index--; return $this->locArray[ $this->index + 1 ]; } else { return false; } } /** * Clear * * Clears the stack to be reused. */ public function clear() { $this->index = -1; $this->locArray = array(); } /** * Get Stack * * Returns the array of stack elements, keeping all, indexed at 0 * * @return Mixed Array of stack elements or false if none exist. */ public function getStack() { if ( $this->index > -1 ) { return array_values( $this->locArray ); } else { return false; } } } ================================================ FILE: includes/libraries/class-tgm-plugin-activation.php ================================================ wp_version = $GLOBALS['wp_version']; // Announce that the class is ready, and pass the object (for advanced use). do_action_ref_array( 'tgmpa_init', array( $this ) ); /* * Load our text domain and allow for overloading the fall-back file. * * {@internal IMPORTANT! If this code changes, review the regex in the custom TGMPA * generator on the website.}} */ add_action( 'init', array( $this, 'load_textdomain' ), 5 ); add_filter( 'load_textdomain_mofile', array( $this, 'overload_textdomain_mofile' ), 10, 2 ); // When the rest of WP has loaded, kick-start the rest of the class. add_action( 'init', array( $this, 'init' ) ); } /** * Magic method to (not) set protected properties from outside of this class. * * {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property * is being assigned rather than tested in a conditional, effectively rendering it useless. * This 'hack' prevents this from happening.}} * * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593 * * @since 2.5.2 * * @param string $name Name of an inaccessible property. * @param mixed $value Value to assign to the property. * @return void Silently fail to set the property when this is tried from outside of this class context. * (Inside this class context, the __set() method if not used as there is direct access.) */ public function __set( $name, $value ) { return; } /** * Magic method to get the value of a protected property outside of this class context. * * @since 2.5.2 * * @param string $name Name of an inaccessible property. * @return mixed The property value. */ public function __get( $name ) { return $this->{$name}; } /** * Initialise the interactions between this class and WordPress. * * Hooks in three new methods for the class: admin_menu, notices and styles. * * @since 2.0.0 * * @see TGM_Plugin_Activation::admin_menu() * @see TGM_Plugin_Activation::notices() * @see TGM_Plugin_Activation::styles() */ public function init() { /** * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter * you can overrule that behaviour. * * @since 2.5.0 * * @param bool $load Whether or not TGMPA should load. * Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`. */ if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) { return; } // Load class strings. $this->strings = array( 'page_title' => __( 'Install Required Plugins', 'tgmpa' ), 'menu_title' => __( 'Install Plugins', 'tgmpa' ), /* translators: %s: plugin name. */ 'installing' => __( 'Installing Plugin: %s', 'tgmpa' ), /* translators: %s: plugin name. */ 'updating' => __( 'Updating Plugin: %s', 'tgmpa' ), 'oops' => __( 'Something went wrong with the plugin API.', 'tgmpa' ), 'notice_can_install_required' => _n_noop( /* translators: 1: plugin name(s). */ 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'tgmpa' ), 'notice_can_install_recommended' => _n_noop( /* translators: 1: plugin name(s). */ 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'tgmpa' ), 'notice_ask_to_update' => _n_noop( /* translators: 1: plugin name(s). */ 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'tgmpa' ), 'notice_ask_to_update_maybe' => _n_noop( /* translators: 1: plugin name(s). */ 'There is an update available for: %1$s.', 'There are updates available for the following plugins: %1$s.', 'tgmpa' ), 'notice_can_activate_required' => _n_noop( /* translators: 1: plugin name(s). */ 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'tgmpa' ), 'notice_can_activate_recommended' => _n_noop( /* translators: 1: plugin name(s). */ 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'tgmpa' ), 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'tgmpa' ), 'update_link' => _n_noop( 'Begin updating plugin', 'Begin updating plugins', 'tgmpa' ), 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'tgmpa' ), 'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ), 'dashboard' => __( 'Return to the Dashboard', 'tgmpa' ), 'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ), 'activated_successfully' => __( 'The following plugin was activated successfully:', 'tgmpa' ), /* translators: 1: plugin name. */ 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'tgmpa' ), /* translators: 1: plugin name. */ 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'tgmpa' ), /* translators: 1: dashboard link. */ 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ), 'dismiss' => __( 'Dismiss this notice', 'tgmpa' ), 'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'tgmpa' ), 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'tgmpa' ), ); do_action( 'tgmpa_register' ); /* After this point, the plugins should be registered and the configuration set. */ // Proceed only if we have plugins to handle. if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) { return; } // Set up the menu and notices if we still have outstanding actions. if ( true !== $this->is_tgmpa_complete() ) { // Sort the plugins. array_multisort( $this->sort_order, SORT_ASC, $this->plugins ); add_action( 'admin_menu', array( $this, 'admin_menu' ) ); add_action( 'admin_head', array( $this, 'dismiss' ) ); // Prevent the normal links from showing underneath a single install/update page. add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) ); add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) ); if ( $this->has_notices ) { add_action( 'admin_notices', array( $this, 'notices' ) ); add_action( 'admin_init', array( $this, 'admin_init' ), 1 ); add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) ); } } // If needed, filter plugin action links. add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 ); // Make sure things get reset on switch theme. add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) ); if ( $this->has_notices ) { add_action( 'switch_theme', array( $this, 'update_dismiss' ) ); } // Setup the force activation hook. if ( true === $this->has_forced_activation ) { add_action( 'admin_init', array( $this, 'force_activation' ) ); } // Setup the force deactivation hook. if ( true === $this->has_forced_deactivation ) { add_action( 'switch_theme', array( $this, 'force_deactivation' ) ); } } /** * Load translations. * * @since 2.6.0 * * (@internal Uses `load_theme_textdomain()` rather than `load_plugin_textdomain()` to * get round the different ways of handling the path and deprecated notices being thrown * and such. For plugins, the actual file name will be corrected by a filter.}} * * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA * generator on the website.}} */ public function load_textdomain() { if ( is_textdomain_loaded( 'tgmpa' ) ) { return; } if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) ) { // Plugin, we'll need to adjust the file name. add_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10, 2 ); load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' ); remove_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10 ); } else { load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' ); } } /** * Correct the .mo file name for (must-use) plugins. * * Themese use `/path/{locale}.mo` while plugins use `/path/{text-domain}-{locale}.mo`. * * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA * generator on the website.}} * * @since 2.6.0 * * @param string $mofile Full path to the target mofile. * @param string $domain The domain for which a language file is being loaded. * @return string $mofile */ public function correct_plugin_mofile( $mofile, $domain ) { // Exit early if not our domain (just in case). if ( 'tgmpa' !== $domain ) { return $mofile; } return preg_replace( '`/([a-z]{2}_[A-Z]{2}.mo)$`', '/tgmpa-$1', $mofile ); } /** * Potentially overload the fall-back translation file for the current language. * * WP, by default since WP 3.7, will load a local translation first and if none * can be found, will try and find a translation in the /wp-content/languages/ directory. * As this library is theme/plugin agnostic, translation files for TGMPA can exist both * in the WP_LANG_DIR /plugins/ subdirectory as well as in the /themes/ subdirectory. * * This method makes sure both directories are checked. * * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA * generator on the website.}} * * @since 2.6.0 * * @param string $mofile Full path to the target mofile. * @param string $domain The domain for which a language file is being loaded. * @return string $mofile */ public function overload_textdomain_mofile( $mofile, $domain ) { // Exit early if not our domain, not a WP_LANG_DIR load or if the file exists and is readable. if ( 'tgmpa' !== $domain || false === strpos( $mofile, WP_LANG_DIR ) || @is_readable( $mofile ) ) { return $mofile; } // Current fallback file is not valid, let's try the alternative option. if ( false !== strpos( $mofile, '/themes/' ) ) { return str_replace( '/themes/', '/plugins/', $mofile ); } elseif ( false !== strpos( $mofile, '/plugins/' ) ) { return str_replace( '/plugins/', '/themes/', $mofile ); } else { return $mofile; } } /** * Hook in plugin action link filters for the WP native plugins page. * * - Prevent activation of plugins which don't meet the minimum version requirements. * - Prevent deactivation of force-activated plugins. * - Add update notice if update available. * * @since 2.5.0 */ public function add_plugin_action_link_filters() { foreach ( $this->plugins as $slug => $plugin ) { if ( false === $this->can_plugin_activate( $slug ) ) { add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 ); } if ( true === $plugin['force_activation'] ) { add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 ); } if ( false !== $this->does_plugin_require_update( $slug ) ) { add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 ); } } } /** * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the * minimum version requirements. * * @since 2.5.0 * * @param array $actions Action links. * @return array */ public function filter_plugin_action_links_activate( $actions ) { unset( $actions['activate'] ); return $actions; } /** * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate. * * @since 2.5.0 * * @param array $actions Action links. * @return array */ public function filter_plugin_action_links_deactivate( $actions ) { unset( $actions['deactivate'] ); return $actions; } /** * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the * minimum version requirements. * * @since 2.5.0 * * @param array $actions Action links. * @return array */ public function filter_plugin_action_links_update( $actions ) { $actions['update'] = sprintf( '%3$s', esc_url( $this->get_tgmpa_status_url( 'update' ) ), esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'tgmpa' ), esc_html__( 'Update Required', 'tgmpa' ) ); return $actions; } /** * Handles calls to show plugin information via links in the notices. * * We get the links in the admin notices to point to the TGMPA page, rather * than the typical plugin-install.php file, so we can prepare everything * beforehand. * * WP does not make it easy to show the plugin information in the thickbox - * here we have to require a file that includes a function that does the * main work of displaying it, enqueue some styles, set up some globals and * finally call that function before exiting. * * Down right easy once you know how... * * Returns early if not the TGMPA page. * * @since 2.1.0 * * @global string $tab Used as iframe div class names, helps with styling * @global string $body_id Used as the iframe body ID, helps with styling * * @return null Returns early if not the TGMPA page. */ public function admin_init() { if ( ! $this->is_tgmpa_page() ) { return; } if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) { // Needed for install_plugin_information(). require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; wp_enqueue_style( 'plugin-install' ); global $tab, $body_id; $body_id = 'plugin-information'; // @codingStandardsIgnoreStart $tab = 'plugin-information'; // @codingStandardsIgnoreEnd install_plugin_information(); exit; } } /** * Enqueue thickbox scripts/styles for plugin info. * * Thickbox is not automatically included on all admin pages, so we must * manually enqueue it for those pages. * * Thickbox is only loaded if the user has not dismissed the admin * notice or if there are any plugins left to install and activate. * * @since 2.1.0 */ public function thickbox() { if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { add_thickbox(); } } /** * Adds submenu page if there are plugin actions to take. * * This method adds the submenu page letting users know that a required * plugin needs to be installed. * * This page disappears once the plugin has been installed and activated. * * @since 1.0.0 * * @see TGM_Plugin_Activation::init() * @see TGM_Plugin_Activation::install_plugins_page() * * @return null Return early if user lacks capability to install a plugin. */ public function admin_menu() { // Make sure privileges are correct to see the page. if ( ! current_user_can( 'install_plugins' ) ) { return; } $args = apply_filters( 'tgmpa_admin_menu_args', array( 'parent_slug' => $this->parent_slug, // Parent Menu slug. 'page_title' => $this->strings['page_title'], // Page title. 'menu_title' => $this->strings['menu_title'], // Menu title. 'capability' => $this->capability, // Capability. 'menu_slug' => $this->menu, // Menu slug. 'function' => array( $this, 'install_plugins_page' ), // Callback. ) ); $this->add_admin_menu( $args ); } /** * Add the menu item. * * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA * generator on the website.}} * * @since 2.5.0 * * @param array $args Menu item configuration. */ protected function add_admin_menu( array $args ) { if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) { _deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'tgmpa' ) ); } if ( 'themes.php' === $this->parent_slug ) { $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); } else { $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'] ); } } /** * Echoes plugin installation form. * * This method is the callback for the admin_menu method function. * This displays the admin page and form area where the user can select to install and activate the plugin. * Aborts early if we're processing a plugin installation action. * * @since 1.0.0 * * @return null Aborts early if we're processing a plugin installation action. */ public function install_plugins_page() { // Store new instance of plugin table in object. $plugin_table = new TGMPA_List_Table; // Return early if processing a plugin installation action. if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) { return; } // Force refresh of available plugin information so we'll know about manual updates/deletes. wp_clean_plugins_cache( false ); ?>

    prepare_items(); ?> message ) && is_string( $this->message ) ) { echo wp_kses_post( $this->message ); } ?> views(); ?>
    display(); ?>
    sanitize_key( urldecode( $_GET['plugin'] ) ); if ( ! isset( $this->plugins[ $slug ] ) ) { return false; } // Was an install or upgrade action link clicked? if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) { $install_type = 'install'; if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) { $install_type = 'update'; } check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' ); // Pass necessary information via URL if WP_Filesystem is needed. $url = wp_nonce_url( add_query_arg( array( 'plugin' => urlencode( $slug ), 'tgmpa-' . $install_type => $install_type . '-plugin', ), $this->get_tgmpa_url() ), 'tgmpa-' . $install_type, 'tgmpa-nonce' ); $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) { return true; } if ( ! WP_Filesystem( $creds ) ) { request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem. return true; } /* If we arrive here, we have the filesystem. */ // Prep variables for Plugin_Installer_Skin class. $extra = array(); $extra['slug'] = $slug; // Needed for potentially renaming of directory name. $source = $this->get_download_url( $slug ); $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; $api = ( false !== $api ) ? $api : null; $url = add_query_arg( array( 'action' => $install_type . '-plugin', 'plugin' => urlencode( $slug ), ), 'update.php' ); if ( ! class_exists( 'Plugin_Upgrader', false ) ) { require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; } $title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing']; $skin_args = array( 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload', 'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ), 'url' => esc_url_raw( $url ), 'nonce' => $install_type . '-plugin_' . $slug, 'plugin' => '', 'api' => $api, 'extra' => $extra, ); unset( $title ); if ( 'update' === $install_type ) { $skin_args['plugin'] = $this->plugins[ $slug ]['file_path']; $skin = new Plugin_Upgrader_Skin( $skin_args ); } else { $skin = new Plugin_Installer_Skin( $skin_args ); } // Create a new instance of Plugin_Upgrader. $upgrader = new Plugin_Upgrader( $skin ); // Perform the action and install the plugin from the $source urldecode(). add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 ); if ( 'update' === $install_type ) { // Inject our info into the update transient. $to_inject = array( $slug => $this->plugins[ $slug ] ); $to_inject[ $slug ]['source'] = $source; $this->inject_update_info( $to_inject ); $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] ); } else { $upgrader->install( $source ); } remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 ); // Make sure we have the correct file path now the plugin is installed/updated. $this->populate_file_path( $slug ); // Only activate plugins if the config option is set to true and the plugin isn't // already active (upgrade). if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) { $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method. if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) { return true; // Finish execution of the function early as we encountered an error. } } $this->show_tgmpa_version(); // Display message based on if all plugins are now active or not. if ( $this->is_tgmpa_complete() ) { echo '

    ', sprintf( esc_html( $this->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '' ), '

    '; echo ''; } else { echo '

    ', esc_html( $this->strings['return'] ), '

    '; } return true; } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { // Activate action link was clicked. check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' ); if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) { return true; // Finish execution of the function early as we encountered an error. } } return false; } /** * Inject information into the 'update_plugins' site transient as WP checks that before running an update. * * @since 2.5.0 * * @param array $plugins The plugin information for the plugins which are to be updated. */ public function inject_update_info( $plugins ) { $repo_updates = get_site_transient( 'update_plugins' ); if ( ! is_object( $repo_updates ) ) { $repo_updates = new stdClass; } foreach ( $plugins as $slug => $plugin ) { $file_path = $plugin['file_path']; if ( empty( $repo_updates->response[ $file_path ] ) ) { $repo_updates->response[ $file_path ] = new stdClass; } // We only really need to set package, but let's do all we can in case WP changes something. $repo_updates->response[ $file_path ]->slug = $slug; $repo_updates->response[ $file_path ]->plugin = $file_path; $repo_updates->response[ $file_path ]->new_version = $plugin['version']; $repo_updates->response[ $file_path ]->package = $plugin['source']; if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) { $repo_updates->response[ $file_path ]->url = $plugin['external_url']; } } set_site_transient( 'update_plugins', $repo_updates ); } /** * Adjust the plugin directory name if necessary. * * The final destination directory of a plugin is based on the subdirectory name found in the * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this * subdirectory name is not the same as the expected slug and the plugin will not be recognized * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to * the expected plugin slug. * * @since 2.5.0 * * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/. * @param string $remote_source Path to upgrade/zip-file-name.tmp. * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin. * @return string $source */ public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) { if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) { return $source; } // Check for single file plugins. $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) ); if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) { return $source; } // Multi-file plugin, let's see if the directory is correctly named. $desired_slug = ''; // Figure out what the slug is supposed to be. if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) { $desired_slug = $upgrader->skin->options['extra']['slug']; } else { // Bulk installer contains less info, so fall back on the info registered here. foreach ( $this->plugins as $slug => $plugin ) { if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { $desired_slug = $slug; break; } } unset( $slug, $plugin ); } if ( ! empty( $desired_slug ) ) { $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) ); if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) { $from_path = untrailingslashit( $source ); $to_path = trailingslashit( $remote_source ) . $desired_slug; if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) { return trailingslashit( $to_path ); } else { 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 ) ); } } elseif ( empty( $subdir_name ) ) { 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 ) ); } } return $source; } /** * Activate a single plugin and send feedback about the result to the screen. * * @since 2.5.0 * * @param string $file_path Path within wp-plugins/ to main plugin file. * @param string $slug Plugin slug. * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false. * This determines the styling of the output messages. * @return bool False if an error was encountered, true otherwise. */ protected function activate_single_plugin( $file_path, $slug, $automatic = false ) { if ( $this->can_plugin_activate( $slug ) ) { $activate = activate_plugin( $file_path ); if ( is_wp_error( $activate ) ) { echo '

    ', wp_kses_post( $activate->get_error_message() ), '

    ', '

    ', esc_html( $this->strings['return'] ), '

    '; return false; // End it here if there is an error with activation. } else { if ( ! $automatic ) { // Make sure message doesn't display again if bulk activation is performed // immediately after a single activation. if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. echo '

    ', esc_html( $this->strings['activated_successfully'] ), ' ', esc_html( $this->plugins[ $slug ]['name'] ), '.

    '; } } else { // Simpler message layout for use on the plugin install page. echo '

    ', esc_html( $this->strings['plugin_activated'] ), '

    '; } } } elseif ( $this->is_plugin_active( $slug ) ) { // No simpler message format provided as this message should never be encountered // on the plugin install page. echo '

    ', sprintf( esc_html( $this->strings['plugin_already_active'] ), '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' ), '

    '; } elseif ( $this->does_plugin_require_update( $slug ) ) { if ( ! $automatic ) { // Make sure message doesn't display again if bulk activation is performed // immediately after a single activation. if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. echo '

    ', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' ), '

    '; } } else { // Simpler message layout for use on the plugin install page. echo '

    ', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '

    '; } } return true; } /** * Echoes required plugin notice. * * Outputs a message telling users that a specific plugin is required for * their theme. If appropriate, it includes a link to the form page where * users can install and activate the plugin. * * Returns early if we're on the Install page. * * @since 1.0.0 * * @global object $current_screen * * @return null Returns early if we're on the Install page. */ public function notices() { // Remove nag on the install page / Return early if the nag message has been dismissed or user < author. 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' ) ) ) { return; } // Store for the plugin slugs by message type. $message = array(); // Initialize counters used to determine plurality of action link texts. $install_link_count = 0; $update_link_count = 0; $activate_link_count = 0; $total_required_action_count = 0; foreach ( $this->plugins as $slug => $plugin ) { if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) { continue; } if ( ! $this->is_plugin_installed( $slug ) ) { if ( current_user_can( 'install_plugins' ) ) { $install_link_count++; if ( true === $plugin['required'] ) { $message['notice_can_install_required'][] = $slug; } else { $message['notice_can_install_recommended'][] = $slug; } } if ( true === $plugin['required'] ) { $total_required_action_count++; } } else { if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) { if ( current_user_can( 'activate_plugins' ) ) { $activate_link_count++; if ( true === $plugin['required'] ) { $message['notice_can_activate_required'][] = $slug; } else { $message['notice_can_activate_recommended'][] = $slug; } } if ( true === $plugin['required'] ) { $total_required_action_count++; } } if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { if ( current_user_can( 'update_plugins' ) ) { $update_link_count++; if ( $this->does_plugin_require_update( $slug ) ) { $message['notice_ask_to_update'][] = $slug; } elseif ( false !== $this->does_plugin_have_update( $slug ) ) { $message['notice_ask_to_update_maybe'][] = $slug; } } if ( true === $plugin['required'] ) { $total_required_action_count++; } } } } unset( $slug, $plugin ); // If we have notices to display, we move forward. if ( ! empty( $message ) || $total_required_action_count > 0 ) { krsort( $message ); // Sort messages. $rendered = ''; // As add_settings_error() wraps the final message in a

    and as the final message can't be // filtered, using

    's in our html would render invalid html output. $line_template = '%s' . "\n"; if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) { $rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] ); $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template ); } else { // If dismissable is false and a message is set, output it now. if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) { $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) ); } // Render the individual message lines for the notice. foreach ( $message as $type => $plugin_group ) { $linked_plugins = array(); // Get the external info link for a plugin if one is available. foreach ( $plugin_group as $plugin_slug ) { $linked_plugins[] = $this->get_info_link( $plugin_slug ); } unset( $plugin_slug ); $count = count( $plugin_group ); $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins ); $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability. $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin ); $rendered .= sprintf( $line_template, sprintf( translate_nooped_plural( $this->strings[ $type ], $count, 'tgmpa' ), $imploded, $count ) ); } unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded ); $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template ); } // Register the nag messages and prepare them to be processed. add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() ); } // Admin options pages already output settings_errors, so this is to avoid duplication. if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) { $this->display_settings_errors(); } } /** * Generate the user action links for the admin notice. * * @since 2.6.0 * * @param int $install_count Number of plugins to install. * @param int $update_count Number of plugins to update. * @param int $activate_count Number of plugins to activate. * @param int $line_template Template for the HTML tag to output a line. * @return string Action links. */ protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) { // Setup action links. $action_links = array( 'install' => '', 'update' => '', 'activate' => '', 'dismiss' => $this->dismissable ? '' . esc_html( $this->strings['dismiss'] ) . '' : '', ); $link_template = '%1$s'; if ( current_user_can( 'install_plugins' ) ) { if ( $install_count > 0 ) { $action_links['install'] = sprintf( $link_template, translate_nooped_plural( $this->strings['install_link'], $install_count, 'tgmpa' ), esc_url( $this->get_tgmpa_status_url( 'install' ) ) ); } if ( $update_count > 0 ) { $action_links['update'] = sprintf( $link_template, translate_nooped_plural( $this->strings['update_link'], $update_count, 'tgmpa' ), esc_url( $this->get_tgmpa_status_url( 'update' ) ) ); } } if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) { $action_links['activate'] = sprintf( $link_template, translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'tgmpa' ), esc_url( $this->get_tgmpa_status_url( 'activate' ) ) ); } $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links ); $action_links = array_filter( (array) $action_links ); // Remove any empty array items. if ( ! empty( $action_links ) ) { $action_links = sprintf( $line_template, implode( ' | ', $action_links ) ); return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links ); } else { return ''; } } /** * Get admin notice class. * * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7 * (lowest supported version by TGMPA). * * @since 2.6.0 * * @return string */ protected function get_admin_notice_class() { if ( ! empty( $this->strings['nag_type'] ) ) { return sanitize_html_class( strtolower( $this->strings['nag_type'] ) ); } else { if ( version_compare( $this->wp_version, '4.2', '>=' ) ) { return 'notice-warning'; } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) { return 'notice'; } else { return 'updated'; } } } /** * Display settings errors and remove those which have been displayed to avoid duplicate messages showing * * @since 2.5.0 */ protected function display_settings_errors() { global $wp_settings_errors; settings_errors( 'tgmpa' ); foreach ( (array) $wp_settings_errors as $key => $details ) { if ( 'tgmpa' === $details['setting'] ) { unset( $wp_settings_errors[ $key ] ); break; } } } /** * Register dismissal of admin notices. * * Acts on the dismiss link in the admin nag messages. * If clicked, the admin notice disappears and will no longer be visible to this user. * * @since 2.1.0 */ public function dismiss() { if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) { update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 ); } } /** * Add individual plugin to our collection of plugins. * * If the required keys are not set or the plugin has already * been registered, the plugin is not added. * * @since 2.0.0 * * @param array|null $plugin Array of plugin arguments or null if invalid argument. * @return null Return early if incorrect argument. */ public function register( $plugin ) { if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) { return; } if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { return; } $defaults = array( 'name' => '', // String 'slug' => '', // String 'source' => 'repo', // String 'required' => false, // Boolean 'version' => '', // String 'force_activation' => false, // Boolean 'force_deactivation' => false, // Boolean 'external_url' => '', // String 'is_callable' => '', // String|Array. ); // Prepare the received data. $plugin = wp_parse_args( $plugin, $defaults ); // Standardize the received slug. $plugin['slug'] = $this->sanitize_key( $plugin['slug'] ); // Forgive users for using string versions of booleans or floats for version number. $plugin['version'] = (string) $plugin['version']; $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source']; $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] ); $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] ); $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] ); // Enrich the received data. $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] ); $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); // Set the class properties. $this->plugins[ $plugin['slug'] ] = $plugin; $this->sort_order[ $plugin['slug'] ] = $plugin['name']; // Should we add the force activation hook ? if ( true === $plugin['force_activation'] ) { $this->has_forced_activation = true; } // Should we add the force deactivation hook ? if ( true === $plugin['force_deactivation'] ) { $this->has_forced_deactivation = true; } } /** * Determine what type of source the plugin comes from. * * @since 2.5.0 * * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path * (= bundled) or an external URL. * @return string 'repo', 'external', or 'bundled' */ protected function get_plugin_source_type( $source ) { if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) { return 'repo'; } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) { return 'external'; } else { return 'bundled'; } } /** * Sanitizes a string key. * * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are* * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase * characters in the plugin directory path/slug. Silly them. * * @see https://developer.wordpress.org/reference/hooks/sanitize_key/ * * @since 2.5.0 * * @param string $key String key. * @return string Sanitized key */ public function sanitize_key( $key ) { $raw_key = $key; $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key ); /** * Filter a sanitized key string. * * @since 2.5.0 * * @param string $key Sanitized key. * @param string $raw_key The key prior to sanitization. */ return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key ); } /** * Amend default configuration settings. * * @since 2.0.0 * * @param array $config Array of config options to pass as class properties. */ public function config( $config ) { $keys = array( 'id', 'default_path', 'has_notices', 'dismissable', 'dismiss_msg', 'menu', 'parent_slug', 'capability', 'is_automatic', 'message', 'strings', ); foreach ( $keys as $key ) { if ( isset( $config[ $key ] ) ) { if ( is_array( $config[ $key ] ) ) { $this->$key = array_merge( $this->$key, $config[ $key ] ); } else { $this->$key = $config[ $key ]; } } } } /** * Amend action link after plugin installation. * * @since 2.0.0 * * @param array $install_actions Existing array of actions. * @return false|array Amended array of actions. */ public function actions( $install_actions ) { // Remove action links on the TGMPA install page. if ( $this->is_tgmpa_page() ) { return false; } return $install_actions; } /** * Flushes the plugins cache on theme switch to prevent stale entries * from remaining in the plugin table. * * @since 2.4.0 * * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache. * Parameter added in v2.5.0. */ public function flush_plugins_cache( $clear_update_cache = true ) { wp_clean_plugins_cache( $clear_update_cache ); } /** * Set file_path key for each installed plugin. * * @since 2.1.0 * * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin. * Parameter added in v2.5.0. */ public function populate_file_path( $plugin_slug = '' ) { if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); } else { // Add file_path key for all plugins. foreach ( $this->plugins as $slug => $values ) { $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); } } } /** * Helper function to extract the file path of the plugin file from the * plugin slug, if the plugin is installed. * * @since 2.0.0 * * @param string $slug Plugin slug (typically folder name) as provided by the developer. * @return string Either file path for plugin if installed, or just the plugin slug. */ protected function _get_plugin_basename_from_slug( $slug ) { $keys = array_keys( $this->get_plugins() ); foreach ( $keys as $key ) { if ( preg_match( '|^' . $slug . '/|', $key ) ) { return $key; } } return $slug; } /** * Retrieve plugin data, given the plugin name. * * Loops through the registered plugins looking for $name. If it finds it, * it returns the $data from that plugin. Otherwise, returns false. * * @since 2.1.0 * * @param string $name Name of the plugin, as it was registered. * @param string $data Optional. Array key of plugin data to return. Default is slug. * @return string|boolean Plugin slug if found, false otherwise. */ public function _get_plugin_data_from_name( $name, $data = 'slug' ) { foreach ( $this->plugins as $values ) { if ( $name === $values['name'] && isset( $values[ $data ] ) ) { return $values[ $data ]; } } return false; } /** * Retrieve the download URL for a package. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string Plugin download URL or path to local file or empty string if undetermined. */ public function get_download_url( $slug ) { $dl_source = ''; switch ( $this->plugins[ $slug ]['source_type'] ) { case 'repo': return $this->get_wp_repo_download_url( $slug ); case 'external': return $this->plugins[ $slug ]['source']; case 'bundled': return $this->default_path . $this->plugins[ $slug ]['source']; } return $dl_source; // Should never happen. } /** * Retrieve the download URL for a WP repo package. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string Plugin download URL. */ protected function get_wp_repo_download_url( $slug ) { $source = ''; $api = $this->get_plugins_api( $slug ); if ( false !== $api && isset( $api->download_link ) ) { $source = $api->download_link; } return $source; } /** * Try to grab information from WordPress API. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return object Plugins_api response object on success, WP_Error on failure. */ protected function get_plugins_api( $slug ) { static $api = array(); // Cache received responses. if ( ! isset( $api[ $slug ] ) ) { if ( ! function_exists( 'plugins_api' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; } $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); $api[ $slug ] = false; if ( is_wp_error( $response ) ) { wp_die( esc_html( $this->strings['oops'] ) ); } else { $api[ $slug ] = $response; } } return $api[ $slug ]; } /** * Retrieve a link to a plugin information page. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string Fully formed html link to a plugin information page if available * or the plugin name if not. */ public function get_info_link( $slug ) { if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { $link = sprintf( '%2$s', esc_url( $this->plugins[ $slug ]['external_url'] ), esc_html( $this->plugins[ $slug ]['name'] ) ); } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { $url = add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => urlencode( $slug ), 'TB_iframe' => 'true', 'width' => '640', 'height' => '500', ), self_admin_url( 'plugin-install.php' ) ); $link = sprintf( '%2$s', esc_url( $url ), esc_html( $this->plugins[ $slug ]['name'] ) ); } else { $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. } return $link; } /** * Determine if we're on the TGMPA Install page. * * @since 2.1.0 * * @return boolean True when on the TGMPA page, false otherwise. */ protected function is_tgmpa_page() { return isset( $_GET['page'] ) && $this->menu === $_GET['page']; } /** * Determine if we're on a WP Core installation/upgrade page. * * @since 2.6.0 * * @return boolean True when on a WP Core installation/upgrade page, false otherwise. */ protected function is_core_update_page() { // Current screen is not always available, most notably on the customizer screen. if ( ! function_exists( 'get_current_screen' ) ) { return false; } $screen = get_current_screen(); if ( 'update-core' === $screen->base ) { // Core update screen. return true; } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. // Plugins bulk update screen. return true; } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. // Individual updates (ajax call). return true; } return false; } /** * Retrieve the URL to the TGMPA Install page. * * I.e. depending on the config settings passed something along the lines of: * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins * * @since 2.5.0 * * @return string Properly encoded URL (not escaped). */ public function get_tgmpa_url() { static $url; if ( ! isset( $url ) ) { $parent = $this->parent_slug; if ( false === strpos( $parent, '.php' ) ) { $parent = 'admin.php'; } $url = add_query_arg( array( 'page' => urlencode( $this->menu ), ), self_admin_url( $parent ) ); } return $url; } /** * Retrieve the URL to the TGMPA Install page for a specific plugin status (view). * * I.e. depending on the config settings passed something along the lines of: * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install * * @since 2.5.0 * * @param string $status Plugin status - either 'install', 'update' or 'activate'. * @return string Properly encoded URL (not escaped). */ public function get_tgmpa_status_url( $status ) { return add_query_arg( array( 'plugin_status' => urlencode( $status ), ), $this->get_tgmpa_url() ); } /** * Determine whether there are open actions for plugins registered with TGMPA. * * @since 2.5.0 * * @return bool True if complete, i.e. no outstanding actions. False otherwise. */ public function is_tgmpa_complete() { $complete = true; foreach ( $this->plugins as $slug => $plugin ) { if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { $complete = false; break; } } return $complete; } /** * Check if a plugin is installed. Does not take must-use plugins into account. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True if installed, false otherwise. */ public function is_plugin_installed( $slug ) { $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); } /** * Check if a plugin is active. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True if active, false otherwise. */ public function is_plugin_active( $slug ) { return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); } /** * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required * available, check whether the current install meets them. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True if OK to update, false otherwise. */ public function can_plugin_update( $slug ) { // We currently can't get reliable info on non-WP-repo plugins - issue #380. if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { return true; } $api = $this->get_plugins_api( $slug ); if ( false !== $api && isset( $api->requires ) ) { return version_compare( $this->wp_version, $api->requires, '>=' ); } // No usable info received from the plugins API, presume we can update. return true; } /** * Check to see if the plugin is 'updatetable', i.e. installed, with an update available * and no WP version requirements blocking it. * * @since 2.6.0 * * @param string $slug Plugin slug. * @return bool True if OK to proceed with update, false otherwise. */ public function is_plugin_updatetable( $slug ) { if ( ! $this->is_plugin_installed( $slug ) ) { return false; } else { return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) ); } } /** * Check if a plugin can be activated, i.e. is not currently active and meets the minimum * plugin version requirements set in TGMPA (if any). * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True if OK to activate, false otherwise. */ public function can_plugin_activate( $slug ) { return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) ); } /** * Retrieve the version number of an installed plugin. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string Version number as string or an empty string if the plugin is not installed * or version unknown (plugins which don't comply with the plugin header standard). */ public function get_installed_version( $slug ) { $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; } return ''; } /** * Check whether a plugin complies with the minimum version requirements. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True when a plugin needs to be updated, otherwise false. */ public function does_plugin_require_update( $slug ) { $installed_version = $this->get_installed_version( $slug ); $minimum_version = $this->plugins[ $slug ]['version']; return version_compare( $minimum_version, $installed_version, '>' ); } /** * Check whether there is an update available for a plugin. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return false|string Version number string of the available update or false if no update available. */ public function does_plugin_have_update( $slug ) { // Presume bundled and external plugins will point to a package which meets the minimum required version. if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { if ( $this->does_plugin_require_update( $slug ) ) { return $this->plugins[ $slug ]['version']; } return false; } $repo_updates = get_site_transient( 'update_plugins' ); if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; } return false; } /** * Retrieve potential upgrade notice for a plugin. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string The upgrade notice or an empty string if no message was available or provided. */ public function get_upgrade_notice( $slug ) { // We currently can't get reliable info on non-WP-repo plugins - issue #380. if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { return ''; } $repo_updates = get_site_transient( 'update_plugins' ); if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; } return ''; } /** * Wrapper around the core WP get_plugins function, making sure it's actually available. * * @since 2.5.0 * * @param string $plugin_folder Optional. Relative path to single plugin folder. * @return array Array of installed plugins with plugin information. */ public function get_plugins( $plugin_folder = '' ) { if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } return get_plugins( $plugin_folder ); } /** * Delete dismissable nag option when theme is switched. * * This ensures that the user(s) is/are again reminded via nag of required * and/or recommended plugins if they re-activate the theme. * * @since 2.1.1 */ public function update_dismiss() { delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true ); } /** * Forces plugin activation if the parameter 'force_activation' is * set to true. * * This allows theme authors to specify certain plugins that must be * active at all times while using the current theme. * * Please take special care when using this parameter as it has the * potential to be harmful if not used correctly. Setting this parameter * to true will not allow the specified plugin to be deactivated unless * the user switches themes. * * @since 2.2.0 */ public function force_activation() { foreach ( $this->plugins as $slug => $plugin ) { if ( true === $plugin['force_activation'] ) { if ( ! $this->is_plugin_installed( $slug ) ) { // Oops, plugin isn't there so iterate to next condition. continue; } elseif ( $this->can_plugin_activate( $slug ) ) { // There we go, activate the plugin. activate_plugin( $plugin['file_path'] ); } } } } /** * Forces plugin deactivation if the parameter 'force_deactivation' * is set to true and adds the plugin to the 'recently active' plugins list. * * This allows theme authors to specify certain plugins that must be * deactivated upon switching from the current theme to another. * * Please take special care when using this parameter as it has the * potential to be harmful if not used correctly. * * @since 2.2.0 */ public function force_deactivation() { $deactivated = array(); foreach ( $this->plugins as $slug => $plugin ) { /* * Only proceed forward if the parameter is set to true and plugin is active * as a 'normal' (not must-use) plugin. */ if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) { deactivate_plugins( $plugin['file_path'] ); $deactivated[ $plugin['file_path'] ] = time(); } } if ( ! empty( $deactivated ) ) { update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) ); } } /** * Echo the current TGMPA version number to the page. * * @since 2.5.0 */ public function show_tgmpa_version() { echo '

    ', esc_html( sprintf( /* translators: %s: version number */ __( 'TGMPA v%s', 'tgmpa' ), self::TGMPA_VERSION ) ), '

    '; } /** * Returns the singleton instance of the class. * * @since 2.4.0 * * @return \TGM_Plugin_Activation The TGM_Plugin_Activation object. */ public static function get_instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { self::$instance = new self(); } return self::$instance; } } if ( ! function_exists( 'load_tgm_plugin_activation' ) ) { /** * Ensure only one instance of the class is ever invoked. * * @since 2.5.0 */ function load_tgm_plugin_activation() { $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance(); } } if ( did_action( 'plugins_loaded' ) ) { load_tgm_plugin_activation(); } else { add_action( 'plugins_loaded', 'load_tgm_plugin_activation' ); } } if ( ! function_exists( 'tgmpa' ) ) { /** * Helper function to register a collection of required plugins. * * @since 2.0.0 * @api * * @param array $plugins An array of plugin arrays. * @param array $config Optional. An array of configuration values. */ function tgmpa( $plugins, $config = array() ) { $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); foreach ( $plugins as $plugin ) { call_user_func( array( $instance, 'register' ), $plugin ); } if ( ! empty( $config ) && is_array( $config ) ) { // Send out notices for deprecated arguments passed. if ( isset( $config['notices'] ) ) { _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' ); if ( ! isset( $config['has_notices'] ) ) { $config['has_notices'] = $config['notices']; } } if ( isset( $config['parent_menu_slug'] ) ) { _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.' ); } if ( isset( $config['parent_url_slug'] ) ) { _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.' ); } call_user_func( array( $instance, 'config' ), $config ); } } } /** * WP_List_Table isn't always available. If it isn't available, * we load it here. * * @since 2.2.0 */ if ( ! class_exists( 'WP_List_Table' ) ) { require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; } if ( ! class_exists( 'TGMPA_List_Table' ) ) { /** * List table class for handling plugins. * * Extends the WP_List_Table class to provide a future-compatible * way of listing out all required/recommended plugins. * * Gives users an interface similar to the Plugin Administration * area with similar (albeit stripped down) capabilities. * * This class also allows for the bulk install of plugins. * * @since 2.2.0 * * @package TGM-Plugin-Activation * @author Thomas Griffin * @author Gary Jones */ class TGMPA_List_Table extends WP_List_Table { /** * TGMPA instance. * * @since 2.5.0 * * @var object */ protected $tgmpa; /** * The currently chosen view. * * @since 2.5.0 * * @var string One of: 'all', 'install', 'update', 'activate' */ public $view_context = 'all'; /** * The plugin counts for the various views. * * @since 2.5.0 * * @var array */ protected $view_totals = array( 'all' => 0, 'install' => 0, 'update' => 0, 'activate' => 0, ); /** * References parent constructor and sets defaults for class. * * @since 2.2.0 */ public function __construct() { $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); parent::__construct( array( 'singular' => 'plugin', 'plural' => 'plugins', 'ajax' => false, ) ); if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) { $this->view_context = sanitize_key( $_REQUEST['plugin_status'] ); } add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) ); } /** * Get a list of CSS classes for the tag. * * Overruled to prevent the 'plural' argument from being added. * * @since 2.5.0 * * @return array CSS classnames. */ public function get_table_classes() { return array( 'widefat', 'fixed' ); } /** * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table. * * @since 2.2.0 * * @return array $table_data Information for use in table. */ protected function _gather_plugin_data() { // Load thickbox for plugin links. $this->tgmpa->admin_init(); $this->tgmpa->thickbox(); // Categorize the plugins which have open actions. $plugins = $this->categorize_plugins_to_views(); // Set the counts for the view links. $this->set_view_totals( $plugins ); // Prep variables for use and grab list of all installed plugins. $table_data = array(); $i = 0; // Redirect to the 'all' view if no plugins were found for the selected view context. if ( empty( $plugins[ $this->view_context ] ) ) { $this->view_context = 'all'; } foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) { $table_data[ $i ]['sanitized_plugin'] = $plugin['name']; $table_data[ $i ]['slug'] = $slug; $table_data[ $i ]['plugin'] = '' . $this->tgmpa->get_info_link( $slug ) . ''; $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] ); $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] ); $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug ); $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug ); $table_data[ $i ]['minimum_version'] = $plugin['version']; $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug ); // Prep the upgrade notice info. $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug ); if ( ! empty( $upgrade_notice ) ) { $table_data[ $i ]['upgrade_notice'] = $upgrade_notice; add_action( "tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 ); } $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin ); $i++; } return $table_data; } /** * Categorize the plugins which have open actions into views for the TGMPA page. * * @since 2.5.0 */ protected function categorize_plugins_to_views() { $plugins = array( 'all' => array(), // Meaning: all plugins which still have open actions. 'install' => array(), 'update' => array(), 'activate' => array(), ); foreach ( $this->tgmpa->plugins as $slug => $plugin ) { if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { // No need to display plugins if they are installed, up-to-date and active. continue; } else { $plugins['all'][ $slug ] = $plugin; if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { $plugins['install'][ $slug ] = $plugin; } else { if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { $plugins['update'][ $slug ] = $plugin; } if ( $this->tgmpa->can_plugin_activate( $slug ) ) { $plugins['activate'][ $slug ] = $plugin; } } } } return $plugins; } /** * Set the counts for the view links. * * @since 2.5.0 * * @param array $plugins Plugins order by view. */ protected function set_view_totals( $plugins ) { foreach ( $plugins as $type => $list ) { $this->view_totals[ $type ] = count( $list ); } } /** * Get the plugin required/recommended text string. * * @since 2.5.0 * * @param string $required Plugin required setting. * @return string */ protected function get_plugin_advise_type_text( $required ) { if ( true === $required ) { return __( 'Required', 'tgmpa' ); } return __( 'Recommended', 'tgmpa' ); } /** * Get the plugin source type text string. * * @since 2.5.0 * * @param string $type Plugin type. * @return string */ protected function get_plugin_source_type_text( $type ) { $string = ''; switch ( $type ) { case 'repo': $string = __( 'WordPress Repository', 'tgmpa' ); break; case 'external': $string = __( 'External Source', 'tgmpa' ); break; case 'bundled': $string = __( 'Pre-Packaged', 'tgmpa' ); break; } return $string; } /** * Determine the plugin status message. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string */ protected function get_plugin_status_text( $slug ) { if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { return __( 'Not Installed', 'tgmpa' ); } if ( ! $this->tgmpa->is_plugin_active( $slug ) ) { $install_status = __( 'Installed But Not Activated', 'tgmpa' ); } else { $install_status = __( 'Active', 'tgmpa' ); } $update_status = ''; if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { $update_status = __( 'Required Update not Available', 'tgmpa' ); } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) { $update_status = __( 'Requires Update', 'tgmpa' ); } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { $update_status = __( 'Update recommended', 'tgmpa' ); } if ( '' === $update_status ) { return $install_status; } return sprintf( /* translators: 1: install status, 2: update status */ _x( '%1$s, %2$s', 'Install/Update Status', 'tgmpa' ), $install_status, $update_status ); } /** * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type. * * @since 2.5.0 * * @param array $items Prepared table items. * @return array Sorted table items. */ public function sort_table_items( $items ) { $type = array(); $name = array(); foreach ( $items as $i => $plugin ) { $type[ $i ] = $plugin['type']; // Required / recommended. $name[ $i ] = $plugin['sanitized_plugin']; } array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items ); return $items; } /** * Get an associative array ( id => link ) of the views available on this table. * * @since 2.5.0 * * @return array */ public function get_views() { $status_links = array(); foreach ( $this->view_totals as $type => $count ) { if ( $count < 1 ) { continue; } switch ( $type ) { case 'all': /* translators: 1: number of plugins. */ $text = _nx( 'All (%s)', 'All (%s)', $count, 'plugins', 'tgmpa' ); break; case 'install': /* translators: 1: number of plugins. */ $text = _n( 'To Install (%s)', 'To Install (%s)', $count, 'tgmpa' ); break; case 'update': /* translators: 1: number of plugins. */ $text = _n( 'Update Available (%s)', 'Update Available (%s)', $count, 'tgmpa' ); break; case 'activate': /* translators: 1: number of plugins. */ $text = _n( 'To Activate (%s)', 'To Activate (%s)', $count, 'tgmpa' ); break; default: $text = ''; break; } if ( ! empty( $text ) ) { $status_links[ $type ] = sprintf( '%s', esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ), ( $type === $this->view_context ) ? ' class="current"' : '', sprintf( $text, number_format_i18n( $count ) ) ); } } return $status_links; } /** * Create default columns to display important plugin information * like type, action and status. * * @since 2.2.0 * * @param array $item Array of item data. * @param string $column_name The name of the column. * @return string */ public function column_default( $item, $column_name ) { return $item[ $column_name ]; } /** * Required for bulk installing. * * Adds a checkbox for each plugin. * * @since 2.2.0 * * @param array $item Array of item data. * @return string The input checkbox with all necessary info. */ public function column_cb( $item ) { return sprintf( '', esc_attr( $this->_args['singular'] ), esc_attr( $item['slug'] ), esc_attr( $item['sanitized_plugin'] ) ); } /** * Create default title column along with the action links. * * @since 2.2.0 * * @param array $item Array of item data. * @return string The plugin name and action links. */ public function column_plugin( $item ) { return sprintf( '%1$s %2$s', $item['plugin'], $this->row_actions( $this->get_row_actions( $item ), true ) ); } /** * Create version information column. * * @since 2.5.0 * * @param array $item Array of item data. * @return string HTML-formatted version information. */ public function column_version( $item ) { $output = array(); if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'tgmpa' ); $color = ''; if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) { $color = ' color: #ff0000; font-weight: bold;'; } $output[] = sprintf( '

    %2$s' . __( 'Installed version:', 'tgmpa' ) . '

    ', $color, $installed ); } if ( ! empty( $item['minimum_version'] ) ) { $output[] = sprintf( '

    %1$s' . __( 'Minimum required version:', 'tgmpa' ) . '

    ', $item['minimum_version'] ); } if ( ! empty( $item['available_version'] ) ) { $color = ''; if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) { $color = ' color: #71C671; font-weight: bold;'; } $output[] = sprintf( '

    %2$s' . __( 'Available version:', 'tgmpa' ) . '

    ', $color, $item['available_version'] ); } if ( empty( $output ) ) { return ' '; // Let's not break the table layout. } else { return implode( "\n", $output ); } } /** * Sets default message within the plugins table if no plugins * are left for interaction. * * Hides the menu item to prevent the user from clicking and * getting a permissions error. * * @since 2.2.0 */ public function no_items() { echo esc_html__( 'No plugins to install, update or activate.', 'tgmpa' ) . ' ' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . ''; echo ''; } /** * Output all the column information within the table. * * @since 2.2.0 * * @return array $columns The column names. */ public function get_columns() { $columns = array( 'cb' => '', 'plugin' => __( 'Plugin', 'tgmpa' ), 'source' => __( 'Source', 'tgmpa' ), 'type' => __( 'Type', 'tgmpa' ), ); if ( 'all' === $this->view_context || 'update' === $this->view_context ) { $columns['version'] = __( 'Version', 'tgmpa' ); $columns['status'] = __( 'Status', 'tgmpa' ); } return apply_filters( 'tgmpa_table_columns', $columns ); } /** * Get name of default primary column * * @since 2.5.0 / WP 4.3+ compatibility * @access protected * * @return string */ protected function get_default_primary_column_name() { return 'plugin'; } /** * Get the name of the primary column. * * @since 2.5.0 / WP 4.3+ compatibility * @access protected * * @return string The name of the primary column. */ protected function get_primary_column_name() { if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) { return parent::get_primary_column_name(); } else { return $this->get_default_primary_column_name(); } } /** * Get the actions which are relevant for a specific plugin row. * * @since 2.5.0 * * @param array $item Array of item data. * @return array Array with relevant action links. */ protected function get_row_actions( $item ) { $actions = array(); $action_links = array(); // Display the 'Install' action link if the plugin is not yet available. if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { /* translators: %2$s: plugin name in screen reader markup */ $actions['install'] = __( 'Install %2$s', 'tgmpa' ); } else { // Display the 'Update' action link if an update is available and WP complies with plugin minimum. if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) { /* translators: %2$s: plugin name in screen reader markup */ $actions['update'] = __( 'Update %2$s', 'tgmpa' ); } // Display the 'Activate' action link, but only if the plugin meets the minimum version. if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) { /* translators: %2$s: plugin name in screen reader markup */ $actions['activate'] = __( 'Activate %2$s', 'tgmpa' ); } } // Create the actual links. foreach ( $actions as $action => $text ) { $nonce_url = wp_nonce_url( add_query_arg( array( 'plugin' => urlencode( $item['slug'] ), 'tgmpa-' . $action => $action . '-plugin', ), $this->tgmpa->get_tgmpa_url() ), 'tgmpa-' . $action, 'tgmpa-nonce' ); $action_links[ $action ] = sprintf( '' . esc_html( $text ) . '', // $text contains the second placeholder. esc_url( $nonce_url ), '' . esc_html( $item['sanitized_plugin'] ) . '' ); } $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : ''; return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context ); } /** * Generates content for a single row of the table. * * @since 2.5.0 * * @param object $item The current item. */ public function single_row( $item ) { parent::single_row( $item ); /** * Fires after each specific row in the TGMPA Plugins list table. * * The dynamic portion of the hook name, `$item['slug']`, refers to the slug * for the plugin. * * @since 2.5.0 */ do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context ); } /** * Show the upgrade notice below a plugin row if there is one. * * @since 2.5.0 * * @see /wp-admin/includes/update.php * * @param string $slug Plugin slug. * @param array $item The information available in this table row. * @return null Return early if upgrade notice is empty. */ public function wp_plugin_update_row( $slug, $item ) { if ( empty( $item['upgrade_notice'] ) ) { return; } echo ' '; } /** * Extra controls to be displayed between bulk actions and pagination. * * @since 2.5.0 * * @param string $which 'top' or 'bottom' table navigation. */ public function extra_tablenav( $which ) { if ( 'bottom' === $which ) { $this->tgmpa->show_tgmpa_version(); } } /** * Defines the bulk actions for handling registered plugins. * * @since 2.2.0 * * @return array $actions The bulk actions for the plugin install table. */ public function get_bulk_actions() { $actions = array(); if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) { if ( current_user_can( 'install_plugins' ) ) { $actions['tgmpa-bulk-install'] = __( 'Install', 'tgmpa' ); } } if ( 'install' !== $this->view_context ) { if ( current_user_can( 'update_plugins' ) ) { $actions['tgmpa-bulk-update'] = __( 'Update', 'tgmpa' ); } if ( current_user_can( 'activate_plugins' ) ) { $actions['tgmpa-bulk-activate'] = __( 'Activate', 'tgmpa' ); } } return $actions; } /** * Processes bulk installation and activation actions. * * The bulk installation process looks for the $_POST information and passes that * through if a user has to use WP_Filesystem to enter their credentials. * * @since 2.2.0 */ public function process_bulk_actions() { // Bulk installation process. if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) { check_admin_referer( 'bulk-' . $this->_args['plural'] ); $install_type = 'install'; if ( 'tgmpa-bulk-update' === $this->current_action() ) { $install_type = 'update'; } $plugins_to_install = array(); // Did user actually select any plugins to install/update ? if ( empty( $_POST['plugin'] ) ) { if ( 'install' === $install_type ) { $message = __( 'No plugins were selected to be installed. No action taken.', 'tgmpa' ); } else { $message = __( 'No plugins were selected to be updated. No action taken.', 'tgmpa' ); } echo '

    ', esc_html( $message ), '

    '; return false; } if ( is_array( $_POST['plugin'] ) ) { $plugins_to_install = (array) $_POST['plugin']; } elseif ( is_string( $_POST['plugin'] ) ) { // Received via Filesystem page - un-flatten array (WP bug #19643). $plugins_to_install = explode( ',', $_POST['plugin'] ); } // Sanitize the received input. $plugins_to_install = array_map( 'urldecode', $plugins_to_install ); $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install ); // Validate the received input. foreach ( $plugins_to_install as $key => $slug ) { // Check if the plugin was registered with TGMPA and remove if not. if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) { unset( $plugins_to_install[ $key ] ); continue; } // For install: make sure this is a plugin we *can* install and not one already installed. if ( 'install' === $install_type && true === $this->tgmpa->is_plugin_installed( $slug ) ) { unset( $plugins_to_install[ $key ] ); } // For updates: make sure this is a plugin we *can* update (update available and WP version ok). if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) { unset( $plugins_to_install[ $key ] ); } } // No need to proceed further if we have no plugins to handle. if ( empty( $plugins_to_install ) ) { if ( 'install' === $install_type ) { $message = __( 'No plugins are available to be installed at this time.', 'tgmpa' ); } else { $message = __( 'No plugins are available to be updated at this time.', 'tgmpa' ); } echo '

    ', esc_html( $message ), '

    '; return false; } // Pass all necessary information if WP_Filesystem is needed. $url = wp_nonce_url( $this->tgmpa->get_tgmpa_url(), 'bulk-' . $this->_args['plural'] ); // Give validated data back to $_POST which is the only place the filesystem looks for extra fields. $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643. $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem. if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) { return true; // Stop the normal page form from displaying, credential request form will be shown. } // Now we have some credentials, setup WP_Filesystem. if ( ! WP_Filesystem( $creds ) ) { // Our credentials were no good, ask the user for them again. request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields ); return true; } /* If we arrive here, we have the filesystem */ // Store all information in arrays since we are processing a bulk installation. $names = array(); $sources = array(); // Needed for installs. $file_paths = array(); // Needed for upgrades. $to_inject = array(); // Information to inject into the update_plugins transient. // Prepare the data for validated plugins for the install/upgrade. foreach ( $plugins_to_install as $slug ) { $name = $this->tgmpa->plugins[ $slug ]['name']; $source = $this->tgmpa->get_download_url( $slug ); if ( ! empty( $name ) && ! empty( $source ) ) { $names[] = $name; switch ( $install_type ) { case 'install': $sources[] = $source; break; case 'update': $file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path']; $to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ]; $to_inject[ $slug ]['source'] = $source; break; } } } unset( $slug, $name, $source ); // Create a new instance of TGMPA_Bulk_Installer. $installer = new TGMPA_Bulk_Installer( new TGMPA_Bulk_Installer_Skin( array( 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ), 'nonce' => 'bulk-' . $this->_args['plural'], 'names' => $names, 'install_type' => $install_type, ) ) ); // Wrap the install process with the appropriate HTML. echo '
    ', '

    ', esc_html( get_admin_page_title() ), '

    '; // Process the bulk installation submissions. add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 ); if ( 'tgmpa-bulk-update' === $this->current_action() ) { // Inject our info into the update transient. $this->tgmpa->inject_update_info( $to_inject ); $installer->bulk_upgrade( $file_paths ); } else { $installer->bulk_install( $sources ); } remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 ); echo '
    '; return true; } // Bulk activation process. if ( 'tgmpa-bulk-activate' === $this->current_action() ) { check_admin_referer( 'bulk-' . $this->_args['plural'] ); // Did user actually select any plugins to activate ? if ( empty( $_POST['plugin'] ) ) { echo '

    ', esc_html__( 'No plugins were selected to be activated. No action taken.', 'tgmpa' ), '

    '; return false; } // Grab plugin data from $_POST. $plugins = array(); if ( isset( $_POST['plugin'] ) ) { $plugins = array_map( 'urldecode', (array) $_POST['plugin'] ); $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins ); } $plugins_to_activate = array(); $plugin_names = array(); // Grab the file paths for the selected & inactive plugins from the registration array. foreach ( $plugins as $slug ) { if ( $this->tgmpa->can_plugin_activate( $slug ) ) { $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path']; $plugin_names[] = $this->tgmpa->plugins[ $slug ]['name']; } } unset( $slug ); // Return early if there are no plugins to activate. if ( empty( $plugins_to_activate ) ) { echo '

    ', esc_html__( 'No plugins are available to be activated at this time.', 'tgmpa' ), '

    '; return false; } // Now we are good to go - let's start activating plugins. $activate = activate_plugins( $plugins_to_activate ); if ( is_wp_error( $activate ) ) { echo '

    ', wp_kses_post( $activate->get_error_message() ), '

    '; } else { $count = count( $plugin_names ); // Count so we can use _n function. $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names ); $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability. $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin ); printf( // WPCS: xss ok. '

    %1$s %2$s.

    ', esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'tgmpa' ) ), $imploded ); // Update recently activated plugins option. $recent = (array) get_option( 'recently_activated' ); foreach ( $plugins_to_activate as $plugin => $time ) { if ( isset( $recent[ $plugin ] ) ) { unset( $recent[ $plugin ] ); } } update_option( 'recently_activated', $recent ); } unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another. return true; } return false; } /** * Prepares all of our information to be outputted into a usable table. * * @since 2.2.0 */ public function prepare_items() { $columns = $this->get_columns(); // Get all necessary column information. $hidden = array(); // No columns to hide, but we must set as an array. $sortable = array(); // No reason to make sortable columns. $primary = $this->get_primary_column_name(); // Column which has the row actions. $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers. // Process our bulk activations here. if ( 'tgmpa-bulk-activate' === $this->current_action() ) { $this->process_bulk_actions(); } // Store all of our plugin data into $items array so WP_List_Table can use it. $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() ); } /* *********** DEPRECATED METHODS *********** */ /** * Retrieve plugin data, given the plugin name. * * @since 2.2.0 * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead. * @see TGM_Plugin_Activation::_get_plugin_data_from_name() * * @param string $name Name of the plugin, as it was registered. * @param string $data Optional. Array key of plugin data to return. Default is slug. * @return string|boolean Plugin slug if found, false otherwise. */ protected function _get_plugin_data_from_name( $name, $data = 'slug' ) { _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' ); return $this->tgmpa->_get_plugin_data_from_name( $name, $data ); } } } if ( ! class_exists( 'TGM_Bulk_Installer' ) ) { /** * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+. * * @since 2.5.2 * * {@internal The TGMPA_Bulk_Installer class was originally called TGM_Bulk_Installer. * For more information, see that class.}} */ class TGM_Bulk_Installer { } } if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) { /** * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+. * * @since 2.5.2 * * {@internal The TGMPA_Bulk_Installer_Skin class was originally called TGM_Bulk_Installer_Skin. * For more information, see that class.}} */ class TGM_Bulk_Installer_Skin { } } /** * The WP_Upgrader file isn't always available. If it isn't available, * we load it here. * * We check to make sure no action or activation keys are set so that WordPress * does not try to re-include the class when processing upgrades or installs outside * of the class. * * @since 2.2.0 */ add_action( 'admin_init', 'tgmpa_load_bulk_installer' ); if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) { /** * Load bulk installer */ function tgmpa_load_bulk_installer() { // Silently fail if 2.5+ is loaded *after* an older version. if ( ! isset( $GLOBALS['tgmpa'] ) ) { return; } // Get TGMPA class instance. $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) { if ( ! class_exists( 'Plugin_Upgrader', false ) ) { require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; } if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) { /** * Installer class to handle bulk plugin installations. * * Extends WP_Upgrader and customizes to suit the installation of multiple * plugins. * * @since 2.2.0 * * {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}} * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer. * This was done to prevent backward compatibility issues with v2.3.6.}} * * @package TGM-Plugin-Activation * @author Thomas Griffin * @author Gary Jones */ class TGMPA_Bulk_Installer extends Plugin_Upgrader { /** * Holds result of bulk plugin installation. * * @since 2.2.0 * * @var string */ public $result; /** * Flag to check if bulk installation is occurring or not. * * @since 2.2.0 * * @var boolean */ public $bulk = false; /** * TGMPA instance * * @since 2.5.0 * * @var object */ protected $tgmpa; /** * Whether or not the destination directory needs to be cleared ( = on update). * * @since 2.5.0 * * @var bool */ protected $clear_destination = false; /** * References parent constructor and sets defaults for class. * * @since 2.2.0 * * @param \Bulk_Upgrader_Skin|null $skin Installer skin. */ public function __construct( $skin = null ) { // Get TGMPA class instance. $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); parent::__construct( $skin ); if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) { $this->clear_destination = true; } if ( $this->tgmpa->is_automatic ) { $this->activate_strings(); } add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) ); } /** * Sets the correct activation strings for the installer skin to use. * * @since 2.2.0 */ public function activate_strings() { $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'tgmpa' ); $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'tgmpa' ); } /** * Performs the actual installation of each plugin. * * @since 2.2.0 * * @see WP_Upgrader::run() * * @param array $options The installation config options. * @return null|array Return early if error, array of installation data on success. */ public function run( $options ) { $result = parent::run( $options ); // Reset the strings in case we changed one during automatic activation. if ( $this->tgmpa->is_automatic ) { if ( 'update' === $this->skin->options['install_type'] ) { $this->upgrade_strings(); } else { $this->install_strings(); } } return $result; } /** * Processes the bulk installation of plugins. * * @since 2.2.0 * * {@internal This is basically a near identical copy of the WP Core * Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with * new installs instead of upgrades. * For ease of future synchronizations, the adjustments are clearly commented, but no other * comments are added. Code style has been made to comply.}} * * @see Plugin_Upgrader::bulk_upgrade() * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838 * (@internal Last synced: Dec 31st 2015 against https://core.trac.wordpress.org/browser/trunk?rev=36134}} * * @param array $plugins The plugin sources needed for installation. * @param array $args Arbitrary passed extra arguments. * @return array|false Install confirmation messages on success, false on failure. */ public function bulk_install( $plugins, $args = array() ) { // [TGMPA + ] Hook auto-activation in. add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); $defaults = array( 'clear_update_cache' => true, ); $parsed_args = wp_parse_args( $args, $defaults ); $this->init(); $this->bulk = true; $this->install_strings(); // [TGMPA + ] adjusted. /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */ /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */ $this->skin->header(); // Connect to the Filesystem first. $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); if ( ! $res ) { $this->skin->footer(); return false; } $this->skin->bulk_header(); /* * Only start maintenance mode if: * - running Multisite and there are one or more plugins specified, OR * - a plugin with an update available is currently active. * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible. */ $maintenance = ( is_multisite() && ! empty( $plugins ) ); /* [TGMPA - ] foreach ( $plugins as $plugin ) $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) ); */ if ( $maintenance ) { $this->maintenance_mode( true ); } $results = array(); $this->update_count = count( $plugins ); $this->update_current = 0; foreach ( $plugins as $plugin ) { $this->update_current++; /* [TGMPA - ] $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true); if ( !isset( $current->response[ $plugin ] ) ) { $this->skin->set_result('up_to_date'); $this->skin->before(); $this->skin->feedback('up_to_date'); $this->skin->after(); $results[$plugin] = true; continue; } // Get the URL to the zip file. $r = $current->response[ $plugin ]; $this->skin->plugin_active = is_plugin_active($plugin); */ $result = $this->run( array( 'package' => $plugin, // [TGMPA + ] adjusted. 'destination' => WP_PLUGIN_DIR, 'clear_destination' => false, // [TGMPA + ] adjusted. 'clear_working' => true, 'is_multi' => true, 'hook_extra' => array( 'plugin' => $plugin, ), ) ); $results[ $plugin ] = $this->result; // Prevent credentials auth screen from displaying multiple times. if ( false === $result ) { break; } } //end foreach $plugins $this->maintenance_mode( false ); /** * Fires when the bulk upgrader process is complete. * * @since WP 3.6.0 / TGMPA 2.5.0 * * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might * be a Theme_Upgrader or Core_Upgrade instance. * @param array $data { * Array of bulk item update data. * * @type string $action Type of action. Default 'update'. * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'. * @type bool $bulk Whether the update process is a bulk update. Default true. * @type array $packages Array of plugin, theme, or core packages to update. * } */ do_action( 'upgrader_process_complete', $this, array( 'action' => 'install', // [TGMPA + ] adjusted. 'type' => 'plugin', 'bulk' => true, 'plugins' => $plugins, ) ); $this->skin->bulk_footer(); $this->skin->footer(); // Cleanup our hooks, in case something else does a upgrade on this connection. /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */ // [TGMPA + ] Remove our auto-activation hook. remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); // Force refresh of plugin update information. wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); return $results; } /** * Handle a bulk upgrade request. * * @since 2.5.0 * * @see Plugin_Upgrader::bulk_upgrade() * * @param array $plugins The local WP file_path's of the plugins which should be upgraded. * @param array $args Arbitrary passed extra arguments. * @return string|bool Install confirmation messages on success, false on failure. */ public function bulk_upgrade( $plugins, $args = array() ) { add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); $result = parent::bulk_upgrade( $plugins, $args ); remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); return $result; } /** * Abuse a filter to auto-activate plugins after installation. * * Hooked into the 'upgrader_post_install' filter hook. * * @since 2.5.0 * * @param bool $bool The value we need to give back (true). * @return bool */ public function auto_activate( $bool ) { // Only process the activation of installed plugins if the automatic flag is set to true. if ( $this->tgmpa->is_automatic ) { // Flush plugins cache so the headers of the newly installed plugins will be read correctly. wp_clean_plugins_cache(); // Get the installed plugin file. $plugin_info = $this->plugin_info(); // Don't try to activate on upgrade of active plugin as WP will do this already. if ( ! is_plugin_active( $plugin_info ) ) { $activate = activate_plugin( $plugin_info ); // Adjust the success string based on the activation result. $this->strings['process_success'] = $this->strings['process_success'] . "
    \n"; if ( is_wp_error( $activate ) ) { $this->skin->error( $activate ); $this->strings['process_success'] .= $this->strings['activation_failed']; } else { $this->strings['process_success'] .= $this->strings['activation_success']; } } } return $bool; } } } if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) { /** * Installer skin to set strings for the bulk plugin installations.. * * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple * plugins. * * @since 2.2.0 * * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to * TGMPA_Bulk_Installer_Skin. * This was done to prevent backward compatibility issues with v2.3.6.}} * * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php * * @package TGM-Plugin-Activation * @author Thomas Griffin * @author Gary Jones */ class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin { /** * Holds plugin info for each individual plugin installation. * * @since 2.2.0 * * @var array */ public $plugin_info = array(); /** * Holds names of plugins that are undergoing bulk installations. * * @since 2.2.0 * * @var array */ public $plugin_names = array(); /** * Integer to use for iteration through each plugin installation. * * @since 2.2.0 * * @var integer */ public $i = 0; /** * TGMPA instance * * @since 2.5.0 * * @var object */ protected $tgmpa; /** * Constructor. Parses default args with new ones and extracts them for use. * * @since 2.2.0 * * @param array $args Arguments to pass for use within the class. */ public function __construct( $args = array() ) { // Get TGMPA class instance. $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); // Parse default and new args. $defaults = array( 'url' => '', 'nonce' => '', 'names' => array(), 'install_type' => 'install', ); $args = wp_parse_args( $args, $defaults ); // Set plugin names to $this->plugin_names property. $this->plugin_names = $args['names']; // Extract the new args. parent::__construct( $args ); } /** * Sets install skin strings for each individual plugin. * * Checks to see if the automatic activation flag is set and uses the * the proper strings accordingly. * * @since 2.2.0 */ public function add_strings() { if ( 'update' === $this->options['install_type'] ) { parent::add_strings(); /* translators: 1: plugin name, 2: action number 3: total number of actions. */ $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); } else { /* translators: 1: plugin name, 2: error message. */ $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: %2$s.', 'tgmpa' ); /* translators: 1: plugin name. */ $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'tgmpa' ); if ( $this->tgmpa->is_automatic ) { // Automatic activation strings. $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' ); /* translators: 1: plugin name. */ $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'tgmpa' ) . ' ' . esc_html__( 'Show Details', 'tgmpa' ) . '.'; $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'tgmpa' ); /* translators: 1: plugin name, 2: action number 3: total number of actions. */ $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); } else { // Default installation strings. $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' ); /* translators: 1: plugin name. */ $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'tgmpa' ) . ' ' . esc_html__( 'Show Details', 'tgmpa' ) . '.'; $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'tgmpa' ); /* translators: 1: plugin name, 2: action number 3: total number of actions. */ $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); } } } /** * Outputs the header strings and necessary JS before each plugin installation. * * @since 2.2.0 * * @param string $title Unused in this implementation. */ public function before( $title = '' ) { if ( empty( $title ) ) { $title = esc_html( $this->plugin_names[ $this->i ] ); } parent::before( $title ); } /** * Outputs the footer strings and necessary JS after each plugin installation. * * Checks for any errors and outputs them if they exist, else output * success strings. * * @since 2.2.0 * * @param string $title Unused in this implementation. */ public function after( $title = '' ) { if ( empty( $title ) ) { $title = esc_html( $this->plugin_names[ $this->i ] ); } parent::after( $title ); $this->i++; } /** * Outputs links after bulk plugin installation is complete. * * @since 2.2.0 */ public function bulk_footer() { // Serve up the string to say installations (and possibly activations) are complete. parent::bulk_footer(); // Flush plugins cache so we can make sure that the installed plugins list is always up to date. wp_clean_plugins_cache(); $this->tgmpa->show_tgmpa_version(); // Display message based on if all plugins are now active or not. $update_actions = array(); if ( $this->tgmpa->is_tgmpa_complete() ) { // All plugins are active, so we display the complete string and hide the menu to protect users. echo ''; $update_actions['dashboard'] = sprintf( esc_html( $this->tgmpa->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '' ); } else { $update_actions['tgmpa_page'] = '' . esc_html( $this->tgmpa->strings['return'] ) . ''; } /** * Filter the list of action links available following bulk plugin installs/updates. * * @since 2.5.0 * * @param array $update_actions Array of plugin action links. * @param array $plugin_info Array of information for the last-handled plugin. */ $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info ); if ( ! empty( $update_actions ) ) { $this->feedback( implode( ' | ', (array) $update_actions ) ); } } /* *********** DEPRECATED METHODS *********** */ /** * Flush header output buffer. * * @since 2.2.0 * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead * @see Bulk_Upgrader_Skin::flush_output() */ public function before_flush_output() { _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); $this->flush_output(); } /** * Flush footer output buffer and iterate $this->i to make sure the * installation strings reference the correct plugin. * * @since 2.2.0 * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead * @see Bulk_Upgrader_Skin::flush_output() */ public function after_flush_output() { _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); $this->flush_output(); $this->i++; } } } } } } if ( ! class_exists( 'TGMPA_Utils' ) ) { /** * Generic utilities for TGMPA. * * All methods are static, poor-dev name-spacing class wrapper. * * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy. * * @since 2.5.0 * * @package TGM-Plugin-Activation * @author Juliette Reinders Folmer */ class TGMPA_Utils { /** * Whether the PHP filter extension is enabled. * * @see http://php.net/book.filter * * @since 2.5.0 * * @static * * @var bool $has_filters True is the extension is enabled. */ public static $has_filters; /** * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). * * @since 2.5.0 * * @static * * @param string $string Text to be wrapped. * @return string */ public static function wrap_in_em( $string ) { return '' . wp_kses_post( $string ) . ''; } /** * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). * * @since 2.5.0 * * @static * * @param string $string Text to be wrapped. * @return string */ public static function wrap_in_strong( $string ) { return '' . wp_kses_post( $string ) . ''; } /** * Helper function: Validate a value as boolean * * @since 2.5.0 * * @static * * @param mixed $value Arbitrary value. * @return bool */ public static function validate_bool( $value ) { if ( ! isset( self::$has_filters ) ) { self::$has_filters = extension_loaded( 'filter' ); } if ( self::$has_filters ) { return filter_var( $value, FILTER_VALIDATE_BOOLEAN ); } else { return self::emulate_filter_bool( $value ); } } /** * Helper function: Cast a value to bool * * @since 2.5.0 * * @static * * @param mixed $value Value to cast. * @return bool */ protected static function emulate_filter_bool( $value ) { // @codingStandardsIgnoreStart static $true = array( '1', 'true', 'True', 'TRUE', 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', ); static $false = array( '0', 'false', 'False', 'FALSE', 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF', ); // @codingStandardsIgnoreEnd if ( is_bool( $value ) ) { return $value; } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) { return (bool) $value; } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) { return (bool) $value; } elseif ( is_string( $value ) ) { $value = trim( $value ); if ( in_array( $value, $true, true ) ) { return true; } elseif ( in_array( $value, $false, true ) ) { return false; } else { return false; } } return false; } } // End of class TGMPA_Utils } // End of class_exists wrapper ================================================ FILE: includes/shortcodes/class-sp-shortcode-countdown.php ================================================ templates->$type; // Combine layout setting with available templates $templates = array_merge( array_flip( $layout ), $templates ); $templates = apply_filters( 'sportspress_' . $type . '_templates', $templates ); // Split templates into sections and tabs $slice = array_search( 'tabs', array_keys( $templates ) ); if ( $slice ) { $section_templates = array_slice( $templates, 0, $slice ); $tab_templates = array_slice( $templates, $slice ); } else { $section_templates = $templates; $tab_templates = array(); } ob_start(); // Before template hook do_action( 'sportspress_before_single_' . $type ); // Loop through sections if ( ! empty( $section_templates ) ) { foreach ( $section_templates as $key => $template ) { // Ignore templates that are unavailable or that have been turned off if ( ! is_array( $template ) ) { continue; } if ( ! isset( $template['option'] ) ) { continue; } if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) { continue; } // Render the template echo '
    '; if ( 'content' === $key ) { echo wp_kses_post( $content ); // Template content hook do_action( 'sportspress_single_' . $type . '_content' ); } elseif ( 'excerpt' === $key ) { sp_get_template( 'post-excerpt.php', $atts ); } else { // call_user_func( $template['action'] ); sp_get_template( 'event-' . $key . '.php', $atts ); } echo '
    '; } } // After template hook do_action( 'sportspress_after_single_' . $type ); $ob = ob_get_clean(); $tabs = ''; if ( ! empty( $tab_templates ) ) { $i = 0; $tab_content = ''; foreach ( $tab_templates as $key => $template ) { // Ignore templates that are unavailable or that have been turned off if ( ! is_array( $template ) ) { continue; } if ( ! isset( $template['option'] ) ) { continue; } if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) { continue; } // Put tab content into buffer ob_start(); if ( 'content' === $key ) { echo wp_kses_post( $content ); // Template content hook do_action( 'sportspress_single_' . $type . '_content' ); } elseif ( 'excerpt' === $key ) { sp_get_template( 'post-excerpt.php', $atts ); } else { // call_user_func( $template['action'] ); sp_get_template( 'event-' . $key . '.php', $atts ); } $buffer = ob_get_clean(); // Trim whitespace from buffer $buffer = trim( $buffer ); // Continue if tab content is empty if ( empty( $buffer ) ) { continue; } // Get template label $label = sp_array_value( $template, 'label', $template['title'] ); // Add to tabs $tabs .= '
  • ' . apply_filters( 'gettext', $label, $label, 'sportspress' ) . '
  • '; // Render the template $tab_content .= '
    ' . $buffer . '
    '; $i++; } $ob .= '
    '; if ( ! empty( $tabs ) ) { $ob .= '
      ' . $tabs . '
    '; } $ob .= $tab_content; $ob .= '
    '; } // Add all the native allowed html tags $allowed_html = wp_kses_allowed_html( 'post' ); // Include script as allowed tag $allowed_html['script'] = array(); // Include iframe as allowed tag $allowed_html['iframe'] = array( 'src' => array(), 'height' => array(), 'width' => array(), 'allow' => array(), 'title' => array(), 'frameborder' => array(), 'allowfullscreen' => array(), ); echo wp_kses( $ob, $allowed_html ); } } ================================================ FILE: includes/shortcodes/class-sp-shortcode-event-list.php ================================================ $post_type, 'numberposts' => -1, 'posts_per_page' => -1, ), $args ); return get_posts( $args ); } function sp_get_leagues( $post = 0, $ids = true ) { $terms = get_the_terms( $post, 'sp_league' ); if ( $terms && $ids ) { $terms = wp_list_pluck( $terms, 'term_id' ); } return $terms; } function sp_get_seasons( $post = 0, $ids = true ) { $terms = get_the_terms( $post, 'sp_season' ); if ( $terms && $ids ) { $terms = wp_list_pluck( $terms, 'term_id' ); } return $terms; } function sp_the_leagues( $post = 0, $delimiter = ', ' ) { $terms = sp_get_leagues( $post, false ); $arr = array(); if ( $terms ) { foreach ( $terms as $term ) : $arr[] = $term->name; endforeach; } echo wp_kses_post( implode( $delimiter, $arr ) ); } function sp_the_seasons( $post = 0, $delimiter = ', ' ) { $terms = sp_get_seasons( $post, false ); $arr = array(); if ( $terms ) { foreach ( $terms as $term ) : $arr[] = $term->name; endforeach; } echo wp_kses_post( implode( $delimiter, $arr ) ); } /** * Retrieve a post object by exact title for any post type. * * This function replaces the deprecated get_page_by_title() call by running a WP_Query * that looks for an exact match on post_title within the specified post type(s). * * @param string $title The exact post title to search for. * @param string|string[] $post_types Post type slug (or array of slugs) to search in. * @param string|string[] $post_status Post status or array of statuses to include. Default 'publish'. * @return WP_Post|null WP_Post object if found; null otherwise. */ function sp_get_post_by_title( $title, $post_types, $post_status = 'publish' ) { // If the input $title came from a source that applied magic‐quotes, reverse it. $post_title = wp_unslash( $title ); // Force $post_types and $post_status into arrays so WP_Query accepts them. $post_type_arg = (array) $post_types; $post_status_arg = (array) $post_status; // Build query args. We're matching post_title exactly via 'title' (available since WP 4.4). $args = array( 'post_type' => $post_type_arg, // Query one or more post types. 'post_status' => $post_status_arg, // Query one or more statuses. 'posts_per_page' => 1, // Only need one match. 'no_found_rows' => true, // Skip pagination count for performance. 'ignore_sticky_posts' => true, // Not relevant, but good practice. 'update_post_term_cache' => false, // Skip term cache—unneeded here. 'update_post_meta_cache' => false, // Skip meta cache—unneeded here. 'title' => $post_title, // Exact title match. 'orderby' => 'post_date ID', // Ensure deterministic ordering. 'order' => 'ASC', ); // Execute the query. $query = new WP_Query( $args ); // If a post is found, grab it; otherwise $query->posts will be empty. if ( $query->have_posts() ) { $post_obj = $query->posts[0]; wp_reset_postdata(); // Reset global $post if it was changed by WP_Query. return $post_obj; } // No match—reset global state and return null. wp_reset_postdata(); return null; } /* * Event functions */ function sp_get_status( $post = 0 ) { $event = new SP_Event( $post ); return $event->status(); } function sp_get_results( $post = 0 ) { $event = new SP_Event( $post ); return $event->results(); } function sp_get_teams( $post = 0 ) { return get_post_meta( $post, 'sp_team' ); } function sp_get_main_result_option() { $main_result = get_option( 'sportspress_primary_result', null ); if ( $main_result ) { return $main_result; } $results = get_posts( array( 'post_type' => 'sp_result', 'posts_per_page' => 1, 'orderby' => 'menu_order', 'order' => 'DESC', ) ); if ( ! $results ) { return null; } $result = reset( $results ); $slug = $result->post_name; return $slug; } function sp_get_main_results( $post = 0 ) { $event = new SP_Event( $post ); return $event->main_results(); } function sp_the_main_results( $post = 0, $delimiter = '-' ) { $results = sp_get_main_results( $post ); echo wp_kses_post( implode( $delimiter, $results ) ); } function sp_update_main_results( $post = 0, $results = array() ) { $event = new SP_Event( $post ); return $event->update_main_results( $results ); } function sp_get_main_results_or_time( $post = 0 ) { $results = sp_get_main_results( $post ); if ( sizeof( $results ) ) { return $results; } else { return array( sp_get_time( $post ) ); } } function sp_the_main_results_or_time( $post = 0, $delimiter = '-' ) { echo wp_kses_post( implode( $delimiter, sp_get_main_results_or_time( $post ) ) ); } function sp_get_main_results_or_date( $post = 0, $format = null ) { $results = sp_get_main_results( $post ); if ( sizeof( $results ) ) { return $results; } else { return array( sp_get_date( $post, $format ) ); } } function sp_get_outcome( $post = 0 ) { $event = new SP_Event( $post ); return $event->outcome( true ); } function sp_get_outcomes( $post = 0 ) { $event = new SP_Event( $post ); return $event->outcome( false ); } function sp_get_winner( $post = 0 ) { $event = new SP_Event( $post ); return $event->winner(); } function sp_get_main_performance_option() { $main_performance = get_option( 'sportspress_primary_performance', null ); if ( $main_performance ) { return $main_performance; } $options = get_posts( array( 'post_type' => 'sp_performance', 'posts_per_page' => 1, 'orderby' => 'menu_order', 'order' => 'ASC', ) ); if ( ! $options ) { return null; } $performance = reset( $options ); $slug = $performance->post_name; return $slug; } function sp_get_performance( $post = 0 ) { $event = new SP_Event( $post ); return $event->performance(); } function sp_get_singular_name( $post = 0 ) { $singular = get_post_meta( $post, 'sp_singular', true ); if ( $singular && '' !== $singular ) { return $singular; } else { return get_the_title( $post ); } } function sp_event_logos( $post = 0 ) { sp_get_template( 'event-logos.php', array( 'id' => $post ) ); } function sp_event_video( $post = 0 ) { sp_get_template( 'event-video.php', array( 'id' => $post ) ); } function sp_event_results( $post = 0 ) { sp_get_template( 'event-results.php', array( 'id' => $post ) ); } function sp_event_details( $post = 0 ) { sp_get_template( 'event-details.php', array( 'id' => $post ) ); } function sp_event_venue( $post = 0 ) { sp_get_template( 'event-venue.php', array( 'id' => $post ) ); } function sp_event_staff( $post = 0 ) { sp_get_template( 'event-staff.php', array( 'id' => $post ) ); } function sp_event_performance( $post = 0 ) { sp_get_template( 'event-performance.php', array( 'id' => $post ) ); } /* * Calendar functions */ function sp_get_calendar( $post = 0 ) { $calendar = new SP_Calendar( $post ); return $calendar->data(); } function sp_event_calendar( $post = 0 ) { sp_get_template( 'event-calendar.php', array( 'id' => $post ) ); } function sp_event_list( $post = 0 ) { sp_get_template( 'event-list.php', array( 'id' => $post ) ); } function sp_event_blocks( $post = 0 ) { sp_get_template( 'event-blocks.php', array( 'id' => $post ) ); } /* * Team functions */ function sp_has_logo( $post = 0 ) { return has_post_thumbnail( $post ); } function sp_get_logo( $post = 0, $size = 'icon', $attr = array() ) { return get_the_post_thumbnail( $post, 'sportspress-fit-' . $size, $attr ); } function sp_get_logo_url( $post = 0, $size = 'icon' ) { $thumbnail_id = get_post_thumbnail_id( $post ); $src = wp_get_attachment_image_src( $thumbnail_id, $size, false ); return $src[0]; } function sp_get_abbreviation( $post = 0 ) { return get_post_meta( $post, 'sp_abbreviation', true ); } function sp_get_venues( $post = 0, $ids = true ) { $terms = get_the_terms( $post, 'sp_venue' ); if ( $terms && $ids ) { $terms = wp_list_pluck( $terms, 'term_id' ); } return $terms; } function sp_the_venues( $post = 0, $delimiter = ', ' ) { $terms = sp_get_venues( $post, false ); $arr = array(); if ( $terms ) { foreach ( $terms as $term ) : $arr[] = $term->name; endforeach; } echo wp_kses_post( implode( $delimiter, $arr ) ); } function sp_is_home_venue( $post = 0, $event = 0 ) { $pv = sp_get_venues( $post ); $ev = sp_get_venues( $event ); if ( is_array( $pv ) && is_array( $ev ) && sizeof( array_intersect( $pv, $ev ) ) ) { return true; } else { return false; } } function sp_the_logo( $post = 0, $size = 'icon', $attr = array() ) { echo wp_kses_post( sp_get_logo( $post, $size, $attr ) ); } function sp_team_logo( $post = 0 ) { sp_get_template( 'team-logo.php', array( 'id' => $post ) ); } function sp_team_abbreviation( $post = 0, $forced = false ) { $abbreviation = get_post_meta( $post, 'sp_abbreviation', true ); if ( $abbreviation ) { return $abbreviation; } else { return $forced ? sp_substr( sp_strtoupper( sp_team_short_name( $post ) ), 0, 3 ) : sp_team_short_name( $post ); } } function sp_the_abbreviation( $post = 0, $forced = false ) { echo wp_kses_post( sp_team_abbreviation( $post, $forced ) ); } function sp_team_short_name( $post = 0 ) { $short_name = get_post_meta( $post, 'sp_short_name', true ); if ( $short_name ) { return $short_name; } else { return get_the_title( $post ); } } function sp_the_short_name( $post = 0 ) { echo wp_kses_post( sp_team_short_name( $post ) ); } function sp_team_name( $post = 0, $length = 'full' ) { if ( 'abbreviation' == $length ) { return sp_team_abbreviation( $post ); } elseif ( 'short' == $length ) { return sp_team_short_name( $post ); } else { return get_the_title( $post ); } } function sp_team_details( $post = 0 ) { sp_get_template( 'team-details.php', array( 'id' => $post ) ); } function sp_team_link( $post = 0 ) { sp_get_template( 'team-link.php', array( 'id' => $post ) ); } function sp_team_lists( $post = 0 ) { sp_get_template( 'team-lists.php', array( 'id' => $post ) ); } function sp_team_tables( $post = 0 ) { sp_get_template( 'team-tables.php', array( 'id' => $post ) ); } /* * League Table functions */ function sp_get_table( $post = 0 ) { $table = new SP_League_Table( $post ); return $table->data(); } function sp_league_table( $post = 0 ) { sp_get_template( 'league-table.php', array( 'id' => $post ) ); } /* * Player functions */ function sp_get_player_number( $post = 0 ) { return get_post_meta( $post, 'sp_number', true ); } function sp_get_player_number_in_event( $player_id, $team_id, $event_id ) { $event_players = get_post_meta( $event_id, 'sp_players', true ); if ( ! array_key_exists( $team_id, $event_players ) ) { return; } if ( ! array_key_exists( $player_id, $event_players[ $team_id ] ) ) { return; } return $event_players[ $team_id ][ $player_id ]['number']; } function sp_get_player_number_in_event_or_profile( $player_id, $team_id, $event_id ) { $number = sp_get_player_number_in_event( $player_id, $team_id, $event_id ); if ( is_null( $number ) ) { $number = sp_get_player_number( $player_id ); } return $number; } function sp_get_player_name( $post = 0 ) { return apply_filters( 'sportspress_player_name', get_the_title( $post ), $post ); } function sp_get_player_name_with_number( $post = 0, $prepend = '', $append = '. ' ) { $name = sp_get_player_name( $post ); $number = sp_get_player_number( $post ); if ( isset( $number ) && '' !== $number ) { return apply_filters( 'sportspress_player_name_with_number', $prepend . $number . $append . $name, $post ); } else { return $name; } } function sp_get_player_name_then_number( $post = 0, $prepend = ' (', $append = ')' ) { $name = sp_get_player_name( $post ); $number = sp_get_player_number( $post ); if ( isset( $number ) && '' !== $number ) { return apply_filters( 'sportspress_player_name_then_number', $name . $prepend . $number . $append, $post ); } else { return $name; } } function sp_player_details( $post = 0 ) { sp_get_template( 'player-details.php', array( 'id' => $post ) ); } function sp_player_photo( $post = 0 ) { sp_get_template( 'player-photo.php', array( 'id' => $post ) ); } function sp_player_statistics( $post = 0 ) { sp_get_template( 'player-statistics.php', array( 'id' => $post ) ); } /* * Player List functions */ function sp_get_list( $post = 0 ) { $list = new SP_Player_List( $post ); return $list->data(); } function sp_player_list( $post = 0 ) { sp_get_template( 'player-list.php', array( 'id' => $post ) ); } /* * Staff functions */ function sp_staff_details( $post = 0 ) { sp_get_template( 'staff-details.php', array( 'id' => $post ) ); } function sp_staff_photo( $post = 0 ) { sp_get_template( 'staff-photo.php', array( 'id' => $post ) ); } /* * Venue functions */ function sp_venue_map( $term = 0 ) { $meta = get_option( "taxonomy_$term" ); sp_get_template( 'venue-map.php', array( 'meta' => $meta ) ); } function sp_get_position_caption( $term = 0 ) { $meta = get_option( "taxonomy_$term" ); $caption = sp_array_value( $meta, 'sp_caption', '' ); if ( $caption ) { return $caption; } else { $term = get_term( $term, 'sp_position' ); return $term->name; } } ================================================ FILE: includes/sp-conditional-functions.php ================================================ array( 'sp_calendar' ), 'sp_team' => array( 'sp_table' ), 'sp_player' => array( 'sp_list' ), 'sp_staff' => array(), ) ); } } /** * is_sp_post_type - Returns true if post is SportsPress post type * * @access public * @return bool */ if ( ! function_exists( 'is_sp_post_type' ) ) { function is_sp_post_type( $typenow = null ) { if ( $typenow == null ) { global $typenow; } $post_types = sp_post_types(); if ( in_array( $typenow, $post_types ) ) { return true; } return false; } } /** * is_sp_config_type - Returns true if post is SportsPress config type * * @access public * @return bool */ if ( ! function_exists( 'is_sp_config_type' ) ) { function is_sp_config_type( $typenow = null ) { if ( $typenow == null ) { global $typenow; } $post_types = sp_config_types(); if ( in_array( $typenow, $post_types ) ) { return true; } return false; } } /** * is_sp_taxonomy - Returns true if post is SportsPress taxonomy * * @access public * @return bool */ if ( ! function_exists( 'is_sp_taxonomy' ) ) { function is_sp_taxonomy( $typenow = null ) { if ( $typenow == null ) { global $typenow; } $taxonomies = sp_taxonomies(); if ( in_array( $typenow, $taxonomies ) ) { return true; } return false; } } if ( ! function_exists( 'is_ajax' ) ) { /** * is_ajax - Returns true when the page is loaded via ajax. * * @access public * @return bool */ function is_ajax() { return defined( 'DOING_AJAX' ); } } ================================================ FILE: includes/sp-core-functions.php ================================================ template_path() . "{$slug}-{$name}.php" ) ); } // Get default slug-name.php if ( ! $template && $name && file_exists( SP()->plugin_path() . "/templates/{$slug}-{$name}.php" ) ) { $template = SP()->plugin_path() . "/templates/{$slug}-{$name}.php"; } // If template file doesn't exist, look in yourtheme/slug.php and yourtheme/sportspress/slug.php if ( ! $template ) { $template = locate_template( array( "{$slug}.php", SP()->template_path() . "{$slug}.php" ) ); } // Allow 3rd party plugin filter template file from their plugin $template = apply_filters( 'sportspress_get_template_part', $template, $slug, $name ); if ( $template ) { load_template( $template, false ); } } /** * Get templates passing attributes and including the file. * * @access public * @param mixed $template_name * @param array $args (default: array()) * @param string $template_path (default: '') * @param string $default_path (default: '') * @return void */ function sp_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) { // Store the original parameters before extract() to prevent override attacks $original_template_name = $template_name; $original_template_path = $template_path; $original_default_path = $default_path; if ( $args && is_array( $args ) ) { // Remove security-sensitive parameters from args before extraction // to prevent Local File Inclusion attacks via shortcode attributes unset( $args['template_name'], $args['template_path'], $args['default_path'] ); extract( $args ); } // Use original parameters for template location $located = sp_locate_template( $original_template_name, $original_template_path, $original_default_path ); if ( ! file_exists( $located ) ) { _doing_it_wrong( __FUNCTION__, sprintf( '%s does not exist.', esc_html( $located ) ), '0.7' ); return; } do_action( 'sportspress_before_template', $template_name, $template_path, $located, $args ); include $located; do_action( 'sportspress_after_template', $template_name, $template_path, $located, $args ); } /** * Locate a template and return the path for inclusion. * * This is the load order: * * yourtheme / $template_path / $template_name * yourtheme / $template_name * $default_path / $template_name * * @access public * @param mixed $template_name * @param string $template_path (default: '') * @param string $default_path (default: '') * @return string */ function sp_locate_template( $template_name, $template_path = '', $default_path = '' ) { // Sanitize template name to prevent directory traversal attacks // First extract just the filename component, removing any directory paths $template_name = basename( $template_name ); // Sanitize the filename to remove special characters and traversal attempts $template_name = sanitize_file_name( $template_name ); // Additional security: ensure no path separators remain after sanitization $template_name = str_replace( array( '/', '\\' ), '', $template_name ); // Prevent access to hidden files $template_name = ltrim( $template_name, '.' ); // Sanitize path parameters if provided by user input (defense-in-depth) if ( ! empty( $template_path ) ) { // Validate that template_path doesn't contain directory traversal $template_path = str_replace( array( '../', '..\\' ), '', $template_path ); } if ( ! empty( $default_path ) ) { // Validate that default_path doesn't contain directory traversal $default_path = str_replace( array( '../', '..\\' ), '', $default_path ); } if ( ! $template_path ) { $template_path = SP()->template_path(); } if ( ! $default_path ) { $default_path = SP()->plugin_path() . '/templates/'; } // Look within passed path within the theme - this is priority $template = locate_template( array( trailingslashit( $template_path ) . $template_name, $template_name, ) ); // Get default template if ( ! $template ) { $template = $default_path . $template_name; } // Return what we found return apply_filters( 'sportspress_locate_template', $template, $template_name, $template_path ); } function sp_substr( $string = '', $start = 0, $length = null ) { if ( function_exists( 'mb_substr' ) ) { return mb_substr( $string, $start, $length ); } else { return substr( $string, $start, $length ); } } function sp_strtoupper( $string = '' ) { if ( function_exists( 'mb_strtoupper' ) ) { return mb_strtoupper( $string ); } else { return strtoupper( $string ); } } /** * Get the timezone string. * * @access public * @return string */ function sp_get_timezone() { $tzstring = get_option( 'timezone_string' ); // Remove old Etc mappings. Fallback to gmt_offset. if ( false !== strpos( $tzstring, 'Etc/GMT' ) ) { $tzstring = ''; } if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists $current_offset = get_option( 'gmt_offset' ); if ( 0 == $current_offset ) { $tzstring = 'UTC+0'; } elseif ( $current_offset < 0 ) { $tzstring = 'UTC' . $current_offset; } else { $tzstring = 'UTC+' . $current_offset; } } return $tzstring; } /* deprecated functions below */ if ( ! function_exists( 'date_diff' ) ) { class DateInterval { public $y; public $m; public $d; public $h; public $i; public $s; public $invert; public $days; public function format( $format ) { $format = str_replace( '%R%y', ( $this->invert ? '-' : '+' ) . $this->y, $format ); $format = str_replace( '%R%m', ( $this->invert ? '-' : '+' ) . $this->m, $format ); $format = str_replace( '%R%d', ( $this->invert ? '-' : '+' ) . $this->d, $format ); $format = str_replace( '%R%h', ( $this->invert ? '-' : '+' ) . $this->h, $format ); $format = str_replace( '%R%i', ( $this->invert ? '-' : '+' ) . $this->i, $format ); $format = str_replace( '%R%s', ( $this->invert ? '-' : '+' ) . $this->s, $format ); $format = str_replace( '%y', $this->y, $format ); $format = str_replace( '%m', $this->m, $format ); $format = str_replace( '%d', $this->d, $format ); $format = str_replace( '%h', $this->h, $format ); $format = str_replace( '%i', $this->i, $format ); $format = str_replace( '%s', $this->s, $format ); return $format; } } function date_diff( DateTime $date1, DateTime $date2 ) { $diff = new DateInterval(); if ( $date1 > $date2 ) { $tmp = $date1; $date1 = $date2; $date2 = $tmp; $diff->invert = 1; } else { $diff->invert = 0; } $diff->y = ( (int) $date2->format( 'Y' ) ) - ( (int) $date1->format( 'Y' ) ); $diff->m = ( (int) $date2->format( 'n' ) ) - ( (int) $date1->format( 'n' ) ); if ( $diff->m < 0 ) { $diff->y -= 1; $diff->m = $diff->m + 12; } $diff->d = ( (int) $date2->format( 'j' ) ) - ( (int) $date1->format( 'j' ) ); if ( $diff->d < 0 ) { $diff->m -= 1; $diff->d = $diff->d + ( (int) $date1->format( 't' ) ); } $diff->h = ( (int) $date2->format( 'G' ) ) - ( (int) $date1->format( 'G' ) ); if ( $diff->h < 0 ) { $diff->d -= 1; $diff->h = $diff->h + 24; } $diff->i = ( (int) $date2->format( 'i' ) ) - ( (int) $date1->format( 'i' ) ); if ( $diff->i < 0 ) { $diff->h -= 1; $diff->i = $diff->i + 60; } $diff->s = ( (int) $date2->format( 's' ) ) - ( (int) $date1->format( 's' ) ); if ( $diff->s < 0 ) { $diff->i -= 1; $diff->s = $diff->s + 60; } $start_ts = $date1->format( 'U' ); $end_ts = $date2->format( 'U' ); $days = $end_ts - $start_ts; $diff->days = round( $days / 86400 ); if ( ( $diff->h > 0 || $diff->i > 0 || $diff->s > 0 ) ) { $diff->days += ( (bool) $diff->invert ) ? 1 : -1; } return $diff; } } if ( ! function_exists( 'sp_flush_rewrite_rules' ) ) { function sp_flush_rewrite_rules() { // Flush rewrite rules $post_types = new SP_Post_types(); $post_types->register_taxonomies(); $post_types->register_post_types(); flush_rewrite_rules(); } } if ( ! function_exists( 'sp_add_link' ) ) { function sp_add_link( $string, $link = false, $active = true ) { if ( empty( $link ) || ! $active ) { return $string; } return ''; } } if ( ! function_exists( 'sp_nonce' ) ) { function sp_nonce() { wp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' ); } } if ( ! function_exists( 'sp_get_option' ) ) { function sp_get_option( $option, $default = null ) { if ( isset( $_POST[ $option ] ) ) { sanitize_text_field( wp_unslash( $_POST[ $option ] ) ); } else { return get_option( $option, $default ); } } } if ( ! function_exists( 'sp_array_between' ) ) { function sp_array_between( $array = array(), $delimiter = 0, $index = 0 ) { $keys = array_keys( $array, $delimiter ); if ( array_key_exists( $index, $keys ) ) : $offset = $keys[ $index ]; $end = sizeof( $array ); if ( array_key_exists( $index + 1, $keys ) ) { $end = $keys[ $index + 1 ]; } $length = $end - $offset; $array = array_slice( $array, $offset, $length ); endif; return $array; } } if ( ! function_exists( 'sp_array_map_recursive' ) ) { function sp_array_map_recursive( callable $func, array $arr ) { array_walk_recursive( $arr, function( &$v ) use ( $func ) { $v = $func( $v ); } ); return $arr; } } if ( ! function_exists( 'sp_array_value' ) ) { function sp_array_value( $arr = array(), $key = 0, $default = null, $sanitize = false ) { $value = ( isset( $arr[ $key ] ) ? $arr[ $key ] : $default ); if ( $sanitize ) : if ( is_array( $value ) ) : switch ( $sanitize ) : case 'int': $value = sp_array_map_recursive( 'intval', $value ); break; case 'title': $value = sp_array_map_recursive( 'sanitize_title', $value ); break; case 'text': $value = sp_array_map_recursive( 'wp_kses_post', $value ); break; case 'key': $value = sp_array_map_recursive( 'sanitize_key', $value ); break; endswitch; else : switch ( $sanitize ) : case 'int': if ( empty( $value ) ) { $value = $value; }else{ $value = intval( $value ); } break; case 'title': $value = sanitize_title( $value ); break; case 'text': $value = sanitize_text_field( $value ); break; case 'key': $value = sanitize_key( $value ); break; endswitch; endif; endif; return $value; } } if ( ! function_exists( 'sp_array_combine' ) ) { function sp_array_combine( $keys = array(), $values = array(), $key_order = false ) { if ( ! is_array( $keys ) ) { return array(); } if ( ! is_array( $values ) ) { $values = array(); } $output = array(); if ( $key_order ) : foreach ( $keys as $key ) : if ( array_key_exists( $key, $values ) ) { $output[ $key ] = $values[ $key ]; } else { $output[ $key ] = array(); } endforeach; else : foreach ( $values as $key => $value ) : if ( in_array( $key, $keys ) ) : $output[ $key ] = $value; endif; endforeach; foreach ( $keys as $key ) : if ( $key !== false && ! array_key_exists( $key, $output ) ) { $output[ $key ] = array(); } endforeach; endif; return $output; } } if ( ! function_exists( 'sp_numbers_to_words' ) ) { function sp_numbers_to_words( $str ) { $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 ); return $output; } } if ( ! function_exists( 'sp_column_active' ) ) { function sp_column_active( $array = null, $value = null ) { return $array == null || in_array( $value, $array ); } } if ( ! function_exists( 'sp_get_the_term_id' ) ) { function sp_get_the_term_id( $post_id, $taxonomy ) { $terms = get_the_terms( $post_id, $taxonomy ); if ( is_array( $terms ) && sizeof( $terms ) > 0 ) : $term = reset( $terms ); if ( is_object( $term ) && property_exists( $term, 'term_id' ) ) { return $term->term_id; } else { return 0; } else : return 0; endif; } } if ( ! function_exists( 'sp_get_the_term_ids' ) ) { function sp_get_the_term_ids( $post_id, $taxonomy ) { $terms = get_the_terms( $post_id, $taxonomy ); $term_ids = array(); if ( is_array( $terms ) && sizeof( $terms ) > 0 ) { $term_ids = wp_list_pluck( $terms, 'term_id' ); } $term_ids = sp_add_auto_term( $term_ids, $post_id, $taxonomy ); return $term_ids; } } if ( ! function_exists( 'sp_get_the_term_id_or_meta' ) ) { function sp_get_the_term_id_or_meta( $post_id, $taxonomy ) { $terms = get_the_terms( $post_id, $taxonomy ); if ( is_array( $terms ) && sizeof( $terms ) > 0 ) : $term = reset( $terms ); if ( is_object( $term ) && property_exists( $term, 'term_id' ) ) { return $term->term_id; } else { return 0; } else : return get_post_meta( $post_id, $taxonomy, true ); endif; } } if ( ! function_exists( 'sp_add_auto_term' ) ) { function sp_add_auto_term( $term_ids, $post_id, $taxonomy ) { switch ( $taxonomy ) { case 'sp_league': if ( get_post_meta( $post_id, 'sp_main_league', true ) ) { $term_id = get_option( 'sportspress_league', false ); if ( $term_id ) { $term_ids[] = $term_id; } } break; case 'sp_season': if ( get_post_meta( $post_id, 'sp_current_season', true ) ) { $term_id = get_option( 'sportspress_season', false ); if ( $term_id ) { $term_ids[] = $term_id; } } break; } return $term_ids; } } if ( ! function_exists( 'sp_get_url' ) ) { function sp_get_url( $post_id ) { $url = get_post_meta( $post_id, 'sp_url', true ); if ( ! $url ) { return; } return ' ' . $url . ''; } } if ( ! function_exists( 'sp_get_post_abbreviation' ) ) { function sp_get_post_abbreviation( $post_id ) { $abbreviation = get_post_meta( $post_id, 'sp_abbreviation', true ); if ( $abbreviation ) : return $abbreviation; else : return mb_substr( get_the_title( $post_id ), 0, 1 ); endif; } } if ( ! function_exists( 'sp_get_post_condition' ) ) { function sp_get_post_condition( $post_id ) { $condition = get_post_meta( $post_id, 'sp_condition', true ); $main_result = get_option( 'sportspress_primary_result', null ); $result = get_page_by_path( $main_result, ARRAY_A, 'sp_result' ); $label = sp_array_value( $result, 'post_title', esc_attr__( 'Primary', 'sportspress' ) ); if ( $condition ) : $conditions = array( '0' => '—', '>' => sprintf( esc_attr__( 'Most %s', 'sportspress' ), $label ), '<' => sprintf( esc_attr__( 'Least %s', 'sportspress' ), $label ), '=' => sprintf( esc_attr__( 'Equal %s', 'sportspress' ), $label ), 'else' => sprintf( esc_attr__( 'Default', 'sportspress' ), $label ), ); return sp_array_value( $conditions, wp_specialchars_decode( $condition ), '—' ); else : return '—'; endif; } } if ( ! function_exists( 'sp_get_post_precision' ) ) { function sp_get_post_precision( $post_id ) { $precision = get_post_meta( $post_id, 'sp_precision', true ); if ( $precision ) : return $precision; else : return 0; endif; } } if ( ! function_exists( 'sp_get_post_calculate' ) ) { function sp_get_post_calculate( $post_id ) { $calculate = get_post_meta( $post_id, 'sp_calculate', true ); if ( $calculate ) : return str_replace( array( 'total', 'average' ), array( esc_attr__( 'Total', 'sportspress' ), esc_attr__( 'Average', 'sportspress' ) ), $calculate ); else : return esc_attr__( 'Total', 'sportspress' ); endif; } } if ( ! function_exists( 'sp_get_post_equation' ) ) { function sp_get_post_equation( $post_id ) { $equation = get_post_meta( $post_id, 'sp_equation', true ); if ( $equation ) : $equation = str_replace( array( '/', '(', ')', '+', '-', '*', '_', '$' ), array( '÷', '(', ')', '+', '−', '×', '@', '' ), trim( $equation ) ); return '' . implode( ' ', explode( ' ', $equation ) ) . ''; else : return '—'; endif; } } if ( ! function_exists( 'sp_get_post_order' ) ) { function sp_get_post_order( $post_id ) { $priority = get_post_meta( $post_id, 'sp_priority', true ); if ( $priority ) : return $priority . ' ' . str_replace( array( 'DESC', 'ASC' ), array( '↓', '↑' ), get_post_meta( $post_id, 'sp_order', true ) ); else : return '—'; endif; } } if ( ! function_exists( 'sp_get_post_section' ) ) { function sp_get_post_section( $post_id ) { $section = get_post_meta( $post_id, 'sp_section', true ); if ( isset( $section ) ) : $options = apply_filters( 'sportspress_performance_sections', array( -1 => esc_attr__( 'All', 'sportspress' ), 0 => esc_attr__( 'Offense', 'sportspress' ), 1 => esc_attr__( 'Defense', 'sportspress' ), ) ); return sp_array_value( $options, $section, esc_attr__( 'All', 'sportspress' ) ); else : return esc_attr__( 'All', 'sportspress' ); endif; } } if ( ! function_exists( 'sp_get_post_format' ) ) { function sp_get_post_format( $post_id ) { $format = get_post_meta( $post_id, 'sp_format', true ); if ( isset( $format ) ) : $options = apply_filters( 'sportspress_performance_formats', array( 'number' => esc_attr__( 'Number', 'sportspress' ), 'time' => esc_attr__( 'Time', 'sportspress' ), 'text' => esc_attr__( 'Text', 'sportspress' ), 'equation' => esc_attr__( 'Equation', 'sportspress' ), 'checkbox' => esc_attr__( 'Checkbox', 'sportspress' ), ) ); return sp_array_value( $options, $format, esc_attr__( 'Number', 'sportspress' ) ); else : return esc_attr__( 'Number', 'sportspress' ); endif; } } if ( ! function_exists( 'sp_get_format_placeholder' ) ) { function sp_get_format_placeholder( $key = 'number' ) { $placeholders = apply_filters( 'sportspress_format_placeholders', array( 'number' => 0, 'time' => '0:00', 'text' => ' ', 'checkbox' => ' ', ) ); return sp_array_value( $placeholders, $key, 0 ); } } if ( ! function_exists( 'sp_get_term_sections' ) ) { function sp_get_term_sections( $t_id ) { $term_meta = get_option( "taxonomy_$t_id" ); if ( isset( $term_meta['sp_sections'] ) ) { $sections = $term_meta['sp_sections']; } else { $sections = apply_filters( 'sportspress_performance_sections', array( 0 => esc_attr__( 'Offense', 'sportspress' ), 1 => esc_attr__( 'Defense', 'sportspress' ), ) ); $sections = array_keys( $sections ); } if ( '' === $sections ) { $sections = array(); } return $sections; } } if ( ! function_exists( 'sp_get_default_mode' ) ) { function sp_get_default_mode() { $mode = get_option( 'sportspress_mode', 'team' ); if ( empty( $mode ) ) { $mode = 'team'; } return $mode; } } if ( ! function_exists( 'sp_get_post_mode' ) ) { function sp_get_post_mode( $post_id ) { $mode = get_post_meta( $post_id, 'sp_mode', true ); if ( empty( $mode ) ) { $mode = sp_get_default_mode(); } return $mode; } } if ( ! function_exists( 'sp_get_post_mode_type' ) ) { function sp_get_post_mode_type( $post_id ) { $mode = sp_get_post_mode( $post_id ); $post_type = "sp_$mode"; if ( ! in_array( $post_type, sp_primary_post_types() ) ) { $post_type = sp_get_default_mode(); } return $post_type; } } if ( ! function_exists( 'sp_get_post_mode_label' ) ) { function sp_get_post_mode_label( $post_id, $singular = false ) { $labels = array( 'team' => array( __( 'Teams', 'sportspress' ), __( 'Team', 'sportspress' ), ), 'player' => array( __( 'Players', 'sportspress' ), __( 'Player', 'sportspress' ), ), ); $mode = sp_get_post_mode( $post_id ); if ( ! array_key_exists( $mode, $labels ) ) { $mode = 'team'; } $index = intval( $singular ); return $labels[ $mode ][ $index ]; } } if ( ! function_exists( 'sp_dropdown_statuses' ) ) { function sp_dropdown_statuses( $args = array() ) { $defaults = array( 'show_option_default' => false, 'name' => 'sp_status', 'id' => null, 'selected' => null, 'class' => null, ); $args = array_merge( $defaults, $args ); printf( '' ); return true; } } if ( ! function_exists( 'sp_dropdown_dates' ) ) { function sp_dropdown_dates( $args = array() ) { $defaults = array( 'show_option_default' => false, 'name' => 'sp_date', 'id' => null, 'selected' => null, 'class' => null, ); $args = array_merge( $defaults, $args ); printf( '' ); return true; } } if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) { function sp_dropdown_taxonomies( $args = array() ) { $defaults = array( 'show_option_blank' => false, 'show_option_all' => false, 'show_option_none' => false, 'show_option_auto' => false, 'taxonomy' => null, 'name' => null, 'id' => null, 'selected' => null, 'hide_empty' => false, 'values' => 'slug', 'class' => null, 'property' => 'none', 'placeholder' => null, 'chosen' => false, 'parent' => 0, 'include_children' => true, ); $args = array_merge( $defaults, $args ); if ( ! $args['taxonomy'] ) { return false; } $name = ( $args['name'] ) ? $args['name'] : $args['taxonomy']; $id = ( $args['id'] ) ? $args['id'] : $name; unset( $args['name'] ); unset( $args['id'] ); $class = $args['class']; unset( $args['class'] ); $property = $args['property']; unset( $args['property'] ); $placeholder = $args['placeholder']; unset( $args['placeholder'] ); $selected = $args['selected']; unset( $args['selected'] ); $chosen = $args['chosen']; unset( $args['chosen'] ); $terms = get_terms( $args['taxonomy'], $args ); printf( '', esc_attr( $args['taxonomy'] ) ); if ( $terms ) : printf( '' ); return true; else : return false; endif; } } function sp_dropdown_hierarchical_taxonomies( $args, $property, $selected, $current_term_id = 0, $depth = 1 ) { $term_children = get_terms([ 'taxonomy' => $args['taxonomy'], 'hide_empty' => false, 'parent' => $current_term_id, ]); if ( $term_children ) { $indent = str_repeat('-', $depth); foreach ( $term_children as $term_child ) { if ( $args['values'] == 'term_id' ) : $this_value = $term_child->term_id; else : $this_value = $term_child->slug; endif; if ( $property && strpos( $property, 'multiple' ) !== false ) : $selected_prop = in_array( $this_value, $selected ) ? 'selected' : ''; else : $selected_prop = selected( $this_value, $selected, false ); endif; printf( '', esc_attr( $this_value ), esc_attr( $selected_prop ), $indent . ' ' . esc_attr( $term_child->name ) ); sp_dropdown_hierarchical_taxonomies( $args, $property, $selected, $term_child->term_id, $depth + 1 ); } } } if ( ! function_exists( 'sp_dropdown_pages' ) ) { function sp_dropdown_pages( $args = array() ) { $defaults = array( 'prepend_options' => null, 'append_options' => null, 'show_option_blank' => false, 'show_option_all' => false, 'show_option_none' => false, 'show_dates' => false, 'option_all_value' => 0, 'option_none_value' => -1, 'name' => 'page_id', 'id' => null, 'selected' => null, 'numberposts' => -1, 'posts_per_page' => -1, 'child_of' => 0, 'order' => 'ASC', 'orderby' => 'title', 'hierarchical' => 1, 'exclude' => null, 'include' => null, 'meta_key' => null, 'meta_value' => null, 'authors' => null, 'exclude_tree' => null, 'post_type' => 'page', 'post_status' => 'publish', 'values' => 'post_name', 'class' => null, 'property' => 'none', 'placeholder' => null, 'chosen' => false, 'filter' => false, ); $args = array_merge( $defaults, $args ); $name = $args['name']; unset( $args['name'] ); $id = ( $args['id'] ) ? $args['id'] : $name; unset( $args['id'] ); $values = $args['values']; unset( $args['values'] ); $class = $args['class']; unset( $args['class'] ); $property = $args['property']; unset( $args['property'] ); $placeholder = $args['placeholder']; unset( $args['placeholder'] ); $selected = $args['selected']; unset( $args['selected'] ); $chosen = $args['chosen']; unset( $args['chosen'] ); $filter = $args['filter']; unset( $args['filter'] ); $posts = get_posts( $args ); if ( $posts || $args['prepend_options'] || $args['append_options'] ) : printf( '' ); return true; else : return false; endif; } } if ( ! function_exists( 'sp_posts' ) ) { function sp_posts( $post_id = null, $meta = 'post' ) { if ( ! isset( $post_id ) ) { global $post_id; } $ids = get_post_meta( $post_id, $meta, false ); if ( ( $key = array_search( 0, $ids ) ) !== false ) { unset( $ids[ $key ] ); } $i = 0; $count = count( $ids ); if ( isset( $ids ) && $ids && is_array( $ids ) && ! empty( $ids ) ) : foreach ( $ids as $id ) : if ( ! $id ) { continue; } $parents = get_post_ancestors( $id ); $keys = array_keys( $parents ); $values = array_reverse( array_values( $parents ) ); if ( ! empty( $keys ) && ! empty( $values ) ) : $parents = array_combine( $keys, $values ); foreach ( $parents as $parent ) : if ( ! in_array( $parent, $ids ) ) { edit_post_link( get_the_title( $parent ), '', '', $parent ); } echo ' - '; endforeach; endif; $title = get_the_title( $id ); if ( ! $title ) { continue; } if ( empty( $title ) ) { $title = esc_attr__( '(no title)', 'sportspress' ); } edit_post_link( $title, '', '', $id ); if ( ++$i !== $count ) { echo ', '; } endforeach; endif; } } if ( ! function_exists( 'sp_post_checklist' ) ) { function sp_post_checklist( $post_id = null, $meta = 'post', $display = 'block', $filters = null, $index = null, $slug = null ) { if ( ! isset( $post_id ) ) { global $post_id; } if ( ! isset( $slug ) ) { $slug = $meta; } ?>
    • $meta, 'numberposts' => -1, 'post_per_page' => -1, 'orderby' => 'menu_order', ); if ( $meta == 'sp_player' ) : $query['meta_key'] = 'sp_number'; $query['orderby'] = 'meta_value_num'; $query['order'] = 'ASC'; endif; // Add a hook to alter $query args. $query = apply_filters( 'sportspress_sp_post_checklist_args', $query, $meta ); $posts = get_posts( $query ); endif; foreach ( $posts as $post ) : $parents = get_post_ancestors( $post ); if ( $filters ) : if ( is_array( $filters ) ) : $filter_values = array(); foreach ( $filters as $filter ) : if ( get_taxonomy( $filter ) ) : $terms = (array) get_the_terms( $post->ID, $filter ); foreach ( $terms as $term ) : if ( is_object( $term ) && property_exists( $term, 'term_id' ) ) { $filter_values[] = $term->term_id; } endforeach; else : $filter_values = array_merge( $filter_values, (array) get_post_meta( $post->ID, $filter, false ) ); endif; endforeach; else : $filter = $filters; if ( get_taxonomy( $filter ) ) : $terms = (array) get_the_terms( $post->ID, $filter ); foreach ( $terms as $term ) : if ( is_object( $term ) && property_exists( $term, 'term_id' ) ) { $filter_values[] = $term->term_id; } endforeach; else : $filter_values = (array) get_post_meta( $post->ID, $filter, false ); endif; endif; endif; ?>
    • ', sizeof( $parents ) ); ?>
    ', sizeof( $parents ) ); ?>
    • $meta, 'number' => 0, ) ); if ( empty( $posts ) ) : $query = array( 'post_type' => $meta, 'numberposts' => -1, 'post_per_page' => -1, 'order' => 'ASC', 'orderby' => 'menu_order', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_format', 'value' => 'number', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_format', 'value' => array( 'equation', 'text' ), 'compare' => 'NOT IN', ), ), ); $posts = get_posts( $query ); endif; if ( sizeof( $posts ) ) : foreach ( $posts as $post ) : if ( 'sp_performance' == $meta ) { $format = get_post_meta( $post->ID, 'sp_format', true ); if ( 'text' === $format ) { continue; } } ?>
    $post_type, 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); if ( ! $all ) { $args['meta_query'] = array( array( 'key' => 'sp_visible', 'value' => 1, ), array( 'key' => 'sp_visible', 'value' => 1, 'compare' => 'NOT EXISTS', ), 'relation' => 'OR', ); } $vars = get_posts( $args ); $output = array(); foreach ( $vars as $var ) : if ( $neg === null || ( $neg && $var->menu_order < 0 ) || ( ! $neg && $var->menu_order >= 0 ) ) { $output[ $var->post_name ] = $var->post_title; } endforeach; return $output; } } if ( ! function_exists( 'sp_get_var_equations' ) ) { function sp_get_var_equations( $post_type ) { $args = array( 'post_type' => $post_type, 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $vars = get_posts( $args ); $output = array(); foreach ( $vars as $var ) : $equation = get_post_meta( $var->ID, 'sp_equation', true ); if ( ! $equation ) { $equation = 0; } $precision = get_post_meta( $var->ID, 'sp_precision', true ); if ( ! $precision ) { $precision = 0; } $output[ $var->post_name ] = array( 'equation' => $equation, 'precision' => $precision, ); endforeach; return $output; } } if ( ! function_exists( 'sp_post_adder' ) ) { function sp_post_adder( $post_type = 'post', $label = null, $attributes = array() ) { $obj = get_post_type_object( $post_type ); if ( $label == null ) { $label = esc_attr__( 'Add New', 'sportspress' ); } ?> 0 ) : return implode( '-', $last5 ); else : return $default; endif; elseif ( strpos( $equation, '$last10' ) !== false ) : // Return imploded string $last10 = sp_array_value( $vars, 'last10', array( 0 ) ); if ( array_sum( $last10 ) > 0 ) : return implode( '-', $last10 ); else : return $default; endif; elseif ( strpos( $equation, '$homerecord' ) !== false ) : // Return imploded string $homerecord = sp_array_value( $vars, 'homerecord', array( 0 ) ); return implode( '-', $homerecord ); elseif ( strpos( $equation, '$awayrecord' ) !== false ) : // Return imploded string $awayrecord = sp_array_value( $vars, 'awayrecord', array( 0 ) ); return implode( '-', $awayrecord ); endif; if ( $solution = apply_filters( 'sportspress_equation_solve_for_presets', null, $equation, $post_id ) ) : return $solution; endif; // Remove unnecessary variables from vars before calculating unset( $vars['gamesback'] ); unset( $vars['streak'] ); unset( $vars['last5'] ); unset( $vars['last10'] ); // Equation Operating System if ( ! class_exists( 'phpStack' ) ) { include_once SP()->plugin_path() . '/includes/libraries/class-phpstack.php'; } if ( ! class_exists( 'eqEOS' ) ) { include_once SP()->plugin_path() . '/includes/libraries/class-eqeos.php'; } $eos = new eqEOS(); // Remove spaces from equation $equation = str_replace( ' ', '', $equation ); // Create temporary equation replacing operators with spaces $temp = str_replace( array( '+', '-', '*', '/', '(', ')' ), ' ', $equation ); // Check if each variable part is in vars $parts = explode( ' ', $temp ); foreach ( $parts as $key => $value ) : if ( substr( $value, 0, 1 ) == '$' ) : if ( ! array_key_exists( preg_replace( '/[^a-z0-9_]/', '', $value ), $vars ) ) { return 0; } endif; endforeach; // Remove space between equation parts $equation = str_replace( ' ', '', $equation ); // Initialize Subequations $subequations = array( $equation ); // Find all equation parts contained in parentheses if ( preg_match_all( '~\((.*?)\)~', $equation, $results ) ) { foreach ( sp_array_value( $results, 1, array() ) as $result ) { if ( ! empty( $result ) ) { $subequations[] = $result; } } } // Initialize subequation $subequation = $equation; // Check each subequation separated by division foreach ( $subequations as $subequation ) { while ( $pos = strpos( $subequation, '/' ) ) { $subequation = substr( $subequation, $pos + 1 ); // Make sure paretheses match if ( substr_count( $subequation, '(' ) === substr_count( $subequation, ')' ) ) { // Return zero if denominator is zero if ( $eos->solveIF( $subequation, $vars ) == 0 ) { return 0; } } } } // Return solution return number_format( $eos->solveIF( str_replace( ' ', '', $equation ), $vars ), $precision, '.', '' ); } } if ( ! function_exists( 'sp_sort_table_teams' ) ) { function sp_sort_table_teams( $a, $b ) { global $sportspress_column_priorities; // Loop through priorities foreach ( $sportspress_column_priorities as $priority ) : // Proceed if columns are not equal if ( sp_array_value( $a, $priority['column'], 0 ) != sp_array_value( $b, $priority['column'], 0 ) ) : // Compare column values $output = sp_array_value( $a, $priority['column'], 0 ) - sp_array_value( $b, $priority['column'], 0 ); // Flip value if descending order if ( $priority['order'] == 'DESC' ) { $output = 0 - $output; } return ( $output > 0 ); endif; endforeach; // Default sort by alphabetical return strcmp( sp_array_value( $a, 'name', '' ), sp_array_value( $b, 'name', '' ) ); } } if ( ! function_exists( 'sp_sort_terms' ) ) { /** * Sorts terms by `sp_order`. * * @param int|object $a Term ID or term. * @param int|object $b Term ID or term. * @return int Sorting order. */ function sp_sort_terms( $a, $b ) { if ( is_numeric( $a ) ) { $a = intval( $a ); $a = get_term( $a ); } if ( is_numeric( $b ) ) { $b = intval( $b ); $b = get_term( $b ); } $term_meta_a = get_term_meta( $a->term_id, 'sp_order', true ); $term_meta_b = get_term_meta( $b->term_id, 'sp_order', true ); return $term_meta_a == $term_meta_b ? 0 : ( $term_meta_a > $term_meta_b ? 1 : -1 ); } } if ( ! function_exists( 'sp_get_next_event' ) ) { function sp_get_next_event( $args = array() ) { $options = array( 'post_type' => 'sp_event', 'posts_per_page' => 1, 'order' => 'ASC', 'post_status' => 'future', ); $options = array_merge( $options, $args ); $posts = get_posts( $options ); if ( $posts && is_array( $posts ) ) { return array_pop( $posts ); } else { return false; } } } if ( ! function_exists( 'sp_taxonomy_field' ) ) { function sp_taxonomy_field( $taxonomy = 'category', $post = null, $multiple = false, $trigger = false, $placeholder = null ) { $obj = get_taxonomy( $taxonomy ); if ( $obj && $obj->public) { $post_type = get_post_type( $post ); ?>

    labels->singular_name ); ?>

    ID, $taxonomy ); $term_ids = array(); if ( $terms ) : foreach ( $terms as $term ) : $term_ids[] = $term->term_id; endforeach; endif; // Set auto option $auto = false; if ( in_array( $post_type, sp_secondary_post_types() ) ) { switch ( $taxonomy ) { case 'sp_league': $auto = esc_attr__( 'Main League', 'sportspress' ); if ( get_post_meta( $post->ID, 'sp_main_league', true ) ) { $term_ids[] = 'auto'; } break; case 'sp_season': $auto = esc_attr__( 'Current Season', 'sportspress' ); if ( get_post_meta( $post->ID, 'sp_current_season', true ) ) { $term_ids[] = 'auto'; } break; } } $args = array( 'show_option_auto' => $auto, 'taxonomy' => $taxonomy, 'name' => 'tax_input[' . $taxonomy . '][]', 'selected' => $term_ids, 'values' => 'term_id', 'class' => 'sp-has-dummy widefat' . ( $trigger ? ' sp-ajax-trigger' : '' ), 'chosen' => true, 'placeholder' => $placeholder ? $placeholder : esc_attr__( 'All', 'sportspress' ), ); if ( $multiple ) { $args['property'] = 'multiple'; } if ( ! sp_dropdown_taxonomies( $args ) ) : sp_taxonomy_adder( $taxonomy, $post_type, $obj->labels->add_new_item ); endif; ?>

    $value ) { $output .= ' ' . $key . '="' . $value . '"'; } } $output .= ']'; return esc_attr( $output ); } /** * Display shortcode template for meta boxes * * @return null */ function sp_shortcode_template( $shortcode, $id = null, $args = array() ) { echo esc_attr( sp_get_shortcode_template( $shortcode, $id, $args ) ); } if ( ! function_exists( 'array_replace' ) ) { /** * array_replace for PHP version earlier than 5.3 * * @link http://be2.php.net/manual/fr/function.array-replace.php#115215 */ function array_replace() { $args = func_get_args(); $num_args = func_num_args(); $res = array(); for ( $i = 0; $i < $num_args; $i++ ) { if ( is_array( $args[ $i ] ) ) { foreach ( $args[ $i ] as $key => $val ) { $res[ $key ] = $val; } } else { trigger_error( __FUNCTION__ . '(): Argument #' . esc_html( $i + 1 ) . ' is not an array', E_USER_WARNING ); return null; } } return $res; } } /** * Check if a shortcode is shown on content * * @return bool */ function sp_has_shortcodes( $content, $tags ) { if ( is_array( $tags ) ) { foreach ( $tags as $tag ) { preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ); if ( empty( $matches ) ) { return false; } foreach ( $matches as $shortcode ) { if ( $tag === $shortcode[2] ) { return true; } } } } else { if ( shortcode_exists( $tags ) ) { preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ); if ( empty( $matches ) ) { return false; } foreach ( $matches as $shortcode ) { if ( $tags === $shortcode[2] ) { return true; } } } } return false; } /** * Check if a custom flag was uploaded from the user * * @return string */ function sp_flags( $nationality ) { $nationality = strtolower( $nationality ); $flag = ''; $custom_flag_post_id = false; $args = array( 'post_type' => 'attachment', 'title' => $nationality, 'posts_per_page' => 1, 'fields' => 'ids', ); $custom_flag = get_posts( $args ); if( $custom_flag ){ $custom_flag_post_id = $custom_flag[0]; } if ( $custom_flag_post_id ) { $flag_src = wp_get_attachment_image_url( $custom_flag_post_id, array( 23, 15 ), false ); $flag = '' . $nationality . ''; } else { $flag = '' . $nationality . ''; } return $flag; } ================================================ FILE: includes/sp-deprecated-functions.php ================================================ data( $league_id, $admin ); } } if ( ! function_exists( 'sp_get_league_table_data' ) ) { function sp_get_league_table_data( $post_id, $admin = false ) { $table = new SP_League_Table( $post_id ); return $table->data( $admin ); } } if ( ! function_exists( 'sp_get_player_statistics_data' ) ) { function sp_get_player_statistics_data( $post_id, $league_id, $admin = false ) { $list = new SP_Player_List( $post_id ); return $list->data( $league_id, $admin ); } } if ( ! function_exists( 'sp_get_player_list_data' ) ) { function sp_get_player_list_data( $post_id, $admin = false ) { $list = new SP_Player_List( $post_id ); return $list->data( $admin ); } } if ( ! function_exists( 'sp_get_short_name' ) ) { function sp_get_short_name( $post = 0 ) { $abbreviation = sp_get_abbreviation( $post, 'sp_abbreviation', true ); if ( $abbreviation ) { return $abbreviation; } else { return get_the_title( $post ); } } } if ( ! function_exists( 'sp_short_name' ) ) { function sp_short_name( $post = 0 ) { echo wp_kses_post( sp_get_short_name( $post ) ); } } if ( ! function_exists( 'sp_get_team_name' ) ) { function sp_get_team_name( $post = 0, $short = true ) { if ( $short ) { return sp_team_abbreviation( $post ); } else { return get_the_title( $post ); } } } ================================================ FILE: includes/sp-formatting-functions.php ================================================ $v ) { if ( ! array_key_exists( $k, $a2 ) ) { continue; } if ( is_array( $v ) && is_array( $a2[ $k ] ) ) { $a1[ $k ] = sp_array_overlay( $v, $a2[ $k ] ); } else { $a1[ $k ] = $a2[ $k ]; } } return $a1; } /** * Array filter returns positive values only. * * @access public * @param int $var * @return bool */ function sp_filter_positive( $var = 0 ) { return $var > 0; } /** * Array filter returns non-empty array values. * * @access public * @param str $var * @return bool */ function sp_filter_non_empty( $var = '' ) { return strlen( $var ) > 0; } /** * Sort array randomly and maintain index association. * * @access public * @param array $array * @return bool */ function sp_sort_random() { return mt_rand( 0, 1 ); } /** * Sort array by name field. * * @access public * @param array $array * @return bool */ function sp_sort_by_name( $a, $b ) { return strcmp( $a['name'], $b['name'] ); } /** * let_to_num function. * * This function transforms the php.ini notation for numbers (like '2M') to an integer. * * @access public * @param $size * @return int */ function sp_let_to_num( $size ) { $l = substr( $size, -1 ); $ret = substr( $size, 0, -1 ); switch ( strtoupper( $l ) ) { case 'P': $ret *= 1024; case 'T': $ret *= 1024; case 'G': $ret *= 1024; case 'M': $ret *= 1024; case 'K': $ret *= 1024; } return $ret; } /** * SportsPress Date Format - Allows to change date format for everything SportsPress * * @access public * @return string */ function sp_date_format() { return apply_filters( 'sportspress_date_format', get_option( 'date_format' ) ); } /** * SportsPress Time Format - Allows to change time format for everything SportsPress * * @access public * @return string */ function sp_time_format() { return apply_filters( 'sportspress_time_format', get_option( 'time_format' ) ); } if ( ! function_exists( 'sp_time_value' ) ) { /** * Convert number of seconds to formatted time * * @access public * @param mixed $value * @return string */ function sp_time_value( $value = 0 ) { $intval = intval( $value ); $timeval = gmdate( 'i:s', $intval ); $hours = floor( $intval / 3600 ); if ( '00' != $hours ) { $timeval = $hours . ':' . $timeval; } return preg_replace( '/^0/', '', $timeval ); } } if ( ! function_exists( 'sp_value_time' ) ) { /** * Convert a time string to the equivalent number of seconds. * * @param string $time_string The time string in the format 'hh:mm:ss'. * @return int The total time in seconds. */ function sp_value_time( $time_string ) { // Initialize variables for hours, minutes, and seconds $hours = 0; $minutes = 0; $seconds = 0; // Split the time string into hours, minutes, and seconds $time_parts = explode( ':', $time_string ); // Determine the number of components in the time string $component_count = count( $time_parts ); // Set values based on the number of components if ( 1 === $component_count ) { $seconds = isset( $time_parts[0] ) ? $time_parts[0] : 0; } elseif ( 2 === $component_count ) { $minutes = isset( $time_parts[0] ) ? $time_parts[0] : 0; $seconds = isset( $time_parts[1] ) ? $time_parts[1] : 0; } elseif ( 2 < $component_count ) { $hours = isset( $time_parts[0] ) ? $time_parts[0] : 0; $minutes = isset( $time_parts[1] ) ? $time_parts[1] : 0; $seconds = isset( $time_parts[2] ) ? $time_parts[2] : 0; } // Convert each part to seconds and calculate the total time in seconds $total_seconds = ( $hours * 3600 ) + ( $minutes * 60 ) + $seconds; return $total_seconds; } } if ( ! function_exists( 'sp_rgb_from_hex' ) ) { /** * Hex darker/lighter/contrast functions for colours * * @access public * @param mixed $color * @return string */ function sp_rgb_from_hex( $color ) { $color = str_replace( '#', '', $color ); // Convert shorthand colors to full format, e.g. "FFF" -> "FFFFFF" $color = preg_replace( '~^(.)(.)(.)$~', '$1$1$2$2$3$3', $color ); $rgb['R'] = hexdec( $color[0] . $color[1] ); $rgb['G'] = hexdec( $color[2] . $color[3] ); $rgb['B'] = hexdec( $color[4] . $color[5] ); return $rgb; } } if ( ! function_exists( 'sp_hex_darker' ) ) { /** * Hex darker/lighter/contrast functions for colours * * @access public * @param mixed $color * @param int $factor (default: 30) * @return string */ function sp_hex_darker( $color, $factor = 30, $absolute = false ) { $base = sp_rgb_from_hex( $color ); $color = '#'; foreach ( $base as $k => $v ) : if ( $absolute ) { $amount = $factor; } else { $amount = $v / 100; $amount = round( $amount * $factor ); } $new_decimal = max( $v - $amount, 0 ); $new_hex_component = dechex( $new_decimal ); if ( strlen( $new_hex_component ) < 2 ) : $new_hex_component = '0' . $new_hex_component; endif; $color .= $new_hex_component; endforeach; return $color; } } if ( ! function_exists( 'sp_hex_lighter' ) ) { /** * Hex darker/lighter/contrast functions for colours * * @access public * @param mixed $color * @param int $factor (default: 30) * @return string */ function sp_hex_lighter( $color, $factor = 30, $absolute = false ) { $base = sp_rgb_from_hex( $color ); $color = '#'; foreach ( $base as $k => $v ) : if ( $absolute ) { $amount = $factor; } else { $amount = 255 - $v; $amount = $amount / 100; $amount = round( $amount * $factor ); } $new_decimal = min( $v + $amount, 255 ); $new_hex_component = dechex( $new_decimal ); if ( strlen( $new_hex_component ) < 2 ) : $new_hex_component = '0' . $new_hex_component; endif; $color .= $new_hex_component; endforeach; return $color; } } if ( ! function_exists( 'sp_light_or_dark' ) ) { /** * Detect if we should use a light or dark colour on a background colour * * @access public * @param mixed $color * @param string $dark (default: '#000000') * @param string $light (default: '#FFFFFF') * @return string */ function sp_light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) { // return ( hexdec( $color ) > 0xffffff / 2 ) ? $dark : $light; $hex = str_replace( '#', '', $color ); $c_r = hexdec( substr( $hex, 0, 2 ) ); $c_g = hexdec( substr( $hex, 2, 2 ) ); $c_b = hexdec( substr( $hex, 4, 2 ) ); $brightness = ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000; return $brightness > 155 ? $dark : $light; } } if ( ! function_exists( 'sp_format_hex' ) ) { /** * Format string as hex * * @access public * @param string $hex * @return string */ function sp_format_hex( $hex ) { $hex = preg_replace( '/[^A-Fa-f0-9]/', '', $hex ); $hex = trim( str_replace( '#', '', $hex ) ); if ( strlen( $hex ) == 3 ) { $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; } $hex = substr( $hex, 0, 6 ); if ( $hex ) { return '#' . $hex; } } } ================================================ FILE: includes/sp-option-filters.php ================================================ 1, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => 'sp_performance', ) ); if ( ! $performance_posts ) { return $option; } $post = reset( $performance_posts ); return $post->post_name; } add_filter( 'option_sportspress_primary_performance', 'sportspress_primary_performance_filter' ); ================================================ FILE: includes/sp-template-functions.php ================================================ '; break; case 'xhtml': $gen .= "\n" . ''; break; } return $gen; } /** * Add body classes for SP pages * * @param array $classes * @return array */ function sp_body_class( $classes ) { $classes = (array) $classes; if ( is_sportspress() ) { $classes[] = 'sportspress'; $classes[] = 'sportspress-page'; } $post_type = get_post_type(); if ( 'sp_event' == $post_type ) { $id = get_the_ID(); $show_venue = get_option( 'sportspress_event_show_venue', 'yes' ) == 'yes' ? true : false; if ( $show_venue && get_the_terms( $id, 'sp_venue' ) ) { if ( get_option( 'sportspress_event_show_maps', 'yes' ) == 'yes' ) { $classes[] = 'sp-has-venue'; } } if ( 'results' == sp_get_status( $id ) ) { if ( get_option( 'sportspress_event_show_results', 'yes' ) == 'yes' ) { $classes[] = 'sp-has-results'; } } $classes[] = 'sp-performance-sections-' . get_option( 'sportspress_event_performance_sections', -1 ); } elseif ( 'sp_team' == $post_type && 'yes' == get_option( 'sportspress_team_show_logo', 'yes' ) ) { $classes[] = 'sp-show-image'; } elseif ( 'sp_player' == $post_type && 'yes' == get_option( 'sportspress_player_show_photo', 'yes' ) ) { $classes[] = 'sp-show-image'; } elseif ( 'sp_staff' == $post_type && 'yes' == get_option( 'sportspress_staff_show_photo', 'yes' ) ) { $classes[] = 'sp-show-image'; } return array_unique( $classes ); } /** Template pages */ if ( ! function_exists( 'sportspress_taxonomy_archive_description' ) ) { /** * Show an archive description on taxonomy archives * * @access public * @subpackage Archives * @return void */ function sportspress_taxonomy_archive_description() { if ( is_tax( array( 'sp_season', 'sp_league', 'sp_venue', 'sp_position' ) ) && get_query_var( 'paged' ) == 0 ) { $description = apply_filters( 'the_content', term_description() ); if ( $description ) { echo '
    ' . wp_kses_post( $description ) . '
    '; } } } } /** Single Post */ if ( ! function_exists( 'sportspress_output_post_excerpt' ) ) { /** * Output the post excerpt. * * @access public * @subpackage Excerpt * @return void */ function sportspress_output_post_excerpt() { sp_get_template( 'post-excerpt.php' ); } } /** Single Event */ if ( ! function_exists( 'sportspress_output_event_logos' ) ) { /** * Output the event logos. * * @access public * @subpackage Event/Logos * @return void */ function sportspress_output_event_logos() { sp_get_template( 'event-logos.php' ); } } if ( ! function_exists( 'sportspress_output_event_video' ) ) { /** * Output the event video. * * @access public * @subpackage Event/Video * @return void */ function sportspress_output_event_video() { sp_get_template( 'event-video.php' ); } } if ( ! function_exists( 'sportspress_output_event_results' ) ) { /** * Output the event results. * * @access public * @subpackage Event/Results * @return void */ function sportspress_output_event_results() { sp_get_template( 'event-results.php' ); } } if ( ! function_exists( 'sportspress_output_event_details' ) ) { /** * Output the event details. * * @access public * @subpackage Event/Details * @return void */ function sportspress_output_event_details() { sp_get_template( 'event-details.php' ); } } if ( ! function_exists( 'sportspress_output_event_overview' ) ) { /** * Output the event details, venue, and results. * * @access public * @subpackage Event/Overview * @return void */ function sportspress_output_event_overview() { sp_get_template( 'event-overview.php' ); } } if ( ! function_exists( 'sportspress_output_event_venue' ) ) { /** * Output the event venue. * * @access public * @subpackage Event/Venue * @return void */ function sportspress_output_event_venue() { sp_get_template( 'event-venue.php' ); } } if ( ! function_exists( 'sportspress_output_event_performance' ) ) { /** * Output the event performance. * * @access public * @subpackage Event/Performance * @return void */ function sportspress_output_event_performance() { sp_get_template( 'event-performance.php' ); } } if ( ! function_exists( 'sportspress_output_event_officials' ) ) { /** * Output the event officials. * * @access public * @subpackage Event/Officials * @return void */ function sportspress_output_event_officials() { sp_get_template( 'event-officials.php' ); } } /** Single Calendar */ if ( ! function_exists( 'sportspress_output_calendar' ) ) { /** * Output the calendar. * * @access public * @subpackage Calendar * @return void */ function sportspress_output_calendar() { $id = get_the_ID(); $format = get_post_meta( $id, 'sp_format', true ); if ( array_key_exists( $format, SP()->formats->calendar ) ) { sp_get_template( 'event-' . $format . '.php', array( 'id' => $id ) ); } else { sp_get_template( 'event-calendar.php', array( 'id' => $id ) ); } } } /** Single Team */ if ( ! function_exists( 'sportspress_output_team_link' ) ) { /** * Output the team link. * * @access public * @subpackage Team/Link * @return void */ function sportspress_output_team_link() { sp_get_template( 'team-link.php' ); } } if ( ! function_exists( 'sportspress_output_team_logo' ) ) { /** * Output the team logo. * * @access public * @subpackage Team/Logo * @return void */ function sportspress_output_team_logo() { sp_get_template( 'team-logo.php' ); } } if ( ! function_exists( 'sportspress_output_team_details' ) ) { /** * Output the team details. * * @access public * @subpackage Team/Details * @return void */ function sportspress_output_team_details() { sp_get_template( 'team-details.php' ); } } if ( ! function_exists( 'sportspress_output_team_staff' ) ) { /** * Output the team staff. * * @access public * @subpackage Team/Staff * @return void */ function sportspress_output_team_staff() { sp_get_template( 'team-staff.php' ); } } if ( ! function_exists( 'sportspress_output_team_tables' ) ) { /** * Output the team tables. * * @access public * @subpackage Team/Tables * @return void */ function sportspress_output_team_tables() { sp_get_template( 'team-tables.php' ); } } if ( ! function_exists( 'sportspress_output_team_lists' ) ) { /** * Output the team lists. * * @access public * @subpackage Team/Lists * @return void */ function sportspress_output_team_lists() { sp_get_template( 'team-lists.php' ); } } if ( ! function_exists( 'sportspress_output_team_events' ) ) { /** * Output the team events. * * @access public * @subpackage Team/Events * @return void */ function sportspress_output_team_events() { sp_get_template( 'team-events.php' ); } } /** Single League Table */ if ( ! function_exists( 'sportspress_output_league_table' ) ) { /** * Output the team columns. * * @access public * @subpackage Table * @return void */ function sportspress_output_league_table() { $id = get_the_ID(); $format = get_post_meta( $id, 'sp_format', true ); if ( array_key_exists( $format, SP()->formats->table ) && 'standings' !== $format ) { sp_get_template( 'team-' . $format . '.php', array( 'id' => $id ) ); } else { sp_get_template( 'league-table.php', array( 'id' => $id ) ); } } } /** Single Player */ if ( ! function_exists( 'sportspress_output_player_selector' ) ) { /** * Output the player dropdown. * * @access public * @subpackage Player/Dropdown * @return void */ function sportspress_output_player_selector() { sp_get_template( 'player-selector.php' ); } } if ( ! function_exists( 'sportspress_output_player_photo' ) ) { /** * Output the player photo. * * @access public * @subpackage Player/Photo * @return void */ function sportspress_output_player_photo() { sp_get_template( 'player-photo.php' ); } } if ( ! function_exists( 'sportspress_output_player_details' ) ) { /** * Output the player details. * * @access public * @subpackage Player/Details * @return void */ function sportspress_output_player_details() { sp_get_template( 'player-details.php' ); } } if ( ! function_exists( 'sportspress_output_player_statistics' ) ) { /** * Output the player statistics. * * @access public * @subpackage Player/Statistics * @return void */ function sportspress_output_player_statistics() { sp_get_template( 'player-statistics.php' ); } } if ( ! function_exists( 'sportspress_output_player_events' ) ) { /** * Output the player events. * * @access public * @subpackage Player/Events * @return void */ function sportspress_output_player_events() { sp_get_template( 'player-events.php' ); } } /** Single Player List */ if ( ! function_exists( 'sportspress_output_player_list' ) ) { /** * Output the player list. * * @access public * @subpackage List * @return void */ function sportspress_output_player_list() { $id = get_the_ID(); $format = get_post_meta( $id, 'sp_format', true ); if ( array_key_exists( $format, SP()->formats->list ) ) { sp_get_template( 'player-' . $format . '.php', array( 'id' => $id ) ); } else { sp_get_template( 'player-list.php', array( 'id' => $id ) ); } } } /** Single Staff */ if ( ! function_exists( 'sportspress_output_staff_selector' ) ) { /** * Output the staff dropdown. * * @access public * @subpackage Staff/Dropdown * @return void */ function sportspress_output_staff_selector() { sp_get_template( 'staff-selector.php' ); } } if ( ! function_exists( 'sportspress_output_staff_photo' ) ) { /** * Output the staff photo. * * @access public * @subpackage Staff/Photo * @return void */ function sportspress_output_staff_photo() { sp_get_template( 'staff-photo.php' ); } } if ( ! function_exists( 'sportspress_output_staff_details' ) ) { /** * Output the staff details. * * @access public * @subpackage Staff/Details * @return void */ function sportspress_output_staff_details() { sp_get_template( 'staff-details.php' ); } } /** Venue Archive ********************************************************/ function sportspress_output_venue_map( $query ) { if ( ! is_tax( 'sp_venue' ) ) { return; } $slug = sp_array_value( $query->query, 'sp_venue', null ); if ( ! $slug ) { return; } $venue = get_term_by( 'slug', $slug, 'sp_venue' ); $t_id = $venue->term_id; $meta = get_option( "taxonomy_$t_id" ); sp_get_template( 'venue-map.php', array( 'meta' => $meta ) ); } /** Misc ********************************************************/ function sportspress_output_br_tag() { ?>
    ' . $number . '
    ' . $title; endif; elseif ( is_singular( 'sp_staff' ) ) : $staff = new SP_Staff( $id ); $role = $staff->role(); if ( $role ) { $title = '' . $role->name . ' ' . $title; } endif; endif; return $title; } add_filter( 'the_title', 'sportspress_the_title', 10, 2 ); function sportspress_gettext( $translated_text, $untranslated_text, $domain = null ) { global $typenow; if ( is_admin() ) : if ( is_sp_config_type( $typenow ) ) : switch ( $untranslated_text ) : case 'Excerpt': $translated_text = esc_attr__( 'Description', 'sportspress' ); break; case 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. Learn more about manual excerpts.': $translated_text = esc_attr__( 'The description is not prominent by default; however, some themes may show it.', 'sportspress' ); break; case 'Slug': $translated_text = ( in_array( $typenow, array( 'sp_column', 'sp_statistic' ) ) ) ? esc_attr__( 'Key', 'sportspress' ) : esc_attr__( 'Variable', 'sportspress' ); break; endswitch; endif; if ( is_sp_post_type( $typenow ) ) : switch ( $untranslated_text ) : case 'Author': $translated_text = esc_attr__( 'User', 'sportspress' ); break; endswitch; endif; if ( in_array( $typenow, array( 'sp_event' ) ) ) : switch ( $untranslated_text ) : case 'Publish immediately': $translated_text = esc_attr__( 'Date/Time:', 'sportspress' ) . ' ' . esc_attr__( 'Now', 'sportspress' ) . ''; break; endswitch; endif; else : if ( $domain == 'sportspress' ) : if ( ! empty( SP()->text[ $translated_text ] ) ) : $translated_text = SP()->text[ $translated_text ]; endif; elseif ( ! current_theme_supports( 'sportspress' ) && $untranslated_text == 'Archives' ) : add_action( 'wp', function() use ( &$translated_text ) { if ( is_tax( 'sp_venue' ) ) : $slug = get_query_var( 'sp_venue' ); if ( $slug ) : $venue = get_term_by( 'slug', $slug, 'sp_venue' ); $translated_text = $venue->name; endif; endif; }); endif; endif; return $translated_text; } add_filter( 'gettext', 'sportspress_gettext', 20, 3 ); function sportspress_team_permalink( $permalink, $post ) { if ( ! is_admin() && 'sp_team' == get_post_type( $post ) ) : $url = get_post_meta( $post->ID, 'sp_url', true ); if ( ! empty( $url ) ) : $redirect = get_post_meta( $post->ID, 'sp_redirect', true ); if ( $redirect === '' ) : $redirect = ( empty( $post->post_content ) ) ? 1 : 0; endif; if ( $redirect ) : return $url; endif; endif; endif; return $permalink; } add_filter( 'post_type_link', 'sportspress_team_permalink', 10, 2 ); function sportspress_no_terms_links( $term_list, $taxonomy ) { if ( in_array( $taxonomy, array( 'sp_league', 'sp_season', 'sp_position', 'sp_role' ) ) ) { return wp_filter_nohtml_kses( $term_list ); } return $term_list; } add_filter( 'the_terms', 'sportspress_no_terms_links', 10, 2 ); function sportspress_strcmp_term_slug( $a, $b ) { return strcmp( $a->slug, $b->slug ); } function sportspress_term_order( $terms, $post_id, $taxonomy ) { if ( ! is_array( $terms ) ) { return array(); } if ( is_sp_taxonomy( $taxonomy ) ) { uasort( $terms, 'sportspress_strcmp_term_slug' ); } return $terms; } add_filter( 'get_the_terms', 'sportspress_term_order', 10, 3 ); function sportspress_pre_get_posts( $query ) { $post_type = sp_array_value( $query->query, 'post_type', null ); if ( is_sp_post_type( $post_type ) ) : $query->set( 'suppress_filters', 0 ); endif; if ( is_admin() ) : if ( isset( $query->query['orderby'] ) || isset( $query->query['order'] ) ) : return $query; endif; if ( is_sp_config_type( $post_type ) ) : $query->set( 'orderby', 'menu_order' ); $query->set( 'order', 'ASC' ); endif; else : if ( isset( $query->query['sp_venue'] ) ) : $query->set( 'post_type', 'sp_event' ); $GLOBALS['wp_post_statuses']['future']->public = true; endif; endif; return $query; } add_filter( 'pre_get_posts', 'sportspress_pre_get_posts' ); function sportspress_show_future_posts( $where, $that ) { global $wpdb; if ( 'sp_event' == $that->query_vars['post_type'] && is_archive() ) { $where = str_replace( "{$wpdb->posts}.post_status = 'publish'", "{$wpdb->posts}.post_status = 'publish' OR $wpdb->posts.post_status = 'future'", $where ); } return $where; } add_filter( 'posts_where', 'sportspress_show_future_posts', 2, 10 ); function sportspress_redirect_future_events() { if ( is_main_query() && 'sp_event' == get_query_var( 'post_type' ) && 'future' == get_post_status( get_query_var( 'p' ) ) && ! empty( $_GET['p'] ) ) { if ( $redirect_url = get_post_permalink( get_query_var( 'p' ), false, true ) ) { wp_redirect( $redirect_url, 301 ); } die(); } } add_action( 'template_redirect', 'sportspress_redirect_future_events' ); function sportspress_give_event_read_permissions( $allcaps, $caps, $args ) { // Bail out if we're not asking about viewing an event if ( 'read_sp_event' !== $args[0] ) { return $allcaps; } // Load the post data $post = get_post( $args[2] ); // Bail out if the event isn't scheduled if ( 'future' != $post->post_status ) { return $allcaps; } // Add post capabilities foreach ( $caps as $cap ) { $allcaps[ $cap ] = true; } return $allcaps; } add_filter( 'user_has_cap', 'sportspress_give_event_read_permissions', 10, 3 ); function sportspress_sanitize_title( $title ) { if ( isset( $_POST ) && array_key_exists( 'taxonomy', $_POST ) ) : return $title; elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && is_sp_config_type( sanitize_key( $_POST['post_type'] ) ) ) : $key = isset( $_POST['sp_key'] ) ? sanitize_text_field( wp_unslash( $_POST['sp_key'] ) ) : null; if ( ! $key ) { $key = isset( $_POST['sp_default_key'] ) ? sanitize_text_field( wp_unslash( $_POST['sp_default_key'] ) ) : null; } if ( ! $key ) { $key = sanitize_text_field( wp_unslash( $_POST['post_title'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput } $id = sp_array_value( $_POST, 'post_ID', 'var', 'text' ); $title = sp_get_eos_safe_slug( $key, $id ); endif; return $title; } add_filter( 'sanitize_title', 'sportspress_sanitize_title' ); function sportspress_widget_text( $content ) { if ( ! 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 ) ) { return $content; } $content = do_shortcode( $content ); return $content; } add_filter( 'widget_text', 'sportspress_widget_text', 9 ); function sportspress_post_updated_messages( $messages ) { global $typenow, $post; if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_metric', 'sp_spec', 'sp_performance' ) ) ) : $obj = get_post_type_object( $typenow ); for ( $i = 0; $i <= 10; $i++ ) : $messages['post'][ $i ] = esc_attr__( 'Settings saved.', 'sportspress' ) . ' ' . __( 'View All', 'sportspress' ) . ''; endfor; elseif ( in_array( $typenow, array( 'sp_event', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ) ) : $obj = get_post_type_object( $typenow ); $messages['post'][1] = esc_attr__( 'Changes saved.', 'sportspress' ) . ' ' . $obj->labels->view_item . ''; $messages['post'][4] = esc_attr__( 'Changes saved.', 'sportspress' ); $messages['post'][6] = esc_attr__( 'Success!', 'sportspress' ) . ' ' . $obj->labels->view_item . ''; $messages['post'][7] = esc_attr__( 'Changes saved.', 'sportspress' ); $messages['post'][8] = esc_attr__( 'Success!', 'sportspress' ) . ' ' . sprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . ''; $messages['post'][9] = sprintf( __( 'Scheduled for: %1$s.', 'sportspress' ), date_i18n( esc_attr__( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post->ID ) ) ) . ' ' . sprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . ''; $messages['post'][10] = esc_attr__( 'Success!', 'sportspress' ) . ' ' . sprintf( esc_attr__( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . ''; endif; return $messages; } function sportspress_hide_adjacent_post_links( $output = null, $format = null, $link = null, $post = null ) { if ( is_object( $post ) && property_exists( $post, 'post_type' ) && in_array( $post->post_type, sp_post_types() ) ) { return false; } return $output; } add_filter( 'post_updated_messages', 'sportspress_post_updated_messages' ); function sportspress_remove_page_parent_class( $classes, $item ) { if ( ( is_sp_post_type( get_post_type() ) && $key = array_search( 'current_page_parent', $classes ) ) !== false ) { unset( $classes[ $key ] ); } return $classes; } add_filter( 'nav_menu_css_class', 'sportspress_remove_page_parent_class', 10, 2 ); ================================================ FILE: includes/widgets/class-sp-widget-birthdays.php ================================================ 'widget_sportspress widget_birthdays widget_sp_birthdays', 'description' => esc_attr__( 'Display players and staff on their birthday.', 'sportspress' ), ); parent::__construct( 'sportspress-birthdays', esc_attr__( 'Birthdays', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $date = empty( $instance['date'] ) ? 'day' : strip_tags( $instance['date'] ); $birthday_format = empty( $instance['birthday_format'] ) ? 'birthday' : strip_tags( $instance['birthday_format'] ); do_action( 'sportspress_before_widget', $args, $instance, 'birthdays' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'birthdays' ); sp_get_template( 'birthdays.php', array( 'date' => $date, 'birthday_format' => $birthday_format, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'birthdays' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'birthdays' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['date'] = strip_tags( $new_instance['date'] ); $instance['birthday_format'] = strip_tags( $new_instance['birthday_format'] ); // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'birthdays' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'date' => 'day', 'birthday_format' => 'birthday', ) ); $title = strip_tags( $instance['title'] ); $date = strip_tags( $instance['date'] ); $options = array( 'day' => esc_attr__( 'Today', 'sportspress' ), 'week' => esc_attr__( 'This week', 'sportspress' ), 'month' => esc_attr__( 'This month', 'sportspress' ), ); $birthday_format = strip_tags( $instance['birthday_format'] ); $birthday_options = array( 'hide' => esc_attr__( 'Hide', 'sportspress' ), 'birthday' => esc_attr__( 'Birthday', 'sportspress' ), 'age' => esc_attr__( 'Age', 'sportspress' ), 'birthdayage' => esc_attr__( 'Birthday (Age)', 'sportspress' ), ); // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'birthdays' ); ?>

    'widget_sportspress widget_countdown widget_sp_countdown', 'description' => esc_attr__( 'A clock that counts down to an upcoming event.', 'sportspress' ), ); parent::__construct( 'sportspress-countdown', esc_attr__( 'Countdown', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $caption = empty( $instance['caption'] ) ? null : $instance['caption']; $calendar = empty( $instance['calendar'] ) ? null : $instance['calendar']; $team = empty( $instance['team'] ) ? null : $instance['team']; $id = empty( $instance['id'] ) ? null : $instance['id']; $show_venue = empty( $instance['show_venue'] ) ? false : $instance['show_venue']; $show_league = empty( $instance['show_league'] ) ? false : $instance['show_league']; $show_date = empty( $instance['show_date'] ) ? false : $instance['show_date']; $show_excluded = empty( $instance['show_excluded'] ) ? false : $instance['show_excluded']; $order = empty( $instance['order'] ) ? false : $instance['order']; $orderby = empty( $instance['orderby'] ) ? false : $instance['orderby']; $show_status = empty( $instance['show_status'] ) ? false : $instance['show_status']; do_action( 'sportspress_before_widget', $args, $instance, 'countdown' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'countdown' ); sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league, 'show_date' => $show_date, 'show_excluded' => $show_excluded, 'order' => $order, 'orderby' => $orderby, 'show_status' => $show_status, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'countdown' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'countdown' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['calendar'] = intval( $new_instance['calendar'] ); $instance['team'] = intval( $new_instance['team'] ); $instance['caption'] = strip_tags( $new_instance['caption'] ); $instance['id'] = intval( $new_instance['id'] ); $instance['show_venue'] = isset( $new_instance['show_venue'] ) ? $new_instance['show_venue'] : false; $instance['show_league'] = isset( $new_instance['show_league'] ) ? $new_instance['show_league'] : false; $instance['show_date'] = isset( $new_instance['show_date'] ) ? $new_instance['show_date'] : false; $instance['show_excluded'] = isset( $new_instance['show_excluded'] ) ? $new_instance['show_excluded'] : false; $instance['order'] = strip_tags( $new_instance['order'] ); $instance['orderby'] = strip_tags( $new_instance['orderby'] ); $instance['show_status'] = isset( $new_instance['show_status'] ) ? $new_instance['show_status'] : false; // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'countdown' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'calendar' => '', 'team' => '', 'id' => '', 'caption' => '', 'show_venue' => false, 'show_league' => false, 'show_date' => false, 'show_excluded' => false, 'order' => '', 'orderby' => '', 'show_status' => true, ) ); $title = strip_tags( $instance['title'] ); $caption = strip_tags( $instance['caption'] ); $calendar = intval( $instance['calendar'] ); $team = intval( $instance['team'] ); $id = intval( $instance['id'] ); $show_venue = intval( $instance['show_venue'] ); $show_league = intval( $instance['show_league'] ); $show_date = intval( $instance['show_date'] ); $show_excluded = intval( $instance['show_excluded'] ); $order = strip_tags( $instance['order'] ); $orderby = strip_tags( $instance['orderby'] ); $show_status = intval( $instance['show_status'] ); // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'countdown' ); ?>

    'sp_calendar', 'name' => $this->get_field_name( 'calendar' ), 'id' => $this->get_field_id( 'calendar' ), 'selected' => $calendar, 'show_option_all' => esc_attr__( 'All', 'sportspress' ), 'values' => 'ID', 'class' => 'widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    'sp_team', 'name' => $this->get_field_name( 'team' ), 'id' => $this->get_field_id( 'team' ), 'selected' => $team, 'show_option_all' => esc_attr__( 'All', 'sportspress' ), 'values' => 'ID', 'class' => 'widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_team', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    'sp_event', 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'selected' => $id, 'show_option_all' => esc_attr__( '(Auto)', 'sportspress' ), 'values' => 'ID', 'class' => 'widefat', 'show_dates' => true, 'post_status' => 'future', 'filter' => 'sp_team', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_event', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    >

    >

    >

    >

    >

    'widget_sportspress widget_sp_event_blocks', 'description' => esc_attr__( 'A list of events.', 'sportspress' ), ); parent::__construct( 'sportspress-event-blocks', esc_attr__( 'Event Blocks', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $id = empty( $instance['id'] ) ? null : $instance['id']; if ( $id && 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) { $format = get_post_meta( $id, 'sp_format', true ); if ( 'blocks' == $format ) { return; } } $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $caption = empty( $instance['caption'] ) ? null : $instance['caption']; $status = empty( $instance['status'] ) ? 'default' : $instance['status']; $date = empty( $instance['date'] ) ? 'default' : $instance['date']; $date_from = empty( $instance['date_from'] ) ? 'default' : $instance['date_from']; $date_to = empty( $instance['date_to'] ) ? 'default' : $instance['date_to']; $date_past = empty( $instance['date_past'] ) ? 'default' : $instance['date_past']; $date_future = empty( $instance['date_future'] ) ? 'default' : $instance['date_future']; $date_relative = empty( $instance['date_relative'] ) ? 'default' : $instance['date_relative']; $day = empty( $instance['day'] ) ? 'default' : $instance['day']; $number = empty( $instance['number'] ) ? null : $instance['number']; $order = empty( $instance['order'] ) ? 'default' : $instance['order']; $show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link']; do_action( 'sportspress_before_widget', $args, $instance, 'event-blocks' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'event-blocks' ); sp_get_template( 'event-blocks.php', array( 'id' => $id, 'title' => $caption, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'date_past' => $date_past, 'date_future' => $date_future, 'date_relative' => $date_relative, 'day' => $day, 'number' => $number, 'order' => $order, 'show_all_events_link' => $show_all_events_link, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'event-blocks' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'event-blocks' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['id'] = intval( $new_instance['id'] ); $instance['caption'] = strip_tags( $new_instance['caption'] ); $instance['status'] = $new_instance['status']; $instance['date'] = $new_instance['date']; $instance['date_from'] = $new_instance['date_from']; $instance['date_to'] = $new_instance['date_to']; $instance['date_past'] = $new_instance['date_past']; $instance['date_future'] = $new_instance['date_future']; $instance['date_relative'] = isset( $new_instance['date_relative'] ) ? $new_instance['date_relative'] : false; $instance['day'] = $new_instance['day']; $instance['number'] = intval( $new_instance['number'] ); $instance['order'] = strip_tags( $new_instance['order'] ); $instance['show_all_events_link'] = isset( $new_instance['show_all_events_link'] ) ? $new_instance['show_all_events_link'] : false; // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'event-blocks' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'caption' => '', 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'date_past' => 7, 'date_future' => 7, 'date_relative' => false, 'day' => '', 'number' => 5, 'order' => 'default', 'show_all_events_link' => true, ) ); $title = strip_tags( $instance['title'] ); $id = intval( $instance['id'] ); $caption = strip_tags( $instance['caption'] ); $status = $instance['status']; $date = $instance['date']; $date_from = $instance['date_from']; $date_to = $instance['date_to']; $date_past = $instance['date_past']; $date_future = $instance['date_future']; $date_relative = $instance['date_relative']; $day = $instance['day']; $number = intval( $instance['number'] ); $order = strip_tags( $instance['order'] ); $show_all_events_link = $instance['show_all_events_link']; // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-blocks' ); ?>

    'sp_calendar', 'show_option_all' => esc_attr__( 'All', 'sportspress' ), 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'selected' => $id, 'values' => 'ID', 'class' => 'sp-event-calendar-select widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    esc_attr__( 'Default', 'sportspress' ), 'name' => $this->get_field_name( 'status' ), 'id' => $this->get_field_id( 'status' ), 'selected' => $status, 'class' => 'sp-event-status-select widefat', ); sp_dropdown_statuses( $args ); ?>

    esc_attr__( 'Default', 'sportspress' ), 'name' => $this->get_field_name( 'date' ), 'id' => $this->get_field_id( 'date' ), 'selected' => $date, 'class' => 'sp-event-date-select widefat', ); sp_dropdown_dates( $args ); ?>

    :

    >

    'widget_sportspress widget_calendar widget_sp_event_calendar', 'description' => esc_attr__( 'A calendar of events.', 'sportspress' ), ); parent::__construct( 'sportspress-event-calendar', esc_attr__( 'Event Calendar', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $id = empty( $instance['id'] ) ? null : $instance['id']; if ( $id && 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) { $format = get_post_meta( $id, 'sp_format', true ); if ( 'calendar' == $format ) { return; } } $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $status = empty( $instance['status'] ) ? 'default' : $instance['status']; $date = empty( $instance['date'] ) ? 'default' : $instance['date']; $date_from = empty( $instance['date_from'] ) ? 'default' : $instance['date_from']; $date_to = empty( $instance['date_to'] ) ? 'default' : $instance['date_to']; $date_past = empty( $instance['date_past'] ) ? 'default' : $instance['date_past']; $date_future = empty( $instance['date_future'] ) ? 'default' : $instance['date_future']; $date_relative = empty( $instance['date_relative'] ) ? 'default' : $instance['date_relative']; $day = empty( $instance['day'] ) ? 'default' : $instance['day']; $show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link']; do_action( 'sportspress_before_widget', $args, $instance, 'event-calendar' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'event-calendar' ); sp_get_template( 'event-calendar.php', array( 'id' => $id, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'date_past' => $date_past, 'date_future' => $date_future, 'date_relative' => $date_relative, 'caption_tag' => 'caption', 'day' => $day, 'show_all_events_link' => $show_all_events_link, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'event-calendar' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'event-calendar' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['id'] = intval( $new_instance['id'] ); $instance['status'] = $new_instance['status']; $instance['date'] = $new_instance['date']; $instance['date_from'] = $new_instance['date_from']; $instance['date_to'] = $new_instance['date_to']; $instance['date_past'] = $new_instance['date_past']; $instance['date_future'] = $new_instance['date_future']; $instance['date_relative'] = isset( $new_instance['date_relative'] ) ? $new_instance['date_relative'] : false; $instance['day'] = $new_instance['day']; $instance['show_all_events_link'] = isset( $new_instance['show_all_events_link'] ) ? $new_instance['show_all_events_link'] : false; // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'event-calendar' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'date_past' => 7, 'date_future' => 7, 'date_relative' => false, 'day' => '', 'show_all_events_link' => false, ) ); $title = strip_tags( $instance['title'] ); $id = intval( $instance['id'] ); $status = $instance['status']; $date = $instance['date']; $date_from = $instance['date_from']; $date_to = $instance['date_to']; $date_past = $instance['date_past']; $date_future = $instance['date_future']; $date_relative = $instance['date_relative']; $day = $instance['day']; $show_all_events_link = $instance['show_all_events_link']; // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-calendar' ); ?>

    'sp_calendar', 'show_option_all' => esc_attr__( 'All', 'sportspress' ), 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'selected' => $id, 'values' => 'ID', 'class' => 'sp-event-calendar-select widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    esc_attr__( 'Default', 'sportspress' ), 'name' => $this->get_field_name( 'status' ), 'id' => $this->get_field_id( 'status' ), 'selected' => $status, 'class' => 'sp-event-status-select widefat', ); sp_dropdown_statuses( $args ); ?>

    esc_attr__( 'Default', 'sportspress' ), 'name' => $this->get_field_name( 'date' ), 'id' => $this->get_field_id( 'date' ), 'selected' => $date, 'class' => 'sp-event-date-select widefat', ); sp_dropdown_dates( $args ); ?>

    :

    >

    'widget_sportspress widget_sp_event_list', 'description' => esc_attr__( 'A list of events.', 'sportspress' ), ); parent::__construct( 'sportspress-event-list', esc_attr__( 'Event List', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $id = empty( $instance['id'] ) ? null : $instance['id']; if ( $id && 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) { $format = get_post_meta( $id, 'sp_format', true ); if ( 'list' == $format ) { return; } } $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $caption = empty( $instance['caption'] ) ? null : $instance['caption']; $status = empty( $instance['status'] ) ? 'default' : $instance['status']; $date = empty( $instance['date'] ) ? 'default' : $instance['date']; $date_from = empty( $instance['date_from'] ) ? 'default' : $instance['date_from']; $date_to = empty( $instance['date_to'] ) ? 'default' : $instance['date_to']; $date_past = empty( $instance['date_past'] ) ? 'default' : $instance['date_past']; $date_future = empty( $instance['date_future'] ) ? 'default' : $instance['date_future']; $date_relative = empty( $instance['date_relative'] ) ? 'default' : $instance['date_relative']; $day = empty( $instance['day'] ) ? 'default' : $instance['day']; $number = empty( $instance['number'] ) ? null : $instance['number']; $columns = empty( $instance['columns'] ) ? null : $instance['columns']; $order = empty( $instance['order'] ) ? 'default' : $instance['order']; $show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link']; do_action( 'sportspress_before_widget', $args, $instance, 'event-list' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'event-list' ); sp_get_template( 'event-list.php', array( 'id' => $id, 'title' => $caption, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'date_past' => $date_past, 'date_future' => $date_future, 'date_relative' => $date_relative, 'day' => $day, 'number' => $number, 'columns' => $columns, 'order' => $order, 'show_all_events_link' => $show_all_events_link, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'event-list' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'event-list' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['id'] = intval( $new_instance['id'] ); $instance['caption'] = strip_tags( $new_instance['caption'] ); $instance['status'] = $new_instance['status']; $instance['date'] = $new_instance['date']; $instance['date_from'] = $new_instance['date_from']; $instance['date_to'] = $new_instance['date_to']; $instance['date_past'] = $new_instance['date_past']; $instance['date_future'] = $new_instance['date_future']; $instance['date_relative'] = isset( $new_instance['date_relative'] ) ? $new_instance['date_relative'] : false; $instance['day'] = $new_instance['day']; $instance['number'] = intval( $new_instance['number'] ); $instance['columns'] = isset( $new_instance['columns'] ) ? (array) $new_instance['columns'] : array(); $instance['order'] = strip_tags( $new_instance['order'] ); $instance['show_all_events_link'] = isset( $new_instance['show_all_events_link'] ) ? $new_instance['show_all_events_link'] : false; // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'event-list' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'caption' => '', 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'date_past' => 7, 'date_future' => 7, 'date_relative' => false, 'day' => '', 'number' => 5, 'columns' => null, 'order' => 'default', 'show_all_events_link' => true, ) ); $title = strip_tags( $instance['title'] ); $id = intval( $instance['id'] ); $caption = strip_tags( $instance['caption'] ); $status = $instance['status']; $date = $instance['date']; $date_from = $instance['date_from']; $date_to = $instance['date_to']; $date_past = $instance['date_past']; $date_future = $instance['date_future']; $date_relative = $instance['date_relative']; $day = $instance['day']; $number = intval( $instance['number'] ); $columns = $instance['columns']; $order = strip_tags( $instance['order'] ); $show_all_events_link = $instance['show_all_events_link']; $time_format = get_option( 'sportspress_event_list_time_format', 'combined' ); // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-list' ); ?>

    'sp_calendar', 'show_option_all' => esc_attr__( 'All', 'sportspress' ), 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'selected' => $id, 'values' => 'ID', 'class' => 'sp-event-calendar-select widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    esc_attr__( 'Default', 'sportspress' ), 'name' => $this->get_field_name( 'status' ), 'id' => $this->get_field_id( 'status' ), 'selected' => $status, 'class' => 'sp-event-status-select widefat', ); sp_dropdown_statuses( $args ); ?>

    esc_attr__( 'Default', 'sportspress' ), 'name' => $this->get_field_name( 'date' ), 'id' => $this->get_field_id( 'date' ), 'selected' => $date, 'class' => 'sp-event-date-select widefat', ); sp_dropdown_dates( $args ); ?>

    :


    get_field_name( 'columns' ) . '[]'; $field_id = $this->get_field_id( 'columns' ); ?> $label ) : ?>

    >

    'widget_sportspress widget_league_table widget_sp_league_table', 'description' => esc_attr__( 'Display a league table.', 'sportspress' ), ); parent::__construct( 'sportspress-league-table', esc_attr__( 'League Table', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $id = empty( $instance['id'] ) ? 0 : $instance['id']; if ( $id <= 0 ) { return; } if ( 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) { return; } $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $caption = empty( $instance['caption'] ) ? null : $instance['caption']; $number = empty( $instance['number'] ) ? null : $instance['number']; $columns = empty( $instance['columns'] ) ? array() : $instance['columns']; $show_team_logo = empty( $instance['show_team_logo'] ) ? false : $instance['show_team_logo']; $show_full_table_link = empty( $instance['show_full_table_link'] ) ? false : $instance['show_full_table_link']; do_action( 'sportspress_before_widget', $args, $instance, 'league-table' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'league-table' ); sp_get_template( 'league-table.php', array( 'id' => $id, 'title' => $caption, 'number' => $number, 'columns' => $columns, 'show_full_table_link' => $show_full_table_link, 'show_team_logo' => $show_team_logo, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'league-table' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'league-table' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['id'] = intval( $new_instance['id'] ); $instance['caption'] = strip_tags( $new_instance['caption'] ); $instance['number'] = intval( $new_instance['number'] ); $instance['columns'] = isset( $new_instance['columns'] ) ? (array) $new_instance['columns'] : array(); $instance['show_team_logo'] = isset( $new_instance['show_team_logo'] ) ? $new_instance['show_team_logo'] : false; $instance['show_full_table_link'] = isset( $new_instance['show_full_table_link'] ) ? $new_instance['show_full_table_link'] : false; // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'league-table' ); return $instance; } function form( $instance ) { $defaults = apply_filters( 'sportspress_widget_defaults', array( 'title' => '', 'id' => '', 'caption' => '', 'number' => 5, 'columns' => null, 'show_team_logo' => false, 'show_full_table_link' => true, ) ); $instance = wp_parse_args( (array) $instance, $defaults ); $title = strip_tags( $instance['title'] ); $id = intval( $instance['id'] ); $caption = strip_tags( $instance['caption'] ); $number = intval( $instance['number'] ); $columns = $instance['columns']; $show_team_logo = $instance['show_team_logo']; $show_full_table_link = $instance['show_full_table_link']; // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'league-table' ); ?>

    'sp_table', 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'show_option_none' => esc_attr__( '— Select —', 'sportspress' ), 'selected' => $id, 'values' => 'ID', 'class' => 'widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_table', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>


    'sp_column', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $the_columns = get_posts( $args ); $field_name = $this->get_field_name( 'columns' ) . '[]'; $field_id = $this->get_field_id( 'columns' ); ?>

    >
    >

    'widget_sportspress widget_player_gallery widget_sp_player_gallery', 'description' => esc_attr__( 'Display a gallery of players.', 'sportspress' ), ); parent::__construct( 'sportspress-player-gallery', esc_attr__( 'Player Gallery', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $id = empty( $instance['id'] ) ? 0 : $instance['id']; if ( $id <= 0 ) { return; } if ( 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) { $format = get_post_meta( $id, 'sp_format', true ); if ( 'gallery' == $format ) { return; } } $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $caption = empty( $instance['caption'] ) ? null : $instance['caption']; $number = empty( $instance['number'] ) ? null : $instance['number']; $columns = empty( $instance['columns'] ) ? null : $instance['columns']; $orderby = empty( $instance['orderby'] ) ? 'default' : $instance['orderby']; $order = empty( $instance['order'] ) ? 'ASC' : $instance['order']; $show_all_players_link = empty( $instance['show_all_players_link'] ) ? false : $instance['show_all_players_link']; do_action( 'sportspress_before_widget', $args, $instance, 'player-gallery' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'player-gallery' ); sp_get_template( 'player-gallery.php', array( 'id' => $id, 'title' => $caption, 'number' => $number, 'columns' => $columns, 'orderby' => $orderby, 'order' => $order, 'grouping' => 0, 'show_all_players_link' => $show_all_players_link, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'player-gallery' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'player-gallery' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['id'] = intval( $new_instance['id'] ); $instance['caption'] = strip_tags( $new_instance['caption'] ); $instance['number'] = intval( $new_instance['number'] ); $instance['columns'] = isset( $new_instance['columns'] ) ? intval( $new_instance['columns'] ) : 2; $instance['orderby'] = isset( $new_instance['orderby'] ) ? strip_tags( $new_instance['orderby'] ) : 'default'; $instance['order'] = isset( $new_instance['order'] ) ? strip_tags( $new_instance['order'] ) : 'ASC'; $instance['show_all_players_link'] = isset( $new_instance['show_all_players_link'] ) ? $new_instance['show_all_players_link'] : false; // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'player-gallery' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '', 'caption' => '', 'number' => 5, 'columns' => 2, 'orderby' => 'default', 'order' => 'ASC', 'show_all_players_link' => true, ) ); $title = strip_tags( $instance['title'] ); $id = intval( $instance['id'] ); $caption = strip_tags( $instance['caption'] ); $number = intval( $instance['number'] ); $columns = intval( $instance['columns'] ); $orderby = strip_tags( $instance['orderby'] ); $order = strip_tags( $instance['order'] ); $show_all_players_link = $instance['show_all_players_link']; // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'player-gallery' ); ?>

    'sp_list', 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'selected' => $id, 'values' => 'ID', 'class' => 'widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    array( 'default' => esc_attr__( 'Default', 'sportspress' ), 'number' => esc_attr__( 'Squad Number', 'sportspress' ), 'name' => esc_attr__( 'Name', 'sportspress' ), 'eventsplayed' => esc_attr__( 'Played', 'sportspress' ), ), 'append_options' => array( 'rand' => esc_attr__( 'Random', 'sportspress' ), ), 'post_type' => 'sp_performance', 'name' => $this->get_field_name( 'orderby' ), 'id' => $this->get_field_id( 'orderby' ), 'selected' => $orderby, 'values' => 'slug', 'class' => 'sp-select-orderby widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    >

    'widget_sportspress widget_player_list widget_sp_player_list', 'description' => esc_attr__( 'Display a list of players.', 'sportspress' ), ); parent::__construct( 'sportspress-player-list', esc_attr__( 'Player List', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $id = empty( $instance['id'] ) ? 0 : $instance['id']; if ( $id <= 0 ) { return; } if ( 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) { $format = get_post_meta( $id, 'sp_format', true ); if ( 'list' == $format ) { return; } } $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $caption = empty( $instance['caption'] ) ? null : $instance['caption']; $number = empty( $instance['number'] ) ? null : $instance['number']; $columns = $instance['columns']; $orderby = empty( $instance['orderby'] ) ? 'default' : $instance['orderby']; $order = empty( $instance['order'] ) ? 'ASC' : $instance['order']; $show_all_players_link = empty( $instance['show_all_players_link'] ) ? false : $instance['show_all_players_link']; do_action( 'sportspress_before_widget', $args, $instance, 'player-list' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'player-list' ); sp_get_template( 'player-list.php', array( 'id' => $id, 'title' => $caption, 'number' => $number, 'columns' => $columns, 'orderby' => $orderby, 'order' => $order, 'grouping' => 0, 'show_all_players_link' => $show_all_players_link, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'player-list' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'player-list' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['id'] = intval( $new_instance['id'] ); $instance['caption'] = strip_tags( $new_instance['caption'] ); $instance['number'] = intval( $new_instance['number'] ); $instance['columns'] = isset( $new_instance['columns'] ) ? (array) $new_instance['columns'] : array(); $instance['orderby'] = isset( $new_instance['orderby'] ) ? strip_tags( $new_instance['orderby'] ) : 'default'; $instance['order'] = isset( $new_instance['order'] ) ? strip_tags( $new_instance['order'] ) : 'ASC'; $instance['show_all_players_link'] = isset( $new_instance['show_all_players_link'] ) ? $new_instance['show_all_players_link'] : false; // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'player-list' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '', 'caption' => '', 'number' => 5, 'columns' => null, 'orderby' => 'default', 'order' => 'ASC', 'show_all_players_link' => true, ) ); $title = strip_tags( $instance['title'] ); $id = intval( $instance['id'] ); $caption = strip_tags( $instance['caption'] ); $number = intval( $instance['number'] ); $columns = $instance['columns']; $orderby = strip_tags( $instance['orderby'] ); $order = strip_tags( $instance['order'] ); $show_all_players_link = $instance['show_all_players_link']; // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'player-list' ); ?>

    'sp_list', 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'selected' => $id, 'values' => 'ID', 'class' => 'widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>


    array( 'sp_metric', 'sp_performance', 'sp_statistic' ), 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $the_columns = get_posts( $args ); $field_name = $this->get_field_name( 'columns' ) . '[]'; $field_id = $this->get_field_id( 'columns' ); ?>

    array( 'default' => esc_attr__( 'Default', 'sportspress' ), 'number' => esc_attr__( 'Squad Number', 'sportspress' ), 'name' => esc_attr__( 'Name', 'sportspress' ), 'eventsplayed' => esc_attr__( 'Played', 'sportspress' ), ), 'post_type' => array( 'sp_metric', 'sp_performance', 'sp_statistic' ), 'name' => $this->get_field_name( 'orderby' ), 'id' => $this->get_field_id( 'orderby' ), 'selected' => $orderby, 'values' => 'slug', 'class' => 'sp-select-orderby widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    >

    'widget_sportspress widget_staff widget_sp_staff', 'description' => esc_attr__( 'Display a single staff member.', 'sportspress' ), ); parent::__construct( 'sportspress-staff', esc_attr__( 'Staff', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? null : $instance['title'], $instance, $this->id_base ); $id = empty( $instance['id'] ) ? null : $instance['id']; do_action( 'sportspress_before_widget', $args, $instance, 'staff' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'staff' ); echo '

    ' . wp_kses_post( get_the_title( $id ) ) . '

    '; sp_get_template( 'staff-photo.php', array( 'id' => $id ) ); sp_get_template( 'staff-details.php', array( 'id' => $id ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'staff' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'staff' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['id'] = intval( $new_instance['id'] ); // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'staff' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '', ) ); $title = strip_tags( $instance['title'] ); $id = intval( $instance['id'] ); // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'staff' ); ?>

    'sp_staff', 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'selected' => $id, 'values' => 'ID', 'class' => 'widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_staff', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    'widget_sportspress widget_team_gallery widget_sp_team_gallery', 'description' => esc_attr__( 'Display a gallery of teams.', 'sportspress' ), ); parent::__construct( 'sportspress-team-gallery', esc_attr__( 'Team Gallery', 'sportspress' ), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $id = empty( $instance['id'] ) ? 0 : $instance['id']; if ( $id <= 0 ) { return; } if ( 'yes' == get_option( 'sportspress_widget_unique', 'no' ) && get_the_ID() === $id ) { $format = get_post_meta( $id, 'sp_format', true ); if ( 'gallery' == $format ) { return; } } $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $caption = empty( $instance['caption'] ) ? null : $instance['caption']; $number = empty( $instance['number'] ) ? null : $instance['number']; $columns = empty( $instance['columns'] ) ? null : $instance['columns']; $orderby = empty( $instance['orderby'] ) ? 'default' : $instance['orderby']; $show_all_teams_link = empty( $instance['show_all_teams_link'] ) ? false : $instance['show_all_teams_link']; do_action( 'sportspress_before_widget', $args, $instance, 'team-gallery' ); echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } // Action to hook into do_action( 'sportspress_before_widget_template', $args, $instance, 'team-gallery' ); sp_get_template( 'team-gallery.php', array( 'id' => $id, 'title' => $caption, 'number' => $number, 'columns' => $columns, 'orderby' => $orderby, 'grouping' => 0, 'show_all_teams_link' => $show_all_teams_link, ) ); // Action to hook into do_action( 'sportspress_after_widget_template', $args, $instance, 'team-gallery' ); echo wp_kses_post( $after_widget ); do_action( 'sportspress_after_widget', $args, $instance, 'team-gallery' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['id'] = intval( $new_instance['id'] ); $instance['caption'] = strip_tags( $new_instance['caption'] ); $instance['number'] = intval( $new_instance['number'] ); $instance['columns'] = intval( $new_instance['columns'] ); $instance['orderby'] = strip_tags( $new_instance['orderby'] ); $instance['show_all_teams_link'] = isset( $new_instance['show_all_teams_link'] ) ? $new_instance['show_all_teams_link'] : false; // Filter to hook into $instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'team-gallery' ); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '', 'caption' => '', 'number' => 5, 'columns' => 2, 'orderby' => 'default', 'show_all_teams_link' => true, ) ); $title = strip_tags( $instance['title'] ); $id = intval( $instance['id'] ); $caption = strip_tags( $instance['caption'] ); $number = intval( $instance['number'] ); $columns = intval( $instance['columns'] ); $orderby = strip_tags( $instance['orderby'] ); $show_all_teams_link = $instance['show_all_teams_link']; // Action to hook into do_action( 'sportspress_before_widget_template_form', $this, $instance, 'team-gallery' ); ?>

    'sp_table', 'name' => $this->get_field_name( 'id' ), 'id' => $this->get_field_id( 'id' ), 'selected' => $id, 'values' => 'ID', 'class' => 'widefat', ); if ( ! sp_dropdown_pages( $args ) ) : sp_post_adder( 'sp_table', esc_attr__( 'Add New', 'sportspress' ) ); endif; ?>

    >

    \n" "Language-Team: ThemeBoy \n" "Language: en_US\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.4.3\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPathExcluded-0: includes/libraries\n" #: assets/js/admin/editor-lang.php:35 msgid "SportsPress Shortcodes" msgstr "" #: assets/js/admin/editor-lang.php:36 #: includes/admin/post-types/class-sp-admin-cpt-list.php:77 #: includes/admin/post-types/class-sp-admin-cpt-table.php:81 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:162 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:90 #: includes/admin/settings/class-sp-settings-events.php:350 #: includes/admin/settings/class-sp-settings-events.php:413 #: includes/admin/settings/class-sp-settings-general.php:154 #: includes/admin/settings/class-sp-settings-general.php:241 #: includes/admin/settings/class-sp-settings-players.php:162 msgid "Auto" msgstr "" #: assets/js/admin/editor-lang.php:37 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:163 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:91 #: includes/admin/settings/class-sp-settings-events.php:351 #: includes/admin/settings/class-sp-settings-events.php:414 #: includes/admin/settings/class-sp-settings-players.php:163 msgid "Manual" msgstr "" #: assets/js/admin/editor-lang.php:38 msgid "Select..." msgstr "" #: assets/js/admin/editor-lang.php:39 #: includes/admin/class-sp-admin-importers.php:68 #: includes/admin/class-sp-admin-sample-data.php:441 #: includes/admin/class-sp-admin-setup-wizard.php:817 #: includes/admin/importers/class-sp-event-importer.php:159 #: includes/admin/importers/class-sp-event-importer.php:341 #: includes/admin/importers/class-sp-event-performance-importer.php:184 #: includes/admin/importers/class-sp-event-performance-importer.php:206 #: includes/admin/importers/class-sp-fixture-importer.php:125 #: includes/admin/importers/class-sp-fixture-importer.php:229 #: includes/admin/post-types/class-sp-admin-cpt-event.php:149 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:295 #: includes/class-sp-ajax.php:64 includes/class-sp-ajax.php:109 #: includes/class-sp-ajax.php:139 includes/class-sp-ajax.php:169 #: includes/class-sp-ajax.php:199 includes/class-sp-ajax.php:229 #: includes/class-sp-ajax.php:259 includes/class-sp-ajax.php:289 #: includes/class-sp-ajax.php:626 includes/class-sp-post-types.php:446 #: includes/sp-core-functions.php:1776 #: includes/widgets/class-sp-widget-countdown.php:171 #: includes/widgets/class-sp-widget-event-list.php:244 #: templates/event-list.php:178 templates/event-list.php:385 msgid "Event" msgstr "" #: assets/js/admin/editor-lang.php:40 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:34 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:43 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:59 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:75 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:91 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:100 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:136 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:166 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:195 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:224 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:287 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:28 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:264 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-shortcode.php:29 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:117 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:112 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:113 #: includes/admin/settings/class-sp-settings-events.php:74 #: includes/admin/settings/class-sp-settings-players.php:69 #: includes/admin/settings/class-sp-settings-staff.php:71 #: includes/class-sp-templates.php:62 includes/class-sp-templates.php:147 #: includes/class-sp-templates.php:201 includes/class-sp-templates.php:274 #: includes/sp-core-functions.php:1775 modules/sportspress-calendars.php:214 #: modules/sportspress-calendars.php:355 #: modules/sportspress-league-tables.php:205 #: modules/sportspress-player-lists.php:214 templates/event-details.php:74 msgid "Details" msgstr "" #: assets/js/admin/editor-lang.php:41 #: includes/admin/importers/class-sp-event-importer.php:32 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:150 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:49 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:92 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:27 #: includes/admin/settings/class-sp-settings-events.php:288 #: includes/api/class-sp-rest-api.php:274 includes/class-sp-templates.php:74 #: includes/sp-core-functions.php:1801 #: includes/widgets/class-sp-widget-event-list.php:257 #: templates/event-fixtures-results.php:89 templates/event-list.php:162 #: templates/event-list.php:188 templates/event-list.php:198 #: templates/event-list.php:344 templates/event-list.php:403 #: templates/event-list.php:433 templates/event-results.php:29 msgid "Results" msgstr "" #: assets/js/admin/editor-lang.php:42 #: includes/widgets/class-sp-widget-countdown.php:9 #: modules/sportspress-countdowns.php:88 msgid "Countdown" msgstr "" #: assets/js/admin/editor-lang.php:43 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:157 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:29 #: includes/admin/settings/class-sp-settings-events.php:372 #: includes/api/class-sp-rest-api.php:291 includes/class-sp-templates.php:80 #: includes/sp-core-functions.php:1769 modules/sportspress-tutorials.php:135 #: templates/event-performance.php:132 msgid "Box Score" msgstr "" #: assets/js/admin/editor-lang.php:44 #: includes/admin/class-sp-admin-setup-wizard.php:80 #: includes/admin/class-sp-admin-setup-wizard.php:566 #: includes/admin/class-sp-admin-setup-wizard.php:610 #: includes/admin/importers/class-sp-event-importer.php:30 #: includes/admin/importers/class-sp-fixture-importer.php:30 #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:55 #: includes/admin/post-types/class-sp-admin-cpt-event.php:144 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:54 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:113 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:84 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:51 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:30 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:109 #: includes/admin/settings/class-sp-settings-teams.php:77 #: includes/class-sp-ajax.php:631 includes/class-sp-post-types.php:118 #: includes/class-sp-templates.php:68 includes/sp-core-functions.php:1812 #: includes/widgets/class-sp-widget-event-list.php:261 #: templates/event-list.php:217 templates/event-list.php:219 #: templates/event-list.php:486 templates/event-list.php:499 #: templates/event-venue.php:43 msgid "Venue" msgstr "" #: assets/js/admin/editor-lang.php:45 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php:57 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:31 #: includes/class-sp-modules.php:141 modules/sportspress-officials.php:141 #: modules/sportspress-officials.php:335 modules/sportspress-officials.php:350 #: modules/sportspress-officials.php:364 modules/sportspress-officials.php:380 #: modules/sportspress-officials.php:399 templates/event-officials-list.php:17 #: templates/event-officials-table.php:17 msgid "Officials" msgstr "" #: assets/js/admin/editor-lang.php:46 #: includes/admin/class-sp-admin-permalink-settings.php:32 #: includes/admin/class-sp-admin-sample-data.php:173 #: includes/admin/class-sp-admin-setup-wizard.php:70 #: includes/admin/importers/class-sp-event-importer.php:31 #: includes/admin/importers/class-sp-player-importer.php:31 #: includes/admin/importers/class-sp-staff-importer.php:30 #: includes/admin/post-types/class-sp-admin-cpt-event.php:141 #: includes/admin/post-types/class-sp-admin-cpt-player.php:82 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:72 #: includes/admin/post-types/class-sp-admin-cpt-table.php:55 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:143 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:37 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:68 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:32 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:132 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:149 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:108 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:125 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:60 #: includes/admin/settings/class-sp-settings-events.php:136 #: includes/admin/settings/class-sp-settings-events.php:242 #: includes/admin/settings/class-sp-settings-modules.php:39 #: includes/admin/settings/class-sp-settings-teams.php:27 #: includes/api/class-sp-rest-api.php:73 includes/api/class-sp-rest-api.php:426 #: includes/api/class-sp-rest-api.php:527 includes/class-sp-ajax.php:627 #: includes/class-sp-post-types.php:480 includes/class-sp-templates.php:31 #: includes/sp-core-functions.php:741 includes/sp-core-functions.php:1808 #: modules/sportspress-calendars.php:270 modules/sportspress-calendars.php:284 #: modules/sportspress-calendars.php:347 #: modules/sportspress-league-tables.php:260 #: modules/sportspress-player-lists.php:287 #: modules/sportspress-player-lists.php:295 #: modules/sportspress-tutorials.php:90 modules/sportspress-tutorials.php:144 #: modules/sportspress-wordpay.php:207 templates/event-list.php:176 #: templates/event-list.php:379 msgid "Teams" msgstr "" #: assets/js/admin/editor-lang.php:47 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:33 msgid "Full Info" msgstr "" #: assets/js/admin/editor-lang.php:48 #: includes/admin/class-sp-admin-sample-data.php:571 #: includes/class-sp-ajax.php:319 includes/class-sp-ajax.php:472 #: includes/class-sp-ajax.php:679 includes/class-sp-formats.php:33 #: includes/class-sp-templates.php:102 #: includes/widgets/class-sp-widget-countdown.php:122 #: includes/widgets/class-sp-widget-event-blocks.php:140 #: includes/widgets/class-sp-widget-event-calendar.php:123 #: includes/widgets/class-sp-widget-event-list.php:147 #: modules/sportspress-bulk-actions.php:80 modules/sportspress-calendars.php:79 #: modules/sportspress-calendars.php:435 modules/sportspress-calendars.php:478 #: modules/sportspress-gutenberg.php:90 msgid "Calendar" msgstr "" #: assets/js/admin/editor-lang.php:49 #: includes/admin/class-sp-admin-taxonomies.php:186 #: includes/admin/class-sp-admin-taxonomies.php:223 #: includes/admin/class-sp-admin-taxonomies.php:334 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:209 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:61 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-shortcode.php:33 #: includes/admin/settings/class-sp-settings-players.php:150 #: includes/api/class-sp-rest-api.php:510 includes/class-sp-post-types.php:413 #: includes/class-sp-templates.php:226 includes/sp-core-functions.php:1805 msgid "Statistics" msgstr "" #: assets/js/admin/editor-lang.php:50 #: includes/admin/class-sp-admin-sample-data.php:173 #: includes/admin/importers/class-sp-event-performance-importer.php:217 #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:56 #: includes/admin/post-types/class-sp-admin-cpt-list.php:55 #: includes/admin/post-types/class-sp-admin-cpt-team.php:78 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:113 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php:281 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:45 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:62 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:86 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:119 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:99 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:186 #: includes/admin/settings/class-sp-settings-events.php:540 #: includes/admin/settings/class-sp-settings-events.php:542 #: includes/class-sp-ajax.php:1154 includes/class-sp-league-table.php:854 #: includes/class-sp-player-list.php:901 includes/class-sp-player-list.php:960 #: includes/class-sp-player.php:836 includes/class-sp-player.php:856 #: includes/class-sp-post-types.php:481 includes/sp-core-functions.php:742 #: includes/sp-core-functions.php:1807 #: includes/widgets/class-sp-widget-countdown.php:154 #: modules/sportspress-user-registration.php:126 #: modules/sportspress-user-registration.php:132 #: modules/sportspress-wordpay.php:166 modules/sportspress-wordpay.php:172 #: templates/event-results.php:121 msgid "Team" msgstr "" #: assets/js/admin/editor-lang.php:51 #: includes/admin/class-sp-admin-sample-data.php:621 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:57 #: includes/class-sp-ajax.php:870 includes/class-sp-ajax.php:955 #: includes/class-sp-templates.php:175 includes/sp-core-functions.php:1784 #: includes/widgets/class-sp-widget-league-table.php:9 #: includes/widgets/class-sp-widget-league-table.php:108 #: includes/widgets/class-sp-widget-team-gallery.php:111 #: modules/sportspress-league-tables.php:76 #: modules/sportspress-league-tables.php:150 #: modules/sportspress-league-tables.php:212 #: modules/sportspress-league-tables.php:341 msgid "League Table" msgstr "" #: assets/js/admin/editor-lang.php:52 #: includes/admin/class-sp-admin-sample-data.php:233 #: includes/admin/importers/class-sp-event-performance-importer.php:28 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:131 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:356 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:60 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:211 #: includes/class-sp-ajax.php:1013 includes/class-sp-ajax.php:1043 #: includes/class-sp-install.php:153 includes/class-sp-player-list.php:958 #: includes/class-sp-post-types.php:524 includes/sp-core-functions.php:746 #: includes/sp-core-functions.php:1791 templates/event-performance-table.php:80 #: templates/event-performance-table.php:233 msgid "Player" msgstr "" #: assets/js/admin/editor-lang.php:53 includes/class-sp-formats.php:34 #: includes/class-sp-formats.php:42 modules/sportspress-calendars.php:436 #: modules/sportspress-calendars.php:479 modules/sportspress-officials.php:386 msgid "List" msgstr "" #: assets/js/admin/editor-lang.php:54 includes/class-sp-formats.php:35 #: modules/sportspress-calendars.php:434 modules/sportspress-calendars.php:477 msgid "Blocks" msgstr "" #: assets/js/admin/editor-lang.php:55 includes/class-sp-formats.php:39 #: includes/class-sp-formats.php:43 msgid "Gallery" msgstr "" #: assets/js/leaflet.js:5 msgid "number" msgstr "" #: assets/js/leaflet.js:5 msgid "shadow" msgstr "" #: feeds/ical.php:16 msgid "ERROR: This is not a valid feed template." msgstr "" #: includes/admin/class-sp-admin-assets.php:114 #: includes/admin/class-sp-admin-settings.php:147 #: includes/admin/class-sp-admin-setup-wizard.php:111 #: includes/admin/importers/class-sp-event-importer.php:540 #: includes/admin/importers/class-sp-event-importer.php:557 #: includes/admin/importers/class-sp-fixture-importer.php:325 #: includes/admin/importers/class-sp-fixture-importer.php:342 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:247 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:47 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:631 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:139 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:126 #: includes/admin/settings/class-sp-settings-events.php:435 #: includes/admin/settings/class-sp-settings-status.php:309 #: includes/admin/views/html-admin-page-status.php:268 #: modules/sportspress-league-tables.php:315 #: modules/sportspress-widget-alignment.php:74 msgid "None" msgstr "" #: includes/admin/class-sp-admin-assets.php:115 #: includes/admin/class-sp-admin-setup-wizard.php:112 msgid "— Remove —" msgstr "" #: includes/admin/class-sp-admin-assets.php:116 #: includes/admin/class-sp-admin-dashboard.php:85 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:87 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:91 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:69 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:67 #: includes/class-sp-ajax.php:420 includes/class-sp-ajax.php:424 #: includes/class-sp-ajax.php:585 includes/class-sp-ajax.php:589 #: includes/class-sp-ajax.php:792 includes/class-sp-ajax.php:796 #: includes/class-sp-frontend-scripts.php:87 #: includes/widgets/class-sp-widget-event-blocks.php:208 #: includes/widgets/class-sp-widget-event-calendar.php:191 #: includes/widgets/class-sp-widget-event-list.php:215 #: modules/sportspress-countdowns.php:130 templates/countdown.php:237 msgid "days" msgstr "" #: includes/admin/class-sp-admin-assets.php:117 #: includes/class-sp-frontend-scripts.php:88 #: modules/sportspress-countdowns.php:131 templates/countdown.php:238 msgid "hrs" msgstr "" #: includes/admin/class-sp-admin-assets.php:118 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:39 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:549 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:570 #: includes/admin/settings/class-sp-settings-events.php:157 #: includes/class-sp-frontend-scripts.php:89 #: modules/sportspress-countdowns.php:132 templates/countdown.php:239 msgid "mins" msgstr "" #: includes/admin/class-sp-admin-assets.php:119 #: includes/class-sp-frontend-scripts.php:90 #: modules/sportspress-countdowns.php:133 templates/countdown.php:240 msgid "secs" msgstr "" #: includes/admin/class-sp-admin-assets.php:120 #: includes/admin/importers/class-sp-importer.php:198 #, php-format msgid "Displaying %1$s–%2$s of %3$s" msgstr "" #: includes/admin/class-sp-admin-dashboard.php:36 msgid "Sports News" msgstr "" #: includes/admin/class-sp-admin-dashboard.php:37 #: includes/admin/class-sp-admin-menus.php:50 #: includes/admin/class-sp-admin-permalink-settings.php:52 #: includes/admin/class-sp-admin-setup-wizard.php:146 #: includes/admin/class-sp-admin-setup-wizard.php:150 #: includes/admin/class-sp-admin-welcome.php:110 #: includes/admin/views/html-admin-settings.php:2 #: modules/sportspress-admin-bar.php:63 modules/sportspress-gutenberg.php:72 #: modules/sportspress-overview.php:107 modules/sportspress-overview.php:286 #: modules/sportspress-overview.php:452 modules/sportspress-overview.php:535 #: modules/sportspress-overview.php:760 modules/sportspress-overview.php:890 #: modules/sportspress-overview.php:928 msgid "SportsPress" msgstr "" #: includes/admin/class-sp-admin-dashboard.php:54 #, php-format msgid "%s " msgid_plural "%s " msgstr[0] "" msgstr[1] "" #: includes/admin/class-sp-admin-dashboard.php:85 #, php-format msgid "%s until next event" msgstr "" #: includes/admin/class-sp-admin-dashboard.php:92 #, php-format msgid "%s event scheduled" msgid_plural "%s events scheduled" msgstr[0] "" msgstr[1] "" #: includes/admin/class-sp-admin-dashboard.php:97 #, php-format msgid "%s event published" msgid_plural "%s events published" msgstr[0] "" msgstr[1] "" #: includes/admin/class-sp-admin-importers.php:38 msgid "SportsPress Events (CSV)" msgstr "" #: includes/admin/class-sp-admin-importers.php:39 msgid "Import events from a csv file." msgstr "" #: includes/admin/class-sp-admin-importers.php:43 msgid "SportsPress Fixtures (CSV)" msgstr "" #: includes/admin/class-sp-admin-importers.php:44 msgid "Import upcoming events from a csv file." msgstr "" #: includes/admin/class-sp-admin-importers.php:48 msgid "SportsPress Teams (CSV)" msgstr "" #: includes/admin/class-sp-admin-importers.php:49 msgid "Import teams from a csv file." msgstr "" #: includes/admin/class-sp-admin-importers.php:53 msgid "SportsPress Players (CSV)" msgstr "" #: includes/admin/class-sp-admin-importers.php:54 msgid "Import players from a csv file." msgstr "" #: includes/admin/class-sp-admin-importers.php:58 msgid "SportsPress Staff (CSV)" msgstr "" #: includes/admin/class-sp-admin-importers.php:59 msgid "Import staff from a csv file." msgstr "" #: includes/admin/class-sp-admin-importers.php:67 msgid "SportsPress Box Score (CSV)" msgstr "" #: includes/admin/class-sp-admin-importers.php:68 #: includes/admin/importers/class-sp-event-performance-importer.php:184 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:287 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php:57 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:197 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:264 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:108 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:90 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:114 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:132 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:149 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:167 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:186 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:73 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:85 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:108 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:125 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:142 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:159 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:173 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:229 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:71 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:90 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:109 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:117 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:112 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:113 #: modules/sportspress-user-registration.php:132 #: modules/sportspress-wordpay.php:172 #, php-format msgid "Select %s" msgstr "" #: includes/admin/class-sp-admin-menus.php:57 #: includes/admin/class-sp-admin-settings.php:558 #: includes/admin/views/html-admin-config.php:7 msgid "Configure" msgstr "" #: includes/admin/class-sp-admin-menus.php:64 #: includes/admin/class-sp-admin-menus.php:260 #: includes/admin/class-sp-admin-permalink-settings.php:33 #: includes/admin/importers/class-sp-player-importer.php:32 #: includes/admin/importers/class-sp-staff-importer.php:31 #: includes/admin/importers/class-sp-team-importer.php:29 #: includes/admin/post-types/class-sp-admin-cpt-player.php:83 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:73 #: includes/admin/post-types/class-sp-admin-cpt-team.php:73 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:159 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:167 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:134 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:142 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:63 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:71 #: includes/admin/settings/class-sp-settings-players.php:118 #: includes/admin/settings/class-sp-settings-status.php:448 #: includes/admin/views/html-admin-page-status.php:406 #: includes/class-sp-post-types.php:39 includes/class-sp-post-types.php:55 #: includes/sp-core-functions.php:1783 modules/sportspress-tutorials.php:85 #: templates/official-details.php:115 templates/player-details.php:115 #: templates/team-details.php:29 msgid "Leagues" msgstr "" #: includes/admin/class-sp-admin-menus.php:71 #: includes/admin/class-sp-admin-menus.php:268 #: includes/admin/class-sp-admin-permalink-settings.php:34 #: includes/admin/importers/class-sp-player-importer.php:33 #: includes/admin/importers/class-sp-staff-importer.php:32 #: includes/admin/importers/class-sp-team-importer.php:30 #: includes/admin/post-types/class-sp-admin-cpt-player.php:84 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:74 #: includes/admin/post-types/class-sp-admin-cpt-team.php:74 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:178 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:186 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:151 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:159 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:82 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:90 #: includes/admin/settings/class-sp-settings-players.php:126 #: includes/admin/settings/class-sp-settings-status.php:461 #: includes/admin/views/html-admin-page-status.php:419 #: includes/class-sp-post-types.php:78 includes/class-sp-post-types.php:94 #: includes/sp-core-functions.php:1803 modules/sportspress-tutorials.php:85 #: templates/official-details.php:126 templates/player-details.php:126 #: templates/team-details.php:38 msgid "Seasons" msgstr "" #: includes/admin/class-sp-admin-menus.php:109 #: includes/admin/class-sp-admin-welcome.php:140 #: modules/sportspress-tutorials.php:124 sportspress.php:147 msgid "Settings" msgstr "" #: includes/admin/class-sp-admin-menus.php:256 #: includes/admin/importers/class-sp-event-importer.php:541 #: includes/admin/importers/class-sp-event-importer.php:558 #: includes/admin/importers/class-sp-fixture-importer.php:326 #: includes/admin/importers/class-sp-fixture-importer.php:343 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:127 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:145 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:68 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php:64 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-specs.php:45 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:142 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:97 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:178 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-metrics.php:45 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:79 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:97 #: includes/admin/views/html-admin-config.php:66 #: includes/admin/views/html-admin-config.php:154 #: includes/admin/views/html-admin-config.php:283 #: includes/admin/views/html-admin-config.php:347 #: includes/admin/views/html-admin-config.php:408 #: includes/admin/views/html-admin-config.php:514 #: includes/class-sp-post-types.php:45 includes/class-sp-post-types.php:84 #: includes/class-sp-post-types.php:123 includes/class-sp-post-types.php:162 #: includes/class-sp-post-types.php:201 includes/sp-core-functions.php:1400 #: includes/sp-core-functions.php:1418 #: includes/widgets/class-sp-widget-countdown.php:134 #: includes/widgets/class-sp-widget-countdown.php:166 #: includes/widgets/class-sp-widget-countdown.php:186 #: includes/widgets/class-sp-widget-event-blocks.php:152 #: includes/widgets/class-sp-widget-event-calendar.php:135 #: includes/widgets/class-sp-widget-event-list.php:159 #: includes/widgets/class-sp-widget-league-table.php:120 #: includes/widgets/class-sp-widget-player-gallery.php:127 #: includes/widgets/class-sp-widget-player-gallery.php:158 #: includes/widgets/class-sp-widget-player-list.php:127 #: includes/widgets/class-sp-widget-player-list.php:193 #: includes/widgets/class-sp-widget-staff.php:78 #: includes/widgets/class-sp-widget-team-gallery.php:122 #: modules/sportspress-event-specs.php:190 modules/sportspress-officials.php:94 msgid "Add New" msgstr "" #: includes/admin/class-sp-admin-menus.php:264 #: includes/admin/class-sp-admin-permalink-settings.php:37 #: includes/admin/importers/class-sp-player-importer.php:30 #: includes/admin/post-types/class-sp-admin-cpt-player.php:81 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:106 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:114 #: includes/admin/settings/class-sp-settings-events.php:443 #: includes/admin/settings/class-sp-settings-status.php:487 #: includes/admin/views/html-admin-page-status.php:445 #: includes/class-sp-post-types.php:156 includes/class-sp-post-types.php:172 #: modules/sportspress-tutorials.php:87 msgid "Positions" msgstr "" #: includes/admin/class-sp-admin-menus.php:272 #: includes/admin/class-sp-admin-permalink-settings.php:30 #: includes/admin/settings/class-sp-settings-events.php:183 #: includes/admin/settings/class-sp-settings-status.php:474 #: includes/admin/views/html-admin-page-status.php:432 #: includes/class-sp-post-types.php:117 includes/class-sp-post-types.php:133 #: modules/sportspress-tutorials.php:86 msgid "Venues" msgstr "" #: includes/admin/class-sp-admin-permalink-settings.php:29 #: includes/admin/class-sp-admin-sample-data.php:441 #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:57 #: includes/admin/settings/class-sp-settings-events.php:27 #: includes/admin/settings/class-sp-settings-modules.php:38 #: includes/api/class-sp-rest-api.php:358 includes/class-sp-post-types.php:445 #: includes/sp-core-functions.php:1777 modules/sportspress-calendars.php:169 #: modules/sportspress-calendars.php:221 modules/sportspress-calendars.php:429 #: modules/sportspress-calendars.php:453 modules/sportspress-calendars.php:472 #: modules/sportspress-calendars.php:496 modules/sportspress-tutorials.php:111 #: modules/sportspress-tutorials.php:131 msgid "Events" msgstr "" #: includes/admin/class-sp-admin-permalink-settings.php:31 #: includes/admin/class-sp-admin-sample-data.php:571 #: includes/class-sp-modules.php:30 modules/sportspress-calendars.php:78 #: modules/sportspress-template-selector.php:183 #: modules/sportspress-tutorials.php:116 modules/sportspress-tutorials.php:138 msgid "Calendars" msgstr "" #: includes/admin/class-sp-admin-permalink-settings.php:35 #: includes/admin/class-sp-admin-sample-data.php:621 #: includes/api/class-sp-rest-api.php:325 includes/class-sp-modules.php:93 #: modules/sportspress-league-tables.php:75 #: modules/sportspress-league-tables.php:177 #: modules/sportspress-league-tables.php:243 #: modules/sportspress-league-tables.php:340 #: modules/sportspress-tutorials.php:94 msgid "League Tables" msgstr "" #: includes/admin/class-sp-admin-permalink-settings.php:36 #: includes/admin/class-sp-admin-sample-data.php:233 #: includes/admin/class-sp-admin-setup-wizard.php:75 #: includes/admin/class-sp-admin-setup-wizard.php:445 #: includes/admin/importers/class-sp-event-importer.php:34 #: includes/admin/post-types/class-sp-admin-cpt-list.php:56 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:91 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:159 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:60 #: includes/admin/settings/class-sp-settings-events.php:304 #: includes/admin/settings/class-sp-settings-events.php:392 #: includes/admin/settings/class-sp-settings-modules.php:40 #: includes/admin/settings/class-sp-settings-players.php:27 #: includes/api/class-sp-rest-api.php:206 includes/class-sp-post-types.php:523 #: includes/class-sp-templates.php:189 includes/sp-core-functions.php:745 #: includes/sp-core-functions.php:1793 modules/sportspress-player-lists.php:270 #: modules/sportspress-player-lists.php:348 #: modules/sportspress-tutorials.php:97 modules/sportspress-tutorials.php:152 #: modules/sportspress-wordpay.php:208 msgid "Players" msgstr "" #: includes/admin/class-sp-admin-permalink-settings.php:38 #: includes/admin/class-sp-admin-sample-data.php:663 #: includes/admin/class-sp-admin-sample-data.php:708 #: includes/api/class-sp-rest-api.php:342 includes/class-sp-modules.php:121 #: modules/sportspress-player-lists.php:75 #: modules/sportspress-player-lists.php:186 #: modules/sportspress-player-lists.php:253 #: modules/sportspress-player-lists.php:347 msgid "Player Lists" msgstr "" #: includes/admin/class-sp-admin-permalink-settings.php:39 #: includes/admin/class-sp-admin-sample-data.php:345 #: includes/admin/class-sp-admin-setup-wizard.php:75 #: includes/admin/class-sp-admin-setup-wizard.php:460 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:173 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:96 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:57 #: includes/admin/settings/class-sp-settings-events.php:384 #: includes/admin/settings/class-sp-settings-modules.php:40 #: includes/admin/settings/class-sp-settings-staff.php:27 #: includes/admin/settings/class-sp-settings-teams.php:61 #: includes/api/class-sp-rest-api.php:257 #: includes/api/class-sp-rest-api.php:308 includes/class-sp-install.php:185 #: includes/class-sp-post-types.php:562 includes/class-sp-post-types.php:563 #: includes/class-sp-templates.php:153 includes/class-sp-templates.php:262 #: includes/sp-core-functions.php:1804 #: includes/widgets/class-sp-widget-staff.php:9 #: includes/widgets/class-sp-widget-staff.php:67 #: modules/sportspress-tutorials.php:97 templates/event-staff.php:50 msgid "Staff" msgstr "" #: includes/admin/class-sp-admin-permalink-settings.php:81 msgid "" "These settings control the permalinks used for SportsPress. These settings " "only apply when not using \"default\" permalinks above." msgstr "" #: includes/admin/class-sp-admin-post-types.php:77 #: includes/sp-template-hooks.php:279 msgid "Settings saved." msgstr "" #: includes/admin/class-sp-admin-post-types.php:79 #: includes/admin/views/html-admin-config.php:65 #: includes/admin/views/html-admin-config.php:153 #: includes/admin/views/html-admin-config.php:282 #: includes/admin/views/html-admin-config.php:346 #: includes/admin/views/html-admin-config.php:407 #: includes/admin/views/html-admin-config.php:513 #: includes/sp-template-hooks.php:281 modules/sportspress-event-specs.php:189 #: modules/sportspress-overview.php:755 msgid "View All" msgstr "" #: includes/admin/class-sp-admin-post-types.php:84 #: includes/admin/class-sp-admin-post-types.php:87 #: includes/admin/class-sp-admin-post-types.php:92 #: includes/sp-template-hooks.php:287 includes/sp-template-hooks.php:290 #: includes/sp-template-hooks.php:295 msgid "Changes saved." msgstr "" #: includes/admin/class-sp-admin-post-types.php:89 #: includes/admin/class-sp-admin-post-types.php:94 #: includes/admin/class-sp-admin-post-types.php:106 #: includes/sp-template-hooks.php:292 includes/sp-template-hooks.php:297 #: includes/sp-template-hooks.php:309 msgid "Success!" msgstr "" #: includes/admin/class-sp-admin-post-types.php:96 #: includes/admin/class-sp-admin-post-types.php:104 #: includes/admin/class-sp-admin-post-types.php:108 #: includes/sp-template-hooks.php:299 includes/sp-template-hooks.php:307 #: includes/sp-template-hooks.php:311 #, php-format msgid "Preview %s" msgstr "" #: includes/admin/class-sp-admin-post-types.php:99 #: includes/sp-template-hooks.php:302 #, php-format msgid "Scheduled for: %1$s." msgstr "" #: includes/admin/class-sp-admin-post-types.php:100 #: includes/sp-template-hooks.php:303 msgid "M j, Y @ G:i" msgstr "" #: includes/admin/class-sp-admin-sample-data.php:44 #: includes/admin/class-sp-admin-setup-wizard.php:289 #: includes/admin/class-sp-admin-setup-wizard.php:341 msgctxt "example" msgid "Primary League" msgstr "" #: includes/admin/class-sp-admin-sample-data.php:44 msgctxt "example" msgid "Secondary League" msgstr "" #: includes/admin/class-sp-admin-sample-data.php:117 #: includes/admin/class-sp-admin-setup-wizard.php:693 #, php-format msgctxt "example" msgid "" "This is an example %1$s. As a new SportsPress user, you should go to your dashboard to delete this %1$s and create new %2$s for " "your content. Have fun!" msgstr "" #: includes/admin/class-sp-admin-sample-data.php:568 msgctxt "example" msgid "Fixtures & Results" msgstr "" #: includes/admin/class-sp-admin-sample-data.php:660 msgctxt "example" msgid "Roster" msgstr "" #: includes/admin/class-sp-admin-sample-data.php:663 #: includes/admin/class-sp-admin-sample-data.php:708 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:57 #: includes/class-sp-ajax.php:1079 includes/class-sp-ajax.php:1221 #: includes/class-sp-templates.php:248 #: includes/widgets/class-sp-widget-player-gallery.php:116 #: includes/widgets/class-sp-widget-player-list.php:9 #: includes/widgets/class-sp-widget-player-list.php:116 #: modules/sportspress-player-lists.php:76 #: modules/sportspress-player-lists.php:168 #: modules/sportspress-player-lists.php:221 msgid "Player List" msgstr "" #: includes/admin/class-sp-admin-sample-data.php:705 msgctxt "example" msgid "Player Ranking" msgstr "" #: includes/admin/class-sp-admin-settings.php:69 msgid "Action failed. Please refresh the page and retry." msgstr "" #: includes/admin/class-sp-admin-settings.php:77 #: includes/admin/class-sp-admin-welcome.php:191 msgid "Your settings have been saved." msgstr "" #: includes/admin/class-sp-admin-settings.php:562 msgid "Install demo content" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:60 msgid "Introduction" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:65 #: includes/admin/class-sp-admin-setup-wizard.php:221 msgid "Basic Setup" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:85 #: includes/admin/class-sp-admin-setup-wizard.php:647 msgid "Pages" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:90 msgid "Ready!" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:160 msgid "Return to the WordPress Dashboard" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:205 #: includes/admin/class-sp-admin-welcome.php:52 #: includes/admin/settings/class-sp-settings-modules.php:195 #: includes/admin/views/html-notice-install.php:7 msgid "Welcome to SportsPress" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:206 msgid "" "Thank you for choosing SportsPress to power your sports website! This quick " "setup wizard will help you configure the basic settings. It’s " "completely optional and shouldn’t take longer than five minutes." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:207 msgid "" "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!" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:209 msgid "Let's Go!" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:210 msgid "Not right now" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:223 msgid "Select your timezone and sport to get started." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:226 #: includes/admin/settings/class-sp-settings-general.php:357 #: includes/admin/settings/class-sp-settings-general.php:360 msgid "Timezone" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:226 #: includes/admin/settings/class-sp-settings-general.php:357 msgid "Choose a city in the same timezone as you." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:256 msgctxt "Page title" msgid "Sport" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:287 #: includes/admin/settings/class-sp-settings-general.php:98 #: includes/sp-core-functions.php:1720 msgid "Main League" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:287 msgid "The name of a league or division." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:293 #: includes/admin/settings/class-sp-settings-general.php:106 #: includes/sp-core-functions.php:1726 msgid "Current Season" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:301 #: includes/admin/class-sp-admin-setup-wizard.php:388 #: includes/admin/class-sp-admin-setup-wizard.php:470 #: includes/admin/class-sp-admin-setup-wizard.php:582 #: includes/admin/class-sp-admin-setup-wizard.php:668 msgid "Continue" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:302 #: includes/admin/class-sp-admin-setup-wizard.php:389 #: includes/admin/class-sp-admin-setup-wizard.php:471 #: includes/admin/class-sp-admin-setup-wizard.php:583 #: includes/admin/class-sp-admin-setup-wizard.php:669 msgid "Skip this step" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:368 msgid "Team Setup" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:370 msgid "Great! Now let's add some teams." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:373 msgid "Home Team" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:375 msgid "What is your team called?" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:379 msgid "Rival Team" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:381 msgid "Who are you playing against next?" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:382 msgid "You can add more teams later." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:440 msgid "Player & Staff Setup" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:442 msgid "Let's add players and a staff member." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:445 msgid "Enter a squad number, name, and position for each player." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:449 #: includes/admin/class-sp-admin-setup-wizard.php:463 #: includes/admin/class-sp-admin-setup-wizard.php:564 #: includes/admin/importers/class-sp-official-importer.php:28 #: includes/admin/importers/class-sp-player-importer.php:29 #: includes/admin/importers/class-sp-staff-importer.php:28 #: includes/admin/importers/class-sp-team-importer.php:28 #: includes/admin/post-types/class-sp-admin-cpt-official.php:48 #: includes/admin/post-types/class-sp-admin-cpt-player.php:65 #: includes/admin/post-types/class-sp-admin-cpt-player.php:88 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:56 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:78 #: includes/admin/post-types/class-sp-admin-cpt-team.php:55 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:136 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:112 #: includes/admin/settings/class-sp-settings-events.php:272 #: includes/admin/settings/class-sp-settings-players.php:78 #: includes/class-sp-ajax.php:1168 includes/class-sp-ajax.php:1252 #: includes/class-sp-post-types.php:46 includes/class-sp-post-types.php:85 #: includes/class-sp-post-types.php:124 includes/class-sp-post-types.php:163 #: includes/class-sp-post-types.php:202 #: includes/widgets/class-sp-widget-player-gallery.php:144 #: includes/widgets/class-sp-widget-player-list.php:182 #: modules/sportspress-officials.php:95 #: modules/sportspress-player-lists.php:300 templates/official-details.php:50 #: templates/player-details.php:50 msgid "Name" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:449 #: includes/admin/class-sp-admin-setup-wizard.php:522 #: includes/admin/class-sp-admin-sports.php:114 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:359 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:51 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:65 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:127 #: includes/admin/settings/class-sp-settings-events.php:463 #: includes/admin/settings/class-sp-settings-players.php:94 #: includes/class-sp-ajax.php:1155 includes/class-sp-event.php:182 #: includes/class-sp-player-list.php:963 includes/class-sp-post-types.php:157 #: includes/sp-core-functions.php:1795 templates/event-performance.php:54 #: templates/event-performance.php:164 templates/official-details.php:72 #: templates/player-details.php:72 msgid "Position" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:456 msgid "You can add more players later." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:463 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:71 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:60 #: includes/class-sp-post-types.php:196 msgid "Job" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:559 msgid "Venue Setup" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:561 msgid "Enter the details of your home venue." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:570 #: includes/admin/class-sp-admin-taxonomies.php:121 #: includes/admin/class-sp-admin-taxonomies.php:156 #: includes/admin/class-sp-admin-taxonomies.php:312 msgid "Address" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:574 #: includes/admin/class-sp-admin-taxonomies.php:118 #: includes/admin/class-sp-admin-taxonomies.php:152 msgid "Drag the marker to the venue's location." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:641 #: includes/admin/class-sp-admin-setup-wizard.php:685 #: includes/class-sp-modules.php:32 msgid "Organize and publish calendars using different layouts." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:642 #: includes/admin/class-sp-admin-setup-wizard.php:686 #: includes/class-sp-modules.php:95 msgid "Create automated league tables to keep track of team standings." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:643 #: includes/admin/class-sp-admin-setup-wizard.php:687 #: includes/class-sp-modules.php:123 msgid "Create team rosters, player galleries, and ranking charts." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:649 msgid "" "The following will be created automatically (if they do not already exist):" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:665 msgid "Once created, these pages can be managed from your admin dashboard." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:859 msgid "Next Steps" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:860 msgid "Schedule your first event!" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:863 #: includes/admin/class-sp-admin-welcome.php:253 #: includes/admin/settings/class-sp-settings-modules.php:185 #: includes/admin/settings/class-sp-settings-modules.php:229 msgid "Upgrade to Pro" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:864 #: includes/admin/class-sp-admin-welcome.php:255 #: includes/admin/settings/class-sp-settings-modules.php:72 msgid "" "Get SportsPress Pro to get access to all modules. You can upgrade any time " "without losing any of your data." msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:864 #: includes/admin/settings/class-sp-settings-modules.php:237 msgid "Learn more" msgstr "" #: includes/admin/class-sp-admin-setup-wizard.php:872 #: includes/admin/class-sp-admin-welcome.php:121 msgid "Thanks for installing!" msgstr "" #: includes/admin/class-sp-admin-sports.php:324 msgid "Team Sports" msgstr "" #: includes/admin/class-sp-admin-sports.php:325 msgid "Racket Sports" msgstr "" #: includes/admin/class-sp-admin-sports.php:326 msgid "Water Sports" msgstr "" #: includes/admin/class-sp-admin-sports.php:327 msgid "Target Sports" msgstr "" #: includes/admin/class-sp-admin-sports.php:328 msgid "Esports" msgstr "" #: includes/admin/class-sp-admin-sports.php:329 #: includes/admin/settings/class-sp-settings-modules.php:42 #: modules/sportspress-tutorials.php:159 msgid "Other" msgstr "" #: includes/admin/class-sp-admin-sports.php:340 msgid "Baseball" msgstr "" #: includes/admin/class-sp-admin-sports.php:341 msgid "Basketball" msgstr "" #: includes/admin/class-sp-admin-sports.php:342 msgid "Cricket" msgstr "" #: includes/admin/class-sp-admin-sports.php:343 msgid "Darts" msgstr "" #: includes/admin/class-sp-admin-sports.php:344 msgid "Floorball" msgstr "" #: includes/admin/class-sp-admin-sports.php:345 msgid "Association Football" msgstr "" #: includes/admin/class-sp-admin-sports.php:346 msgid "American Football" msgstr "" #: includes/admin/class-sp-admin-sports.php:347 msgid "Australian Rules Football" msgstr "" #: includes/admin/class-sp-admin-sports.php:348 msgid "Handball" msgstr "" #: includes/admin/class-sp-admin-sports.php:349 msgid "Ice Hockey" msgstr "" #: includes/admin/class-sp-admin-sports.php:350 msgid "Lacrosse" msgstr "" #: includes/admin/class-sp-admin-sports.php:351 msgid "Netball" msgstr "" #: includes/admin/class-sp-admin-sports.php:352 msgid "Rugby League" msgstr "" #: includes/admin/class-sp-admin-sports.php:353 msgid "Rugby Union" msgstr "" #: includes/admin/class-sp-admin-sports.php:354 msgid "Snooker" msgstr "" #: includes/admin/class-sp-admin-sports.php:355 msgid "Softball" msgstr "" #: includes/admin/class-sp-admin-sports.php:356 msgid "Squash" msgstr "" #: includes/admin/class-sp-admin-sports.php:357 msgid "Table Tennis" msgstr "" #: includes/admin/class-sp-admin-sports.php:358 msgid "Tennis" msgstr "" #: includes/admin/class-sp-admin-sports.php:359 msgid "Volleyball" msgstr "" #: includes/admin/class-sp-admin-sports.php:360 msgid "Water Polo" msgstr "" #: includes/admin/class-sp-admin-sports.php:361 msgid "Dota 2" msgstr "" #: includes/admin/class-sp-admin-sports.php:362 msgid "League of Legends" msgstr "" #: includes/admin/class-sp-admin-sports.php:363 msgid "Counter-Strike: Global Offensive" msgstr "" #: includes/admin/class-sp-admin-taxonomies.php:79 #: includes/admin/class-sp-admin-taxonomies.php:249 #: includes/admin/class-sp-admin-taxonomies.php:291 #: includes/admin/class-sp-admin-taxonomies.php:337 #: includes/admin/settings/class-sp-settings-events.php:252 #: includes/admin/settings/class-sp-settings-events.php:314 #: modules/sportspress-officials.php:483 modules/sportspress-officials.php:507 msgid "Order" msgstr "" #: includes/admin/class-sp-admin-taxonomies.php:125 #: includes/admin/class-sp-admin-taxonomies.php:162 msgid "Latitude" msgstr "" #: includes/admin/class-sp-admin-taxonomies.php:129 #: includes/admin/class-sp-admin-taxonomies.php:168 msgid "Longitude" msgstr "" #: includes/admin/class-sp-admin-taxonomies.php:196 #: includes/admin/class-sp-admin-taxonomies.php:235 #: includes/admin/class-sp-admin-taxonomies.php:375 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:255 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:258 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:73 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:86 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:80 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:58 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:61 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:66 #: includes/admin/settings/class-sp-settings-events.php:487 #: includes/admin/settings/class-sp-settings-events.php:488 #: includes/admin/settings/class-sp-settings-players.php:185 #: includes/admin/settings/class-sp-settings-players.php:186 #: includes/api/class-sp-rest-api.php:223 includes/sp-core-functions.php:619 #: includes/sp-core-functions.php:681 includes/sp-core-functions.php:1787 #: modules/sportspress-officials.php:551 templates/event-performance.php:152 #: templates/event-performance.php:155 templates/player-statistics.php:52 #: templates/player-statistics.php:55 msgid "Offense" msgstr "" #: includes/admin/class-sp-admin-taxonomies.php:198 #: includes/admin/class-sp-admin-taxonomies.php:236 #: includes/admin/class-sp-admin-taxonomies.php:377 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:254 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:258 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:77 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:82 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:82 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:57 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:61 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:68 #: includes/admin/settings/class-sp-settings-events.php:487 #: includes/admin/settings/class-sp-settings-events.php:488 #: includes/admin/settings/class-sp-settings-players.php:185 #: includes/admin/settings/class-sp-settings-players.php:186 #: includes/api/class-sp-rest-api.php:240 includes/sp-core-functions.php:621 #: includes/sp-core-functions.php:683 includes/sp-core-functions.php:1774 #: modules/sportspress-officials.php:553 templates/event-performance.php:151 #: templates/event-performance.php:155 templates/player-statistics.php:51 #: templates/player-statistics.php:55 msgid "Defense" msgstr "" #: includes/admin/class-sp-admin-welcome.php:51 msgid "About SportsPress" msgstr "" #: includes/admin/class-sp-admin-welcome.php:112 #, php-format msgid "Version %s" msgstr "" #: includes/admin/class-sp-admin-welcome.php:117 msgid "Thanks, all done!" msgstr "" #: includes/admin/class-sp-admin-welcome.php:119 msgid "Thank you for updating to the latest version!" msgstr "" #: includes/admin/class-sp-admin-welcome.php:124 #, php-format msgid "" "%1$s SportsPress %2$s has lots of refinements we think you’ll love." msgstr "" #: includes/admin/class-sp-admin-welcome.php:141 sportspress.php:148 msgid "Docs" msgstr "" #: includes/admin/class-sp-admin-welcome.php:153 msgid "Welcome" msgstr "" #: includes/admin/class-sp-admin-welcome.php:160 msgid "Credits" msgstr "" #: includes/admin/class-sp-admin-welcome.php:319 msgid "Go to SportsPress Settings" msgstr "" #: includes/admin/class-sp-admin-welcome.php:332 #, php-format msgid "" "SportsPress is developed and maintained by a worldwide team of passionate " "individuals and backed by an awesome developer community. Want to see your " "name? Contribute to SportsPress." msgstr "" #: includes/admin/class-sp-admin-welcome.php:350 #, php-format msgid "" "SportsPress has been kindly translated into several other languages thanks " "to our translation team. Want to see your name? Translate " "SportsPress." msgstr "" #: includes/admin/class-sp-admin-welcome.php:375 #, php-format msgid "View %s" msgstr "" #: includes/admin/class-sp-admin.php:112 #: includes/admin/importers/class-sp-fixture-importer.php:26 msgid "Import Fixtures" msgstr "" #: includes/admin/class-sp-admin.php:114 #: includes/admin/importers/class-sp-event-importer.php:26 msgid "Import Events" msgstr "" #: includes/admin/class-sp-admin.php:126 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:178 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:281 msgid "Import" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:28 #: includes/admin/importers/class-sp-fixture-importer.php:28 #: includes/admin/post-types/class-sp-admin-cpt-event.php:139 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:55 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:66 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:152 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:48 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:46 #: includes/admin/settings/class-sp-settings-events.php:75 #: includes/class-sp-ajax.php:824 includes/sp-core-functions.php:1773 #: includes/widgets/class-sp-widget-countdown.php:142 #: templates/event-details.php:27 templates/event-list.php:150 #: templates/event-list.php:315 msgid "Date" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:29 #: includes/admin/importers/class-sp-fixture-importer.php:29 #: includes/admin/post-types/class-sp-admin-cpt-event.php:140 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:43 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:81 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:101 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:88 #: includes/admin/settings/class-sp-settings-events.php:83 #: includes/admin/settings/class-sp-settings-events.php:280 #: includes/class-sp-ajax.php:628 includes/sp-core-functions.php:641 #: includes/sp-core-functions.php:1809 #: includes/widgets/class-sp-widget-event-list.php:253 #: templates/event-details.php:32 templates/event-list.php:170 #: templates/event-list.php:185 templates/event-list.php:193 #: templates/event-list.php:365 templates/event-list.php:392 #: templates/event-list.php:420 msgid "Time" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:33 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php:296 #: includes/admin/settings/class-sp-settings-events.php:356 #: includes/api/class-sp-rest-api.php:105 includes/class-sp-event.php:69 #: includes/class-sp-event.php:90 includes/class-sp-post-types.php:280 #: includes/sp-core-functions.php:1788 msgid "Outcome" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:473 #: includes/admin/importers/class-sp-fixture-importer.php:263 #, php-format msgid "" "Import complete - imported %1$s events and skipped " "%2$s." msgstr "" #: includes/admin/importers/class-sp-event-importer.php:483 #: includes/admin/importers/class-sp-event-performance-importer.php:148 #: includes/admin/importers/class-sp-fixture-importer.php:273 #: includes/admin/importers/class-sp-official-importer.php:96 #: includes/admin/importers/class-sp-player-importer.php:229 #: includes/admin/importers/class-sp-staff-importer.php:177 #: includes/admin/importers/class-sp-team-importer.php:133 msgid "All done!" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:483 msgid "View Events" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:496 #: includes/admin/importers/class-sp-event-performance-importer.php:180 #: includes/admin/importers/class-sp-fixture-importer.php:286 #: includes/admin/importers/class-sp-official-importer.php:119 #: includes/admin/importers/class-sp-player-importer.php:252 #: includes/admin/importers/class-sp-staff-importer.php:200 #: includes/admin/importers/class-sp-team-importer.php:146 msgid "" "Hi there! Choose a .csv file to upload, then click \"Upload file and import" "\"." msgstr "" #: includes/admin/importers/class-sp-event-importer.php:497 #, php-format msgid "" "Events need to be defined with columns in a specific order (3+ columns). Click here to download a sample." msgstr "" #: includes/admin/importers/class-sp-event-importer.php:498 #: includes/admin/importers/class-sp-fixture-importer.php:288 #, php-format msgid "Supports CSV files generated by LeagueLobster." msgstr "" #: includes/admin/importers/class-sp-event-importer.php:514 #: includes/admin/importers/class-sp-fixture-importer.php:304 #: includes/admin/post-types/class-sp-admin-cpt-event.php:137 #: includes/admin/post-types/class-sp-admin-cpt-performance.php:50 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:122 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:93 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:79 #: includes/admin/views/html-admin-config.php:197 #: includes/api/class-sp-rest-api.php:138 msgid "Format" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:530 #: includes/admin/importers/class-sp-fixture-importer.php:315 #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:53 #: includes/admin/post-types/class-sp-admin-cpt-event.php:142 #: includes/admin/post-types/class-sp-admin-cpt-list.php:53 #: includes/admin/post-types/class-sp-admin-cpt-table.php:53 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:52 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:99 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:63 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:63 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:63 #: includes/class-sp-ajax.php:629 includes/class-sp-post-types.php:40 #: includes/sp-core-functions.php:1782 templates/event-list.php:209 #: templates/event-list.php:468 msgid "League" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:537 #: includes/admin/importers/class-sp-event-importer.php:554 #: includes/admin/importers/class-sp-fixture-importer.php:322 #: includes/admin/importers/class-sp-fixture-importer.php:339 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:61 msgid "— Not set —" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:547 #: includes/admin/importers/class-sp-fixture-importer.php:332 #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:54 #: includes/admin/post-types/class-sp-admin-cpt-event.php:143 #: includes/admin/post-types/class-sp-admin-cpt-list.php:54 #: includes/admin/post-types/class-sp-admin-cpt-table.php:54 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:53 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:106 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:116 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-columns.php:64 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:66 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:66 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:66 #: includes/class-sp-ajax.php:630 includes/class-sp-player.php:855 #: includes/class-sp-post-types.php:79 includes/sp-core-functions.php:1802 #: templates/event-list.php:213 templates/event-list.php:477 msgid "Season" msgstr "" #: includes/admin/importers/class-sp-event-importer.php:565 #: includes/admin/importers/class-sp-fixture-importer.php:350 msgid "Date Format" msgstr "" #: includes/admin/importers/class-sp-event-performance-importer.php:26 msgid "Import Box Score" msgstr "" #: includes/admin/importers/class-sp-event-performance-importer.php:138 #, php-format msgid "" "Import complete - imported %1$s rows and skipped " "%2$s." msgstr "" #: includes/admin/importers/class-sp-event-performance-importer.php:156 #: includes/class-sp-post-types.php:450 msgid "View Event" msgstr "" #: includes/admin/importers/class-sp-event-performance-importer.php:181 #, php-format msgid "" "Box scores need to be defined with columns in a specific order. Click here to download a sample." msgstr "" #: includes/admin/importers/class-sp-fixture-importer.php:31 #: includes/admin/importers/class-sp-team-importer.php:33 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:35 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:62 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:82 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:101 #: includes/sp-core-functions.php:1781 modules/sportspress-calendars.php:285 #: templates/event-list.php:155 templates/event-list.php:326 #: templates/team-details.php:44 templates/team-details.php:50 msgid "Home" msgstr "" #: includes/admin/importers/class-sp-fixture-importer.php:32 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:35 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:66 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:83 #: includes/sp-core-functions.php:1768 modules/sportspress-calendars.php:285 #: templates/event-list.php:166 templates/event-list.php:361 msgid "Away" msgstr "" #: includes/admin/importers/class-sp-fixture-importer.php:33 #: includes/admin/post-types/class-sp-admin-cpt-event.php:145 #: includes/admin/post-types/class-sp-admin-cpt-event.php:315 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:56 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:127 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:103 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:153 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:30 #: includes/admin/settings/class-sp-settings-events.php:91 #: includes/api/class-sp-rest-api.php:172 includes/class-sp-ajax.php:825 #: includes/sp-core-functions.php:1785 #: includes/widgets/class-sp-widget-countdown.php:143 #: includes/widgets/class-sp-widget-event-list.php:263 #: templates/event-blocks.php:201 templates/event-details.php:55 #: templates/event-list.php:227 templates/event-list.php:532 msgid "Match Day" msgstr "" #: includes/admin/importers/class-sp-fixture-importer.php:273 msgid "View Fixtures" msgstr "" #: includes/admin/importers/class-sp-fixture-importer.php:287 #, php-format msgid "" "Fixtures need to be defined with columns in a specific order (4+ columns). " "Click here to download a sample." msgstr "" #: includes/admin/importers/class-sp-fixture-importer.php:308 #: includes/class-sp-formats.php:29 msgid "Competitive" msgstr "" #: includes/admin/importers/class-sp-fixture-importer.php:309 #: includes/class-sp-formats.php:30 msgid "Friendly" msgstr "" #: includes/admin/importers/class-sp-importer.php:108 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:52 msgid "Disable" msgstr "" #: includes/admin/importers/class-sp-importer.php:153 #: includes/admin/importers/class-sp-importer.php:178 #: includes/admin/importers/class-sp-importer.php:192 msgid "Insert row after" msgstr "" #: includes/admin/importers/class-sp-importer.php:170 #: includes/admin/post-types/class-sp-admin-cpt-event.php:269 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:32 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:75 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:111 #: includes/admin/settings/class-sp-settings-events.php:214 #: includes/admin/settings/class-sp-settings-general.php:142 #: includes/admin/settings/class-sp-settings-status.php:134 #: includes/admin/views/html-admin-config.php:118 #: includes/admin/views/html-admin-config.php:218 #: includes/admin/views/html-admin-page-status.php:93 #: includes/class-sp-ajax.php:337 includes/class-sp-ajax.php:351 #: includes/class-sp-ajax.php:365 includes/class-sp-ajax.php:379 #: includes/class-sp-ajax.php:393 includes/class-sp-ajax.php:490 #: includes/class-sp-ajax.php:504 includes/class-sp-ajax.php:518 #: includes/class-sp-ajax.php:532 includes/class-sp-ajax.php:546 #: includes/class-sp-ajax.php:616 includes/class-sp-ajax.php:697 #: includes/class-sp-ajax.php:711 includes/class-sp-ajax.php:725 #: includes/class-sp-ajax.php:739 includes/class-sp-ajax.php:753 #: includes/class-sp-ajax.php:823 includes/class-sp-ajax.php:833 #: includes/class-sp-ajax.php:1096 includes/class-sp-ajax.php:1110 #: includes/class-sp-ajax.php:1124 includes/class-sp-ajax.php:1166 #: includes/class-sp-ajax.php:1184 includes/class-sp-ajax.php:1250 #: includes/class-sp-ajax.php:1268 includes/sp-core-functions.php:545 #: includes/widgets/class-sp-widget-countdown.php:141 #: includes/widgets/class-sp-widget-event-blocks.php:160 #: includes/widgets/class-sp-widget-event-blocks.php:174 #: includes/widgets/class-sp-widget-event-blocks.php:228 #: includes/widgets/class-sp-widget-event-calendar.php:143 #: includes/widgets/class-sp-widget-event-calendar.php:157 #: includes/widgets/class-sp-widget-event-list.php:167 #: includes/widgets/class-sp-widget-event-list.php:181 #: includes/widgets/class-sp-widget-event-list.php:235 #: includes/widgets/class-sp-widget-player-gallery.php:142 #: includes/widgets/class-sp-widget-player-list.php:180 msgid "Default" msgstr "" #: includes/admin/importers/class-sp-importer.php:177 msgid "Delete row" msgstr "" #: includes/admin/importers/class-sp-importer.php:207 #: includes/admin/importers/class-sp-importer.php:243 #: includes/admin/importers/class-sp-importer.php:258 #: includes/admin/settings/class-sp-settings-licenses.php:162 #: includes/admin/settings/class-sp-settings-licenses.php:217 #: includes/admin/settings/class-sp-settings-licenses.php:229 msgid "Sorry, there has been an error." msgstr "" #: includes/admin/importers/class-sp-importer.php:208 msgid "The CSV is invalid." msgstr "" #: includes/admin/importers/class-sp-official-importer.php:26 #: includes/admin/importers/class-sp-official-importer.php:108 msgid "Import Officials" msgstr "" #: includes/admin/importers/class-sp-official-importer.php:86 #, php-format msgid "" "Import complete - imported %1$s officials and skipped " "%2$s." msgstr "" #: includes/admin/importers/class-sp-official-importer.php:96 msgid "View Officials" msgstr "" #: includes/admin/importers/class-sp-official-importer.php:120 #, php-format msgid "" "Officials need to be defined with columns in a specific order. Click here to download a sample." msgstr "" #: includes/admin/importers/class-sp-player-importer.php:26 #: includes/admin/importers/class-sp-player-importer.php:241 msgid "Import Players" msgstr "" #: includes/admin/importers/class-sp-player-importer.php:28 #: includes/admin/post-types/class-sp-admin-cpt-player.php:79 #: includes/admin/post-types/class-sp-admin-cpt-player.php:247 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:34 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:135 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:86 #: includes/admin/settings/class-sp-settings-events.php:455 #: includes/admin/settings/class-sp-settings-players.php:70 #: includes/api/class-sp-rest-api.php:409 includes/class-sp-ajax.php:1167 #: includes/class-sp-ajax.php:1251 #: includes/widgets/class-sp-widget-player-gallery.php:143 #: includes/widgets/class-sp-widget-player-list.php:159 #: includes/widgets/class-sp-widget-player-list.php:161 #: includes/widgets/class-sp-widget-player-list.php:181 msgid "Squad Number" msgstr "" #: includes/admin/importers/class-sp-player-importer.php:34 #: includes/admin/importers/class-sp-staff-importer.php:33 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:106 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:108 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:89 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:90 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:84 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:85 #: includes/admin/settings/class-sp-settings-players.php:86 #: includes/admin/settings/class-sp-settings-players.php:134 #: includes/admin/settings/class-sp-settings-staff.php:72 #: includes/admin/settings/class-sp-settings-staff.php:96 #: includes/sp-core-functions.php:1786 templates/official-details.php:61 #: templates/player-details.php:61 templates/staff-details.php:51 msgid "Nationality" msgstr "" #: includes/admin/importers/class-sp-player-importer.php:35 #: includes/class-sp-player-list.php:905 includes/class-sp-player-list.php:966 #: modules/sportspress-birthdays.php:216 msgid "Date of Birth" msgstr "" #: includes/admin/importers/class-sp-player-importer.php:219 #, php-format msgid "" "Import complete - imported %1$s players and skipped " "%2$s." msgstr "" #: includes/admin/importers/class-sp-player-importer.php:229 msgid "View Players" msgstr "" #: includes/admin/importers/class-sp-player-importer.php:253 #, php-format msgid "" "Players need to be defined with columns in a specific order (8 columns). Click here to download a sample." msgstr "" #: includes/admin/importers/class-sp-player-importer.php:270 msgid "Date of Birth Format" msgstr "" #: includes/admin/importers/class-sp-player-importer.php:293 #: includes/admin/importers/class-sp-staff-importer.php:221 #: includes/admin/importers/class-sp-team-importer.php:167 msgid "Merge duplicates" msgstr "" #: includes/admin/importers/class-sp-staff-importer.php:26 #: includes/admin/importers/class-sp-staff-importer.php:189 msgid "Import Staff" msgstr "" #: includes/admin/importers/class-sp-staff-importer.php:29 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:65 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:73 #: includes/class-sp-post-types.php:195 includes/class-sp-post-types.php:211 #: modules/sportspress-tutorials.php:87 msgid "Jobs" msgstr "" #: includes/admin/importers/class-sp-staff-importer.php:167 #, php-format msgid "" "Import complete - imported %1$s staff and skipped " "%2$s." msgstr "" #: includes/admin/importers/class-sp-staff-importer.php:177 #: includes/class-sp-post-types.php:567 msgid "View Staff" msgstr "" #: includes/admin/importers/class-sp-staff-importer.php:201 #, php-format msgid "" "Staff need to be defined with columns in a specific order (6 columns). Click here to download a sample." msgstr "" #: includes/admin/importers/class-sp-team-importer.php:26 msgid "Import Teams" msgstr "" #: includes/admin/importers/class-sp-team-importer.php:31 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:119 #: includes/admin/settings/class-sp-settings-status.php:65 #: includes/admin/views/html-admin-page-status.php:24 #: includes/api/class-sp-rest-api.php:392 msgid "Site URL" msgstr "" #: includes/admin/importers/class-sp-team-importer.php:32 #: includes/admin/post-types/class-sp-admin-cpt-outcome.php:48 #: includes/admin/post-types/class-sp-admin-cpt-team.php:72 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:55 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:126 #: includes/admin/views/html-admin-config.php:32 #: includes/api/class-sp-rest-api.php:375 msgid "Abbreviation" msgstr "" #: includes/admin/importers/class-sp-team-importer.php:123 #, php-format msgid "" "Import complete - imported %1$s teams and skipped " "%2$s." msgstr "" #: includes/admin/importers/class-sp-team-importer.php:133 msgid "View Teams" msgstr "" #: includes/admin/importers/class-sp-team-importer.php:147 #, php-format msgid "" "Teams need to be defined with columns in a specific order (3 columns). Click here to download a sample." msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:52 #: includes/admin/post-types/class-sp-admin-cpt-list.php:52 #: includes/admin/post-types/class-sp-admin-cpt-table.php:52 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:39 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:70 #: modules/sportspress-calendars.php:262 modules/sportspress-calendars.php:283 #: modules/sportspress-calendars.php:339 modules/sportspress-gutenberg.php:89 #: modules/sportspress-league-tables.php:252 #: modules/sportspress-player-lists.php:262 msgid "Title" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:58 #: includes/admin/post-types/class-sp-admin-cpt-list.php:57 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:69 #: includes/admin/settings/class-sp-settings-events.php:260 #: includes/admin/settings/class-sp-settings-page.php:119 #: modules/sportspress-calendars.php:153 modules/sportspress-calendars.php:200 #: modules/sportspress-league-tables.php:198 #: modules/sportspress-player-lists.php:151 #: modules/sportspress-player-lists.php:200 #: modules/sportspress-tutorials.php:141 msgid "Layout" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:73 #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:76 #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:79 #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:85 #: includes/admin/post-types/class-sp-admin-cpt-list.php:81 #: includes/admin/post-types/class-sp-admin-cpt-list.php:84 #: includes/admin/post-types/class-sp-admin-cpt-list.php:90 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:105 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:124 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:142 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:92 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:101 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:182 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:79 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:65 #: includes/admin/settings/class-sp-settings-events.php:498 #: includes/class-sp-ajax.php:325 includes/class-sp-ajax.php:438 #: includes/class-sp-ajax.php:476 includes/class-sp-ajax.php:603 #: includes/class-sp-ajax.php:683 includes/class-sp-ajax.php:810 #: includes/class-sp-post-types.php:41 includes/class-sp-post-types.php:80 #: includes/class-sp-post-types.php:119 includes/class-sp-post-types.php:158 #: includes/class-sp-post-types.php:197 includes/sp-core-functions.php:618 #: includes/sp-core-functions.php:626 includes/sp-core-functions.php:628 #: includes/sp-core-functions.php:782 includes/sp-core-functions.php:816 #: includes/sp-core-functions.php:1742 #: includes/widgets/class-sp-widget-countdown.php:129 #: includes/widgets/class-sp-widget-countdown.php:161 #: includes/widgets/class-sp-widget-event-blocks.php:144 #: includes/widgets/class-sp-widget-event-blocks.php:221 #: includes/widgets/class-sp-widget-event-calendar.php:127 #: includes/widgets/class-sp-widget-event-calendar.php:204 #: includes/widgets/class-sp-widget-event-list.php:151 #: includes/widgets/class-sp-widget-event-list.php:228 #: modules/sportspress-gutenberg.php:91 modules/sportspress-officials.php:90 #: modules/sportspress-overview.php:303 msgid "All" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:96 #: includes/admin/post-types/class-sp-admin-cpt-player.php:127 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:109 #: includes/admin/settings/class-sp-settings-players.php:102 #: includes/admin/settings/class-sp-settings-staff.php:80 #: includes/sp-core-functions.php:1772 templates/official-details.php:89 #: templates/player-details.php:89 templates/staff-details.php:63 msgid "Current Team" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:125 #: includes/admin/post-types/class-sp-admin-cpt-event.php:298 #: includes/admin/post-types/class-sp-admin-cpt-list.php:121 #: includes/admin/post-types/class-sp-admin-cpt-player.php:180 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:147 #: includes/admin/post-types/class-sp-admin-cpt-table.php:99 #: includes/admin/post-types/class-sp-admin-cpt-team.php:123 msgid "Show all leagues" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:134 #: includes/admin/post-types/class-sp-admin-cpt-event.php:307 #: includes/admin/post-types/class-sp-admin-cpt-list.php:130 #: includes/admin/post-types/class-sp-admin-cpt-player.php:191 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:156 #: includes/admin/post-types/class-sp-admin-cpt-table.php:108 #: includes/admin/post-types/class-sp-admin-cpt-team.php:132 msgid "Show all seasons" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-calendar.php:145 #: includes/admin/post-types/class-sp-admin-cpt-event.php:290 #: includes/admin/post-types/class-sp-admin-cpt-list.php:141 #: includes/admin/post-types/class-sp-admin-cpt-player.php:171 #: includes/admin/post-types/class-sp-admin-cpt-staff.php:139 #: includes/admin/post-types/class-sp-admin-cpt-table.php:119 msgid "Show all teams" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-column.php:46 #: includes/admin/post-types/class-sp-admin-cpt-metric.php:46 #: includes/admin/post-types/class-sp-admin-cpt-outcome.php:46 #: includes/admin/post-types/class-sp-admin-cpt-performance.php:47 #: includes/admin/post-types/class-sp-admin-cpt-result.php:46 #: includes/admin/post-types/class-sp-admin-cpt-spec.php:46 #: includes/admin/post-types/class-sp-admin-cpt-statistic.php:47 #: includes/admin/views/html-admin-config.php:30 #: includes/admin/views/html-admin-config.php:100 #: includes/admin/views/html-admin-config.php:194 #: includes/admin/views/html-admin-config.php:311 #: includes/admin/views/html-admin-config.php:376 #: includes/admin/views/html-admin-config.php:442 #: modules/sportspress-event-specs.php:158 msgid "Label" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-column.php:47 #: includes/admin/post-types/class-sp-admin-cpt-statistic.php:48 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:39 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:49 #: includes/sp-template-hooks.php:75 msgid "Key" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-column.php:48 #: includes/admin/post-types/class-sp-admin-cpt-statistic.php:49 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:50 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:66 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:82 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:107 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:103 #: includes/admin/views/html-admin-config.php:102 #: includes/admin/views/html-admin-config.php:312 #: includes/admin/views/html-admin-config.php:444 #: includes/sp-core-functions.php:643 msgid "Equation" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-column.php:49 #: includes/admin/post-types/class-sp-admin-cpt-statistic.php:50 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:44 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:117 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php:46 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:54 #: includes/admin/views/html-admin-config.php:103 #: includes/admin/views/html-admin-config.php:313 #: includes/admin/views/html-admin-config.php:445 msgid "Decimal Places" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-column.php:50 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:156 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:48 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:152 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:123 #: includes/admin/views/html-admin-config.php:314 msgid "Sort Order" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-column.php:51 #: includes/admin/post-types/class-sp-admin-cpt-metric.php:48 #: includes/admin/post-types/class-sp-admin-cpt-outcome.php:49 #: includes/admin/post-types/class-sp-admin-cpt-performance.php:51 #: includes/admin/post-types/class-sp-admin-cpt-result.php:48 #: includes/admin/post-types/class-sp-admin-cpt-spec.php:48 #: includes/admin/post-types/class-sp-admin-cpt-statistic.php:51 #: includes/admin/views/html-admin-config.php:34 #: includes/admin/views/html-admin-config.php:104 #: includes/admin/views/html-admin-config.php:204 #: includes/admin/views/html-admin-config.php:315 #: includes/admin/views/html-admin-config.php:378 #: includes/admin/views/html-admin-config.php:453 #: includes/class-sp-templates.php:92 includes/class-sp-templates.php:165 #: includes/class-sp-templates.php:238 includes/sp-template-hooks.php:69 #: modules/sportspress-event-specs.php:160 msgid "Description" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-event.php:67 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:65 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php:325 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-results.php:344 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:153 #: includes/class-sp-ajax.php:70 includes/class-sp-team.php:350 #: includes/sp-core-functions.php:906 #: includes/widgets/class-sp-widget-countdown.php:178 #: modules/sportspress-tutorials.php:134 msgid "(Auto)" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-event.php:248 msgid "Edit Results" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-event.php:250 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php:35 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:123 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:147 #: includes/class-sp-ajax.php:93 includes/class-sp-ajax.php:123 #: includes/class-sp-ajax.php:153 includes/class-sp-ajax.php:183 #: includes/class-sp-ajax.php:213 includes/class-sp-ajax.php:243 #: includes/class-sp-ajax.php:273 includes/class-sp-ajax.php:303 #: includes/class-sp-ajax.php:450 includes/class-sp-ajax.php:651 #: includes/class-sp-ajax.php:848 includes/class-sp-ajax.php:933 #: includes/class-sp-ajax.php:997 includes/class-sp-ajax.php:1027 #: includes/class-sp-ajax.php:1057 includes/class-sp-ajax.php:1199 #: includes/class-sp-ajax.php:1283 msgid "Cancel" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-event.php:251 #: includes/class-sp-post-types.php:44 includes/class-sp-post-types.php:83 #: includes/class-sp-post-types.php:122 includes/class-sp-post-types.php:161 #: includes/class-sp-post-types.php:200 modules/sportspress-officials.php:93 msgid "Update" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-event.php:362 #: includes/sp-core-functions.php:1796 modules/sportspress-event-status.php:73 #: templates/countdown.php:135 msgid "Postponed" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-event.php:364 #: includes/sp-core-functions.php:1770 modules/sportspress-event-status.php:74 #: templates/countdown.php:136 msgid "Canceled" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-event.php:366 #: includes/sp-core-functions.php:1806 modules/sportspress-event-status.php:72 #: templates/countdown.php:134 msgid "TBD" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-metric.php:47 #: includes/admin/post-types/class-sp-admin-cpt-outcome.php:47 #: includes/admin/post-types/class-sp-admin-cpt-performance.php:48 #: includes/admin/post-types/class-sp-admin-cpt-result.php:47 #: includes/admin/post-types/class-sp-admin-cpt-spec.php:47 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:34 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:46 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:59 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php:37 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:34 #: includes/admin/views/html-admin-config.php:31 #: includes/admin/views/html-admin-config.php:195 #: includes/admin/views/html-admin-config.php:377 #: includes/sp-template-hooks.php:75 modules/sportspress-event-specs.php:159 msgid "Variable" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-performance.php:46 #: includes/admin/post-types/class-sp-admin-cpt-statistic.php:46 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:307 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:310 #: includes/admin/views/html-admin-config.php:193 #: includes/admin/views/html-admin-config.php:443 #: includes/class-sp-post-types.php:385 includes/class-sp-post-types.php:422 msgid "Icon" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-performance.php:49 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:72 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:58 #: includes/admin/views/html-admin-config.php:196 #: includes/admin/views/html-admin-config.php:446 msgid "Category" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-player.php:159 msgid "Show all positions" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-player.php:283 #: includes/admin/post-types/class-sp-admin-cpt-player.php:370 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:124 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:100 #: includes/api/class-sp-rest-api.php:443 #: includes/api/class-sp-rest-api.php:544 msgid "Current Teams" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-player.php:290 #: includes/admin/post-types/class-sp-admin-cpt-player.php:377 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-details.php:141 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php:117 #: includes/admin/settings/class-sp-settings-players.php:110 #: includes/admin/settings/class-sp-settings-staff.php:88 #: includes/api/class-sp-rest-api.php:460 #: includes/api/class-sp-rest-api.php:561 includes/sp-core-functions.php:1789 #: templates/official-details.php:104 templates/player-details.php:104 #: templates/staff-details.php:75 msgid "Past Teams" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-team.php:69 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:298 #: includes/class-sp-post-types.php:489 includes/class-sp-templates.php:115 #: modules/sportspress-player-lists.php:301 #: modules/sportspress-tutorials.php:147 msgid "Logo" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt-team.php:71 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:123 msgid "Short Name" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt.php:45 #, php-format msgid "Insert into %s" msgstr "" #: includes/admin/post-types/class-sp-admin-cpt.php:46 #, php-format msgid "Uploaded to this %s" msgstr "" #: includes/admin/post-types/class-sp-admin-meta-boxes.php:116 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:182 #: modules/sportspress-tutorials.php:165 msgid "Shortcodes" msgstr "" #: includes/admin/post-types/class-sp-admin-meta-boxes.php:129 #: includes/admin/settings/class-sp-settings-events.php:419 #: includes/admin/settings/class-sp-settings-players.php:168 #: includes/api/class-sp-rest-api.php:155 #: modules/sportspress-league-tables.php:185 msgid "Mode" msgstr "" #: includes/admin/post-types/class-sp-admin-meta-boxes.php:188 #: includes/admin/settings/class-sp-settings-events.php:345 #: includes/admin/settings/class-sp-settings-events.php:408 #: includes/admin/settings/class-sp-settings-players.php:157 #: modules/sportspress-calendars.php:207 #: modules/sportspress-player-lists.php:207 msgid "Columns" msgstr "" #: includes/admin/post-types/class-sp-admin-meta-boxes.php:202 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:60 #: includes/api/class-sp-rest-api.php:494 msgid "Metrics" msgstr "" #: includes/admin/post-types/class-sp-admin-meta-boxes.php:218 #: modules/sportspress-calendars.php:188 #: modules/sportspress-league-tables.php:192 #: modules/sportspress-player-lists.php:194 msgid "Shortcode" msgstr "" #: includes/admin/post-types/class-sp-admin-meta-boxes.php:301 #: includes/admin/post-types/class-sp-admin-meta-boxes.php:304 #: includes/class-sp-post-types.php:532 includes/class-sp-post-types.php:571 #: includes/class-sp-templates.php:195 includes/class-sp-templates.php:268 #: includes/sp-core-functions.php:1790 modules/sportspress-officials.php:150 msgid "Photo" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:45 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:83 #: includes/sp-core-functions.php:1810 #: includes/widgets/class-sp-widget-event-list.php:248 #: templates/event-list.php:159 templates/event-list.php:160 #: templates/event-list.php:203 templates/event-list.php:330 #: templates/event-list.php:450 msgid "Time/Results" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php:55 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:120 #: includes/class-sp-ajax.php:632 includes/class-sp-templates.php:46 #: includes/sp-core-functions.php:1767 #: includes/widgets/class-sp-widget-event-list.php:262 #: templates/event-list.php:223 templates/event-list.php:507 msgid "Article" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:249 #: includes/class-sp-template-loader.php:173 #: includes/sp-core-functions.php:1800 templates/event-list.php:519 msgid "Recap" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:251 #: includes/class-sp-template-loader.php:175 #: includes/sp-core-functions.php:1797 templates/event-list.php:521 #: templates/event-logos-block.php:50 msgid "Preview" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php:278 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:34 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-lists.php:108 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:34 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php:103 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:34 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-tables.php:104 #: includes/admin/views/html-admin-config.php:60 #: includes/admin/views/html-admin-config.php:147 #: includes/admin/views/html-admin-config.php:276 #: includes/admin/views/html-admin-config.php:341 #: includes/admin/views/html-admin-config.php:402 #: includes/admin/views/html-admin-config.php:508 #: includes/class-sp-post-types.php:50 includes/class-sp-post-types.php:89 #: includes/class-sp-post-types.php:128 includes/class-sp-post-types.php:167 #: includes/class-sp-post-types.php:206 includes/class-sp-post-types.php:254 #: includes/class-sp-post-types.php:255 includes/class-sp-post-types.php:286 #: includes/class-sp-post-types.php:287 includes/class-sp-post-types.php:318 #: includes/class-sp-post-types.php:319 includes/class-sp-post-types.php:350 #: includes/class-sp-post-types.php:351 includes/class-sp-post-types.php:383 #: includes/class-sp-post-types.php:384 includes/class-sp-post-types.php:420 #: includes/class-sp-post-types.php:421 includes/class-sp-post-types.php:452 #: includes/class-sp-post-types.php:453 includes/class-sp-post-types.php:487 #: includes/class-sp-post-types.php:488 includes/class-sp-post-types.php:530 #: includes/class-sp-post-types.php:531 includes/class-sp-post-types.php:569 #: includes/class-sp-post-types.php:570 includes/sp-core-functions.php:1218 #: includes/sp-core-functions.php:1297 modules/sportspress-calendars.php:85 #: modules/sportspress-calendars.php:86 modules/sportspress-event-specs.php:83 #: modules/sportspress-event-specs.php:84 #: modules/sportspress-event-specs.php:184 #: modules/sportspress-lazy-loading.php:268 #: modules/sportspress-lazy-loading.php:283 #: modules/sportspress-league-tables.php:82 #: modules/sportspress-league-tables.php:83 #: modules/sportspress-officials.php:99 modules/sportspress-officials.php:148 #: modules/sportspress-officials.php:149 modules/sportspress-overview.php:897 #: modules/sportspress-player-lists.php:82 #: modules/sportspress-player-lists.php:83 msgid "No results found." msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:42 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:44 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:42 #: includes/admin/settings/class-sp-settings-general.php:448 msgid "Heading" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:45 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:386 msgid "Status" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:56 msgid "Event Format" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:85 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:67 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:103 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:65 #: includes/class-sp-ajax.php:418 includes/class-sp-ajax.php:583 #: includes/class-sp-ajax.php:790 #: includes/widgets/class-sp-widget-event-blocks.php:203 #: includes/widgets/class-sp-widget-event-calendar.php:186 #: includes/widgets/class-sp-widget-event-list.php:210 msgid "Past" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:89 #: includes/class-sp-ajax.php:422 includes/class-sp-ajax.php:587 #: includes/class-sp-ajax.php:794 includes/class-sp-frontend-scripts.php:93 #: includes/widgets/class-sp-widget-event-blocks.php:206 #: includes/widgets/class-sp-widget-event-calendar.php:189 #: includes/widgets/class-sp-widget-event-list.php:213 msgid "Next" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:97 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:75 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:73 #: includes/class-sp-ajax.php:430 includes/class-sp-ajax.php:595 #: includes/class-sp-ajax.php:802 #: includes/widgets/class-sp-widget-event-blocks.php:214 #: includes/widgets/class-sp-widget-event-calendar.php:197 #: includes/widgets/class-sp-widget-event-list.php:221 msgid "Relative" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:149 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:130 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:106 msgid "Sort by" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:159 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:66 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:155 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:126 #: includes/class-sp-ajax.php:617 includes/class-sp-ajax.php:834 #: includes/class-sp-ajax.php:1185 includes/class-sp-ajax.php:1269 #: includes/widgets/class-sp-widget-countdown.php:149 #: includes/widgets/class-sp-widget-event-blocks.php:229 #: includes/widgets/class-sp-widget-event-list.php:236 #: includes/widgets/class-sp-widget-player-gallery.php:165 #: includes/widgets/class-sp-widget-player-list.php:200 msgid "Ascending" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php:160 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php:65 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:156 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:127 #: includes/class-sp-ajax.php:618 includes/class-sp-ajax.php:835 #: includes/class-sp-ajax.php:1186 includes/class-sp-ajax.php:1270 #: includes/widgets/class-sp-widget-countdown.php:150 #: includes/widgets/class-sp-widget-event-blocks.php:230 #: includes/widgets/class-sp-widget-event-list.php:237 #: includes/widgets/class-sp-widget-player-gallery.php:166 #: includes/widgets/class-sp-widget-player-list.php:201 msgid "Descending" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-feeds.php:47 #: includes/admin/settings/class-sp-settings-events.php:59 #: includes/admin/settings/class-sp-settings-events.php:193 #: includes/admin/settings/class-sp-settings-general.php:449 #: includes/admin/settings/class-sp-settings-players.php:61 #: includes/admin/settings/class-sp-settings-staff.php:63 #: includes/admin/settings/class-sp-settings-teams.php:69 #: includes/class-sp-templates.php:141 msgid "Link" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-shortcode.php:30 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-shortcode.php:39 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-shortcode.php:30 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-shortcode.php:26 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-shortcode.php:26 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-shortcode.php:30 msgid "" "Copy this code and paste it into your post, page or text widget content." msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:39 msgid "Attended" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:40 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:48 #: includes/class-sp-ajax.php:1169 includes/class-sp-ajax.php:1253 #: includes/widgets/class-sp-widget-player-gallery.php:145 #: includes/widgets/class-sp-widget-player-list.php:183 msgid "Played" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:41 msgid "Started" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:42 msgid "Substituted" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:43 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:49 #: includes/admin/settings/class-sp-settings-events.php:471 msgid "Minutes" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:56 msgid "for" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:58 msgid "against" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:71 msgid "Games Back" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:72 msgid "Home Record" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:73 msgid "Away Record" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:74 msgid "Streak" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:75 #: modules/sportspress-league-tables.php:289 msgid "Form" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:76 msgid "Last 5" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:77 msgid "Last 10" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:231 msgid "Presets" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:232 msgid "Operators" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:233 msgid "Subsets" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php:234 msgid "Constants" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:30 msgid "Optional" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php:36 #: includes/admin/settings/class-sp-settings-events.php:99 #: includes/admin/settings/class-sp-settings-events.php:153 #: includes/api/class-sp-rest-api.php:189 includes/sp-core-functions.php:1780 #: templates/event-details.php:64 templates/event-logos-block.php:66 msgid "Full Time" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-mode.php:29 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php:29 #: includes/admin/settings/class-sp-settings-events.php:114 msgid "Team vs team" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-mode.php:30 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php:30 #: includes/admin/settings/class-sp-settings-events.php:115 msgid "Player vs player" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php:71 #: modules/sportspress-officials.php:89 msgid "Duty" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:390 #: includes/admin/settings/class-sp-settings-events.php:436 #: includes/sp-core-functions.php:1792 #: templates/event-performance-table.php:141 msgid "Player of the Match" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:390 #: includes/admin/settings/class-sp-settings-events.php:437 #: templates/event-performance-table.php:144 #: templates/event-performance-table.php:147 msgid "Stars" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:412 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:136 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:200 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:106 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-columns.php:42 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-columns.php:86 #: includes/admin/settings/class-sp-settings-events.php:400 #: includes/admin/settings/class-sp-settings-events.php:493 #: includes/admin/settings/class-sp-settings-players.php:192 #: includes/class-sp-player.php:274 includes/class-sp-player.php:722 #: includes/class-sp-player.php:788 includes/class-sp-team.php:66 #: includes/sp-core-functions.php:571 includes/sp-core-functions.php:575 #: includes/sp-core-functions.php:1811 #: templates/event-performance-table.php:272 msgid "Total" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:603 msgid "Starting Lineup" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php:604 #: includes/class-sp-event.php:460 includes/class-sp-event.php:471 msgid "Substitute" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:38 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:229 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:250 #: modules/sportspress-default-nationality.php:57 msgid "— None —" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php:129 #: includes/class-sp-ajax.php:64 includes/class-sp-ajax.php:109 #: includes/class-sp-ajax.php:139 includes/class-sp-ajax.php:169 #: includes/class-sp-ajax.php:199 includes/class-sp-ajax.php:229 #: includes/class-sp-ajax.php:259 includes/class-sp-ajax.php:289 #: includes/class-sp-ajax.php:319 includes/class-sp-ajax.php:472 #: includes/class-sp-ajax.php:679 includes/class-sp-ajax.php:870 #: includes/class-sp-ajax.php:955 includes/class-sp-ajax.php:1013 #: includes/class-sp-ajax.php:1043 includes/class-sp-ajax.php:1079 #: includes/class-sp-ajax.php:1221 #: includes/widgets/class-sp-widget-countdown.php:122 #: includes/widgets/class-sp-widget-countdown.php:154 #: includes/widgets/class-sp-widget-countdown.php:171 #: includes/widgets/class-sp-widget-event-blocks.php:140 #: includes/widgets/class-sp-widget-event-calendar.php:123 #: includes/widgets/class-sp-widget-event-list.php:147 #: includes/widgets/class-sp-widget-league-table.php:108 #: includes/widgets/class-sp-widget-player-gallery.php:116 #: includes/widgets/class-sp-widget-player-list.php:116 #: includes/widgets/class-sp-widget-staff.php:67 #: includes/widgets/class-sp-widget-team-gallery.php:111 #: modules/sportspress-gutenberg.php:90 #, php-format msgid "Select %s:" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php:29 msgid "Remove video" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php:33 msgid "URL" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php:42 msgid "Add video" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:27 #: includes/admin/settings/class-sp-settings-general.php:27 #: includes/admin/settings/class-sp-settings-modules.php:37 msgid "General" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:36 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:58 #: includes/class-sp-ajax.php:982 includes/sp-core-functions.php:1799 #: includes/widgets/class-sp-widget-player-list.php:157 #: includes/widgets/class-sp-widget-player-list.php:163 #: includes/widgets/class-sp-widget-team-gallery.php:135 #: templates/player-list.php:148 msgid "Rank" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:56 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:197 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:173 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:229 msgid "Data" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php:59 #: includes/admin/settings/class-sp-settings-events.php:481 #: includes/class-sp-post-types.php:376 msgid "Performance" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:50 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:87 #: includes/admin/settings/class-sp-settings-events.php:424 #: includes/admin/settings/class-sp-settings-players.php:173 msgid "Values" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:51 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:88 #: modules/sportspress-tutorials.php:148 msgid "Adjustments" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:119 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:82 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:143 #: includes/admin/views/html-admin-config.php:53 #: includes/admin/views/html-admin-config.php:140 #: includes/admin/views/html-admin-config.php:269 #: includes/admin/views/html-admin-config.php:334 #: includes/admin/views/html-admin-config.php:395 #: includes/admin/views/html-admin-config.php:501 #: modules/sportspress-event-specs.php:177 #: modules/sportspress-event-status.php:93 msgid "Edit" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php:124 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:148 msgid "Save" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:102 msgid "Current" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:123 msgid "Grouping" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:149 msgid "Skip if zero?" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:181 #: includes/admin/settings/class-sp-settings-events.php:271 #: includes/admin/settings/class-sp-settings-events.php:454 #: includes/admin/settings/class-sp-settings-players.php:191 #: modules/sportspress-countdowns.php:97 msgid "Display" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php:182 #: modules/sportspress-player-lists.php:318 msgid "players" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:40 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:170 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:40 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:120 #: includes/admin/views/html-admin-config.php:200 #: includes/admin/views/html-admin-config.php:449 msgid "Visible" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:41 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:171 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:121 #: includes/admin/views/html-admin-config.php:201 #: includes/admin/views/html-admin-config.php:450 msgid "Display in player profile?" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:47 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:131 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:151 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:177 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:47 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:127 #: includes/admin/settings/class-sp-settings-status.php:81 #: includes/admin/settings/class-sp-settings-status.php:120 #: includes/admin/settings/class-sp-settings-status.php:158 #: includes/admin/views/html-admin-page-status.php:40 #: includes/admin/views/html-admin-page-status.php:79 #: includes/admin/views/html-admin-page-status.php:117 msgid "Yes" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php:53 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:137 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:157 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:183 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:53 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:133 #: includes/admin/settings/class-sp-settings-status.php:83 #: includes/admin/settings/class-sp-settings-status.php:122 #: includes/admin/settings/class-sp-settings-status.php:158 #: includes/admin/views/html-admin-page-status.php:42 #: includes/admin/views/html-admin-page-status.php:81 #: includes/admin/views/html-admin-page-status.php:117 msgid "No" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:40 #: includes/admin/settings/class-sp-settings-events.php:499 #: includes/admin/settings/class-sp-settings-general.php:445 #: includes/admin/views/html-admin-config.php:99 #: includes/admin/views/html-admin-config.php:192 #: includes/sp-core-functions.php:538 msgid "Primary" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:59 msgid "Color" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:66 #: includes/admin/views/html-admin-config.php:33 msgid "Condition" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:72 #: includes/sp-core-functions.php:542 #, php-format msgid "Most %s" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:73 #: includes/sp-core-functions.php:543 #, php-format msgid "Least %s" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php:74 #: includes/sp-core-functions.php:544 #, php-format msgid "Equal %s" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:68 msgid "Singular" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:100 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:86 #: includes/sp-core-functions.php:640 includes/sp-core-functions.php:650 #: includes/sp-core-functions.php:652 msgid "Number" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:102 #: includes/admin/settings/class-sp-settings-general.php:447 #: includes/admin/settings/class-sp-settings-text.php:27 #: includes/admin/settings/class-sp-settings-text.php:43 #: includes/sp-core-functions.php:642 modules/sportspress-tutorials.php:127 msgid "Text" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:105 #: includes/sp-core-functions.php:645 msgid "Checkbox" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:124 msgid "Timed" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:125 msgid "Record minutes?" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:144 msgid "Send Off" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php:145 msgid "Don't count minutes after?" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:48 #: includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php:78 #: includes/admin/settings/class-sp-settings-players.php:200 #: includes/sp-core-functions.php:1771 templates/player-statistics.php:97 msgid "Career Total" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-spec-details.php:41 msgid "Display in event pages?" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:99 #: includes/admin/settings/class-sp-settings-events.php:209 msgid "Type" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php:108 #: includes/sp-core-functions.php:571 msgid "Average" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php:97 #: modules/sportspress-tutorials.php:149 msgid "Highlight" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php:100 msgid "Event Status (with results)" msgstr "" #: includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php:121 msgid "Redirect" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:48 msgid "Event Options" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:60 msgid "Link events" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:109 msgid "Default mode" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:117 msgctxt "mode setting description" msgid "Who competes in events?" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:121 #: modules/sportspress-calendars.php:311 modules/sportspress-calendars.php:396 #: modules/sportspress-league-tables.php:276 #: modules/sportspress-player-lists.php:314 msgid "Limit" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:125 #: modules/sportspress-league-tables.php:280 msgid "teams" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:137 msgid "Filter by league" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:145 msgid "Filter by season" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:166 #: includes/admin/settings/class-sp-settings-teams.php:93 msgid "Comments" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:167 msgid "Allow people to post comments on new articles" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:194 #: includes/admin/settings/class-sp-settings-teams.php:78 msgid "Link venues" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:201 msgid "Venue Map" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:202 msgid "Display venue map" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:215 msgid "Satellite" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:220 msgid "Zoom" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:253 msgid "Reverse order" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:265 msgid "Inline" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:266 msgid "Block" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:319 msgid "Jersey (e.g. \"33. John Doe\")" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:320 msgid "Name (e.g. \"John Doe (33)\")" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:335 #: includes/admin/settings/class-sp-settings-status.php:333 #: includes/admin/views/html-admin-config.php:89 #: includes/admin/views/html-admin-config.php:93 #: includes/admin/views/html-admin-page-status.php:292 #: includes/class-sp-post-types.php:247 msgid "Event Results" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:357 msgid "Display outcome" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:383 msgid "Rows" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:425 #: includes/admin/settings/class-sp-settings-players.php:174 msgid "Icons" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:430 msgid "Awards" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:438 msgid "Star Number" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:444 msgid "Top-level only" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:486 #: includes/admin/settings/class-sp-settings-players.php:184 #: modules/sportspress-calendars.php:295 msgid "Combined" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:548 #: includes/admin/settings/class-sp-settings-events.php:552 msgid "Delimiter" msgstr "" #: includes/admin/settings/class-sp-settings-events.php:557 msgid "Custom:" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:45 #: includes/admin/settings/class-sp-settings-general.php:60 #: includes/widgets/class-sp-widget-league-table.php:114 msgid "— Select —" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:78 msgid "General Options" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:90 #: includes/admin/settings/class-sp-settings-status.php:308 #: includes/admin/views/html-admin-page-status.php:267 msgid "Sport" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:120 msgid "Styles and Scripts" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:137 msgid "Align" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:143 #: modules/sportspress-widget-alignment.php:75 msgid "Left" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:144 msgid "Center" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:145 #: modules/sportspress-widget-alignment.php:76 msgid "Right" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:150 msgid "Padding" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:169 msgid "Custom CSS" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:179 msgid "Scripts" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:180 msgid "Live countdowns" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:185 msgid "This will enable a script allowing the countdowns to be animated." msgstr "" #: includes/admin/settings/class-sp-settings-general.php:189 msgid "Shortcode menu" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:194 msgid "This will enable a shortcode menu to be displayed in the visual editor." msgstr "" #: includes/admin/settings/class-sp-settings-general.php:200 msgid "Tables" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:201 msgid "Responsive" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:209 msgid "Scrollable" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:217 msgid "Sortable" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:225 msgid "Widgets" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:226 msgid "Unique" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:230 msgid "Hide widget when same as content." msgstr "" #: includes/admin/settings/class-sp-settings-general.php:237 msgid "Header Offset" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:393 msgid "Color Scheme" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:414 #: modules/sportspress-icons.php:203 msgid "Customize" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:446 msgid "Background" msgstr "" #: includes/admin/settings/class-sp-settings-general.php:456 #: modules/sportspress-styles.php:72 msgid "Enable" msgstr "" #: includes/admin/settings/class-sp-settings-licenses.php:32 msgid "Licenses" msgstr "" #: includes/admin/settings/class-sp-settings-licenses.php:76 msgid "License Key" msgstr "" #: includes/admin/settings/class-sp-settings-licenses.php:80 msgid "Enter the license key from your purchase receipt." msgstr "" #: includes/admin/settings/class-sp-settings-licenses.php:87 msgid "Deactivate" msgstr "" #: includes/admin/settings/class-sp-settings-licenses.php:92 msgid "Activate" msgstr "" #: includes/admin/settings/class-sp-settings-licenses.php:175 msgid "License activated." msgstr "" #: includes/admin/settings/class-sp-settings-licenses.php:177 msgid "License invalid." msgstr "" #: includes/admin/settings/class-sp-settings-licenses.php:227 msgid "License deactivated." msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:32 #: includes/admin/settings/class-sp-settings-modules.php:221 msgid "Modules" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:41 msgid "Dashboard" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:67 msgid "SportsPress Pro" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:74 #: includes/class-sp-modules.php:203 includes/class-sp-modules.php:214 msgid "Premium" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:75 msgid "Upgrade Now" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:86 msgid "Get Freebies" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:91 msgid "Instant access to exclusive SportsPress extensions and free downloads." msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:93 msgid "Create a free account" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:94 msgid "Sign Up" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:107 msgid "Current Theme" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:113 #: includes/admin/settings/class-sp-settings-modules.php:131 msgid "Rookie is a free starter theme for SportsPress designed by ThemeBoy." msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:115 msgid "Need a better theme?" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:116 #: sportspress.php:149 msgid "Upgrade" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:125 msgid "Free SportsPress Theme" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:133 #: includes/class-sp-modules.php:175 includes/class-sp-modules.php:183 #: includes/class-sp-modules.php:225 msgid "Free" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:134 #: includes/admin/views/html-notice-theme-support.php:10 msgid "Install Now" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:146 msgid "Documentation" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:148 msgid "Getting Started" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:149 msgid "Manuals" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:150 msgid "Videos" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:155 msgid "Help" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:157 msgid "Support Forums" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:158 msgid "Feature Requests" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:163 msgid "Connect" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:165 #: includes/class-sp-modules.php:170 msgid "Twitter" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:166 #: includes/class-sp-modules.php:178 msgid "Facebook" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:167 msgid "YouTube" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:168 msgid "Google+" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:173 msgid "Developers" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:175 msgid "Reference" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:176 msgid "Slack" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:177 msgid "GitHub" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:183 #: includes/admin/settings/class-sp-settings-modules.php:185 msgid "Premium Support" msgstr "" #: includes/admin/settings/class-sp-settings-modules.php:260 #: includes/admin/views/html-admin-settings.php:18 msgid "Save Changes" msgstr "" #: includes/admin/settings/class-sp-settings-page.php:122 msgid "Drag each item into the order you prefer." msgstr "" #: includes/admin/settings/class-sp-settings-page.php:178 msgid "Tabs" msgstr "" #: includes/admin/settings/class-sp-settings-page.php:181 msgid "Drag items here to display them as tabs." msgstr "" #: includes/admin/settings/class-sp-settings-players.php:47 msgid "Player Options" msgstr "" #: includes/admin/settings/class-sp-settings-players.php:62 msgid "Link players" msgstr "" #: includes/admin/settings/class-sp-settings-players.php:135 #: includes/admin/settings/class-sp-settings-staff.php:97 #: modules/sportspress-player-lists.php:279 msgid "Display national flags" msgstr "" #: includes/admin/settings/class-sp-settings-players.php:179 msgid "Categories" msgstr "" #: includes/admin/settings/class-sp-settings-staff.php:49 msgid "Staff Options" msgstr "" #: includes/admin/settings/class-sp-settings-staff.php:64 #: includes/admin/settings/class-sp-settings-teams.php:62 msgid "Link staff" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:27 #: includes/admin/settings/class-sp-settings-status.php:44 #: includes/admin/views/html-admin-page-status.php:2 #: includes/admin/views/html-notice-template-check.php:20 msgid "System Status" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:46 #: includes/admin/views/html-admin-page-status.php:5 msgid "Please include this information when requesting support:" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:47 #: includes/admin/views/html-admin-page-status.php:6 msgid "Get System Report" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:55 #: includes/admin/views/html-admin-page-status.php:14 msgid "Environment" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:61 #: includes/admin/views/html-admin-page-status.php:20 msgid "Home URL" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:69 #: includes/admin/views/html-admin-page-status.php:28 msgid "SP Version" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:73 #: includes/admin/views/html-admin-page-status.php:32 msgid "WP Version" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:77 #: includes/admin/views/html-admin-page-status.php:36 msgid "WP Multisite Enabled" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:89 #: includes/admin/views/html-admin-page-status.php:48 msgid "Web Server Info" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:93 #: includes/admin/views/html-admin-page-status.php:52 msgid "PHP Version" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:102 #: includes/admin/views/html-admin-page-status.php:61 msgid "WP Memory Limit" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:108 #: includes/admin/views/html-admin-page-status.php:67 #, php-format msgid "" "%1$s - We recommend setting memory to at least 64MB. See: Increasing memory allocated to PHP" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:116 #: includes/admin/views/html-admin-page-status.php:75 msgid "WP Debug Mode" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:128 #: includes/admin/views/html-admin-page-status.php:87 msgid "WP Language" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:140 #: includes/admin/views/html-admin-page-status.php:99 msgid "WP Max Upload Size" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:145 #: includes/admin/views/html-admin-page-status.php:104 msgid "PHP Post Max Size" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:149 #: includes/admin/views/html-admin-page-status.php:108 msgid "PHP Time Limit" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:153 #: includes/admin/views/html-admin-page-status.php:112 msgid "PHP Max Input Vars" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:157 #: includes/admin/views/html-admin-page-status.php:116 msgid "SUHOSIN Installed" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:162 #: includes/admin/views/html-admin-page-status.php:121 msgid "Default Timezone" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:167 #: includes/admin/views/html-admin-page-status.php:126 #, php-format msgid "Default timezone is %s - it should be UTC" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:169 #: includes/admin/views/html-admin-page-status.php:128 #, php-format msgid "Default timezone is %s" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:178 #: includes/admin/views/html-admin-page-status.php:137 msgid "fsockopen/cURL" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:181 #: includes/admin/views/html-admin-page-status.php:140 msgid "Your server has fsockopen and cURL enabled." msgstr "" #: includes/admin/settings/class-sp-settings-status.php:183 #: includes/admin/views/html-admin-page-status.php:142 msgid "Your server has fsockopen enabled, cURL is disabled." msgstr "" #: includes/admin/settings/class-sp-settings-status.php:185 #: includes/admin/views/html-admin-page-status.php:144 msgid "Your server has cURL enabled, fsockopen is disabled." msgstr "" #: includes/admin/settings/class-sp-settings-status.php:189 #: includes/admin/views/html-admin-page-status.php:148 msgid "" "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." msgstr "" #: includes/admin/settings/class-sp-settings-status.php:194 #: includes/admin/views/html-admin-page-status.php:153 msgid "SOAP Client" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:196 #: includes/admin/views/html-admin-page-status.php:155 msgid "Your server has the SOAP Client class enabled." msgstr "" #: includes/admin/settings/class-sp-settings-status.php:199 #: includes/admin/views/html-admin-page-status.php:158 #, php-format msgid "" "Your server does not have the SOAP Client class enabled - " "some gateway plugins which use SOAP may not work as expected." msgstr "" #: includes/admin/settings/class-sp-settings-status.php:223 #: includes/admin/views/html-admin-page-status.php:182 msgid "Plugins" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:229 #: includes/admin/views/html-admin-page-status.php:188 msgid "Installed Plugins" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:251 #: includes/admin/views/html-admin-page-status.php:210 msgid "Visit plugin homepage" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:280 #: includes/admin/settings/class-sp-settings-status.php:586 #: includes/admin/views/html-admin-page-status.php:239 #: includes/admin/views/html-admin-page-status.php:544 msgid "is available" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:284 #: includes/admin/views/html-admin-page-status.php:243 msgid "by" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:284 #: includes/admin/views/html-admin-page-status.php:243 msgid "version" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:302 #: includes/admin/views/html-admin-page-status.php:261 msgid "SP Configuration" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:312 #: includes/admin/views/html-admin-config.php:23 #: includes/admin/views/html-admin-page-status.php:271 #: includes/class-sp-post-types.php:279 modules/sportspress-tutorials.php:134 msgid "Event Outcomes" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:354 #: includes/admin/views/html-admin-config.php:182 #: includes/admin/views/html-admin-config.php:186 #: includes/admin/views/html-admin-page-status.php:313 #: includes/class-sp-post-types.php:375 includes/class-sp-post-types.php:377 msgid "Player Performance" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:375 #: includes/admin/views/html-admin-config.php:304 #: includes/admin/views/html-admin-page-status.php:334 #: includes/class-sp-post-types.php:311 #: modules/sportspress-league-tables.php:169 msgid "Table Columns" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:397 #: includes/admin/views/html-admin-config.php:369 #: includes/admin/views/html-admin-page-status.php:355 #: includes/class-sp-post-types.php:343 modules/sportspress-tutorials.php:155 msgid "Player Metrics" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:418 #: includes/admin/views/html-admin-config.php:435 #: includes/admin/views/html-admin-page-status.php:376 #: includes/class-sp-post-types.php:412 msgid "Player Statistics" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:442 #: includes/admin/views/html-admin-page-status.php:400 msgid "SP Taxonomies" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:503 #: includes/admin/views/html-admin-page-status.php:461 msgid "SP Post Types" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:530 #: includes/admin/views/html-admin-page-status.php:488 msgid "Theme" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:572 #: includes/admin/views/html-admin-page-status.php:530 msgid "Theme Name" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:580 #: includes/admin/views/html-admin-page-status.php:538 msgid "Theme Version" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:592 #: includes/admin/views/html-admin-page-status.php:550 msgid "Author URL" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:603 #: includes/admin/views/html-admin-page-status.php:561 msgid "Templates" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:639 #: includes/admin/views/html-admin-page-status.php:595 #, php-format msgid "" "%1$s version %2$s is out " "of date. The core version is %3$s" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:650 #: includes/admin/settings/class-sp-settings-status.php:656 #: includes/admin/views/html-admin-page-status.php:606 #: includes/admin/views/html-admin-page-status.php:612 msgid "Template Overrides" msgstr "" #: includes/admin/settings/class-sp-settings-status.php:657 #: includes/admin/views/html-admin-page-status.php:613 msgid "No overrides present in theme." msgstr "" #: includes/admin/settings/class-sp-settings-teams.php:47 msgid "Team Options" msgstr "" #: includes/admin/settings/class-sp-settings-teams.php:70 msgid "Link teams" msgstr "" #: includes/admin/settings/class-sp-settings-teams.php:85 #: includes/class-sp-templates.php:140 includes/sp-core-functions.php:518 #: includes/sp-core-functions.php:1817 templates/team-link.php:32 msgid "Visit Site" msgstr "" #: includes/admin/settings/class-sp-settings-teams.php:86 msgid "Open link in a new window/tab" msgstr "" #: includes/admin/settings/class-sp-settings-teams.php:94 msgid "Allow people to post comments on Team page" msgstr "" #: includes/admin/settings/class-sp-settings-text.php:45 msgid "The following options affect how words are displayed on the frontend." msgstr "" #: includes/admin/views/html-admin-config.php:24 #: includes/admin/views/html-admin-config.php:90 #: includes/admin/views/html-admin-config.php:183 msgid "Used for events." msgstr "" #: includes/admin/views/html-admin-config.php:101 msgid "Variables" msgstr "" #: includes/admin/views/html-admin-config.php:116 #: includes/admin/views/html-admin-config.php:216 #, php-format msgid "Default (%s)" msgstr "" #: includes/admin/views/html-admin-config.php:305 msgid "Used for league tables." msgstr "" #: includes/admin/views/html-admin-config.php:370 #: includes/admin/views/html-admin-config.php:436 msgid "Used for player lists." msgstr "" #: includes/admin/views/html-notice-install.php:7 msgid "Let's get started with some basic settings." msgstr "" #: includes/admin/views/html-notice-install.php:23 msgid "Run the Setup Wizard" msgstr "" #: includes/admin/views/html-notice-install.php:24 #: includes/admin/views/html-notice-template-check.php:20 #: includes/admin/views/html-notice-theme-support.php:12 msgid "Hide this notice" msgstr "" #: includes/admin/views/html-notice-no-access.php:7 msgid "You are not allowed to edit this item." msgstr "" #: includes/admin/views/html-notice-template-check.php:7 msgid "" "Your theme has bundled outdated copies of SportsPress template " "files – 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." msgstr "" #: includes/admin/views/html-notice-theme-support.php:7 msgid "" "Your theme does not declare SportsPress support – if " "you encounter layout issues please read our integration guide or choose a " "SportsPress theme :)" msgstr "" #: includes/admin/views/html-notice-theme-support.php:8 msgid "Have you tried the free Rookie theme yet?" msgstr "" #: includes/admin/views/html-notice-theme-support.php:11 msgid "Theme Integration Guide" msgstr "" #: includes/api/class-sp-rest-api.php:89 msgid "Main Results" msgstr "" #: includes/api/class-sp-rest-api.php:121 msgid "Winner" msgstr "" #: includes/api/class-sp-rest-api.php:477 #: includes/api/class-sp-rest-api.php:578 msgid "Nationalities" msgstr "" #: includes/class-sp-ajax.php:81 #: includes/widgets/class-sp-widget-countdown.php:192 #: modules/sportspress-calendars.php:380 msgid "Display venue" msgstr "" #: includes/class-sp-ajax.php:87 #: includes/widgets/class-sp-widget-countdown.php:195 #: modules/sportspress-calendars.php:356 msgid "Display league" msgstr "" #: includes/class-sp-ajax.php:92 includes/class-sp-ajax.php:122 #: includes/class-sp-ajax.php:152 includes/class-sp-ajax.php:182 #: includes/class-sp-ajax.php:212 includes/class-sp-ajax.php:242 #: includes/class-sp-ajax.php:272 includes/class-sp-ajax.php:302 #: includes/class-sp-ajax.php:449 includes/class-sp-ajax.php:650 #: includes/class-sp-ajax.php:847 includes/class-sp-ajax.php:932 #: includes/class-sp-ajax.php:996 includes/class-sp-ajax.php:1026 #: includes/class-sp-ajax.php:1056 includes/class-sp-ajax.php:1198 #: includes/class-sp-ajax.php:1282 msgid "Insert Shortcode" msgstr "" #: includes/class-sp-ajax.php:333 includes/class-sp-ajax.php:486 #: includes/class-sp-ajax.php:693 includes/class-sp-ajax.php:1092 msgid "Team:" msgstr "" #: includes/class-sp-ajax.php:347 includes/class-sp-ajax.php:500 #: includes/class-sp-ajax.php:707 includes/class-sp-ajax.php:1106 msgid "League:" msgstr "" #: includes/class-sp-ajax.php:361 includes/class-sp-ajax.php:514 #: includes/class-sp-ajax.php:721 includes/class-sp-ajax.php:1120 msgid "Season:" msgstr "" #: includes/class-sp-ajax.php:375 includes/class-sp-ajax.php:528 #: includes/class-sp-ajax.php:735 msgid "Venue:" msgstr "" #: includes/class-sp-ajax.php:389 includes/class-sp-ajax.php:542 #: includes/class-sp-ajax.php:749 #: includes/widgets/class-sp-widget-event-blocks.php:157 #: includes/widgets/class-sp-widget-event-calendar.php:140 #: includes/widgets/class-sp-widget-event-list.php:164 msgid "Status:" msgstr "" #: includes/class-sp-ajax.php:400 includes/class-sp-ajax.php:565 #: includes/class-sp-ajax.php:772 #: includes/widgets/class-sp-widget-event-blocks.php:171 #: includes/widgets/class-sp-widget-event-calendar.php:154 #: includes/widgets/class-sp-widget-event-list.php:178 msgid "Date:" msgstr "" #: includes/class-sp-ajax.php:437 includes/class-sp-ajax.php:602 #: includes/class-sp-ajax.php:809 #: includes/widgets/class-sp-widget-event-blocks.php:220 #: includes/widgets/class-sp-widget-event-calendar.php:203 #: includes/widgets/class-sp-widget-event-list.php:227 msgid "Match Day:" msgstr "" #: includes/class-sp-ajax.php:443 includes/class-sp-ajax.php:645 #: includes/class-sp-ajax.php:842 #: includes/widgets/class-sp-widget-event-blocks.php:238 #: includes/widgets/class-sp-widget-event-calendar.php:211 #: includes/widgets/class-sp-widget-event-list.php:282 msgid "Display link to view all events" msgstr "" #: includes/class-sp-ajax.php:466 includes/class-sp-ajax.php:667 #: includes/class-sp-ajax.php:864 includes/class-sp-ajax.php:949 #: includes/class-sp-ajax.php:1073 includes/class-sp-ajax.php:1215 #: includes/widgets/class-sp-widget-birthdays.php:82 #: includes/widgets/class-sp-widget-countdown.php:116 #: includes/widgets/class-sp-widget-event-blocks.php:134 #: includes/widgets/class-sp-widget-event-calendar.php:120 #: includes/widgets/class-sp-widget-event-list.php:141 #: includes/widgets/class-sp-widget-league-table.php:102 #: includes/widgets/class-sp-widget-player-gallery.php:110 #: includes/widgets/class-sp-widget-player-list.php:110 #: includes/widgets/class-sp-widget-staff.php:64 #: includes/widgets/class-sp-widget-team-gallery.php:105 msgid "Title:" msgstr "" #: includes/class-sp-ajax.php:554 includes/class-sp-ajax.php:761 #: includes/widgets/class-sp-widget-birthdays.php:94 msgid "Format:" msgstr "" #: includes/class-sp-ajax.php:608 includes/class-sp-ajax.php:815 #: includes/widgets/class-sp-widget-event-blocks.php:223 #: includes/widgets/class-sp-widget-event-list.php:230 msgid "Number of events to show:" msgstr "" #: includes/class-sp-ajax.php:614 includes/class-sp-ajax.php:831 #: includes/class-sp-ajax.php:1182 includes/class-sp-ajax.php:1266 #: includes/widgets/class-sp-widget-countdown.php:147 #: includes/widgets/class-sp-widget-event-blocks.php:226 #: includes/widgets/class-sp-widget-event-list.php:233 #: includes/widgets/class-sp-widget-player-gallery.php:163 #: includes/widgets/class-sp-widget-player-list.php:198 msgid "Sort Order:" msgstr "" #: includes/class-sp-ajax.php:623 includes/class-sp-ajax.php:888 #: includes/class-sp-ajax.php:974 includes/class-sp-ajax.php:1139 #: includes/class-sp-ajax.php:1240 #: includes/widgets/class-sp-widget-event-list.php:241 #: includes/widgets/class-sp-widget-league-table.php:129 #: includes/widgets/class-sp-widget-player-gallery.php:135 #: includes/widgets/class-sp-widget-team-gallery.php:130 msgid "Columns:" msgstr "" #: includes/class-sp-ajax.php:633 modules/sportspress-event-specs.php:208 #: modules/sportspress-event-specs.php:216 msgid "Specs" msgstr "" #: includes/class-sp-ajax.php:673 msgid "Event:" msgstr "" #: includes/class-sp-ajax.php:821 includes/class-sp-ajax.php:1162 #: includes/class-sp-ajax.php:1246 #: includes/widgets/class-sp-widget-countdown.php:139 #: includes/widgets/class-sp-widget-player-gallery.php:138 #: includes/widgets/class-sp-widget-player-list.php:176 #: includes/widgets/class-sp-widget-team-gallery.php:133 msgid "Sort by:" msgstr "" #: includes/class-sp-ajax.php:883 includes/class-sp-ajax.php:968 #: includes/widgets/class-sp-widget-league-table.php:125 #: includes/widgets/class-sp-widget-team-gallery.php:127 msgid "Number of teams to show:" msgstr "" #: includes/class-sp-ajax.php:909 #: includes/widgets/class-sp-widget-league-table.php:153 #: modules/sportspress-calendars.php:271 modules/sportspress-calendars.php:348 #: modules/sportspress-league-tables.php:261 #: modules/sportspress-player-lists.php:288 msgid "Display logos" msgstr "" #: includes/class-sp-ajax.php:915 includes/class-sp-ajax.php:991 #: includes/widgets/class-sp-widget-league-table.php:156 msgid "Display link to view full table" msgstr "" #: includes/class-sp-ajax.php:919 msgid "Event Status:" msgstr "" #: includes/class-sp-ajax.php:922 msgid "Include Published/Played Events with results" msgstr "" #: includes/class-sp-ajax.php:927 msgid "Include Scheduled/Future Events with results" msgstr "" #: includes/class-sp-ajax.php:980 msgid "Order by" msgstr "" #: includes/class-sp-ajax.php:983 #: includes/widgets/class-sp-widget-team-gallery.php:136 msgid "Alphabetical" msgstr "" #: includes/class-sp-ajax.php:984 #: includes/widgets/class-sp-widget-player-gallery.php:148 #: includes/widgets/class-sp-widget-team-gallery.php:137 msgid "Random" msgstr "" #: includes/class-sp-ajax.php:1134 includes/class-sp-ajax.php:1234 #: includes/widgets/class-sp-widget-player-gallery.php:132 #: includes/widgets/class-sp-widget-player-list.php:132 msgid "Number of players to show:" msgstr "" #: includes/class-sp-ajax.php:1153 msgid "#" msgstr "" #: includes/class-sp-ajax.php:1193 includes/class-sp-ajax.php:1277 #: includes/widgets/class-sp-widget-player-gallery.php:170 #: includes/widgets/class-sp-widget-player-list.php:205 msgid "Display link to view all players" msgstr "" #: includes/class-sp-countries.php:32 msgid "Africa" msgstr "" #: includes/class-sp-countries.php:89 msgid "Asia" msgstr "" #: includes/class-sp-countries.php:139 msgid "Europe" msgstr "" #: includes/class-sp-countries.php:196 msgid "North America" msgstr "" #: includes/class-sp-countries.php:235 msgid "Oceania" msgstr "" #: includes/class-sp-countries.php:259 msgid "South America" msgstr "" #: includes/class-sp-countries.php:280 msgid "Afghanistan" msgstr "" #: includes/class-sp-countries.php:281 msgid "Anguilla" msgstr "" #: includes/class-sp-countries.php:282 msgid "Albania" msgstr "" #: includes/class-sp-countries.php:283 msgid "Algeria" msgstr "" #: includes/class-sp-countries.php:284 msgid "Andorra" msgstr "" #: includes/class-sp-countries.php:285 msgid "Angola" msgstr "" #: includes/class-sp-countries.php:286 msgid "Argentina" msgstr "" #: includes/class-sp-countries.php:287 msgid "Armenia" msgstr "" #: includes/class-sp-countries.php:288 msgid "Aruba" msgstr "" #: includes/class-sp-countries.php:289 msgid "American Samoa" msgstr "" #: includes/class-sp-countries.php:290 msgid "Antigua and Barbuda" msgstr "" #: includes/class-sp-countries.php:291 msgid "Australia" msgstr "" #: includes/class-sp-countries.php:292 msgid "Austria" msgstr "" #: includes/class-sp-countries.php:293 msgid "Azerbaijan" msgstr "" #: includes/class-sp-countries.php:294 msgid "Bahamas" msgstr "" #: includes/class-sp-countries.php:295 msgid "Bangladesh" msgstr "" #: includes/class-sp-countries.php:296 msgid "Burundi" msgstr "" #: includes/class-sp-countries.php:297 msgid "Belgium" msgstr "" #: includes/class-sp-countries.php:298 msgid "Benin" msgstr "" #: includes/class-sp-countries.php:299 msgid "Bermuda" msgstr "" #: includes/class-sp-countries.php:300 msgid "Burkina Faso" msgstr "" #: includes/class-sp-countries.php:301 msgid "Bahrain" msgstr "" #: includes/class-sp-countries.php:302 msgid "Bhutan" msgstr "" #: includes/class-sp-countries.php:303 msgid "Bosnia and Herzegovina" msgstr "" #: includes/class-sp-countries.php:304 msgid "Belarus" msgstr "" #: includes/class-sp-countries.php:305 msgid "Belize" msgstr "" #: includes/class-sp-countries.php:306 msgid "Bolivia" msgstr "" #: includes/class-sp-countries.php:307 msgid "Botswana" msgstr "" #: includes/class-sp-countries.php:308 msgid "Brazil" msgstr "" #: includes/class-sp-countries.php:309 msgid "Barbados" msgstr "" #: includes/class-sp-countries.php:310 msgid "Brunei" msgstr "" #: includes/class-sp-countries.php:311 msgid "Bulgaria" msgstr "" #: includes/class-sp-countries.php:312 msgid "Cambodia" msgstr "" #: includes/class-sp-countries.php:313 msgid "Canada" msgstr "" #: includes/class-sp-countries.php:314 msgid "Cayman Islands" msgstr "" #: includes/class-sp-countries.php:315 msgid "Republic of the Congo" msgstr "" #: includes/class-sp-countries.php:316 msgid "Chad" msgstr "" #: includes/class-sp-countries.php:317 msgid "Chile" msgstr "" #: includes/class-sp-countries.php:318 msgid "China" msgstr "" #: includes/class-sp-countries.php:319 msgid "Ivory Coast" msgstr "" #: includes/class-sp-countries.php:320 msgid "Cameroon" msgstr "" #: includes/class-sp-countries.php:321 msgid "Democratic Republic of the Congo" msgstr "" #: includes/class-sp-countries.php:322 msgid "Cook Islands" msgstr "" #: includes/class-sp-countries.php:323 msgid "Colombia" msgstr "" #: includes/class-sp-countries.php:324 msgid "Comoros" msgstr "" #: includes/class-sp-countries.php:325 msgid "Cape Verde" msgstr "" #: includes/class-sp-countries.php:326 msgid "Costa Rica" msgstr "" #: includes/class-sp-countries.php:327 msgid "Croatia" msgstr "" #: includes/class-sp-countries.php:328 msgid "Central African Republic" msgstr "" #: includes/class-sp-countries.php:329 msgid "Cuba" msgstr "" #: includes/class-sp-countries.php:330 msgid "Curacao" msgstr "" #: includes/class-sp-countries.php:331 msgid "Cyprus" msgstr "" #: includes/class-sp-countries.php:332 msgid "Czechia" msgstr "" #: includes/class-sp-countries.php:333 msgid "Denmark" msgstr "" #: includes/class-sp-countries.php:334 msgid "Djibouti" msgstr "" #: includes/class-sp-countries.php:335 msgid "Dominica" msgstr "" #: includes/class-sp-countries.php:336 msgid "Dominican Republic" msgstr "" #: includes/class-sp-countries.php:337 msgid "Ecuador" msgstr "" #: includes/class-sp-countries.php:338 msgid "Egypt" msgstr "" #: includes/class-sp-countries.php:339 msgid "England" msgstr "" #: includes/class-sp-countries.php:340 msgid "Equatorial Guinea" msgstr "" #: includes/class-sp-countries.php:341 msgid "Eritrea" msgstr "" #: includes/class-sp-countries.php:342 msgid "Western Sahara" msgstr "" #: includes/class-sp-countries.php:343 msgid "Spain" msgstr "" #: includes/class-sp-countries.php:344 msgid "Estonia" msgstr "" #: includes/class-sp-countries.php:345 msgid "Ethiopia" msgstr "" #: includes/class-sp-countries.php:346 msgid "Fiji" msgstr "" #: includes/class-sp-countries.php:347 msgid "Finland" msgstr "" #: includes/class-sp-countries.php:348 msgid "France" msgstr "" #: includes/class-sp-countries.php:349 msgid "Faroe Islands" msgstr "" #: includes/class-sp-countries.php:350 msgid "French Guiana" msgstr "" #: includes/class-sp-countries.php:351 msgid "French Polynesia" msgstr "" #: includes/class-sp-countries.php:352 msgid "Micronesia" msgstr "" #: includes/class-sp-countries.php:353 msgid "Gabon" msgstr "" #: includes/class-sp-countries.php:354 msgid "Gambia" msgstr "" #: includes/class-sp-countries.php:355 msgid "United Kingdom" msgstr "" #: includes/class-sp-countries.php:356 msgid "Georgia" msgstr "" #: includes/class-sp-countries.php:357 msgid "Germany" msgstr "" #: includes/class-sp-countries.php:358 msgid "Ghana" msgstr "" #: includes/class-sp-countries.php:359 msgid "Gibraltar" msgstr "" #: includes/class-sp-countries.php:360 msgid "Guadeloupe" msgstr "" #: includes/class-sp-countries.php:361 msgid "Guinea-Bissau" msgstr "" #: includes/class-sp-countries.php:362 msgid "Greece" msgstr "" #: includes/class-sp-countries.php:363 msgid "Greenland" msgstr "" #: includes/class-sp-countries.php:364 msgid "Grenada" msgstr "" #: includes/class-sp-countries.php:365 msgid "Guatemala" msgstr "" #: includes/class-sp-countries.php:366 msgid "Guinea" msgstr "" #: includes/class-sp-countries.php:367 msgid "Guam" msgstr "" #: includes/class-sp-countries.php:368 msgid "Guyana" msgstr "" #: includes/class-sp-countries.php:369 msgid "Haiti" msgstr "" #: includes/class-sp-countries.php:370 msgid "Hong Kong" msgstr "" #: includes/class-sp-countries.php:371 msgid "Honduras" msgstr "" #: includes/class-sp-countries.php:372 msgid "Hungary" msgstr "" #: includes/class-sp-countries.php:373 msgid "Indonesia" msgstr "" #: includes/class-sp-countries.php:374 msgid "India" msgstr "" #: includes/class-sp-countries.php:375 msgid "Ireland" msgstr "" #: includes/class-sp-countries.php:376 msgid "Iran" msgstr "" #: includes/class-sp-countries.php:377 msgid "Iraq" msgstr "" #: includes/class-sp-countries.php:378 msgid "Iceland" msgstr "" #: includes/class-sp-countries.php:379 msgid "Israel" msgstr "" #: includes/class-sp-countries.php:380 msgid "Italy" msgstr "" #: includes/class-sp-countries.php:381 msgid "Jamaica" msgstr "" #: includes/class-sp-countries.php:382 msgid "Jordan" msgstr "" #: includes/class-sp-countries.php:383 msgid "Japan" msgstr "" #: includes/class-sp-countries.php:384 msgid "Kazakhstan" msgstr "" #: includes/class-sp-countries.php:385 msgid "Kenya" msgstr "" #: includes/class-sp-countries.php:386 msgid "Kosovo" msgstr "" #: includes/class-sp-countries.php:387 msgid "Kyrgyzstan" msgstr "" #: includes/class-sp-countries.php:388 msgid "Kiribati" msgstr "" #: includes/class-sp-countries.php:389 msgid "Martinique" msgstr "" #: includes/class-sp-countries.php:390 msgid "South Korea" msgstr "" #: includes/class-sp-countries.php:391 msgid "Saudi Arabia" msgstr "" #: includes/class-sp-countries.php:392 msgid "Kuwait" msgstr "" #: includes/class-sp-countries.php:393 msgid "Laos" msgstr "" #: includes/class-sp-countries.php:394 msgid "Liberia" msgstr "" #: includes/class-sp-countries.php:395 msgid "Libya" msgstr "" #: includes/class-sp-countries.php:396 msgid "Saint Lucia" msgstr "" #: includes/class-sp-countries.php:397 msgid "Lesotho" msgstr "" #: includes/class-sp-countries.php:398 msgid "Lebanon" msgstr "" #: includes/class-sp-countries.php:399 msgid "Liechtenstein" msgstr "" #: includes/class-sp-countries.php:400 msgid "Lithuania" msgstr "" #: includes/class-sp-countries.php:401 msgid "Luxembourg" msgstr "" #: includes/class-sp-countries.php:402 msgid "Latvia" msgstr "" #: includes/class-sp-countries.php:403 msgid "Macau" msgstr "" #: includes/class-sp-countries.php:404 msgid "Madagascar" msgstr "" #: includes/class-sp-countries.php:405 msgid "Morocco" msgstr "" #: includes/class-sp-countries.php:406 msgid "Malaysia" msgstr "" #: includes/class-sp-countries.php:407 msgid "Monaco" msgstr "" #: includes/class-sp-countries.php:408 msgid "Moldova" msgstr "" #: includes/class-sp-countries.php:409 msgid "Maldives" msgstr "" #: includes/class-sp-countries.php:410 msgid "Mexico" msgstr "" #: includes/class-sp-countries.php:411 msgid "Marshall Islands" msgstr "" #: includes/class-sp-countries.php:412 msgid "North Macedonia" msgstr "" #: includes/class-sp-countries.php:413 msgid "Mali" msgstr "" #: includes/class-sp-countries.php:414 msgid "Malta" msgstr "" #: includes/class-sp-countries.php:415 msgid "Montenegro" msgstr "" #: includes/class-sp-countries.php:416 msgid "Mongolia" msgstr "" #: includes/class-sp-countries.php:417 msgid "Mozambique" msgstr "" #: includes/class-sp-countries.php:418 msgid "Mauritius" msgstr "" #: includes/class-sp-countries.php:419 msgid "Montserrat" msgstr "" #: includes/class-sp-countries.php:420 msgid "Mauritania" msgstr "" #: includes/class-sp-countries.php:421 msgid "Malawi" msgstr "" #: includes/class-sp-countries.php:422 msgid "Myanmar" msgstr "" #: includes/class-sp-countries.php:423 msgid "Namibia" msgstr "" #: includes/class-sp-countries.php:424 msgid "Nicaragua" msgstr "" #: includes/class-sp-countries.php:425 msgid "New Caledonia" msgstr "" #: includes/class-sp-countries.php:426 msgid "Netherlands" msgstr "" #: includes/class-sp-countries.php:427 msgid "Nepal" msgstr "" #: includes/class-sp-countries.php:428 msgid "Nigeria" msgstr "" #: includes/class-sp-countries.php:429 msgid "Niger" msgstr "" #: includes/class-sp-countries.php:430 msgid "Northern Ireland" msgstr "" #: includes/class-sp-countries.php:431 msgid "Norway" msgstr "" #: includes/class-sp-countries.php:432 msgid "Nauru" msgstr "" #: includes/class-sp-countries.php:433 msgid "New Zealand" msgstr "" #: includes/class-sp-countries.php:434 msgid "Oman" msgstr "" #: includes/class-sp-countries.php:435 msgid "Pakistan" msgstr "" #: includes/class-sp-countries.php:436 msgid "Panama" msgstr "" #: includes/class-sp-countries.php:437 msgid "Paraguay" msgstr "" #: includes/class-sp-countries.php:438 msgid "Peru" msgstr "" #: includes/class-sp-countries.php:439 msgid "Philippines" msgstr "" #: includes/class-sp-countries.php:440 msgid "Palestine" msgstr "" #: includes/class-sp-countries.php:441 msgid "Palau" msgstr "" #: includes/class-sp-countries.php:442 msgid "Papua New Guinea" msgstr "" #: includes/class-sp-countries.php:443 msgid "Poland" msgstr "" #: includes/class-sp-countries.php:444 msgid "Portugal" msgstr "" #: includes/class-sp-countries.php:445 msgid "North Korea" msgstr "" #: includes/class-sp-countries.php:446 msgid "Puerto Rico" msgstr "" #: includes/class-sp-countries.php:447 msgid "Qatar" msgstr "" #: includes/class-sp-countries.php:448 msgid "Romania" msgstr "" #: includes/class-sp-countries.php:449 msgid "South Africa" msgstr "" #: includes/class-sp-countries.php:450 msgid "Reunion" msgstr "" #: includes/class-sp-countries.php:451 msgid "Russia" msgstr "" #: includes/class-sp-countries.php:452 msgid "Rwanda" msgstr "" #: includes/class-sp-countries.php:453 msgid "Samoa" msgstr "" #: includes/class-sp-countries.php:454 msgid "Scotland" msgstr "" #: includes/class-sp-countries.php:455 msgid "Sudan" msgstr "" #: includes/class-sp-countries.php:456 msgid "Senegal" msgstr "" #: includes/class-sp-countries.php:457 msgid "Seychelles" msgstr "" #: includes/class-sp-countries.php:458 msgid "Singapore" msgstr "" #: includes/class-sp-countries.php:459 msgid "Saint Kitts and Nevis" msgstr "" #: includes/class-sp-countries.php:460 msgid "Sierra Leone" msgstr "" #: includes/class-sp-countries.php:461 msgid "El Salvador" msgstr "" #: includes/class-sp-countries.php:462 msgid "San Marino" msgstr "" #: includes/class-sp-countries.php:463 msgid "Solomon Islands" msgstr "" #: includes/class-sp-countries.php:464 msgid "Somalia" msgstr "" #: includes/class-sp-countries.php:465 msgid "Serbia" msgstr "" #: includes/class-sp-countries.php:466 msgid "Sri Lanka" msgstr "" #: includes/class-sp-countries.php:467 msgid "South Sudan" msgstr "" #: includes/class-sp-countries.php:468 msgid "Sao Tome and Principe" msgstr "" #: includes/class-sp-countries.php:469 msgid "Switzerland" msgstr "" #: includes/class-sp-countries.php:470 msgid "Suriname" msgstr "" #: includes/class-sp-countries.php:471 msgid "Slovakia" msgstr "" #: includes/class-sp-countries.php:472 msgid "Slovenia" msgstr "" #: includes/class-sp-countries.php:473 msgid "Sweden" msgstr "" #: includes/class-sp-countries.php:474 msgid "Eswatini" msgstr "" #: includes/class-sp-countries.php:475 msgid "Sint Maarten" msgstr "" #: includes/class-sp-countries.php:476 msgid "Syria" msgstr "" #: includes/class-sp-countries.php:477 msgid "Tahiti" msgstr "" #: includes/class-sp-countries.php:478 msgid "Tanzania" msgstr "" #: includes/class-sp-countries.php:479 msgid "Turks and Caicos Islands" msgstr "" #: includes/class-sp-countries.php:480 msgid "Tonga" msgstr "" #: includes/class-sp-countries.php:481 msgid "Thailand" msgstr "" #: includes/class-sp-countries.php:482 msgid "Tajikistan" msgstr "" #: includes/class-sp-countries.php:483 msgid "Turkmenistan" msgstr "" #: includes/class-sp-countries.php:484 msgid "East Timor" msgstr "" #: includes/class-sp-countries.php:485 msgid "Togo" msgstr "" #: includes/class-sp-countries.php:486 msgid "Taiwan" msgstr "" #: includes/class-sp-countries.php:487 msgid "Trinidad and Tobago" msgstr "" #: includes/class-sp-countries.php:488 msgid "Tunisia" msgstr "" #: includes/class-sp-countries.php:489 msgid "Turkey" msgstr "" #: includes/class-sp-countries.php:490 msgid "Tuvalu" msgstr "" #: includes/class-sp-countries.php:491 msgid "United Arab Emirates" msgstr "" #: includes/class-sp-countries.php:492 msgid "Uganda" msgstr "" #: includes/class-sp-countries.php:493 msgid "Ukraine" msgstr "" #: includes/class-sp-countries.php:494 msgid "Uruguay" msgstr "" #: includes/class-sp-countries.php:495 msgid "United States" msgstr "" #: includes/class-sp-countries.php:496 msgid "Uzbekistan" msgstr "" #: includes/class-sp-countries.php:497 msgid "Vanuatu" msgstr "" #: includes/class-sp-countries.php:498 msgid "Vatican City" msgstr "" #: includes/class-sp-countries.php:499 msgid "Venezuela" msgstr "" #: includes/class-sp-countries.php:500 msgid "British Virgin Islands" msgstr "" #: includes/class-sp-countries.php:501 msgid "Vietnam" msgstr "" #: includes/class-sp-countries.php:502 msgid "Saint Vincent and the Grenadines" msgstr "" #: includes/class-sp-countries.php:503 msgid "US Virgin Islands" msgstr "" #: includes/class-sp-countries.php:504 msgid "Wales" msgstr "" #: includes/class-sp-countries.php:505 msgid "West Indies" msgstr "" #: includes/class-sp-countries.php:506 msgid "Yemen" msgstr "" #: includes/class-sp-countries.php:507 msgid "Zambia" msgstr "" #: includes/class-sp-countries.php:508 msgid "Zimbabwe" msgstr "" #: includes/class-sp-feeds.php:27 msgid "Apple Calendar" msgstr "" #: includes/class-sp-feeds.php:31 msgid "Outlook" msgstr "" #: includes/class-sp-feeds.php:35 msgid "Google" msgstr "" #: includes/class-sp-formats.php:38 msgid "Standings" msgstr "" #: includes/class-sp-frontend-scripts.php:91 msgid "Previous" msgstr "" #: includes/class-sp-install.php:223 msgid "Event Manager" msgstr "" #: includes/class-sp-install.php:270 msgid "Team Manager" msgstr "" #: includes/class-sp-install.php:340 msgid "League Manager" msgstr "" #: includes/class-sp-install.php:602 msgid "What's new:" msgstr "" #: includes/class-sp-league-table.php:852 includes/sp-core-functions.php:1794 #: modules/sportspress-league-tables.php:302 templates/league-table.php:97 msgid "Pos" msgstr "" #: includes/class-sp-modules.php:35 msgid "Results Matrix" msgstr "" #: includes/class-sp-modules.php:39 msgid "Display fixtures and results between teams in a grid layout." msgstr "" #: includes/class-sp-modules.php:42 msgid "Scoreboard" msgstr "" #: includes/class-sp-modules.php:46 msgid "Display multiple event results in a horizontal scoreboard." msgstr "" #: includes/class-sp-modules.php:49 msgid "Google Maps" msgstr "" #: includes/class-sp-modules.php:53 msgid "Use Google Maps instead of OpenStreetMap for venues." msgstr "" #: includes/class-sp-modules.php:56 msgid "User Scores" msgstr "" #: includes/class-sp-modules.php:60 msgid "Let players, staff, and visitors submit event scores for review." msgstr "" #: includes/class-sp-modules.php:63 msgid "Match Stats" msgstr "" #: includes/class-sp-modules.php:67 msgid "Display head-to-head team comparison charts in events." msgstr "" #: includes/class-sp-modules.php:70 msgid "Past Meetings" msgstr "" #: includes/class-sp-modules.php:74 msgid "Display previous events between teams in list or blocks layout." msgstr "" #: includes/class-sp-modules.php:77 msgid "Timelines" msgstr "" #: includes/class-sp-modules.php:81 msgid "Display a visual timeline of player performance in events." msgstr "" #: includes/class-sp-modules.php:84 msgid "Tournaments" msgstr "" #: includes/class-sp-modules.php:88 msgid "Schedule tournaments and create interactive playoff brackets." msgstr "" #: includes/class-sp-modules.php:98 msgid "League Menu" msgstr "" #: includes/class-sp-modules.php:102 msgid "Add a global navigation bar to display logos that link to each team." msgstr "" #: includes/class-sp-modules.php:105 msgid "Team Colors" msgstr "" #: includes/class-sp-modules.php:109 msgid "Create a custom color palette for each team." msgstr "" #: includes/class-sp-modules.php:112 msgid "Team Access" msgstr "" #: includes/class-sp-modules.php:116 msgid "Limit user access to data that is related to their team." msgstr "" #: includes/class-sp-modules.php:126 msgid "Midseason Transfers" msgstr "" #: includes/class-sp-modules.php:130 msgid "Statistics for players who transferred between teams during a season." msgstr "" #: includes/class-sp-modules.php:134 msgid "Directories" msgstr "" #: includes/class-sp-modules.php:138 msgid "Organize and display staff in list and gallery layouts." msgstr "" #: includes/class-sp-modules.php:143 msgid "Manage referees, umpires, judges, timekeepers, and other officials." msgstr "" #: includes/class-sp-modules.php:149 modules/sportspress-tutorials.php:180 #: modules/sportspress-tutorials.php:182 modules/sportspress-tutorials.php:193 msgid "Tutorials" msgstr "" #: includes/class-sp-modules.php:151 msgid "Display a dashboard page with SportsPress video tutorials." msgstr "" #: includes/class-sp-modules.php:154 msgid "Branding" msgstr "" #: includes/class-sp-modules.php:158 msgid "Instantly rebrand the dashboard with your own logo and colors." msgstr "" #: includes/class-sp-modules.php:161 msgid "Duplicator" msgstr "" #: includes/class-sp-modules.php:165 msgid "Clone anything with just one click. Great for creating multiple events." msgstr "" #: includes/class-sp-modules.php:174 msgid "Add a Twitter feed to team, player, and staff pages." msgstr "" #: includes/class-sp-modules.php:182 msgid "Add a Facebook Page widget to embed and promote each team." msgstr "" #: includes/class-sp-modules.php:186 msgid "Sponsors" msgstr "" #: includes/class-sp-modules.php:190 msgid "Attract sponsors by offering them advertising space on your website." msgstr "" #: includes/class-sp-modules.php:198 msgid "BuddyPress" msgstr "" #: includes/class-sp-modules.php:202 msgid "Easily display SportsPress player information in BuddyPress profiles." msgstr "" #: includes/class-sp-modules.php:209 msgid "WooCommerce" msgstr "" #: includes/class-sp-modules.php:213 msgid "Sell team merchandise by integrating WooCommerce with SportsPress." msgstr "" #: includes/class-sp-modules.php:220 msgid "Yoast SEO" msgstr "" #: includes/class-sp-modules.php:224 msgid "Generate custom titles for SportsPress pages using Yoast SEO." msgstr "" #: includes/class-sp-modules.php:231 msgid "Multisite" msgstr "" #: includes/class-sp-modules.php:235 msgid "Manage multiple sports and display different widgets all on one site." msgstr "" #: includes/class-sp-player-list.php:903 msgid "Savvas" msgstr "" #: includes/class-sp-player-list.php:907 includes/class-sp-player-list.php:969 #: includes/widgets/class-sp-widget-birthdays.php:75 #: modules/sportspress-birthdays.php:99 modules/sportspress-birthdays.php:178 #: modules/sportspress-birthdays.php:195 modules/sportspress-birthdays.php:222 msgid "Age" msgstr "" #: includes/class-sp-post-types.php:42 msgid "Edit League" msgstr "" #: includes/class-sp-post-types.php:43 includes/class-sp-post-types.php:82 #: includes/class-sp-post-types.php:121 includes/class-sp-post-types.php:160 #: includes/class-sp-post-types.php:199 includes/class-sp-post-types.php:252 #: includes/class-sp-post-types.php:284 includes/class-sp-post-types.php:316 #: includes/class-sp-post-types.php:348 includes/class-sp-post-types.php:381 #: includes/class-sp-post-types.php:418 #: modules/sportspress-bulk-actions.php:151 #: modules/sportspress-event-specs.php:81 modules/sportspress-officials.php:92 msgid "View" msgstr "" #: includes/class-sp-post-types.php:47 includes/class-sp-post-types.php:86 #: includes/class-sp-post-types.php:125 includes/class-sp-post-types.php:164 #: includes/class-sp-post-types.php:203 modules/sportspress-officials.php:96 msgid "Parent" msgstr "" #: includes/class-sp-post-types.php:48 includes/class-sp-post-types.php:87 #: includes/class-sp-post-types.php:126 includes/class-sp-post-types.php:165 #: includes/class-sp-post-types.php:204 modules/sportspress-officials.php:97 msgid "Parent:" msgstr "" #: includes/class-sp-post-types.php:49 includes/class-sp-post-types.php:88 #: includes/class-sp-post-types.php:127 includes/class-sp-post-types.php:166 #: includes/class-sp-post-types.php:205 includes/class-sp-post-types.php:253 #: includes/class-sp-post-types.php:285 includes/class-sp-post-types.php:317 #: includes/class-sp-post-types.php:349 includes/class-sp-post-types.php:382 #: includes/class-sp-post-types.php:419 includes/class-sp-post-types.php:451 #: includes/class-sp-post-types.php:486 includes/class-sp-post-types.php:529 #: includes/class-sp-post-types.php:568 modules/sportspress-calendars.php:84 #: modules/sportspress-event-specs.php:82 #: modules/sportspress-league-tables.php:81 #: modules/sportspress-officials.php:98 modules/sportspress-officials.php:147 #: modules/sportspress-player-lists.php:81 msgid "Search" msgstr "" #: includes/class-sp-post-types.php:81 msgid "Edit Season" msgstr "" #: includes/class-sp-post-types.php:120 msgid "Edit Venue" msgstr "" #: includes/class-sp-post-types.php:159 msgid "Edit Position" msgstr "" #: includes/class-sp-post-types.php:198 msgid "Edit Job" msgstr "" #: includes/class-sp-post-types.php:248 msgid "Result" msgstr "" #: includes/class-sp-post-types.php:249 msgid "Add New Result" msgstr "" #: includes/class-sp-post-types.php:250 msgid "Edit Result" msgstr "" #: includes/class-sp-post-types.php:251 includes/class-sp-post-types.php:283 #: includes/class-sp-post-types.php:315 includes/class-sp-post-types.php:347 #: includes/class-sp-post-types.php:380 includes/class-sp-post-types.php:417 #: includes/class-sp-post-types.php:449 includes/class-sp-post-types.php:484 #: includes/class-sp-post-types.php:527 includes/class-sp-post-types.php:566 #: modules/sportspress-calendars.php:82 modules/sportspress-event-specs.php:80 #: modules/sportspress-league-tables.php:79 #: modules/sportspress-officials.php:145 #: modules/sportspress-player-lists.php:79 msgid "New" msgstr "" #: includes/class-sp-post-types.php:281 msgid "Add New Outcome" msgstr "" #: includes/class-sp-post-types.php:282 msgid "Edit Outcome" msgstr "" #: includes/class-sp-post-types.php:312 msgid "Column" msgstr "" #: includes/class-sp-post-types.php:313 msgid "Add New Column" msgstr "" #: includes/class-sp-post-types.php:314 msgid "Edit Column" msgstr "" #: includes/class-sp-post-types.php:344 msgid "Metric" msgstr "" #: includes/class-sp-post-types.php:345 msgid "Add New Metric" msgstr "" #: includes/class-sp-post-types.php:346 msgid "Edit Metric" msgstr "" #: includes/class-sp-post-types.php:378 msgid "Add New Performance" msgstr "" #: includes/class-sp-post-types.php:379 msgid "Edit Performance" msgstr "" #: includes/class-sp-post-types.php:386 includes/class-sp-post-types.php:423 #: modules/sportspress-icons.php:201 msgid "Select Icon" msgstr "" #: includes/class-sp-post-types.php:387 includes/class-sp-post-types.php:424 msgid "Remove icon" msgstr "" #: includes/class-sp-post-types.php:388 includes/class-sp-post-types.php:425 msgid "Add icon" msgstr "" #: includes/class-sp-post-types.php:414 msgid "Statistic" msgstr "" #: includes/class-sp-post-types.php:415 msgid "Add New Statistic" msgstr "" #: includes/class-sp-post-types.php:416 msgid "Edit Statistic" msgstr "" #: includes/class-sp-post-types.php:447 modules/sportspress-tutorials.php:114 msgid "Add New Event" msgstr "" #: includes/class-sp-post-types.php:448 modules/sportspress-tutorials.php:115 msgid "Edit Event" msgstr "" #: includes/class-sp-post-types.php:482 modules/sportspress-tutorials.php:93 msgid "Add New Team" msgstr "" #: includes/class-sp-post-types.php:483 msgid "Edit Team" msgstr "" #: includes/class-sp-post-types.php:485 msgid "View Team" msgstr "" #: includes/class-sp-post-types.php:490 includes/class-sp-post-types.php:492 msgid "Select Logo" msgstr "" #: includes/class-sp-post-types.php:491 msgid "Remove Logo" msgstr "" #: includes/class-sp-post-types.php:525 modules/sportspress-tutorials.php:101 msgid "Add New Player" msgstr "" #: includes/class-sp-post-types.php:526 msgid "Edit Player" msgstr "" #: includes/class-sp-post-types.php:528 msgid "View Player" msgstr "" #: includes/class-sp-post-types.php:533 includes/class-sp-post-types.php:535 #: includes/class-sp-post-types.php:572 includes/class-sp-post-types.php:574 #: modules/sportspress-officials.php:151 modules/sportspress-officials.php:153 msgid "Select Photo" msgstr "" #: includes/class-sp-post-types.php:534 includes/class-sp-post-types.php:573 #: modules/sportspress-officials.php:152 msgid "Remove Photo" msgstr "" #: includes/class-sp-post-types.php:564 modules/sportspress-tutorials.php:107 msgid "Add New Staff" msgstr "" #: includes/class-sp-post-types.php:565 msgid "Edit Staff" msgstr "" #: includes/class-sp-templates.php:37 includes/class-sp-templates.php:121 #: includes/class-sp-templates.php:207 includes/class-sp-templates.php:280 #: includes/sp-core-functions.php:1778 msgid "Excerpt" msgstr "" #: includes/class-sp-templates.php:56 includes/sp-core-functions.php:1813 #: modules/sportspress-event-videos.php:61 templates/event-video.php:22 msgid "Video" msgstr "" #: includes/class-sp-templates.php:130 includes/class-sp-templates.php:216 #: includes/class-sp-templates.php:289 includes/sp-core-functions.php:1798 msgid "Profile" msgstr "" #: includes/class-sp-templates.php:188 includes/class-sp-templates.php:261 msgid "Dropdown" msgstr "" #: includes/sp-core-functions.php:783 msgid "Published" msgstr "" #: includes/sp-core-functions.php:784 msgid "Scheduled" msgstr "" #: includes/sp-core-functions.php:817 msgid "Yesterday" msgstr "" #: includes/sp-core-functions.php:818 #: includes/widgets/class-sp-widget-birthdays.php:67 msgid "Today" msgstr "" #: includes/sp-core-functions.php:819 msgid "Tomorrow" msgstr "" #: includes/sp-core-functions.php:820 msgid "Last week" msgstr "" #: includes/sp-core-functions.php:821 #: includes/widgets/class-sp-widget-birthdays.php:68 msgid "This week" msgstr "" #: includes/sp-core-functions.php:822 msgid "Next week" msgstr "" #: includes/sp-core-functions.php:823 msgid "Date range:" msgstr "" #: includes/sp-core-functions.php:1117 includes/sp-core-functions.php:1320 msgid "(no title)" msgstr "" #: includes/sp-core-functions.php:1140 includes/sp-core-functions.php:1242 #: modules/sportspress-lazy-loading.php:220 #: modules/sportspress-lazy-loading.php:284 msgid "Select All" msgstr "" #: includes/sp-core-functions.php:1222 includes/sp-core-functions.php:1225 #: modules/sportspress-lazy-loading.php:266 #: modules/sportspress-lazy-loading.php:269 #: modules/sportspress-lazy-loading.php:285 msgid "Show all" msgstr "" #: includes/sp-core-functions.php:1779 templates/event-fixtures-results.php:60 msgid "Fixtures" msgstr "" #: includes/sp-core-functions.php:1814 templates/event-blocks.php:276 #: templates/event-calendar.php:301 templates/event-list.php:558 msgid "View all events" msgstr "" #: includes/sp-core-functions.php:1815 templates/player-gallery.php:213 #: templates/player-list.php:278 msgid "View all players" msgstr "" #: includes/sp-core-functions.php:1816 templates/league-table.php:208 msgid "View full table" msgstr "" #: includes/sp-core-functions.php:1834 msgid "Love SportsPress? Help spread the word by rating us 5★ on WordPress.org" msgstr "" #: includes/sp-template-hooks.php:72 msgid "" "The description is not prominent by default; however, some themes may show " "it." msgstr "" #: includes/sp-template-hooks.php:83 msgid "User" msgstr "" #: includes/sp-template-hooks.php:91 msgid "Date/Time:" msgstr "" #: includes/sp-template-hooks.php:91 msgid "Now" msgstr "" #: includes/widgets/class-sp-widget-birthdays.php:7 msgid "Display players and staff on their birthday." msgstr "" #: includes/widgets/class-sp-widget-birthdays.php:9 msgid "Birthdays" msgstr "" #: includes/widgets/class-sp-widget-birthdays.php:69 msgid "This month" msgstr "" #: includes/widgets/class-sp-widget-birthdays.php:73 msgid "Hide" msgstr "" #: includes/widgets/class-sp-widget-birthdays.php:74 #: modules/sportspress-birthdays.php:79 modules/sportspress-birthdays.php:100 #: modules/sportspress-birthdays.php:115 modules/sportspress-birthdays.php:146 #: modules/sportspress-birthdays.php:174 modules/sportspress-birthdays.php:191 msgid "Birthday" msgstr "" #: includes/widgets/class-sp-widget-birthdays.php:76 msgid "Birthday (Age)" msgstr "" #: includes/widgets/class-sp-widget-birthdays.php:86 msgid "Birthday:" msgstr "" #: includes/widgets/class-sp-widget-countdown.php:7 msgid "A clock that counts down to an upcoming event." msgstr "" #: includes/widgets/class-sp-widget-countdown.php:119 #: includes/widgets/class-sp-widget-event-blocks.php:137 #: includes/widgets/class-sp-widget-event-list.php:144 #: includes/widgets/class-sp-widget-league-table.php:105 #: includes/widgets/class-sp-widget-player-gallery.php:113 #: includes/widgets/class-sp-widget-player-list.php:113 #: includes/widgets/class-sp-widget-team-gallery.php:108 msgid "Heading:" msgstr "" #: includes/widgets/class-sp-widget-countdown.php:198 msgid "Display date" msgstr "" #: includes/widgets/class-sp-widget-countdown.php:201 msgid "Display excluded events" msgstr "" #: includes/widgets/class-sp-widget-countdown.php:204 msgid "Display event status" msgstr "" #: includes/widgets/class-sp-widget-event-blocks.php:7 #: includes/widgets/class-sp-widget-event-list.php:7 msgid "A list of events." msgstr "" #: includes/widgets/class-sp-widget-event-blocks.php:9 #: modules/sportspress-calendars.php:330 msgid "Event Blocks" msgstr "" #: includes/widgets/class-sp-widget-event-calendar.php:7 msgid "A calendar of events." msgstr "" #: includes/widgets/class-sp-widget-event-calendar.php:9 #: modules/sportspress-gutenberg.php:87 msgid "Event Calendar" msgstr "" #: includes/widgets/class-sp-widget-event-list.php:9 #: modules/sportspress-calendars.php:253 msgid "Event List" msgstr "" #: includes/widgets/class-sp-widget-league-table.php:7 msgid "Display a league table." msgstr "" #: includes/widgets/class-sp-widget-player-gallery.php:7 msgid "Display a gallery of players." msgstr "" #: includes/widgets/class-sp-widget-player-gallery.php:9 msgid "Player Gallery" msgstr "" #: includes/widgets/class-sp-widget-player-list.php:7 msgid "Display a list of players." msgstr "" #: includes/widgets/class-sp-widget-player-list.php:136 msgid "Performance:" msgstr "" #: includes/widgets/class-sp-widget-staff.php:7 msgid "Display a single staff member." msgstr "" #: includes/widgets/class-sp-widget-team-gallery.php:7 msgid "Display a gallery of teams." msgstr "" #: includes/widgets/class-sp-widget-team-gallery.php:9 msgid "Team Gallery" msgstr "" #: includes/widgets/class-sp-widget-team-gallery.php:141 msgid "Display link to view all teams" msgstr "" #: modules/sportspress-birthdays.php:77 #, php-format msgid "Birthday: %1$s" msgstr "" #: modules/sportspress-birthdays.php:116 modules/sportspress-birthdays.php:147 msgid "Display birthday" msgstr "" #: modules/sportspress-birthdays.php:124 modules/sportspress-birthdays.php:155 msgid "Display age" msgstr "" #: modules/sportspress-bulk-actions.php:66 msgid "Generate Calendars" msgstr "" #: modules/sportspress-bulk-actions.php:103 msgid "Postpone events" msgstr "" #: modules/sportspress-bulk-actions.php:104 msgid "Cancel events" msgstr "" #: modules/sportspress-bulk-actions.php:105 msgid "Set events as on time" msgstr "" #: modules/sportspress-bulk-actions.php:147 #, php-format msgid "Generated %s calendar." msgid_plural "Generated %s calendars." msgstr[0] "" msgstr[1] "" #: modules/sportspress-bulk-actions.php:160 #, php-format msgid "Postponed %s event." msgid_plural "Postponed %s events." msgstr[0] "" msgstr[1] "" #: modules/sportspress-bulk-actions.php:173 #, php-format msgid "Canceled %s event." msgid_plural "Canceled %s events." msgstr[0] "" msgstr[1] "" #: modules/sportspress-bulk-actions.php:186 #, php-format msgid "Set %s event as on time." msgid_plural "Set %s event as on time." msgstr[0] "" msgstr[1] "" #: modules/sportspress-calendars.php:80 msgid "Add New Calendar" msgstr "" #: modules/sportspress-calendars.php:81 msgid "Edit Calendar" msgstr "" #: modules/sportspress-calendars.php:83 msgid "View Calendar" msgstr "" #: modules/sportspress-calendars.php:194 msgid "Feeds" msgstr "" #: modules/sportspress-calendars.php:263 modules/sportspress-calendars.php:340 msgid "Display calendar title" msgstr "" #: modules/sportspress-calendars.php:278 msgid "Title Format" msgstr "" #: modules/sportspress-calendars.php:290 msgid "Time/Results Format" msgstr "" #: modules/sportspress-calendars.php:296 msgid "Separate" msgstr "" #: modules/sportspress-calendars.php:297 msgid "Time Only" msgstr "" #: modules/sportspress-calendars.php:298 msgid "Results Only" msgstr "" #: modules/sportspress-calendars.php:303 modules/sportspress-calendars.php:388 #: modules/sportspress-league-tables.php:268 #: modules/sportspress-player-lists.php:306 msgid "Pagination" msgstr "" #: modules/sportspress-calendars.php:304 modules/sportspress-calendars.php:389 #: modules/sportspress-league-tables.php:269 #: modules/sportspress-player-lists.php:307 msgid "Paginate" msgstr "" #: modules/sportspress-calendars.php:315 modules/sportspress-calendars.php:400 #: modules/sportspress-league-tables.php:293 msgid "events" msgstr "" #: modules/sportspress-calendars.php:364 msgid "Display season" msgstr "" #: modules/sportspress-calendars.php:372 msgid "Display matchday" msgstr "" #: modules/sportspress-comments-scheduled-events.php:82 msgid "Sorry, you must be logged in to comment." msgstr "" #: modules/sportspress-comments-scheduled-events.php:91 msgid "ERROR: please fill the required fields (name, email)." msgstr "" #: modules/sportspress-comments-scheduled-events.php:91 msgid "ERROR: please fill the required fields (name, email)." msgstr "" #: modules/sportspress-comments-scheduled-events.php:94 msgid "ERROR: please enter a valid email address." msgstr "" #: modules/sportspress-comments-scheduled-events.php:94 msgid "ERROR: please enter a valid email address." msgstr "" #: modules/sportspress-comments-scheduled-events.php:100 msgid "ERROR: please type a comment." msgstr "" #: modules/sportspress-comments-scheduled-events.php:100 msgid "ERROR: please type a comment." msgstr "" #: modules/sportspress-comments-scheduled-events.php:128 msgid "" "ERROR: The comment could not be saved. Please try again " "later." msgstr "" #: modules/sportspress-comments-scheduled-events.php:128 msgid "ERROR: The comment could not be saved. Please try again later." msgstr "" #: modules/sportspress-countdowns.php:98 msgid "Logos" msgstr "" #: modules/sportspress-countdowns.php:105 msgid "Featured Image" msgstr "" #: modules/sportspress-default-nationality.php:62 msgid "Default Nationality" msgstr "" #: modules/sportspress-event-specs.php:76 #: modules/sportspress-event-specs.php:151 #: modules/sportspress-event-specs.php:248 msgid "Event Specs" msgstr "" #: modules/sportspress-event-specs.php:77 msgid "Event Spec" msgstr "" #: modules/sportspress-event-specs.php:78 msgid "Add New Event Spec" msgstr "" #: modules/sportspress-event-specs.php:79 msgid "Edit Event Spec" msgstr "" #: modules/sportspress-event-specs.php:152 msgid "Add more details to an event." msgstr "" #: modules/sportspress-event-status.php:71 templates/countdown.php:133 msgid "On time" msgstr "" #: modules/sportspress-event-status.php:92 msgid "Time:" msgstr "" #: modules/sportspress-event-status.php:93 msgid "Edit status" msgstr "" #: modules/sportspress-gutenberg.php:88 msgid "Properties" msgstr "" #: modules/sportspress-icons.php:191 msgid "Image" msgstr "" #: modules/sportspress-lazy-loading.php:286 msgid "Loading…" msgstr "" #: modules/sportspress-league-tables.php:77 msgid "Add New League Table" msgstr "" #: modules/sportspress-league-tables.php:78 msgid "Edit League Table" msgstr "" #: modules/sportspress-league-tables.php:80 msgid "View League Table" msgstr "" #: modules/sportspress-league-tables.php:253 #: modules/sportspress-player-lists.php:263 msgid "Display title" msgstr "" #: modules/sportspress-league-tables.php:303 msgid "Always increment" msgstr "" #: modules/sportspress-league-tables.php:310 msgid "Tiebreaker" msgstr "" #: modules/sportspress-league-tables.php:316 msgid "Head to head" msgstr "" #: modules/sportspress-next-team-preset.php:70 #: modules/sportspress-next-team-preset.php:171 msgid "Next Team" msgstr "" #: modules/sportspress-next-team-preset.php:172 msgid "Filter by League" msgstr "" #: modules/sportspress-officials.php:88 modules/sportspress-officials.php:104 #: modules/sportspress-officials.php:586 msgid "Duties" msgstr "" #: modules/sportspress-officials.php:91 msgid "Edit Duty" msgstr "" #: modules/sportspress-officials.php:142 modules/sportspress-officials.php:201 msgid "Official" msgstr "" #: modules/sportspress-officials.php:143 msgid "Add New Official" msgstr "" #: modules/sportspress-officials.php:144 msgid "Edit Official" msgstr "" #: modules/sportspress-officials.php:146 msgid "View Official" msgstr "" #: modules/sportspress-officials.php:385 msgid "Table" msgstr "" #: modules/sportspress-officials.php:425 msgid "SportsPress Officials (CSV)" msgstr "" #: modules/sportspress-officials.php:426 msgid "Import officials from a csv file." msgstr "" #: modules/sportspress-overview.php:57 modules/sportspress-overview.php:67 #: modules/sportspress-tutorials.php:163 msgid "Overview" msgstr "" #: modules/sportspress-player-lists.php:77 msgid "Add New Player List" msgstr "" #: modules/sportspress-player-lists.php:78 msgid "Edit Player List" msgstr "" #: modules/sportspress-player-lists.php:80 msgid "View Player List" msgstr "" #: modules/sportspress-player-lists.php:271 msgid "Display photos" msgstr "" #: modules/sportspress-styles.php:71 msgid "Frontend Styles" msgstr "" #: modules/sportspress-template-selector.php:134 msgid "Default Template" msgstr "" #: modules/sportspress-template-selector.php:139 msgid "Template" msgstr "" #: modules/sportspress-tutorials.php:81 msgid "Get Started" msgstr "" #: modules/sportspress-tutorials.php:84 msgid "Installation" msgstr "" #: modules/sportspress-tutorials.php:128 msgid "Permalinks" msgstr "" #: modules/sportspress-tutorials.php:156 msgid "Player Ranking" msgstr "" #: modules/sportspress-tutorials.php:162 msgid "Demo Content" msgstr "" #: modules/sportspress-tutorials.php:164 msgid "User Roles" msgstr "" #: modules/sportspress-tutorials.php:166 msgid "Page not found" msgstr "" #: modules/sportspress-tutorials.php:194 msgid "Advanced" msgstr "" #: modules/sportspress-tutorials.php:225 msgid "Pop-out" msgstr "" #: modules/sportspress-tutorials.php:263 msgid "Watch Tutorials" msgstr "" #: modules/sportspress-user-registration.php:66 msgid "User Registration" msgstr "" #: modules/sportspress-user-registration.php:67 msgid "Add name fields to signup form" msgstr "" #: modules/sportspress-user-registration.php:75 msgid "Add a team name field to signup form" msgstr "" #: modules/sportspress-user-registration.php:83 msgid "Add a team selector to signup form" msgstr "" #: modules/sportspress-user-registration.php:91 msgid "Create player profiles for new users" msgstr "" #: modules/sportspress-user-registration.php:112 msgid "First Name" msgstr "" #: modules/sportspress-user-registration.php:117 msgid "Last Name" msgstr "" #: modules/sportspress-widget-alignment.php:112 #: modules/sportspress-widget-alignment.php:146 #, php-format msgid "Alignment: %s" msgstr "" #: modules/sportspress-wordpay.php:91 msgid "There are no plans associated with the Team Manager role." msgstr "" #: modules/sportspress-wordpay.php:117 msgid "There are no plans associated with the Player role." msgstr "" #: modules/sportspress-wordpay.php:158 msgid "Team Name" msgstr "" #: modules/sportspress-wordpay.php:196 msgid "Register Team" msgstr "" #: modules/sportspress-wordpay.php:197 msgid "Register Player" msgstr "" #: modules/sportspress-wordpay.php:206 msgid "Members" msgstr "" #: modules/sportspress-wordpay.php:212 msgid "For:" msgstr "" #: sportspress.php:92 sportspress.php:101 msgid "Cheatin’ huh?" msgstr "" #: templates/event-blocks.php:258 templates/event-list.php:501 msgid "N/A" msgstr "" #: templates/event-calendar.php:148 templates/event-calendar.php:181 #: templates/event-calendar.php:194 #, php-format msgctxt "calendar caption" msgid "%1$s %2$s" msgstr "" #: templates/event-calendar.php:282 #, php-format msgid "%s events" msgstr "" #: templates/team-gallery.php:155 msgid "View all teams" msgstr "" ================================================ FILE: license.txt ================================================ SportsPress Copyright 2026 by the contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA This program incorporates work covered by the following copyright and permission notices: The SportsPress code has been inspired by and partly adapted from the beautifully coded WooCommerce plugin by WooThemes. SportsPress includes icons from WebHostingHub Glyphs, released under the SIL Open Font License; 80 Shades of White Icons by Victor Erixon; Entypo and Entypo+ by Daniel Bruce, released under CC BY-SA 3.0; Font Awesome by Dave Gancy, released under the GPL; Flaticon by Freepick, released under CC BY 3.0. The custom designed icons included in SportsPress are released under the GPL. Wherever third party code has been used, credit has been given in the code's comments. and ThemeBoy SportsPress is released under the GPL =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright © This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright © This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: modules/sportspress-admin-bar.php ================================================ define_constants(); add_action( 'admin_bar_menu', array( $this, 'add_node' ), 40 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_ADMIN_BAR_VERSION' ) ) { define( 'SP_ADMIN_BAR_VERSION', '2.2' ); } if ( ! defined( 'SP_ADMIN_BAR_URL' ) ) { define( 'SP_ADMIN_BAR_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_ADMIN_BAR_DIR' ) ) { define( 'SP_ADMIN_BAR_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add node to admin bar menu. */ public function add_node( $wp_admin_bar ) { if ( is_admin() ) { return; } $args = array( 'id' => 'sportspress', 'title' => esc_attr__( 'SportsPress', 'sportspress' ), 'href' => add_query_arg( 'page', 'sportspress', admin_url( 'admin.php' ) ), ); $wp_admin_bar->add_node( $args ); } } endif; new SportsPress_Admin_Bar(); ================================================ FILE: modules/sportspress-birthdays.php ================================================ define_constants(); add_filter( 'gettext', array( $this, 'gettext' ), 20, 3 ); add_filter( 'sportspress_text', array( $this, 'add_text_options' ) ); add_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) ); add_filter( 'sportspress_staff_options', array( $this, 'add_staff_options' ) ); add_filter( 'sportspress_player_details', array( $this, 'add_player_details' ), 20, 2 ); add_filter( 'sportspress_staff_details', array( $this, 'add_staff_details' ), 20, 2 ); add_action( 'sportspress_widgets', array( $this, 'widgets' ) ); add_action( 'sportspress_list_general_columns', array( $this, 'columns' ), 10, 1 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_BIRTHDAYS_VERSION' ) ) { define( 'SP_BIRTHDAYS_VERSION', '2.7.1' ); } if ( ! defined( 'SP_BIRTHDAYS_URL' ) ) { define( 'SP_BIRTHDAYS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_BIRTHDAYS_DIR' ) ) { define( 'SP_BIRTHDAYS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Text filter. */ public function gettext( $translated_text, $untranslated_text, $domain ) { if ( ! is_admin() ) { return $translated_text; } global $typenow; if ( 'default' == $domain && in_array( $typenow, array( 'sp_player', 'sp_staff', 'sp_official' ) ) ) : switch ( $untranslated_text ) : case 'Scheduled for: %1$s': case 'Published on: %1$s': case 'Schedule for: %1$s': case 'Publish on: %1$s': return wp_kses_post( __( 'Birthday: %1$s', 'sportspress' ) ); case 'Publish immediately': return esc_attr__( 'Birthday', 'sportspress' ); case 'M j, Y @ G:i': return 'M j, Y'; case '%1$s %2$s, %3$s @ %4$s : %5$s': $hour = ''; $minute = ''; return '%1$s %2$s, %3$s' . $hour . $minute; endswitch; endif; return $translated_text; } /** * Add text options */ public function add_text_options( $options = array() ) { return array_merge( $options, array( __( 'Age', 'sportspress' ), __( 'Birthday', 'sportspress' ), ) ); } /** * Add options to player settings page. * * @return array */ public function add_player_options( $options ) { $options = array_merge( $options, array( array( 'title' => esc_attr__( 'Birthday', 'sportspress' ), 'desc' => esc_attr__( 'Display birthday', 'sportspress' ), 'id' => 'sportspress_player_show_birthday', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Display age', 'sportspress' ), 'id' => 'sportspress_player_show_age', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), ) ); return $options; } /** * Add options to staff settings page. * * @return array */ public function add_staff_options( $options ) { $options = array_merge( $options, array( array( 'title' => esc_attr__( 'Birthday', 'sportspress' ), 'desc' => esc_attr__( 'Display birthday', 'sportspress' ), 'id' => 'sportspress_staff_show_birthday', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Display age', 'sportspress' ), 'id' => 'sportspress_staff_show_age', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), ) ); return $options; } /** * Add data to player details template. * * @return array */ public function add_player_details( $data, $post_id ) { if ( 'yes' == get_option( 'sportspress_player_show_birthday', 'no' ) ) { $data[ esc_attr__( 'Birthday', 'sportspress' ) ] = get_the_date( get_option( 'date_format' ), $post_id ); } if ( 'yes' == get_option( 'sportspress_player_show_age', 'no' ) ) { $data[ esc_attr__( 'Age', 'sportspress' ) ] = $this->get_age( get_the_date( 'm-d-Y', $post_id ) ); } return $data; } /** * Add data to staff details template. * * @return array */ public function add_staff_details( $data, $post_id ) { if ( 'yes' == get_option( 'sportspress_staff_show_birthday', 'no' ) ) { $data[ esc_attr__( 'Birthday', 'sportspress' ) ] = get_the_date( get_option( 'date_format' ), $post_id ); } if ( 'yes' == get_option( 'sportspress_staff_show_age', 'no' ) ) { $data[ esc_attr__( 'Age', 'sportspress' ) ] = $this->get_age( get_the_date( 'm-d-Y', $post_id ) ); } return $data; } /** * Register widgets */ public static function widgets() { include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-birthdays.php'; } /** * Add more General Columns at Player Lists */ public static function columns( $selected ) { ?>
  • date( 'md' ) ? ( ( date( 'Y' ) - $date[2] ) - 1 ) : ( date( 'Y' ) - $date[2] ) ); return $age; } } endif; new SportsPress_Birthdays(); ================================================ FILE: modules/sportspress-bulk-actions.php ================================================ define_constants(); // Teams add_filter( 'bulk_actions-edit-sp_team', array( $this, 'team_actions' ) ); add_filter( 'handle_bulk_actions-edit-sp_team', array( $this, 'team_actions_handler' ), 10, 3 ); // Events add_filter( 'bulk_actions-edit-sp_event', array( $this, 'event_actions' ) ); add_filter( 'handle_bulk_actions-edit-sp_event', array( $this, 'event_actions_handler' ), 10, 3 ); // Notices add_action( 'admin_notices', array( $this, 'admin_notices' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_BULK_ACTIONS_VERSION' ) ) { define( 'SP_BULK_ACTIONS_VERSION', '2.7.6' ); } if ( ! defined( 'SP_BULK_ACTIONS_URL' ) ) { define( 'SP_BULK_ACTIONS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_BULK_ACTIONS_DIR' ) ) { define( 'SP_BULK_ACTIONS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add option to the team bulk actions dropdown. */ public function team_actions( $bulk_actions ) { $bulk_actions['sp_calendar'] = esc_attr__( 'Generate Calendars', 'sportspress' ); return $bulk_actions; } /** * Handle form submission for team bulk actions. */ public function team_actions_handler( $redirect_to, $doaction, $post_ids ) { if ( $doaction !== 'sp_calendar' ) { return $redirect_to; } foreach ( $post_ids as $post_id ) { $post = array(); $post['post_title'] = get_the_title( $post_id ) . ' ' . esc_attr__( 'Calendar', 'sportspress' ); $post['post_type'] = 'sp_calendar'; $post['post_status'] = 'publish'; // Insert post $id = wp_insert_post( $post ); // Flag as bulk update_post_meta( $id, '_sp_bulk', 1 ); // Update meta update_post_meta( $id, 'sp_team', $post_id ); update_post_meta( $id, 'sp_format', 'calendar' ); } $redirect_to = add_query_arg( 'sp_bulk_generated_calendars', count( $post_ids ), $redirect_to ); return $redirect_to; } /** * Add option to the event bulk actions dropdown. */ public function event_actions( $bulk_actions ) { $bulk_actions['sp_postpone'] = esc_attr__( 'Postpone events', 'sportspress' ); $bulk_actions['sp_cancel'] = esc_attr__( 'Cancel events', 'sportspress' ); $bulk_actions['sp_ok'] = esc_attr__( 'Set events as on time', 'sportspress' ); return $bulk_actions; } /** * Handle form submission for event bulk actions. */ public function event_actions_handler( $redirect_to, $doaction, $post_ids ) { if ( ! in_array( $doaction, array( 'sp_postpone', 'sp_cancel', 'sp_ok' ) ) ) { return $redirect_to; } if ( 'sp_postpone' == $doaction ) { foreach ( $post_ids as $post_id ) { update_post_meta( $post_id, 'sp_status', 'postponed' ); } $redirect_to = add_query_arg( 'sp_bulk_postponed_events', count( $post_ids ), $redirect_to ); } elseif ( 'sp_cancel' == $doaction ) { foreach ( $post_ids as $post_id ) { update_post_meta( $post_id, 'sp_status', 'cancelled' ); } $redirect_to = add_query_arg( 'sp_bulk_cancelled_events', count( $post_ids ), $redirect_to ); } elseif ( 'sp_ok' == $doaction ) { foreach ( $post_ids as $post_id ) { update_post_meta( $post_id, 'sp_status', 'ok' ); } $redirect_to = add_query_arg( 'sp_bulk_ok_events', count( $post_ids ), $redirect_to ); } return $redirect_to; } /** * Display notices after form submission. */ public function admin_notices() { if ( ! empty( $_REQUEST['sp_bulk_generated_calendars'] ) ) { $count = intval( $_REQUEST['sp_bulk_generated_calendars'] ); printf( '

    ' . esc_attr( _n( 'Generated %s calendar.', 'Generated %s calendars.', $count, 'sportspress' ) ) . ' ' . esc_attr__( 'View', 'sportspress' ) . '

    ', esc_attr( $count ) ); } elseif ( ! empty( $_REQUEST['sp_bulk_postponed_events'] ) ) { $count = intval( $_REQUEST['sp_bulk_postponed_events'] ); printf( '

    ' . esc_attr( _n( 'Postponed %s event.', 'Postponed %s events.', $count, 'sportspress' ) ) . '

    ', esc_attr( $count ) ); } elseif ( ! empty( $_REQUEST['sp_bulk_cancelled_events'] ) ) { $count = intval( $_REQUEST['sp_bulk_cancelled_events'] ); printf( '

    ' . esc_attr( _n( 'Canceled %s event.', 'Canceled %s events.', $count, 'sportspress' ) ) . '

    ', esc_attr( $count ) ); } elseif ( ! empty( $_REQUEST['sp_bulk_ok_events'] ) ) { $count = intval( $_REQUEST['sp_bulk_ok_events'] ); printf( '

    ' . esc_attr( _n( 'Set %s event as on time.', 'Set %s event as on time.', $count, 'sportspress' ) ) . '

    ', esc_attr( $count ) ); } } } endif; new SportsPress_Bulk_Actions(); ================================================ FILE: modules/sportspress-calendars.php ================================================ define_constants(); // Actions add_action( 'init', array( $this, 'register_post_type' ) ); add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 ); add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) ); add_action( 'sportspress_widgets', array( $this, 'include_widgets' ) ); add_action( 'sportspress_create_rest_routes', array( $this, 'create_rest_routes' ) ); add_action( 'sportspress_register_rest_fields', array( $this, 'register_rest_fields' ) ); // Filters add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) ); add_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) ); add_filter( 'sportspress_event_settings', array( $this, 'add_event_settings' ) ); add_filter( 'sportspress_team_options', array( $this, 'add_team_options' ) ); add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 40 ); add_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) ); add_filter( 'sportspress_after_player_template', array( $this, 'add_player_template' ), 40 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_CALENDARS_VERSION' ) ) { define( 'SP_CALENDARS_VERSION', '2.6.15' ); } if ( ! defined( 'SP_CALENDARS_URL' ) ) { define( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_CALENDARS_DIR' ) ) { define( 'SP_CALENDARS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Register calendars post type */ public static function register_post_type() { register_post_type( 'sp_calendar', apply_filters( 'sportspress_register_post_type_calendar', array( 'labels' => array( 'name' => esc_attr__( 'Calendars', 'sportspress' ), 'singular_name' => esc_attr__( 'Calendar', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Calendar', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Calendar', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View Calendar', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => true, 'show_ui' => true, 'capability_type' => 'sp_calendar', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array( 'slug' => get_option( 'sportspress_calendar_slug', 'calendar' ) ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail' ), 'has_archive' => false, 'show_in_nav_menus' => true, 'show_in_menu' => 'edit.php?post_type=sp_event', 'show_in_admin_bar' => true, 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Posts_Controller', 'rest_base' => 'calendars', ) ) ); } /** * Remove meta boxes. */ public function remove_meta_boxes() { remove_meta_box( 'sp_seasondiv', 'sp_calendar', 'side' ); remove_meta_box( 'sp_leaguediv', 'sp_calendar', 'side' ); remove_meta_box( 'sp_venuediv', 'sp_calendar', 'side' ); } /** * Conditonally load the class and functions only needed when viewing this post type. */ public function include_post_type_handler() { include_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-calendar.php'; } /** * Add widgets. */ public function include_widgets() { include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-event-calendar.php'; include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-event-list.php'; include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-event-blocks.php'; } /** * Create REST API routes. */ public function create_rest_routes() { $controller = new SP_REST_Posts_Controller( 'sp_calendar' ); $controller->register_routes(); } /** * Register REST API fields. */ public function register_rest_fields() { register_rest_field( 'sp_calendar', 'format', array( 'get_callback' => 'SP_REST_API::get_post_meta', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Layout', 'sportspress' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_calendar', 'data', array( 'get_callback' => 'SP_REST_API::get_post_data', 'schema' => array( 'description' => esc_attr__( 'Events', 'sportspress' ), 'type' => 'array', 'context' => array( 'view' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); } /** * Add meta boxes to calendars. * * @return array */ public function add_meta_boxes( $meta_boxes ) { $meta_boxes['sp_calendar'] = array( 'shortcode' => array( 'title' => esc_attr__( 'Shortcode', 'sportspress' ), 'output' => 'SP_Meta_Box_Calendar_Shortcode::output', 'context' => 'side', 'priority' => 'default', ), 'feeds' => array( 'title' => esc_attr__( 'Feeds', 'sportspress' ), 'output' => 'SP_Meta_Box_Calendar_Feeds::output', 'context' => 'side', 'priority' => 'default', ), 'format' => array( 'title' => esc_attr__( 'Layout', 'sportspress' ), 'save' => 'SP_Meta_Box_Calendar_Format::save', 'output' => 'SP_Meta_Box_Calendar_Format::output', 'context' => 'side', 'priority' => 'default', ), 'columns' => array( 'title' => esc_attr__( 'Columns', 'sportspress' ), 'save' => 'SP_Meta_Box_Calendar_Columns::save', 'output' => 'SP_Meta_Box_Calendar_Columns::output', 'context' => 'side', 'priority' => 'default', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Calendar_Details::save', 'output' => 'SP_Meta_Box_Calendar_Details::output', 'context' => 'side', 'priority' => 'default', ), 'data' => array( 'title' => esc_attr__( 'Events', 'sportspress' ), 'save' => 'SP_Meta_Box_Calendar_Data::save', 'output' => 'SP_Meta_Box_Calendar_Data::output', 'context' => 'normal', 'priority' => 'high', ), ); return $meta_boxes; } /** * Add shortcodes. * * @return array */ public function add_shortcodes( $shortcodes ) { $shortcodes['event'][] = 'calendar'; $shortcodes['event'][] = 'list'; $shortcodes['event'][] = 'blocks'; return $shortcodes; } /** * Add event settings. * * @return array */ public function add_event_settings( $settings ) { $settings = array_merge( $settings, array( array( 'title' => esc_attr__( 'Event List', 'sportspress' ), 'type' => 'title', 'id' => 'event_list_options', ), ), apply_filters( 'sportspress_event_list_options', array( array( 'title' => esc_attr__( 'Title', 'sportspress' ), 'desc' => esc_attr__( 'Display calendar title', 'sportspress' ), 'id' => 'sportspress_event_list_show_title', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'desc' => esc_attr__( 'Display logos', 'sportspress' ), 'id' => 'sportspress_event_list_show_logos', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Title Format', 'sportspress' ), 'id' => 'sportspress_event_list_title_format', 'default' => 'title', 'type' => 'select', 'options' => array( 'title' => esc_attr__( 'Title', 'sportspress' ), 'teams' => esc_attr__( 'Teams', 'sportspress' ), 'homeaway' => sprintf( '%s | %s', esc_attr__( 'Home', 'sportspress' ), esc_attr__( 'Away', 'sportspress' ) ), ), ), array( 'title' => esc_attr__( 'Time/Results Format', 'sportspress' ), 'id' => 'sportspress_event_list_time_format', 'default' => 'combined', 'type' => 'select', 'options' => array( 'combined' => esc_attr__( 'Combined', 'sportspress' ), 'separate' => esc_attr__( 'Separate', 'sportspress' ), 'time' => esc_attr__( 'Time Only', 'sportspress' ), 'results' => esc_attr__( 'Results Only', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Pagination', 'sportspress' ), 'desc' => esc_attr__( 'Paginate', 'sportspress' ), 'id' => 'sportspress_event_list_paginated', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Limit', 'sportspress' ), 'id' => 'sportspress_event_list_rows', 'class' => 'small-text', 'default' => '10', 'desc' => esc_attr__( 'events', 'sportspress' ), 'type' => 'number', 'custom_attributes' => array( 'min' => 1, 'step' => 1, ), ), ) ), array( array( 'type' => 'sectionend', 'id' => 'event_list_options', ), array( 'title' => esc_attr__( 'Event Blocks', 'sportspress' ), 'type' => 'title', 'id' => 'event_blocks_options', ), ), apply_filters( 'sportspress_event_blocks_options', array( array( 'title' => esc_attr__( 'Title', 'sportspress' ), 'desc' => esc_attr__( 'Display calendar title', 'sportspress' ), 'id' => 'sportspress_event_blocks_show_title', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'desc' => esc_attr__( 'Display logos', 'sportspress' ), 'id' => 'sportspress_event_blocks_show_logos', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'desc' => esc_attr__( 'Display league', 'sportspress' ), 'id' => 'sportspress_event_blocks_show_league', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Display season', 'sportspress' ), 'id' => 'sportspress_event_blocks_show_season', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Display matchday', 'sportspress' ), 'id' => 'sportspress_event_blocks_show_matchday', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Display venue', 'sportspress' ), 'id' => 'sportspress_event_blocks_show_venue', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), array( 'title' => esc_attr__( 'Pagination', 'sportspress' ), 'desc' => esc_attr__( 'Paginate', 'sportspress' ), 'id' => 'sportspress_event_blocks_paginated', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Limit', 'sportspress' ), 'id' => 'sportspress_event_blocks_rows', 'class' => 'small-text', 'default' => '5', 'desc' => esc_attr__( 'events', 'sportspress' ), 'type' => 'number', 'custom_attributes' => array( 'min' => 1, 'step' => 1, ), ), ) ), array( array( 'type' => 'sectionend', 'id' => 'event_list_options', ), ) ); return $settings; } /** * Add team options. * * @return array */ public function add_team_options( $options ) { return array_merge( $options, array( array( 'title' => esc_attr__( 'Events', 'sportspress' ), 'id' => 'sportspress_team_events_format', 'default' => 'title', 'type' => 'select', 'options' => array( 'blocks' => esc_attr__( 'Blocks', 'sportspress' ), 'calendar' => esc_attr__( 'Calendar', 'sportspress' ), 'list' => esc_attr__( 'List', 'sportspress' ), ), ), ) ); } /** * Add player template. * * @return array */ public function add_player_template( $templates ) { return array_merge( $templates, array( 'events' => array( 'title' => esc_attr__( 'Events', 'sportspress' ), 'option' => 'sportspress_player_show_events', 'action' => 'sportspress_output_player_events', 'default' => 'no', ), ) ); } /** * Add player options. * * @return array */ public function add_player_options( $options ) { return array_merge( $options, array( array( 'title' => esc_attr__( 'Events', 'sportspress' ), 'id' => 'sportspress_player_events_format', 'default' => 'title', 'type' => 'select', 'options' => array( 'blocks' => esc_attr__( 'Blocks', 'sportspress' ), 'calendar' => esc_attr__( 'Calendar', 'sportspress' ), 'list' => esc_attr__( 'List', 'sportspress' ), ), ), ) ); } /** * Add team template. * * @return array */ public function add_team_template( $templates ) { return array_merge( $templates, array( 'events' => array( 'title' => esc_attr__( 'Events', 'sportspress' ), 'option' => 'sportspress_team_show_events', 'action' => 'sportspress_output_team_events', 'default' => 'no', ), ) ); } } endif; if ( get_option( 'sportspress_load_calendars_module', 'yes' ) == 'yes' ) { new SportsPress_Calendars(); } ================================================ FILE: modules/sportspress-comments-scheduled-events.php ================================================ define_constants(); // Actions add_action( 'comment_on_draft', array( $this, 'sp_publish_comment' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_COMMENTS_SCHEDULED_EVENTS_VERSION' ) ) { define( 'SP_COMMENTS_SCHEDULED_EVENTS_VERSION', '2.6.8' ); } if ( ! defined( 'SP_COMMENTS_SCHEDULED_EVENTS_URL' ) ) { define( 'SP_COMMENTS_SCHEDULED_EVENTS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_COMMENTS_SCHEDULED_EVENTS_DIR' ) ) { define( 'SP_COMMENTS_SCHEDULED_EVENTS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Save Additional Statistics */ public function sp_publish_comment( $comment_post_ID ) { do_action( 'pre_comment_on_post', $comment_post_ID ); $comment_author = ( isset( $_POST['author'] ) ) ? trim( strip_tags( sanitize_text_field( wp_unslash( $_POST['author'] ) ) ) ) : null; $comment_author_email = ( isset( $_POST['email'] ) ) ? trim( sanitize_email( wp_unslash( $_POST['email'] ) ) ) : null; $comment_author_url = ( isset( $_POST['url'] ) ) ? trim( sanitize_url( wp_unslash( $_POST['url'] ) ) ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $comment_content = ( isset( $_POST['comment'] ) ) ? trim( sanitize_text_field( wp_unslash( $_POST['comment'] ) ) ) : null; // If the user is logged in $user = wp_get_current_user(); if ( $user->exists() ) { if ( empty( $user->display_name ) ) { $user->display_name = $user->user_login; } $comment_author = $user->display_name; $comment_author_email = $user->user_email; $comment_author_url = $user->user_url; $user_ID = $user->ID; if ( current_user_can( 'unfiltered_html' ) ) { if ( ! isset( $comment_data['_wp_unfiltered_html_comment'] ) || ! wp_verify_nonce( $comment_data['_wp_unfiltered_html_comment'], 'unfiltered-html-comment_' . $comment_post_ID ) ) { kses_remove_filters(); // start with a clean slate kses_init_filters(); // set up the filters } } } else { if ( get_option( 'comment_registration' ) ) { return new WP_Error( 'not_logged_in', esc_attr__( 'Sorry, you must be logged in to comment.' ), 403 ); } } $comment_type = ''; if ( get_option( 'require_name_email' ) && ! $user->exists() ) { if ( '' == $comment_author_email || '' == $comment_author ) { // return new WP_Error( 'require_name_email', esc_attr__( 'ERROR: please fill the required fields (name, email).' ), 200 ); wp_die( wp_kses_post( __( 'ERROR: please fill the required fields (name, email).' ) ), esc_attr__( 'ERROR: please fill the required fields (name, email).' ), array( 'back_link' => true ) ); } elseif ( ! is_email( $comment_author_email ) ) { // return new WP_Error( 'require_valid_email', esc_attr__( 'ERROR: please enter a valid email address.' ), 200 ); wp_die( wp_kses_post( __( 'ERROR: please enter a valid email address.' ) ), esc_attr__( 'ERROR: please enter a valid email address.' ), array( 'back_link' => true ) ); } } if ( '' == $comment_content ) { // return new WP_Error( 'require_valid_comment', esc_attr__( 'ERROR: please type a comment.' ), 200 ); wp_die( wp_kses_post( __( 'ERROR: please type a comment.' ) ), esc_attr__( 'ERROR: please type a comment.' ), array( 'back_link' => true ) ); } $comment_parent = isset( $_POST['comment_parent'] ) ? absint( $_POST['comment_parent'] ) : 0; $commentdata = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID' ); $check_max_lengths = wp_check_comment_data_max_lengths( $commentdata ); if ( is_wp_error( $check_max_lengths ) ) { return $check_max_lengths; } $comment_id = wp_new_comment( wp_slash( $commentdata ), true ); if ( is_wp_error( $comment_id ) ) { return $comment_id; } if ( ! $comment_id ) { // return new WP_Error( 'comment_save_error', esc_attr__( 'ERROR: The comment could not be saved. Please try again later.' ), 500 ); wp_die( wp_kses_post( __( 'ERROR: 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 ) ); } $comment = get_comment( $comment_id ); do_action( 'set_comment_cookies', $comment, $user ); if ( $user->exists() ) { wp_set_comment_status( $comment_id, 'approve' ); } $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 $location = apply_filters( 'comment_post_redirect', $location, $comment ); wp_safe_redirect( $location ); exit; } } endif; new SportsPress_Comments_Scheduled_Events(); ================================================ FILE: modules/sportspress-conditional-equations.php ================================================ define_constants(); // Add hooks for filters add_filter( 'sportspress_equation_options', array( $this, 'add_options' ) ); add_filter( 'sportspress_equation_alter', array( $this, 'alter_equation' ), 10, 2 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_CONDITIONAL_EQUATIONS_VERSION' ) ) { define( 'SP_CONDITIONAL_EQUATIONS_VERSION', '2.7.23' ); } if ( ! defined( 'SP_CONDITIONAL_EQUATIONS_URL' ) ) { define( 'SP_CONDITIONAL_EQUATIONS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_CONDITIONAL_EQUATIONS_DIR' ) ) { define( 'SP_CONDITIONAL_EQUATIONS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add additional options. * * @return array */ public function add_options( $options ) { $options['Operators']['>'] = '>'; $options['Operators']['<'] = '<'; $options['Operators']['=='] = '≡'; $options['Operators']['!='] = '≠'; $options['Operators']['>='] = '≥'; $options['Operators']['<='] = '≤'; return $options; } /** * Alter the equation. * * @param string $equation The equation to alter. * @param array $vars Variables to use in the equation. * @return string */ public function alter_equation( $equation, $vars ) { // Check if the equation contains any conditional operators if ( ! preg_match( '/[><=!]/', $equation ) ) { // If no conditional operators, return the equation as-is return $equation; } // Replace all variables in the equation with their values foreach ( $vars as $var_name => $var_value ) { if ( is_null( $var_value ) || $var_value === '' ) { continue; } if ( is_array( $var_value ) ) { continue; } $var_value = (string) $var_value; $equation = str_replace( '$' . $var_name, $var_value, $equation ); } // Remove spaces from the equation $equation = str_replace( ' ', '', $equation ); // Evaluate sub-expressions in parentheses first while ( preg_match( '/\(([^()]+)\)/', $equation, $matches ) ) { $sub_expr = $matches[1]; // Extract the innermost sub-expression // Check for conditional operators in the sub-expression if ( preg_match( '/[><=!]/', $sub_expr ) ) { $evaluated = $this->evaluate_condition( $sub_expr ); // Evaluate the condition } else { $evaluated = $this->evaluate_expression( $sub_expr ); // Evaluate as a mathematical expression } // Replace the sub-expression with its evaluated value $equation = str_replace( '(' . $sub_expr . ')', $evaluated, $equation ); } // Evaluate the fully reduced equation as a mathematical expression return $this->evaluate_expression( $equation ); } /** * Evaluate a conditional expression (e.g., "20 > 10"). * * @param string $expression The conditional expression to evaluate. * @return int 1 for true, 0 for false. */ private function evaluate_condition( $expression ) { try { // Parse the condition into left operand, operator, and right operand preg_match( '/(.+?)([><=!]+)(.+)/', $expression, $matches ); $left_operand = $this->evaluate_expression( trim( $matches[1] ) ); $operator = $matches[2]; $right_operand = $this->evaluate_expression( trim( $matches[3] ) ); // Evaluate the condition switch ( $operator ) { case '>': return (int) ( $left_operand > $right_operand ); case '<': return (int) ( $left_operand < $right_operand ); case '>=': return (int) ( $left_operand >= $right_operand ); case '<=': return (int) ( $left_operand <= $right_operand ); case '==': return (int) ( $left_operand == $right_operand ); case '!=': return (int) ( $left_operand != $right_operand ); default: return 0; } } catch ( Exception $e ) { return 0; } } /** * Evaluate a mathematical expression safely. * * @param string $expression The expression to evaluate. * @return float The result of the evaluation. */ private function evaluate_expression( $expression ) { try { // Include libraries if necessary (e.g., eqEOS) if ( ! class_exists( 'phpStack' ) ) { include_once SP()->plugin_path() . '/includes/libraries/class-phpstack.php'; } if ( ! class_exists( 'eqEOS' ) ) { include_once SP()->plugin_path() . '/includes/libraries/class-eqeos.php'; } // Use eqEOS to safely evaluate the expression $eos = new eqEOS(); return $eos->solveIF( $expression ); } catch ( Exception $e ) { return 0; } } } endif; new SportsPress_Conditional_Equations(); ================================================ FILE: modules/sportspress-countdowns.php ================================================ define_constants(); // Actions add_action( 'sportspress_widgets', array( $this, 'include_widgets' ) ); // Filters add_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) ); add_filter( 'sportspress_event_settings', array( $this, 'add_settings' ) ); add_filter( 'sportspress_text', array( $this, 'add_text_options' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_COUNTDOWNS_VERSION' ) ) { define( 'SP_COUNTDOWNS_VERSION', '2.7' ); } if ( ! defined( 'SP_COUNTDOWNS_URL' ) ) { define( 'SP_COUNTDOWNS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_COUNTDOWNS_DIR' ) ) { define( 'SP_COUNTDOWNS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add widgets. * * @return array */ public function include_widgets() { include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-countdown.php'; } /** * Add shortcodes. * * @return array */ public function add_shortcodes( $shortcodes ) { $shortcodes['event'][] = 'countdown'; return $shortcodes; } /** * Add settings. * * @return array */ public function add_settings( $settings ) { $settings = array_merge( $settings, array( array( 'title' => esc_attr__( 'Countdown', 'sportspress' ), 'type' => 'title', 'id' => 'countdown_options', ), ), apply_filters( 'sportspress_countdown_options', array( array( 'title' => esc_attr__( 'Display', 'sportspress' ), 'desc' => esc_attr__( 'Logos', 'sportspress' ), 'id' => 'sportspress_countdown_show_logos', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Featured Image', 'sportspress' ), 'id' => 'sportspress_countdown_show_thumbnail', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), ) ), array( array( 'type' => 'sectionend', 'id' => 'countdown_options', ), ) ); return $settings; } /** * Add text options */ public function add_text_options( $options = array() ) { return array_merge( $options, array( __( 'days', 'sportspress' ), __( 'hrs', 'sportspress' ), __( 'mins', 'sportspress' ), __( 'secs', 'sportspress' ), ) ); } } endif; new SportsPress_Countdowns(); ================================================ FILE: modules/sportspress-default-nationality.php ================================================ define_constants(); add_filter( 'sportspress_general_options', array( $this, 'add_general_options' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_DEFAULT_NATIONALITY_VERSION' ) ) { define( 'SP_DEFAULT_NATIONALITY_VERSION', '2.6.18' ); } if ( ! defined( 'SP_DEFAULT_NATIONALITY_URL' ) ) { define( 'SP_DEFAULT_NATIONALITY_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_DEFAULT_NATIONALITY_DIR' ) ) { define( 'SP_DEFAULT_NATIONALITY_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add option to SportsPress General Settings. */ public function add_general_options( $settings ) { $countries[''] = esc_attr__( '— None —', 'sportspress' ); $sp_countries = new SP_Countries(); $countries = array_merge( $countries, $sp_countries->countries ); $settings[] = array( 'title' => esc_attr__( 'Default Nationality', 'sportspress' ), 'id' => 'sportspress_default_nationality', 'default' => '', 'type' => 'select', 'options' => $countries, ); return $settings; } } endif; new SportsPress_Default_Nationality(); ================================================ FILE: modules/sportspress-event-specs.php ================================================ define_constants(); // Actions add_action( 'init', array( $this, 'register_post_type' ) ); add_action( 'sportspress_config_page', array( $this, 'sp_specs_config' ), 9 ); add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) ); add_action( 'sportspress_event_list_head_row', array( $this, 'event_list_head_row' ), 11 ); add_action( 'sportspress_event_list_row', array( $this, 'event_list_row' ), 11, 2 ); add_action( 'sportspress_event_blocks_after', array( $this, 'event_blocks_after' ), 11, 2 ); // Filters add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) ); add_filter( 'sportspress_screen_ids', array( $this, 'screen_ids' ) ); add_filter( 'sportspress_config_types', array( $this, 'add_post_type' ) ); add_filter( 'sportspress_event_details', array( $this, 'event_details' ), 10, 2 ); add_filter( 'sportspress_calendar_columns', array( $this, 'calendar_columns' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_EVENT_SPECS_VERSION' ) ) { define( 'SP_EVENT_SPECS_VERSION', '2.6.15' ); } if ( ! defined( 'SP_EVENT_SPECS_URL' ) ) { define( 'SP_EVENT_SPECS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_EVENT_SPECS_DIR' ) ) { define( 'SP_EVENT_SPECS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Register event specs post type */ public static function register_post_type() { register_post_type( 'sp_spec', apply_filters( 'sportspress_register_post_type_spec', array( 'labels' => array( 'name' => esc_attr__( 'Event Specs', 'sportspress' ), 'singular_name' => esc_attr__( 'Event Spec', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Event Spec', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Event Spec', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => false, 'show_ui' => true, 'capability_type' => 'sp_config', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'hierarchical' => false, 'supports' => array( 'title', 'page-attributes', 'excerpt' ), 'has_archive' => false, 'show_in_nav_menus' => false, 'can_export' => false, 'show_in_menu' => false, ) ) ); } /** * Add screen ids. * * @return array */ public function screen_ids( $ids ) { return array_merge( $ids, array( 'edit-sp_spec', 'sp_spec', ) ); } public static function add_post_type( $post_types = array() ) { $post_types[] = 'sp_spec'; return $post_types; } /** * Conditonally load the class and functions only needed when viewing this post type. */ public function include_post_type_handler() { include_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-spec.php'; } /** * Display Event Specs Table at Config Page * * @return null */ public function sp_specs_config() { ?>
    ', esc_html__( 'Upgrade message from the plugin author:', 'tgmpa' ), ' ', wp_kses_data( $item['upgrade_notice'] ), '
    'sp_spec', 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $data = get_posts( $args ); ?>

    >
    post_title ); ?> post_name ); ?>

    post_excerpt ); ?>


    array( 'title' => esc_attr__( 'Specs', 'sportspress' ), 'save' => 'SP_Meta_Box_Spec_Details::save', 'output' => 'SP_Meta_Box_Spec_Details::output', 'context' => 'normal', 'priority' => 'high', ), ); $meta_boxes['sp_event']['specs'] = array( 'title' => esc_attr__( 'Specs', 'sportspress' ), 'save' => 'SP_Meta_Box_Event_Specs::save', 'output' => 'SP_Meta_Box_Event_Specs::output', 'context' => 'side', 'priority' => 'default', ); return $meta_boxes; } /** * Add event details. * * @return array */ public function event_details( $data, $id ) { $event = new SP_Event( $id ); $specs_before = $event->specs( true ); $specs_after = $event->specs( false ); $data = array_merge( $specs_before, $data, $specs_after ); return $data; } /** * Add calendar columns. * * @return array */ public function calendar_columns( $columns = array() ) { $columns['event_specs'] = esc_attr__( 'Event Specs', 'sportspress' ); return $columns; } /** * Event list head row. */ public function event_list_head_row( $usecolumns = array() ) { if ( sp_column_active( $usecolumns, 'event_specs' ) ) { $spec_labels = (array) sp_get_var_labels( 'sp_spec', null, false ); if ( empty( $spec_labels ) ) { return; } foreach ( $spec_labels as $spec_label ) { ?> specs( false ); $spec_labels = (array) sp_get_var_labels( 'sp_spec', null, false ); foreach ( $spec_labels as $spec_label ) { ?> specs( false ); $spec_labels = (array) sp_get_var_labels( 'sp_spec', null, false ); foreach ( $specs as $spec_label => $spec_value ) { echo '
    ' . wp_kses_post( $spec_label ) . ': ' . wp_kses_post( $spec_value ) . '
    '; } } } } endif; new SportsPress_Event_Specs(); ================================================ FILE: modules/sportspress-event-status.php ================================================ define_constants(); add_action( 'init', array( $this, 'get_statuses' ) ); add_action( 'post_submitbox_misc_actions', array( $this, 'section' ) ); add_action( 'sportspress_process_sp_event_meta', array( $this, 'save' ), 10, 1 ); add_filter( 'sportspress_event_time', array( $this, 'filter' ), 10, 2 ); add_filter( 'sportspress_event_time_admin', array( $this, 'filter' ), 10, 2 ); add_filter( 'sportspress_main_results_or_time', array( $this, 'filter_array' ), 10, 2 ); add_filter( 'sportspress_event_blocks_team_result_or_time', array( $this, 'filter_array' ), 10, 2 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_EVENT_STATUS_VERSION' ) ) { define( 'SP_EVENT_STATUS_VERSION', '2.1' ); } if ( ! defined( 'SP_EVENT_STATUS_URL' ) ) { define( 'SP_EVENT_STATUS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_EVENT_STATUS_DIR' ) ) { define( 'SP_EVENT_STATUS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Define statuses. */ public function get_statuses() { $this->statuses = apply_filters( 'sportspress_event_statuses', array( 'ok' => esc_attr__( 'On time', 'sportspress' ), 'tbd' => esc_attr__( 'TBD', 'sportspress' ), 'postponed' => esc_attr__( 'Postponed', 'sportspress' ), 'cancelled' => esc_attr__( 'Canceled', 'sportspress' ), ) ); } /** * Add status section to submit box. */ public function section() { if ( 'sp_event' !== get_post_type() ) { return; } $status = get_post_meta( get_the_ID(), 'sp_status', true ); if ( ! $status ) { $status = 'ok'; } ?>
    statuses[ $status ] ); ?>
    statuses as $value => $label ) { ?>

    OK Cancel

    statuses ) ) { return $time; } return $this->statuses[ $status ]; } /** * Event time array filter. */ public function filter_array( $array, $post_id = 0 ) { if ( ! $post_id ) { $post_id = get_the_ID(); } $status = get_post_meta( $post_id, 'sp_status', true ); if ( ! $status || 'ok' === $status || ! array_key_exists( $status, $this->statuses ) ) { return $array; } return array( $this->statuses[ $status ] ); } } endif; new SportsPress_Event_Status(); ================================================ FILE: modules/sportspress-event-videos.php ================================================ define_constants(); // Filters add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_box' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_EVENT_VIDEOS_VERSION' ) ) { define( 'SP_EVENT_VIDEOS_VERSION', '1.8.3' ); } if ( ! defined( 'SP_EVENT_VIDEOS_URL' ) ) { define( 'SP_EVENT_VIDEOS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_EVENT_VIDEOS_DIR' ) ) { define( 'SP_EVENT_VIDEOS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add meta box to events. * * @return array */ public function add_meta_box( $meta_boxes ) { $meta_boxes['sp_event']['video'] = array( 'title' => esc_attr__( 'Video', 'sportspress' ), 'output' => 'SP_Meta_Box_Event_Video::output', 'save' => 'SP_Meta_Box_Event_Video::save', 'context' => 'side', 'priority' => 'low', ); return $meta_boxes; } } endif; new SportsPress_Event_Videos(); ================================================ FILE: modules/sportspress-gutenberg.php ================================================ define_constants(); add_filter( 'gutenberg_can_edit_post_type', array( $this, 'can_edit_post_type' ), 10, 2 ); add_filter( 'use_block_editor_for_post_type', array( $this, 'can_edit_post_type' ), 10, 2 ); // add_filter( 'block_categories', array( $this, 'add_category' ), 10, 2 ); // add_action( 'enqueue_block_editor_assets', array( $this, 'load_blocks' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_GUTENBERG_VERSION' ) ) { define( 'SP_GUTENBERG_VERSION', '2.6.13' ); } if ( ! defined( 'SP_GUTENBERG_URL' ) ) { define( 'SP_GUTENBERG_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_GUTENBERG_DIR' ) ) { define( 'SP_GUTENBERG_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Modify Gutenberg behavior for custom post types. */ function can_edit_post_type( $enabled, $post_type ) { return is_sp_post_type( $post_type ) ? false : $enabled; } /** * Add SportsPress category to Gutenberg. */ function add_category( $categories, $post ) { return array_merge( $categories, array( array( 'slug' => 'sportspress', 'title' => esc_attr__( 'SportsPress', 'sportspress' ), ), ) ); } /** * Load Gutenberg blocks. */ function load_blocks() { wp_enqueue_script( 'sp-block-event-calendar', plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/js/blocks/event-calendar.js', array( 'wp-blocks', 'wp-editor' ), true ); $strings = apply_filters( 'sportspress_localized_strings', array( 'event_calendar' => esc_attr__( 'Event Calendar', 'sportspress' ), 'properties' => esc_attr__( 'Properties', 'sportspress' ), 'title' => esc_attr__( 'Title', 'sportspress' ), 'select_calendar' => sprintf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ), 'all' => esc_attr__( 'All', 'sportspress' ), ) ); $posts = array( 'events' => (array) get_posts( array( 'post_type' => 'sp_event', 'posts_per_page' => -1, ) ), ); wp_localize_script( 'sp-block-event-calendar', 'strings', $strings ); wp_localize_script( 'sp-block-event-calendar', 'posts', $posts ); } } endif; new SportsPress_Gutenberg(); ================================================ FILE: modules/sportspress-icons.php ================================================ define_constants(); // Define icons $this->get_icons(); add_filter( 'sportspress_enqueue_styles', array( $this, 'add_styles' ) ); add_filter( 'sportspress_performance_icon', array( $this, 'icon' ), 10, 2 ); add_filter( 'sportspress_event_performance_icons', array( $this, 'replace_icons' ), 10, 3 ); add_filter( 'admin_post_thumbnail_html', array( $this, 'sp_admin_post_thumbnail_html' ), 10, 2 ); add_action( 'sportspress_process_sp_performance_meta', array( $this, 'save' ), 10, 2 ); add_action( 'sportspress_process_sp_statistic_meta', array( $this, 'save' ), 10, 2 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_ICONS_VERSION' ) ) { define( 'SP_ICONS_VERSION', '2.7.26' ); } if ( ! defined( 'SP_ICONS_URL' ) ) { define( 'SP_ICONS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_ICONS_DIR' ) ) { define( 'SP_ICONS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add stylesheet. */ public static function add_styles( $styles = array() ) { $styles['sportspress-icons'] = array( 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/icons.css', 'deps' => '', 'version' => SP_ICONS_VERSION, 'media' => 'all', ); return $styles; } /** * Define icons. */ private function get_icons() { $this->icons = apply_filters( 'sportspress_icons', array( 'soccerball', 'soccerball-alt', 'baseball', 'baseball-alt', 'basketball', 'golfball', 'cricketball', 'bowling', 'ice-hockey', 'football', 'poolball', 'table-tennis', 'tennis', 'racing-flag', 'shoe', 'card', 'league', 'shield', 'tshirt', 'whistle', 'time', 'friendly', 'sub', 'update', 'undo', 'redo', 'marker', 'no', 'heart', 'star-filled', ) ); } /** * Display vector icon. */ public function icon( $icon = '', $id = 0 ) { if ( ! $id ) { return $icon; } $meta = get_post_meta( $id, 'sp_icon', true ); if ( null !== $meta && in_array( $meta, $this->icons ) ) { $color = get_post_meta( $id, 'sp_color', true ); $icon = ''; } return $icon; } /** * Replace icons with vectors when available. */ public function replace_icons( $icons = '', $id = 0, $value = 0 ) { if ( ! $id || ! $value ) { return $icons; } $icon = get_post_meta( $id, 'sp_icon', true ); if ( null !== $icon && in_array( $icon, $this->icons ) ) { $title = sp_get_singular_name( $id ); $color = get_post_meta( $id, 'sp_color', true ); preg_match( '#\((.*?)\)#', $value, $match ); if ( ! empty( $match ) && isset( $match[1] ) ) { $icons = ' ' . $match[1] . '
    '; } else { $icons = str_repeat( ' ', intval( $value ) ); } }else{ // Check if the performance has a thumbnail ID $thumbnail_id = get_post_meta( $id, '_thumbnail_id', true ); if ( ! empty( $thumbnail_id ) ) { $title = sp_get_singular_name( $id ); preg_match( '#\((.*?)\)#', $value, $match ); // Get the URL of the thumbnail image $custom_image = wp_get_attachment_image( $thumbnail_id, 'sportspress-fit-mini', "", array( "title" => $title ) ); if ( ! empty( $custom_image ) && ! empty( $match ) && isset( $match[1] ) ) { $icons = $custom_image . $match[1] . '
    '; }else{ $icons = str_repeat( $custom_image . ' ', intval( $value ) ); } } } return $icons; } /** * Post thumbnail HTML. */ public function sp_admin_post_thumbnail_html( $content = '', $id = 0 ) { // Bypass if no ID if ( ! $id ) { return $content; } // Bypass if not performance or statistic post type $post_type = get_post_type( $id ); if ( 'sp_performance' !== $post_type && 'sp_statistic' !== $post_type ) { return $content; } // Detect if image uploaded $is_uploaded = isset( $_POST['thumbnail_id'] ); // Enqueue scripts wp_enqueue_script( 'sp_iconpicker', SP()->plugin_url() . '/assets/js/admin/iconpicker.js', array( 'jquery', 'wp-color-picker', 'iris' ), SP_ICONS_VERSION, true ); // Get selected icon $has_icon = has_post_thumbnail( $id ); if ( $has_icon ) { $selected = null; } else { $selected = $is_uploaded ? null : get_post_meta( $id, 'sp_icon', true ); } // Generate icon selector $icons = ''; foreach ( $this->icons as $icon ) { $icons .= ''; } $icons .= ''; // Get color value $value = get_post_meta( $id, 'sp_color', true ); if ( empty( $value ) ) { $value = '111111'; } $color = '
    '; $content = '

    ' . esc_attr__( 'Select Icon', 'sportspress' ) . '

    ' . $icons . '

    ' . $color . '
    ' . $content . '
    '; return $content; } /** * Save meta boxes data */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_icon', sp_array_value( $_POST, 'sp_icon', null ) ); update_post_meta( $post_id, 'sp_color', sp_array_value( $_POST, 'sp_color', null ) ); if ( null != sp_array_value( $_POST, 'sp_icon', null ) ) { delete_post_thumbnail( $post ); } } } endif; new SportsPress_Icons(); ================================================ FILE: modules/sportspress-importers.php ================================================ define_constants(); add_action( 'init', array( $this, 'includes' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_IMPORTERS_VERSION' ) ) { define( 'SP_IMPORTERS_VERSION', '1.8.3' ); } if ( ! defined( 'SP_IMPORTERS_URL' ) ) { define( 'SP_IMPORTERS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_IMPORTERS_DIR' ) ) { define( 'SP_IMPORTERS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Include importers. */ public function includes() { if ( is_admin() && defined( 'WP_LOAD_IMPORTERS' ) ) { include SP()->plugin_path() . '/includes/admin/class-sp-admin-importers.php'; } } } endif; new SportsPress_Importers(); ================================================ FILE: modules/sportspress-lazy-loading.php ================================================ 'menu_order', ); if ( $team ) { $args['meta_query'] = array( array( 'key' => 'sp_current_team', 'value' => sp_array_value( $_POST, 'team' ), ), ); } if ( $league || $season ) { $args['tax_query'] = array( 'relation' => 'AND' ); if ( $league ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league, ); } if ( $season ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season, ); } } $player_sort = get_option( 'sportspress_event_player_sort', 'jersey' ); if ( $player_sort == 'name' ) { $args['order'] = 'ASC'; $args['orderby'] = 'title'; } else // default 'jersey' { $args['meta_key'] = 'sp_number'; $args['orderby'] = 'meta_value_num'; $args['order'] = 'ASC'; } $player_args = $args; $players = sp_get_posts( 'sp_player', $player_args ); $staff = sp_get_posts( 'sp_staff', $args ); $data = array( 'index' => $index ); foreach ( $players as $key => $value ) { switch ( $player_sort ) { case 'name': $players[ $key ]->post_title = sp_get_player_name_then_number( $value->ID ); break; default: // 'jersey' $players[ $key ]->post_title = sp_get_player_name_with_number( $value->ID ); break; } } $data['players'] = $players; $data['staff'] = $staff; $data['sections'] = get_option( 'sportspress_event_performance_sections', -1 ); wp_send_json_success( $data ); } /** * Ajax checklist. */ public function checklist( $post_id = null, $post_type = 'post', $display = 'block', $team = null, $index = null, $slug = null ) { if ( ! isset( $slug ) ) : $slug = $post_type; endif; $selected = (array) get_post_meta( $post_id, $slug, false ); if ( sizeof( $selected ) ) { $selected = sp_array_between( $selected, 0, $index ); } else { $selected = sp_array_between( (array) get_post_meta( $post_id, $post_type, false ), 0, $index ); } if ( 'yes' == get_option( 'sportspress_event_filter_teams_by_league', 'no' ) ) { $leagues = get_the_terms( $post_id, 'sp_league' ); } else { $leagues = false; } if ( 'yes' == get_option( 'sportspress_event_filter_teams_by_season', 'no' ) ) { $seasons = get_the_terms( $post_id, 'sp_season' ); } else { $seasons = false; } $args = array( 'orderby' => 'menu_order', ); $player_sort = get_option( 'sportspress_event_player_sort', 'jersey' ); if ( 'sp_player' == $post_type ) { if ( $player_sort == 'name' ) { $args['order'] = 'ASC'; $args['orderby'] = 'title'; } else // default 'jersey' { $args['meta_key'] = 'sp_number'; $args['orderby'] = 'meta_value_num'; $args['order'] = 'ASC'; } } $args['meta_query'] = array( array( 'key' => 'sp_current_team', 'value' => $team, ), ); if ( $leagues || $seasons ) { $args['tax_query'] = array( 'relation' => 'AND' ); if ( $leagues ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => wp_list_pluck( $leagues, 'term_id' ), ); } if ( $seasons ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => wp_list_pluck( $seasons, 'term_id' ), ); } } $posts = sp_get_posts( $post_type, $args ); $post_ids = wp_list_pluck( $posts, 'ID' ); $diff = array_diff( $post_ids, $selected ); $borrowed = array_diff( $selected, $post_ids ); $selected = array_flip( $selected ); if ( sizeof( $borrowed ) ) { $args = array( 'post__in' => $borrowed ); $borrowed_posts = sp_get_posts( $post_type, $args ); if ( is_array( $borrowed_posts ) ) { $posts += $borrowed_posts; } } ?>
    • ID ] ); ?> $post ) { ?>
    esc_attr__( 'No results found.', 'sportspress' ), 'select_all' => esc_attr__( 'Select All', 'sportspress' ), 'show_all' => esc_attr__( 'Show all', 'sportspress' ), 'loading' => esc_attr__( 'Loading…', 'sportspress' ), 'option_filter_by_league' => get_option( 'sportspress_event_filter_teams_by_league', 'no' ), 'option_filter_by_season' => get_option( 'sportspress_event_filter_teams_by_season', 'no' ), ) ); return $strings; } } endif; new SportsPress_Lazy_Loading(); ================================================ FILE: modules/sportspress-league-tables.php ================================================ define_constants(); // Actions add_action( 'init', array( $this, 'register_post_type' ) ); add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 ); add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) ); add_action( 'sportspress_widgets', array( $this, 'include_widgets' ) ); add_action( 'sportspress_create_rest_routes', array( $this, 'create_rest_routes' ) ); add_action( 'sportspress_register_rest_fields', array( $this, 'register_rest_fields' ) ); // Filters add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) ); add_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) ); add_filter( 'sportspress_team_settings', array( $this, 'add_settings' ) ); add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 30 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_LEAGUE_TABLES_VERSION' ) ) { define( 'SP_LEAGUE_TABLES_VERSION', '2.6.15' ); } if ( ! defined( 'SP_LEAGUE_TABLES_URL' ) ) { define( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_LEAGUE_TABLES_DIR' ) ) { define( 'SP_LEAGUE_TABLES_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Register league tables post type */ public static function register_post_type() { register_post_type( 'sp_table', apply_filters( 'sportspress_register_post_type_table', array( 'labels' => array( 'name' => esc_attr__( 'League Tables', 'sportspress' ), 'singular_name' => esc_attr__( 'League Table', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New League Table', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit League Table', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View League Table', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => true, 'show_ui' => true, 'capability_type' => 'sp_table', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array( 'slug' => get_option( 'sportspress_table_slug', 'table' ) ), 'supports' => array( 'title', 'editor', 'page-attributes', 'thumbnail' ), 'has_archive' => false, 'show_in_nav_menus' => true, 'show_in_menu' => 'edit.php?post_type=sp_team', 'show_in_admin_bar' => true, 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Posts_Controller', 'rest_base' => 'tables', ) ) ); } /** * Remove meta boxes. */ public function remove_meta_boxes() { remove_meta_box( 'sp_seasondiv', 'sp_table', 'side' ); remove_meta_box( 'sp_leaguediv', 'sp_table', 'side' ); } /** * Conditonally load the class and functions only needed when viewing this post type. */ public function include_post_type_handler() { include_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-table.php'; } /** * Add widgets. * * @return array */ public function include_widgets() { include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-league-table.php'; include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-team-gallery.php'; } /** * Create REST API routes. */ public function create_rest_routes() { $controller = new SP_REST_Posts_Controller( 'sp_table' ); $controller->register_routes(); } /** * Register REST API fields. */ public function register_rest_fields() { register_rest_field( 'sp_table', 'data', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_arrays', 'schema' => array( 'description' => esc_attr__( 'League Table', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); } /** * Add meta boxes. * * @return array */ public function add_meta_boxes( $meta_boxes ) { if ( 'yes' == get_option( 'sportspress_team_column_editing', 'no' ) ) { $meta_boxes['sp_team']['columns'] = array( 'title' => esc_attr__( 'Table Columns', 'sportspress' ), 'output' => 'SP_Meta_Box_Team_Columns::output', 'save' => 'SP_Meta_Box_Team_Columns::save', 'context' => 'normal', 'priority' => 'high', ); } $meta_boxes['sp_team']['tables'] = array( 'title' => esc_attr__( 'League Tables', 'sportspress' ), 'output' => 'SP_Meta_Box_Team_Tables::output', 'save' => 'SP_Meta_Box_Team_Tables::save', 'context' => 'normal', 'priority' => 'high', ); $meta_boxes['sp_table'] = array( 'mode' => array( 'title' => esc_attr__( 'Mode', 'sportspress' ), 'save' => 'SP_Meta_Box_Table_Mode::save', 'output' => 'SP_Meta_Box_Table_Mode::output', 'context' => 'side', 'priority' => 'default', ), 'shortcode' => array( 'title' => esc_attr__( 'Shortcode', 'sportspress' ), 'output' => 'SP_Meta_Box_Table_Shortcode::output', 'context' => 'side', 'priority' => 'default', ), 'format' => array( 'title' => esc_attr__( 'Layout', 'sportspress' ), 'save' => 'SP_Meta_Box_Table_Format::save', 'output' => 'SP_Meta_Box_Table_Format::output', 'context' => 'side', 'priority' => 'default', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_Table_Details::save', 'output' => 'SP_Meta_Box_Table_Details::output', 'context' => 'side', 'priority' => 'default', ), 'data' => array( 'title' => esc_attr__( 'League Table', 'sportspress' ), 'save' => 'SP_Meta_Box_Table_Data::save', 'output' => 'SP_Meta_Box_Table_Data::output', 'context' => 'normal', 'priority' => 'high', ), ); return $meta_boxes; } /** * Add shortcodes. * * @return array */ public function add_shortcodes( $shortcodes ) { $shortcodes['team'][] = 'standings'; $shortcodes['team'][] = 'gallery'; return $shortcodes; } /** * Add settings. * * @return array */ public function add_settings( $settings ) { return array_merge( $settings, array( array( 'title' => esc_attr__( 'League Tables', 'sportspress' ), 'type' => 'title', 'id' => 'table_options', ), ), apply_filters( 'sportspress_table_options', array( array( 'title' => esc_attr__( 'Title', 'sportspress' ), 'desc' => esc_attr__( 'Display title', 'sportspress' ), 'id' => 'sportspress_table_show_title', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'desc' => esc_attr__( 'Display logos', 'sportspress' ), 'id' => 'sportspress_table_show_logos', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Pagination', 'sportspress' ), 'desc' => esc_attr__( 'Paginate', 'sportspress' ), 'id' => 'sportspress_table_paginated', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Limit', 'sportspress' ), 'id' => 'sportspress_table_rows', 'class' => 'small-text', 'default' => '10', 'desc' => esc_attr__( 'teams', 'sportspress' ), 'type' => 'number', 'custom_attributes' => array( 'min' => 1, 'step' => 1, ), ), array( 'title' => esc_attr__( 'Form', 'sportspress' ), 'id' => 'sportspress_form_limit', 'class' => 'small-text', 'default' => '5', 'desc' => esc_attr__( 'events', 'sportspress' ), 'type' => 'number', 'custom_attributes' => array( 'min' => 1, 'step' => 1, ), ), array( 'title' => esc_attr__( 'Pos', 'sportspress' ), 'desc' => esc_attr__( 'Always increment', 'sportspress' ), 'id' => 'sportspress_table_increment', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Tiebreaker', 'sportspress' ), 'id' => 'sportspress_table_tiebreaker', 'default' => 'none', 'type' => 'select', 'options' => array( 'none' => esc_attr__( 'None', 'sportspress' ), 'h2h' => esc_attr__( 'Head to head', 'sportspress' ), ), ), ) ), array( array( 'type' => 'sectionend', 'id' => 'table_options', ), ) ); } /** * Add team template. * * @return array */ public function add_team_template( $templates ) { return array_merge( $templates, array( 'tables' => array( 'title' => esc_attr__( 'League Tables', 'sportspress' ), 'label' => esc_attr__( 'League Table', 'sportspress' ), 'option' => 'sportspress_team_show_tables', 'action' => 'sportspress_output_team_tables', 'default' => 'yes', ), ) ); } } endif; if ( get_option( 'sportspress_load_league_tables_module', 'yes' ) == 'yes' ) { new SportsPress_League_Tables(); /** * Create alias of SP_League_Table class for REST API. * Note: class_alias is not supported in PHP < 5.3 so extend the original class instead. */ class SP_Table extends SP_League_Table {} } ================================================ FILE: modules/sportspress-next-team-preset.php ================================================ define_constants(); $this->link_events = get_option( 'sportspress_link_events', 'yes' ) === 'yes' ? true : false; // Filters add_filter( 'sportspress_equation_options', array( $this, 'add_options' ) ); add_filter( 'sportspress_equation_presets', array( $this, 'presets' ) ); add_filter( 'sportspress_equation_solve_for_presets', array( $this, 'solve' ), 10, 3 ); add_filter( 'sportspress_table_options', array( $this, 'add_settings' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_NEXT_TEAM_PRESET_VERSION' ) ) { define( 'SP_NEXT_TEAM_PRESET_VERSION', '2.7.17' ); } if ( ! defined( 'SP_NEXT_TEAM_PRESET_URL' ) ) { define( 'SP_NEXT_TEAM_PRESET_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_NEXT_TEAM_PRESET_DIR' ) ) { define( 'SP_NEXT_TEAM_PRESET_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add additional options. * * @return array */ public function add_options( $options ) { $options['Presets']['$nextteam'] = esc_attr__( 'Next Team', 'sportspress' ); return $options; } /** * Add preset * * @return array */ public function presets( $presets ) { $presets[] = '$nextteam'; return $presets; } /** * Solve preset * * @return mixed */ public function solve( $input, $equation, $post_id ) { if ( strpos( $equation, '$nextteam' ) !== false ) { $args = array( 'post_type' => 'sp_event', 'numberposts' => 1, 'posts_per_page' => 1, 'post_status' => 'future', 'meta_query' => array( array( 'key' => 'sp_team', 'value' => $post_id, 'compare' => 'IN', ), ), 'order' => 'ASC', ); if ( get_option( 'sportspress_table_next_team_filter_league', 'no' ) === 'yes' ) { $leagues = get_the_terms( $post_id, 'sp_league' ); if ( ! isset( $league_ids ) ) { $league_ids = array(); } if ( empty( $league_ids ) && $leagues ) : foreach ( $leagues as $league ) : $league_ids[] = $league->term_id; endforeach; endif; $league_ids = sp_add_auto_term( $league_ids, $post_id, 'sp_league' ); if ( isset( $league_ids ) ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ); } } $events = get_posts( $args ); if ( $events ) { $event = reset( $events ); $teams = array_filter( (array) get_post_meta( $event->ID, 'sp_team', false ) ); if ( ( $key = array_search( $post_id, $teams ) ) !== false ) { unset( $teams[ $key ] ); } else { return '-'; } $team_id = reset( $teams ); if ( ! $team_id ) { return '-'; } if ( has_post_thumbnail( $team_id ) ) { $logo = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon' ); $icon = ''; } else { $icon = sp_team_abbreviation( $team_id, true ); } if ( $this->link_events ) { return '' . $icon . ''; } else { return '' . $icon . ''; } } else { return '-'; } } else { return $input; } } /** * Add settings. * * @return array */ public function add_settings( $settings ) { $settings[] = array( 'title' => esc_attr__( 'Next Team', 'sportspress' ), 'desc' => esc_attr__( 'Filter by League', 'sportspress' ), 'id' => 'sportspress_table_next_team_filter_league', 'default' => 'no', 'type' => 'checkbox', ); return $settings; } } endif; new SportsPress_Next_Team_Preset(); ================================================ FILE: modules/sportspress-officials.php ================================================ define_constants(); // Actions add_action( 'sportspress_after_register_taxonomy', array( $this, 'register_taxonomy' ) ); add_action( 'sportspress_after_register_post_type', array( $this, 'register_post_type' ) ); add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) ); add_action( 'sportspress_create_rest_routes', array( $this, 'create_rest_routes' ) ); add_action( 'sportspress_register_rest_fields', array( $this, 'register_rest_fields' ) ); add_action( 'sportspress_event_list_head_row', array( $this, 'event_list_head_row' ) ); add_action( 'sportspress_event_list_row', array( $this, 'event_list_row' ), 10, 2 ); add_action( 'sportspress_calendar_data_meta_box_table_head_row', array( $this, 'calendar_meta_head_row' ) ); add_action( 'sportspress_calendar_data_meta_box_table_row', array( $this, 'calendar_meta_row' ), 10, 2 ); add_action( 'sp_duty_edit_form_fields', array( $this, 'edit_taxonomy_fields' ), 10, 1 ); add_action( 'edited_sp_duty', array( $this, 'save_taxonomy_fields' ), 10, 1 ); add_action( 'admin_menu', array( $this, 'duties_menu' ) ); add_action( 'parent_file', array( $this, 'parent_file' ) ); // Filters add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) ); add_filter( 'sportspress_calendar_columns', array( $this, 'calendar_columns' ) ); add_filter( 'sportspress_after_event_template', array( $this, 'add_event_template' ), 30 ); add_filter( 'sportspress_event_options', array( $this, 'add_event_options' ) ); add_filter( 'sportspress_text', array( $this, 'add_text_options' ) ); add_filter( 'sportspress_menu_items', array( $this, 'add_menu_item' ) ); add_filter( 'sportspress_glance_items', array( $this, 'add_glance_item' ) ); add_filter( 'sportspress_importers', array( $this, 'register_importer' ) ); add_filter( 'sportspress_screen_ids', array( $this, 'screen_ids' ) ); add_filter( 'sportspress_post_types', array( $this, 'add_post_type' ) ); add_filter( 'sportspress_primary_post_types', array( $this, 'add_post_type' ) ); add_filter( 'sportspress_importable_post_types', array( $this, 'add_post_type' ) ); add_filter( 'sportspress_post_type_hierarchy', array( $this, 'add_to_hierarchy' ) ); add_filter( 'manage_edit-sp_duty_columns', array( $this, 'taxonomy_columns' ) ); add_filter( 'manage_sp_duty_custom_column', array( $this, 'taxonomy_column_value' ), 10, 3 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_OFFICIALS_VERSION' ) ) { define( 'SP_OFFICIALS_VERSION', '2.7.9' ); } if ( ! defined( 'SP_OFFICIALS_URL' ) ) { define( 'SP_OFFICIALS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_OFFICIALS_DIR' ) ) { define( 'SP_OFFICIALS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Register officials taxonomy */ public static function register_taxonomy() { $labels = array( 'name' => esc_attr__( 'Duties', 'sportspress' ), 'singular_name' => esc_attr__( 'Duty', 'sportspress' ), 'all_items' => esc_attr__( 'All', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Duty', 'sportspress' ), 'view_item' => esc_attr__( 'View', 'sportspress' ), 'update_item' => esc_attr__( 'Update', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New', 'sportspress' ), 'new_item_name' => esc_attr__( 'Name', 'sportspress' ), 'parent_item' => esc_attr__( 'Parent', 'sportspress' ), 'parent_item_colon' => esc_attr__( 'Parent:', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), ); $args = apply_filters( 'sportspress_register_taxonomy_duty', array( 'label' => esc_attr__( 'Duties', 'sportspress' ), 'labels' => $labels, 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'hierarchical' => true, 'rewrite' => array( 'slug' => get_option( 'sportspress_duty_slug', 'duty' ) ), 'capabilities' => array( 'manage_terms' => 'manage_sp_event_terms', 'edit_terms' => 'edit_sp_event_terms', 'delete_terms' => 'delete_sp_event_terms', 'assign_terms' => 'assign_sp_event_terms', ), 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Terms_Controller', 'rest_base' => 'duties', ) ); $object_types = apply_filters( 'sportspress_duty_object_types', array() ); register_taxonomy( 'sp_duty', $object_types, $args ); foreach ( $object_types as $object_type ) : register_taxonomy_for_object_type( 'sp_duty', $object_type ); endforeach; } /** * Register officials post type */ public static function register_post_type() { register_post_type( 'sp_official', apply_filters( 'sportspress_register_post_type_official', array( 'labels' => array( 'name' => esc_attr__( 'Officials', 'sportspress' ), 'singular_name' => esc_attr__( 'Official', 'sportspress' ), 'add_new' => esc_attr__( 'Add New Official', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Official', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Official', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View Official', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), 'featured_image' => esc_attr__( 'Photo', 'sportspress' ), 'set_featured_image' => esc_attr__( 'Select Photo', 'sportspress' ), 'remove_featured_image' => esc_attr__( 'Remove Photo', 'sportspress' ), 'use_featured_image' => esc_attr__( 'Select Photo', 'sportspress' ), ), 'public' => true, 'show_ui' => true, 'capability_type' => 'sp_event', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array( 'slug' => get_option( 'sportspress_official_slug', 'official' ) ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'page-attributes' ), 'has_archive' => false, 'show_in_nav_menus' => true, 'menu_icon' => 'dashicons-flag', 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Posts_Controller', 'rest_base' => 'officials', ) ) ); } /** * Conditonally load the class and functions only needed when viewing this post type. */ public function include_post_type_handler() { include_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-official.php'; } /** * Create REST API routes. */ public function create_rest_routes() { $controller = new SP_REST_Posts_Controller( 'sp_official' ); $controller->register_routes(); } /** * Register REST API fields. */ public function register_rest_fields() { register_rest_field( 'sp_official', 'data', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_arrays', 'schema' => array( 'description' => esc_attr__( 'Official', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); } /** * Event list head row. */ public function event_list_head_row( $usecolumns = array() ) { if ( is_array( $usecolumns ) && in_array( 'officials', $usecolumns ) ) { $duties = get_terms( array( 'taxonomy' => 'sp_duty', 'hide_empty' => false, 'orderby' => 'meta_value_num', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_order', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_order', 'compare' => 'EXISTS', ), ), ) ); if ( empty( $duties ) ) { return; } foreach ( $duties as $duty ) { ?> name ); ?> appointments( true ); unset( $appointments[0] ); foreach ( $appointments as $officials ) { ?> ', $officials ) ); ?> 'sp_duty', 'hide_empty' => false, 'orderby' => 'meta_value_num', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_order', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_order', 'compare' => 'EXISTS', ), ), ) ); if ( empty( $duties ) ) { return; } foreach ( $duties as $duty ) { ?> appointments( true, '—' ); unset( $appointments[0] ); foreach ( $appointments as $officials ) { ?> ', $officials ) ); ?> esc_attr__( 'Officials', 'sportspress' ), 'output' => 'SP_Meta_Box_Event_Officials::output', 'save' => 'SP_Meta_Box_Event_Officials::save', 'context' => 'side', 'priority' => 'default', ); return $meta_boxes; } /** * Add calendar columns. * * @return array */ public function calendar_columns( $columns = array() ) { $columns['officials'] = esc_attr__( 'Officials', 'sportspress' ); return $columns; } /** * Add event template. * * @return array */ public function add_event_template( $templates ) { return array_merge( $templates, array( 'officials' => array( 'title' => esc_attr__( 'Officials', 'sportspress' ), 'option' => 'sportspress_event_show_officials', 'action' => 'sportspress_output_event_officials', 'default' => 'yes', ), ) ); } /** * Add event options. * * @return array */ public function add_event_options( $options ) { $options[] = array( 'title' => esc_attr__( 'Officials', 'sportspress' ), 'id' => 'sportspress_event_officials_format', 'default' => 'table', 'type' => 'radio', 'options' => array( 'table' => esc_attr__( 'Table', 'sportspress' ), 'list' => esc_attr__( 'List', 'sportspress' ), ), ); return $options; } /** * Add text options */ public function add_text_options( $options = array() ) { return array_merge( $options, array( __( 'Officials', 'sportspress' ), ) ); } /** * Add menu item */ public function add_menu_item( $items ) { $items[] = 'edit.php?post_type=sp_official'; return $items; } /** * Add glance item */ public function add_glance_item( $items ) { $items[] = 'sp_official'; return $items; } /** * Register importer */ public function register_importer( $importers = array() ) { $importers['sp_official_csv'] = array( 'name' => esc_attr__( 'SportsPress Officials (CSV)', 'sportspress' ), 'description' => wp_kses_post( __( 'Import officials from a csv file.', 'sportspress' ) ), 'callback' => array( $this, 'officials_importer' ), ); return $importers; } /** * Officials importer */ public function officials_importer() { SP_Admin_Importers::includes(); require SP()->plugin_path() . '/includes/admin/importers/class-sp-official-importer.php'; // Dispatch $importer = new SP_Official_Importer(); $importer->dispatch(); } /** * Add screen ids. * * @return array */ public function screen_ids( $ids ) { return array_merge( $ids, array( 'sp_official', 'edit-sp_official', 'sp_duty', 'edit-sp_duty', ) ); } public static function add_post_type( $post_types = array() ) { $post_types[] = 'sp_official'; return $post_types; } public static function add_to_hierarchy( $hierarchy = array() ) { $hierarchy['sp_official'] = array(); return $hierarchy; } /** * Taxonomy columns. * * @access public * @param mixed $columns * @return array */ public function taxonomy_columns( $columns ) { $new_columns = array(); if ( function_exists( 'get_term_meta' ) ) { $new_columns['sp_order'] = esc_attr__( 'Order', 'sportspress' ); } if ( array_key_exists( 'posts', $columns ) ) { $new_columns['posts'] = $columns['posts']; unset( $columns['posts'] ); } return array_merge( $columns, $new_columns ); } /** * Edit taxonomy fields. * * @access public * @param mixed $term Term (category) being edited */ public function edit_taxonomy_fields( $term ) { $t_id = $term->term_id; ?> esc_attr__( 'Offense', 'sportspress' ), 1 => esc_attr__( 'Defense', 'sportspress' ), ) ); $sections = sp_get_term_sections( $id ); $section_names = array(); if ( is_array( $sections ) ) { foreach ( $sections as $section ) { if ( array_key_exists( $section, $options ) ) { $section_names[] = $options[ $section ]; } } } $columns .= implode( ', ', $section_names ); } elseif ( $column == 'sp_order' ) { $columns = (int) get_term_meta( $id, 'sp_order', true ); } return $columns; } /** * Add menu item */ public function duties_menu() { add_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' ); } /** * Highlight parent menu item */ public function parent_file( $parent_file ) { global $current_screen; $taxonomy = $current_screen->taxonomy; if ( 'sp_duty' == $taxonomy ) { $parent_file = 'edit.php?post_type=sp_official'; } return $parent_file; } } endif; if ( get_option( 'sportspress_load_officials_module', 'no' ) == 'yes' ) { new SportsPress_Officials(); } ================================================ FILE: modules/sportspress-openstreetmap.php ================================================ define_constants(); // Actions add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) ); add_action( 'sp_admin_venue_scripts', array( $this, 'admin_venue_scripts' ) ); add_action( 'sp_frontend_venue_scripts', array( $this, 'frontend_venue_scripts' ) ); add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) ); add_action( 'sp_venue_show_map', array( $this, 'show_venue_map' ), 10, 5 ); add_action( 'sp_admin_geocoder_scripts', array( $this, 'admin_geocoder_scripts' ), 10 ); add_action( 'sp_setup_geocoder_scripts', array( $this, 'setup_geocoder_scripts' ), 10 ); add_action( 'sp_setup_venue_geocoder_scripts', array( $this, 'setup_venue_geocoder_scripts' ), 10 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_OPENSTREETMAP_VERSION' ) ) { define( 'SP_OPENSTREETMAP_VERSION', '2.7.14' ); } if ( ! defined( 'SP_OPENSTREETMAP_URL' ) ) { define( 'SP_OPENSTREETMAP_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_OPENSTREETMAP_DIR' ) ) { define( 'SP_OPENSTREETMAP_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Enqueue admin scripts */ public function admin_scripts() { do_action( 'sp_admin_venue_scripts' ); } /** * Enqueue admin venue scripts */ public function admin_venue_scripts() { $screen = get_current_screen(); if ( in_array( $screen->id, sp_get_screen_ids() ) ) { wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.8.0' ); wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array(), '1.13.0' ); } if ( in_array( $screen->id, sp_get_screen_ids() ) ) { wp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.8.0' ); wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.min.js', array( 'leaflet_js' ), '1.13.0' ); wp_register_script( 'sportspress-admin-geocoder', SP()->plugin_url() . '/assets/js/admin/sp-geocoder.js', array( 'leaflet_js', 'control-geocoder' ), SP_VERSION, true ); } if ( in_array( $screen->id, array( 'edit-sp_venue' ) ) ) { wp_enqueue_script( 'leaflet_js' ); wp_enqueue_script( 'control-geocoder' ); wp_enqueue_script( 'sportspress-admin-geocoder' ); } } /** * Enqueue frontend scripts */ public function frontend_scripts() { do_action( 'sp_frontend_venue_scripts' ); } /** * Enqueue frontend venue scripts */ public function frontend_venue_scripts() { global $post; if ( is_tax( 'sp_venue' ) || is_singular( 'sp_event' ) || ( isset( $post->post_content ) && sp_has_shortcodes( $post->post_content, array( 'event_full', 'event_venue' ) ) ) ) { wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.8.0' ); wp_enqueue_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.8.0' ); } } /** * Integrate OpenStreetMap (Show Venue) * * @return mix */ public function show_venue_map( $latitude, $longitude, $address, $zoom, $maptype ) { $lat = abs( $latitude ); $lat_deg = floor( $lat ); $lat_sec = ( $lat - $lat_deg ) * 3600; $lat_min = floor( $lat_sec / 60 ); $lat_sec = floor( $lat_sec - ( $lat_min * 60 ) ); $lat_dir = $latitude > 0 ? 'N' : 'S'; $lon = abs( $longitude ); $lon_deg = floor( $lon ); $lon_sec = ( $lon - $lon_deg ) * 3600; $lon_min = floor( $lon_sec / 60 ); $lon_sec = floor( $lon_sec - ( $lon_min * 60 ) ); $lon_dir = $longitude > 0 ? 'E' : 'W'; ?> " target="_blank">
    plugin_url() . '/assets/js/leaflet.js', array(), '1.8.0' ); wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.min.js', array( 'leaflet_js' ), '1.13.0' ); 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 ); wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array(), '1.13.0' ); wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.8.0' ); } /** * Print geocoder script in setup venue step */ public function setup_venue_geocoder_scripts() { wp_print_scripts( 'leaflet_js' ); wp_print_scripts( 'control-geocoder' ); } } endif; new SportsPress_OpenStreetMap(); ================================================ FILE: modules/sportspress-overview.php ================================================ define_constants(); add_action( 'admin_menu', array( $this, 'admin_menu' ), 11 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_OVERVIEW_VERSION' ) ) { define( 'SP_OVERVIEW_VERSION', '2.5' ); } if ( ! defined( 'SP_OVERVIEW_URL' ) ) { define( 'SP_OVERVIEW_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_OVERVIEW_DIR' ) ) { define( 'SP_OVERVIEW_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add menu item */ public function admin_menu() { add_submenu_page( 'sportspress', esc_attr__( 'Overview', 'sportspress' ), esc_attr__( 'Overview', 'sportspress' ), 'manage_sportspress', 'sportspress-overview', array( $this, 'overview_page' ) ); } /** * Init the overview page */ public function overview_page() { ?>

    object_type, $taxonomy ); ?> false, 'parent' => $term->term_id, 'orderby' => 'slug', ) ); ?> false, 'parent' => 0, 'orderby' => 'slug', ) ); ?> -1, 'post_type' => $post_type, ) ); ?> false, 'parent' => 0, 'orderby' => 'slug', ) ); ?>
    define_constants(); // Actions add_action( 'sportspress_process_sp_player_meta', array( $this, 'save' ) ); // Filters add_filter( 'sportspress_player_list_args', array( $this, 'add_args' ), 10, 2 ); add_filter( 'sportspress_player_list_players', array( $this, 'add_players' ), 10, 4 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_PLAYER_ASSIGNMENTS_VERSION' ) ) { define( 'SP_PLAYER_ASSIGNMENTS_VERSION', '2.7.3' ); } if ( ! defined( 'SP_PLAYER_ASSIGNMENTS_URL' ) ) { define( 'SP_PLAYER_ASSIGNMENTS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_PLAYER_ASSIGNMENTS_DIR' ) ) { define( 'SP_PLAYER_ASSIGNMENTS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Save Additional Statistics */ public function save( $post_id ) { delete_post_meta( $post_id, 'sp_assignments' ); $leagues = sp_array_value( $_POST, 'sp_leagues', array() ); if ( ! is_array( $leagues ) ) { return; } foreach ( $leagues as $l_id => $season ) { if ( 0 === $l_id ) { continue; } foreach ( $season as $s_id => $team_id ) { if ( 0 >= $team_id ) { continue; } $serialized = intval( $l_id ) . '_' . intval( $s_id ) . '_' . intval( $team_id ); add_post_meta( $post_id, 'sp_assignments', $serialized, false ); } } } /** * Add args to filter out assigned players */ public function add_args( $args = array(), $team = false ) { if ( ! $team ) { return $args; } $tax_query = (array) sp_array_value( $args, 'tax_query', array() ); $league_ids = array(); $season_ids = array(); foreach ( $tax_query as $param ) { if ( 'sp_league' === sp_array_value( $param, 'taxonomy' ) ) { $league_ids = sp_array_value( $param, 'terms', array() ); } if ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) { $season_ids = sp_array_value( $param, 'terms', array() ); } } if ( empty( $league_ids ) && empty( $season_ids ) ) { return $args; } $args['meta_query'][] = array( 'key' => 'sp_assignments', 'value' => '', 'compare' => 'NOT EXISTS', ); $args['meta_query']['relation'] = 'AND'; return $args; } /** * Add assigned players to player list */ public function add_players( $players = array(), $args = array(), $team = false, $team_key = 'sp_team' ) { if ( ! $team ) { return $players; } $tax_query = (array) sp_array_value( $args, 'tax_query', array() ); $league_ids = array(); $season_ids = array(); foreach ( $tax_query as $param ) { if ( 'sp_league' === sp_array_value( $param, 'taxonomy' ) ) { $league_ids = sp_array_value( $param, 'terms', array() ); } if ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) { $season_ids = sp_array_value( $param, 'terms', array() ); } } if ( empty( $league_ids ) && empty( $season_ids ) ) { return $players; } $assignments = array(); if ( ! empty( $league_ids ) && ! empty( $season_ids ) ) { foreach ( $league_ids as $l_id ) { foreach ( $season_ids as $s_id ) { if ( $team && $team != '0' ) { $assignments[] = $l_id . '_' . $s_id . '_' . $team; $compare = 'IN'; } } } } if ( empty( $league_ids ) && ! empty( $season_ids ) ) { foreach ( $season_ids as $s_id ) { if ( $team && $team != '0' ) { $assignments[] = '_' . $s_id . '_' . $team; $compare = 'LIKE'; } } } if ( ! empty( $league_ids ) && empty( $season_ids ) ) { foreach ( $league_ids as $l_id ) { if ( $team && $team != '0' ) { $assignments[] = $l_id . '_%_' . $team; $compare = 'LIKE'; } } } if ( sizeof( $assignments ) ) { if ( 'IN' == $compare ) { $args['meta_query'] = array( 'relation' => 'AND', array( 'key' => 'sp_assignments', 'value' => $assignments, 'compare' => $compare, ), array( 'key' => $team_key, 'value' => $team, ), ); } if ( 'LIKE' == $compare ) { $args['meta_query'] = array( 'relation' => 'AND', array( 'key' => $team_key, 'value' => $team, ), array( 'relation' => 'OR', ), ); foreach ( $assignments as $assignment ) { $args['meta_query'][1][] = array( 'key' => 'sp_assignments', 'value' => $assignment, 'compare' => $compare, ); } } } $assigned_players = (array) get_posts( $args ); $players = array_merge( $assigned_players, $players ); $players = array_map( 'unserialize', array_unique( array_map( 'serialize', $players ) ) ); foreach ( $players as $i => $player ) { $player->sp_number = get_post_meta( $player->ID, 'sp_number', true ); } uasort( $players, array( $this, 'sort' ) ); return $players; } public function sort( $a, $b ) { if ( $a->sp_number == $b->sp_number ) { return 0; } return ( $a->sp_number < $b->sp_number ) ? -1 : 1; } } endif; new SportsPress_Player_Assignments(); ================================================ FILE: modules/sportspress-player-lists.php ================================================ define_constants(); // Actions add_action( 'init', array( $this, 'register_post_type' ) ); add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 ); add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) ); add_action( 'sportspress_widgets', array( $this, 'include_widgets' ) ); add_action( 'sportspress_create_rest_routes', array( $this, 'create_rest_routes' ) ); add_action( 'sportspress_register_rest_fields', array( $this, 'register_rest_fields' ) ); // Filters add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) ); add_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) ); add_filter( 'sportspress_player_settings', array( $this, 'add_settings' ) ); add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 20 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_PLAYER_LISTS_VERSION' ) ) { define( 'SP_PLAYER_LISTS_VERSION', '2.6.15' ); } if ( ! defined( 'SP_PLAYER_LISTS_URL' ) ) { define( 'SP_PLAYER_LISTS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_PLAYER_LISTS_DIR' ) ) { define( 'SP_PLAYER_LISTS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Register league tables post type */ public static function register_post_type() { register_post_type( 'sp_list', apply_filters( 'sportspress_register_post_type_list', array( 'labels' => array( 'name' => esc_attr__( 'Player Lists', 'sportspress' ), 'singular_name' => esc_attr__( 'Player List', 'sportspress' ), 'add_new_item' => esc_attr__( 'Add New Player List', 'sportspress' ), 'edit_item' => esc_attr__( 'Edit Player List', 'sportspress' ), 'new_item' => esc_attr__( 'New', 'sportspress' ), 'view_item' => esc_attr__( 'View Player List', 'sportspress' ), 'search_items' => esc_attr__( 'Search', 'sportspress' ), 'not_found' => esc_attr__( 'No results found.', 'sportspress' ), 'not_found_in_trash' => esc_attr__( 'No results found.', 'sportspress' ), ), 'public' => true, 'show_ui' => true, 'capability_type' => 'sp_list', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ), 'supports' => array( 'title', 'editor', 'page-attributes', 'author', 'thumbnail' ), 'has_archive' => false, 'show_in_nav_menus' => true, 'show_in_menu' => 'edit.php?post_type=sp_player', 'show_in_admin_bar' => true, 'show_in_rest' => true, 'rest_controller_class' => 'SP_REST_Posts_Controller', 'rest_base' => 'lists', ) ) ); } /** * Remove meta boxes. */ public function remove_meta_boxes() { remove_meta_box( 'sp_positiondiv', 'sp_list', 'side' ); remove_meta_box( 'sp_seasondiv', 'sp_list', 'side' ); remove_meta_box( 'sp_leaguediv', 'sp_list', 'side' ); } /** * Conditonally load the class and functions only needed when viewing this post type. */ public function include_post_type_handler() { include_once SP()->plugin_path() . '/includes/admin/post-types/class-sp-admin-cpt-list.php'; } /** * Add widgets. * * @return array */ public function include_widgets() { include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-player-list.php'; include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-player-gallery.php'; } /** * Create REST API routes. */ public function create_rest_routes() { $controller = new SP_REST_Posts_Controller( 'sp_list' ); $controller->register_routes(); } /** * Register REST API fields. */ public function register_rest_fields() { register_rest_field( 'sp_list', 'format', array( 'get_callback' => 'SP_REST_API::get_post_meta', 'update_callback' => 'SP_REST_API::update_post_meta', 'schema' => array( 'description' => esc_attr__( 'Layout', 'sportspress' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); register_rest_field( 'sp_list', 'data', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_arrays', 'schema' => array( 'description' => esc_attr__( 'Player List', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) ); } /** * Add meta boxes. * * @return array */ public function add_meta_boxes( $meta_boxes ) { $meta_boxes['sp_team']['lists'] = array( 'title' => esc_attr__( 'Player Lists', 'sportspress' ), 'output' => 'SP_Meta_Box_Team_Lists::output', 'save' => 'SP_Meta_Box_Team_Lists::save', 'context' => 'normal', 'priority' => 'high', ); $meta_boxes['sp_list'] = array( 'shortcode' => array( 'title' => esc_attr__( 'Shortcode', 'sportspress' ), 'output' => 'SP_Meta_Box_List_Shortcode::output', 'context' => 'side', 'priority' => 'default', ), 'format' => array( 'title' => esc_attr__( 'Layout', 'sportspress' ), 'save' => 'SP_Meta_Box_List_Format::save', 'output' => 'SP_Meta_Box_List_Format::output', 'context' => 'side', 'priority' => 'default', ), 'columns' => array( 'title' => esc_attr__( 'Columns', 'sportspress' ), 'save' => 'SP_Meta_Box_List_Columns::save', 'output' => 'SP_Meta_Box_List_Columns::output', 'context' => 'side', 'priority' => 'default', ), 'details' => array( 'title' => esc_attr__( 'Details', 'sportspress' ), 'save' => 'SP_Meta_Box_List_Details::save', 'output' => 'SP_Meta_Box_List_Details::output', 'context' => 'side', 'priority' => 'default', ), 'data' => array( 'title' => esc_attr__( 'Player List', 'sportspress' ), 'save' => 'SP_Meta_Box_List_Data::save', 'output' => 'SP_Meta_Box_List_Data::output', 'context' => 'normal', 'priority' => 'high', ), ); return $meta_boxes; } /** * Add shortcodes. * * @return array */ public function add_shortcodes( $shortcodes ) { $shortcodes['player'][] = 'list'; $shortcodes['player'][] = 'gallery'; return $shortcodes; } /** * Add settings. * * @return array */ public function add_settings( $settings ) { return array_merge( $settings, array_merge( array( array( 'title' => esc_attr__( 'Player Lists', 'sportspress' ), 'type' => 'title', 'id' => 'list_options', ), ), apply_filters( 'sportspress_player_list_options', array( array( 'title' => esc_attr__( 'Title', 'sportspress' ), 'desc' => esc_attr__( 'Display title', 'sportspress' ), 'id' => 'sportspress_list_show_title', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Players', 'sportspress' ), 'desc' => esc_attr__( 'Display photos', 'sportspress' ), 'id' => 'sportspress_list_show_photos', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Display national flags', 'sportspress' ), 'id' => 'sportspress_list_show_flags', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'desc' => esc_attr__( 'Display logos', 'sportspress' ), 'id' => 'sportspress_list_show_logos', 'default' => 'no', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Teams', 'sportspress' ), 'id' => 'sportspress_list_team_format', 'default' => 'name', 'type' => 'radio', 'options' => array( 'name' => esc_attr__( 'Name', 'sportspress' ), 'logo' => esc_attr__( 'Logo', 'sportspress' ), ), ), array( 'title' => esc_attr__( 'Pagination', 'sportspress' ), 'desc' => esc_attr__( 'Paginate', 'sportspress' ), 'id' => 'sportspress_list_paginated', 'default' => 'yes', 'type' => 'checkbox', ), array( 'title' => esc_attr__( 'Limit', 'sportspress' ), 'id' => 'sportspress_list_rows', 'class' => 'small-text', 'default' => '10', 'desc' => esc_attr__( 'players', 'sportspress' ), 'type' => 'number', 'custom_attributes' => array( 'min' => 1, 'step' => 1, ), ), ) ), array( array( 'type' => 'sectionend', 'id' => 'list_options', ), ) ) ); } /** * Add team template. * * @return array */ public function add_team_template( $templates ) { return array_merge( $templates, array( 'lists' => array( 'title' => esc_attr__( 'Player Lists', 'sportspress' ), 'label' => esc_attr__( 'Players', 'sportspress' ), 'option' => 'sportspress_team_show_lists', 'action' => 'sportspress_output_team_lists', 'default' => 'yes', ), ) ); } } endif; if ( get_option( 'sportspress_load_player_lists_module', 'yes' ) == 'yes' ) { new SportsPress_Player_Lists(); /** * Create alias of SP_Player_List class for REST API. * Note: class_alias is not supported in PHP < 5.3 so extend the original class instead. */ class SP_List extends SP_Player_List {} } ================================================ FILE: modules/sportspress-styles.php ================================================ define_constants(); // Add option add_filter( 'sportspress_script_styling_options', array( $this, 'add_option' ) ); // Add stylesheet add_filter( 'sportspress_enqueue_styles', array( $this, 'add_styles' ), 20 ); // Output custom CSS add_action( 'sportspress_frontend_css', array( $this, 'custom_css' ), 40 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_STYLES_VERSION' ) ) { define( 'SP_STYLES_VERSION', '2.7' ); } if ( ! defined( 'SP_STYLES_URL' ) ) { define( 'SP_STYLES_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_STYLES_DIR' ) ) { define( 'SP_STYLES_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add option. */ public static function add_option( $options = array() ) { if ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) { return $options; } array_unshift( $options, array( 'title' => esc_attr__( 'Frontend Styles', 'sportspress' ), 'desc' => esc_attr__( 'Enable', 'sportspress' ), 'id' => 'sportspress_styles', 'default' => 'yes', 'type' => 'checkbox', ) ); return $options; } /** * Add stylesheet. */ public static function add_styles( $styles = array() ) { if ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) { return $styles; } if ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) { return $styles; } $styles['sportspress-roboto'] = array( 'src' => '//fonts.googleapis.com/css?family=Roboto:400,500&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese', 'deps' => '', 'version' => SP_STYLES_VERSION, 'media' => 'all', ); $styles['sportspress-style'] = array( 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style.css', 'deps' => '', 'version' => SP_STYLES_VERSION, 'media' => 'all', ); if ( is_rtl() ) { $styles['sportspress-style-rtl'] = array( 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-rtl.css', 'deps' => 'sportspress-style', 'version' => SP_STYLES_VERSION, 'media' => 'all', ); } else { $styles['sportspress-style-ltr'] = array( 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-ltr.css', 'deps' => 'sportspress-style', 'version' => SP_STYLES_VERSION, 'media' => 'all', ); } return $styles; } /** * Output custom CSS. */ public function custom_css( $colors = array() ) { if ( current_theme_supports( 'sportspress' ) && ! current_theme_supports( 'sportspress-styles' ) ) { return; } if ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) { return; } // Defaults if ( empty( $colors['primary'] ) ) { $colors['primary'] = '#2b353e'; } if ( empty( $colors['background'] ) ) { $colors['background'] = '#f4f4f4'; } if ( empty( $colors['text'] ) ) { $colors['text'] = '#222222'; } if ( empty( $colors['heading'] ) ) { $colors['heading'] = '#ffffff'; } if ( empty( $colors['link'] ) ) { $colors['link'] = '#00a69c'; } // Calculate primary variations $colors['primary_border'] = sp_hex_darker( $colors['primary'], 26, true ); // Calculate background variations $colors['background_highlight'] = sp_hex_darker( $colors['background'], 6, true ); $colors['background_border'] = sp_hex_darker( $colors['background'], 26, true ); // Calculate text variations $rgb = sp_rgb_from_hex( $colors['text'] ); $colors['text_muted'] = 'rgba(' . implode( ',', $rgb ) . ',0.5)'; // Primary echo '.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}'; echo '.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}'; // Background echo '.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}'; echo '.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}'; echo '.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}'; echo '.sp-data-table .sp-highlight,.sp-data-table .highlighted td,.sp-template-scoreboard td:hover{background:' . esc_attr( $colors['background_highlight'] ) . ' !important}'; // Text echo '.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}'; echo '.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}'; // Heading echo '.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}'; // Link echo '.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}'; echo '.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}'; echo '.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}'; } } endif; new SportsPress_Styles(); ================================================ FILE: modules/sportspress-template-selector.php ================================================ define_constants(); // Hooks add_filter( 'sportspress_event_options', array( $this, 'event_options' ) ); add_filter( 'sportspress_calendar_options', array( $this, 'calendar_options' ) ); add_filter( 'sportspress_team_options', array( $this, 'team_options' ) ); add_filter( 'sportspress_table_options', array( $this, 'table_options' ) ); add_filter( 'sportspress_player_options', array( $this, 'player_options' ) ); add_filter( 'sportspress_player_list_options', array( $this, 'list_options' ) ); add_filter( 'sportspress_staff_options', array( $this, 'staff_options' ) ); add_filter( 'sportspress_post_type_options', array( $this, 'post_type_options' ), 10, 2 ); add_filter( 'sportspress_event_settings', array( $this, 'add_event_settings' ), 9 ); add_filter( 'template_include', array( $this, 'template_loader' ), 99 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_TEMPLATE_SELECTOR_VERSION' ) ) { define( 'SP_TEMPLATE_SELECTOR_VERSION', '2.3' ); } if ( ! defined( 'SP_TEMPLATE_SELECTOR_URL' ) ) { define( 'SP_TEMPLATE_SELECTOR_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_TEMPLATE_SELECTOR_DIR' ) ) { define( 'SP_TEMPLATE_SELECTOR_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add option to event post type. */ public function event_options( $options ) { return $this->options( $options, 'event' ); } /** * Add option to calendar post type. */ public function calendar_options( $options ) { return $this->options( $options, 'calendar' ); } /** * Add option to team post type. */ public function team_options( $options ) { return $this->options( $options, 'team' ); } /** * Add option to league table post type. */ public function table_options( $options ) { return $this->options( $options, 'table' ); } /** * Add option to player post type. */ public function player_options( $options ) { return $this->options( $options, 'player' ); } /** * Add option to player list post type. */ public function list_options( $options ) { return $this->options( $options, 'list' ); } /** * Add option to staff post type. */ public function staff_options( $options ) { return $this->options( $options, 'staff' ); } /** * Filter for other post types. */ public function post_type_options( $options = array(), $post_type = null ) { if ( null == $post_type ) { return $options; } return $this->options( $options, $post_type ); } /** * Add template option. */ public function options( $options, $post_type ) { // Get page templates from current theme $templates = wp_get_theme()->get_page_templates( get_post() ); // Sort options alphabetically asort( $templates ); // Add default option $templates = array_merge( array( 'default' => esc_attr__( 'Default Template', 'sportspress' ) ), $templates ); $options = array_merge( array( array( 'title' => esc_attr__( 'Template', 'sportspress' ), 'id' => 'sportspress_' . $post_type . '_page_template', 'default' => 'default', 'type' => 'select', 'options' => $templates, ), ), $options ); return $options; } /** * Load page template. */ public function template_loader( $template ) { if ( is_single() ) { $post_type = get_post_type(); if ( is_sp_post_type( $post_type ) ) { $option = get_option( 'sportspress_' . str_replace( 'sp_', '', $post_type ) . '_page_template', 'default' ); if ( 'default' !== $option ) { $new_template = locate_template( array( $option ) ); if ( '' != $new_template ) { return $new_template; } } } } return $template; } /** * Add event settings. * * @return array */ public function add_event_settings( $settings ) { $settings = array_merge( $settings, array( array( 'title' => esc_attr__( 'Calendars', 'sportspress' ), 'type' => 'title', 'id' => 'calendar_options', ), ), apply_filters( 'sportspress_calendar_options', array() ), array( array( 'type' => 'sectionend', 'id' => 'calendar_options', ), ) ); return $settings; } } endif; new SportsPress_Template_Selector(); ================================================ FILE: modules/sportspress-tutorials.php ================================================ define_constants(); add_action( 'init', array( $this, 'get_video_ids' ) ); add_action( 'admin_menu', array( $this, 'admin_menu' ), 10 ); add_action( 'sportspress_admin_css', array( $this, 'admin_styles' ) ); add_action( 'sportspress_screen_ids', array( $this, 'screen_ids' ) ); add_filter( 'sportspress_next_steps', array( $this, 'next_steps' ) ); } /** * Enqueue styles */ public function admin_styles( $screen ) { if ( strpos( $screen->id, 'sportspress-tutorials' ) !== false ) { wp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION ); } } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_TUTORIALS_VERSION' ) ) { define( 'SP_TUTORIALS_VERSION', '2.5' ); } if ( ! defined( 'SP_TUTORIALS_URL' ) ) { define( 'SP_TUTORIALS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_TUTORIALS_DIR' ) ) { define( 'SP_TUTORIALS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Get video IDs. */ public function get_video_ids() { $this->ids = apply_filters( 'sportspress_videos', array( 'tutorials' => apply_filters( 'sportspress_tutorial_videos', array( __( 'Get Started', 'sportspress' ) => apply_filters( 'sportspress_get_started_tutorial_videos', array( __( 'Installation', 'sportspress' ) => '//www.youtube-nocookie.com/embed/nE8-RlbotmU?rel=0&showinfo=0', __( 'Leagues', 'sportspress' ) . ' & ' . esc_attr__( 'Seasons', 'sportspress' ) => '//www.youtube-nocookie.com/embed/XAf2EsDrf8M?rel=0&showinfo=0', __( 'Venues', 'sportspress' ) => '//www.youtube-nocookie.com/embed/iTZnC_7VvYk?rel=0&showinfo=0', __( 'Positions', 'sportspress' ) . ' & ' . esc_attr__( 'Jobs', 'sportspress' ) => '//www.youtube-nocookie.com/embed/g6QKbDH05n0?rel=0&showinfo=0', ) ), __( 'Teams', 'sportspress' ) => apply_filters( 'sportspress_team_tutorial_videos', array( __( 'Add New Team', 'sportspress' ) => '//www.youtube-nocookie.com/embed/x8GoxaHwC9U?rel=0&showinfo=0', __( 'League Tables', 'sportspress' ) => '//www.youtube-nocookie.com/embed/8AXh399Vstc?rel=0&showinfo=0', ) ), __( 'Players', 'sportspress' ) . ' & ' . esc_attr__( 'Staff', 'sportspress' ) => array_merge( apply_filters( 'sportspress_player_tutorial_videos', array( __( 'Add New Player', 'sportspress' ) => '//www.youtube-nocookie.com/embed/wWYQNHITz-g?rel=0&showinfo=0', ) ), apply_filters( 'sportspress_staff_tutorial_videos', array( __( 'Add New Staff', 'sportspress' ) => '//www.youtube-nocookie.com/embed/cxm2S7qYSL4?rel=0&showinfo=0', ) ) ), __( 'Events', 'sportspress' ) => apply_filters( 'sportspress_event_tutorial_videos', array( __( 'Add New Event', 'sportspress' ) => '//www.youtube-nocookie.com/embed/UA25lgqgnSc?rel=0&showinfo=0', __( 'Edit Event', 'sportspress' ) => '//www.youtube-nocookie.com/embed/nL0ObdPMyBM?rel=0&showinfo=0', __( 'Calendars', 'sportspress' ) => '//www.youtube-nocookie.com/embed/NIHBKMMqN0s?rel=0&showinfo=0', ) ), ) ), 'advanced' => apply_filters( 'sportspress_advanced_videos', array( __( 'Settings', 'sportspress' ) => apply_filters( 'sportspress_settings_advanced_videos', array( __( 'Text', 'sportspress' ) => '//www.youtube-nocookie.com/embed/qEucgVVsDcE?rel=0&showinfo=0', __( 'Permalinks', 'sportspress' ) => '//www.youtube-nocookie.com/embed/QuHmsdVyjU8?rel=0&showinfo=0', ) ), __( 'Events', 'sportspress' ) => apply_filters( 'sportspress_event_advanced_videos', array( __( 'Event Outcomes', 'sportspress' ) . ' ' . esc_attr__( '(Auto)', 'sportspress' ) => '//www.youtube-nocookie.com/embed/pCVfPv2O5yY?rel=0&showinfo=0', __( 'Box Score', 'sportspress' ) => '//www.youtube-nocookie.com/embed/rERU6X7vjTc?rel=0&showinfo=0', ) ), __( 'Calendars', 'sportspress' ) => apply_filters( 'sportspress_calendar_advanced_videos', array( __( 'Layout', 'sportspress' ) => '//www.youtube-nocookie.com/embed/aLx_5D0Xgnc?rel=0&showinfo=0', ) ), __( 'Teams', 'sportspress' ) => apply_filters( 'sportspress_team_advanced_videos', array( __( 'Logo', 'sportspress' ) => '//www.youtube-nocookie.com/embed/tLJZKB0fnXw?rel=0&showinfo=0', __( 'Adjustments', 'sportspress' ) => '//www.youtube-nocookie.com/embed/VJkhn9Or0jA?rel=0&showinfo=0', __( 'Highlight', 'sportspress' ) => '//www.youtube-nocookie.com/embed/1rKRmRzVWoU?rel=0&showinfo=0', ) ), __( 'Players', 'sportspress' ) => apply_filters( 'sportspress_player_advanced_videos', array( __( 'Player Metrics', 'sportspress' ) => '//www.youtube-nocookie.com/embed/dGXYgi8esPc?rel=0&showinfo=0', __( 'Player Ranking', 'sportspress' ) => '//www.youtube-nocookie.com/embed/xAQRZf7VOTg?rel=0&showinfo=0', ) ), __( 'Other', 'sportspress' ) => apply_filters( 'sportspress_other_advanced_videos', array( __( 'Demo Content', 'sportspress' ) => '//www.youtube-nocookie.com/embed/sARiHQJqSBw?rel=0&showinfo=0', __( 'Overview', 'sportspress' ) => '//www.youtube-nocookie.com/embed/osXGpBJDMpY?rel=0&showinfo=0', __( 'User Roles', 'sportspress' ) => '//www.youtube-nocookie.com/embed/UancX-33NE4?rel=0&showinfo=0', __( 'Shortcodes', 'sportspress' ) => '//www.youtube-nocookie.com/embed/czrhafIcLaM?rel=0&showinfo=0', __( 'Page not found', 'sportspress' ) => '//www.youtube-nocookie.com/embed/2rss9qfMubw?rel=0&showinfo=0', ) ), ) ), ) ); } /** * Add menu item */ public function admin_menu() { if ( current_user_can( 'manage_sportspress' ) ) { add_submenu_page( 'sportspress', esc_attr__( 'Tutorials', 'sportspress' ), esc_attr__( 'Tutorials', 'sportspress' ), 'manage_sportspress', 'sportspress-tutorials', array( $this, 'tutorials_page' ) ); } else { add_menu_page( esc_attr__( 'Tutorials', 'sportspress' ), esc_attr__( 'Tutorials', 'sportspress' ), 'edit_sp_players', 'sportspress-tutorials', array( $this, 'tutorials_page' ), 'dashicons-video-alt3' ); } } /** * Init the tutorials page */ public function tutorials_page() { $tabs = apply_filters( 'sportspress_tutorial_tabs', array( 'tutorials' => esc_attr__( 'Tutorials', 'sportspress' ), 'advanced' => esc_attr__( 'Advanced', 'sportspress' ), ) ); if ( isset( $_GET['tab'] ) && array_key_exists( wp_unslash( $_GET['tab'] ), $tabs ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $current_tab = sanitize_key( $_GET['tab'] ); } else { $current_tab = key( $tabs ); } $i = 0; ?>
    ids[ $current_tab ] as $section => $urls ) { ?>

      $url ) { $i++; ?>
    array( 'link' => admin_url( add_query_arg( array( 'page' => 'sportspress-tutorials' ), 'admin.php' ) ), 'icon' => 'dashicons dashicons-video-alt3', 'label' => esc_attr__( 'Watch Tutorials', 'sportspress' ), ), ) + $steps; return $steps; } } endif; if ( get_option( 'sportspress_load_tutorials_module', 'yes' ) == 'yes' ) { new SportsPress_Tutorials(); } ================================================ FILE: modules/sportspress-user-registration.php ================================================ define_constants(); // Hooks add_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) ); add_action( 'register_form', array( $this, 'register_form' ) ); add_action( 'user_register', array( $this, 'user_register' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_USER_REGISTRATION_VERSION' ) ) { define( 'SP_USER_REGISTRATION_VERSION', '2.4' ); } if ( ! defined( 'SP_USER_REGISTRATION_URL' ) ) { define( 'SP_USER_REGISTRATION_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_USER_REGISTRATION_DIR' ) ) { define( 'SP_USER_REGISTRATION_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add options to player settings page. * * @return array */ public function add_player_options( $options ) { $options = array_merge( $options, array( array( 'title' => esc_attr__( 'User Registration', 'sportspress' ), 'desc' => esc_attr__( 'Add name fields to signup form', 'sportspress' ), 'id' => 'sportspress_registration_name_inputs', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), array( 'desc' => esc_attr__( 'Add a team name field to signup form', 'sportspress' ), 'id' => 'sportspress_registration_team_input', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Add a team selector to signup form', 'sportspress' ), 'id' => 'sportspress_registration_team_select', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => '', ), array( 'desc' => esc_attr__( 'Create player profiles for new users', 'sportspress' ), 'id' => 'sportspress_registration_add_player', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', ), ) ); return $options; } /** * Add name fields to user registration form. */ public static function register_form() { if ( 'yes' === get_option( 'sportspress_registration_name_inputs', 'no' ) ) { $first_name = ( ! empty( $_POST['first_name'] ) ) ? trim( sanitize_text_field( wp_unslash( $_POST['first_name'] ) ) ) : ''; $last_name = ( ! empty( $_POST['last_name'] ) ) ? trim( sanitize_text_field( wp_unslash( $_POST['last_name'] ) ) ) : ''; ?>

    define_constants(); // Initialize add_action( 'init', array( $this, 'init' ) ); // Widgets add_filter( 'sportspress_widget_update', array( $this, 'widget_update' ), 10, 2 ); add_filter( 'sportspress_widget_defaults', array( $this, 'widget_defaults' ) ); add_filter( 'sportspress_shortcode_wrapper', array( $this, 'shortcode_wrapper' ), 10, 3 ); add_action( 'sportspress_before_widget_template_form', array( $this, 'before_widget_form' ), 10, 2 ); add_action( 'sportspress_before_widget', array( $this, 'before_widget' ), 10, 2 ); add_action( 'sportspress_after_widget', array( $this, 'after_widget' ) ); add_action( 'sportspress_ajax_shortcode_form', array( $this, 'ajax_shortcode_form' ) ); add_action( 'sportspress_ajax_scripts_before_shortcode', array( $this, 'ajax_scripts' ) ); } /** * Define constants */ private function define_constants() { if ( ! defined( 'SP_WIDGET_ALIGNMENT_VERSION' ) ) { define( 'SP_WIDGET_ALIGNMENT_VERSION', '1.8.3' ); } if ( ! defined( 'SP_WIDGET_ALIGNMENT_URL' ) ) { define( 'SP_WIDGET_ALIGNMENT_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_WIDGET_ALIGNMENT_DIR' ) ) { define( 'SP_WIDGET_ALIGNMENT_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Initialize */ public function init() { $this->options = array( 'none' => esc_attr__( 'None', 'sportspress' ), 'left' => esc_attr__( 'Left', 'sportspress' ), 'right' => esc_attr__( 'Right', 'sportspress' ), ); } /** * Widget update */ function widget_update( $instance, $new_instance ) { $instance['align'] = strip_tags( $new_instance['align'] ); return $instance; } /** * Widget defaults */ function widget_defaults( $defaults ) { $defaults['align'] = 'none'; return $defaults; } /** * Shortcode wrapper */ function shortcode_wrapper( $wrapper = array(), $function = null, $atts = array() ) { if ( isset( $atts['align'] ) ) { $wrapper['class'] = sp_array_value( $wrapper, 'class', '' ) . ' ' . 'sp-widget-align-' . $atts['align']; } return $wrapper; } /** * Before widget forms */ function before_widget_form( $object, $instance ) { ?>

    ' ); } /** * After widget */ function after_widget() { echo '
    '; } /** * Ajax shortcode form */ function ajax_shortcode_form() { ?>

    args.align = $div.find('[name=align]').val(); define_constants(); add_action( 'widgets_init', array( $this, 'includes' ) ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_WIDGETS_VERSION' ) ) { define( 'SP_WIDGETS_VERSION', '1.8.3' ); } if ( ! defined( 'SP_WIDGETS_URL' ) ) { define( 'SP_WIDGETS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_WIDGETS_DIR' ) ) { define( 'SP_WIDGETS_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Include widgets. */ public function includes() { include_once SP()->plugin_path() . '/includes/widgets/class-sp-widget-staff.php'; do_action( 'sportspress_widgets' ); } } endif; new SportsPress_Widgets(); ================================================ FILE: modules/sportspress-wordpay.php ================================================ define_constants(); // Shortcode add_action( 'init', array( $this, 'add_shortcodes' ) ); add_action( 'wpay_register_form_after_fields', array( $this, 'form_field' ) ); // Editor add_filter( 'wordpay_shortcodes', array( $this, 'editor_shortcodes' ) ); add_filter( 'wordpay_tinymce_strings', array( $this, 'editor_strings' ) ); // Widgets add_action( 'wordpay_after_widget_register_form', array( $this, 'widget_form' ), 10, 2 ); add_filter( 'wordpay_widget_register_update', array( $this, 'widget_update' ), 10, 2 ); add_filter( 'wordpay_widget_register_shortcode', array( $this, 'widget_shortcode' ), 10, 2 ); } /** * Define constants. */ private function define_constants() { if ( ! defined( 'SP_WORDPAY_VERSION' ) ) { define( 'SP_WORDPAY_VERSION', '2.6' ); } if ( ! defined( 'SP_WORDPAY_URL' ) ) { define( 'SP_WORDPAY_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'SP_WORDPAY_DIR' ) ) { define( 'SP_WORDPAY_DIR', plugin_dir_path( __FILE__ ) ); } } /** * Add team and player registration shortcodes. */ public function add_shortcodes() { add_shortcode( 'wpay-register-team', array( $this, 'register_team' ) ); add_shortcode( 'wpay-register-player', array( $this, 'register_player' ) ); } /** * Team registration shortcode. */ public static function register_team( $atts = array() ) { $args = array( 'post_type' => 'wpay-subscription', 'post_status' => 'active', 'posts_per_page' => 500, 'meta_query' => array( array( 'key' => 'wpay_subscription_plan_user_role', 'value' => 'sp_team_manager', ), ), 'fields' => 'ids', ); $plans = get_posts( $args ); if ( empty( $plans ) ) { return '

    ' . esc_attr__( 'There are no plans associated with the Team Manager role.', 'sportspress' ) . '

    '; } return self::register_form( $atts, 'team', $plans ); } /** * Player registration shortcode. */ public static function register_player( $atts = array() ) { $args = array( 'post_type' => 'wpay-subscription', 'post_status' => 'active', 'posts_per_page' => 500, 'meta_query' => array( array( 'key' => 'wpay_subscription_plan_user_role', 'value' => 'sp_player', ), ), 'fields' => 'ids', ); $plans = get_posts( $args ); if ( empty( $plans ) ) { return '

    ' . esc_attr__( 'There are no plans associated with the Player role.', 'sportspress' ) . '

    '; } return self::register_form( $atts, 'player', $plans ); } /** * Registration form template. */ public static function register_form( $atts = array(), $context = '', $plans = array() ) { $atts = shortcode_atts( array( 'plans_position' => 'bottom', 'selected' => '', ), $atts ); $atts['subscription_plans'] = implode( ',', $plans ); $atts['context'] = $context; $shortcode = '[wpay-register'; foreach ( $atts as $key => $value ) { $shortcode .= ' ' . $key . '="' . esc_attr( $value ) . '"'; } $shortcode .= ']'; return do_shortcode( $shortcode ); } /** * Add field to registration form. */ public static function form_field( $atts = array() ) { if ( 'team' == $atts['context'] ) { ?>

  • 'sp_team', 'name' => 'sp_team', 'values' => 'ID', 'show_option_none' => sprintf( esc_attr__( 'Select %s', 'sportspress' ), esc_attr__( 'Team', 'sportspress' ) ), 'class' => 'widefat', ); sp_dropdown_pages( $args ); ?>
  • esc_attr__( 'Members', 'sportspress' ), 'team' => esc_attr__( 'Teams', 'sportspress' ), 'player' => esc_attr__( 'Players', 'sportspress' ), ); ?>

    " }, { "name" : "Loss", "condition" : "<" } ], "results": [ "Map Score", { "name" : "Round Score", "primary" : 1 } ], "performance": [ "Kills", "Deaths", "Assists" ], "metrics": [ ], "statistics": [ { "name" : "KDA Ratio", "equation" : "( $kills + $assists ) / $deaths", "precision" : 2, "type" : "average", "description" : "Kills/deaths/assists ratio" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/esports/dota2.json ================================================ { "name": "Dota 2", "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" } ], "results": [ { "name" : "Rating", "description" : "Rating adjustment", "primary" : 1 } ], "performance": [ { "name" : "Rating", "description" : "Rating adjustment" } ], "columns": [ { "name" : "W", "equation" : "$win", "priority" : 2, "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "Rating", "equation" : "$rating", "priority" : 1 } ], "metrics": [ ], "statistics": [ { "name" : "Wins", "equation" : "$win" }, { "name" : "Losses", "equation" : "$loss" }, { "name" : "Winrate", "equation" : "$win / $eventsplayed * 100", "type" : "average" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/esports/lol.json ================================================ { "name": "League of Legends", "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" } ], "results": [ "Kills", "Deaths", "Assists", { "name" : "Gold", "primary" : 1 } ], "performance": [ "Kills", "Deaths", "Assists", "Gold" ], "columns": [ { "name" : "Wins", "equation" : "$win", "priority" : 1, "description" : "Wins" }, { "name" : "Losses", "equation" : "$loss", "priority" : 2, "order" : "ASC", "description" : "Losses" } ], "metrics": [ ], "statistics": [ { "name" : "Avg. KDA Ratio", "equation" : "( $kills + $assists ) / $deaths", "precision" : 1, "type" : "average", "description" : "Average kills/deaths/assists ratio" }, { "name" : "Avg. Gold per Min", "equation" : "$gold / $eventminutes", "type" : "average", "description" : "Average gold per minute" }, { "name" : "Avg. Total Gold", "equation" : "$gold / $eventsplayed", "type" : "average", "description" : "Average total gold" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/other/custom.json ================================================ { "name": "Custom", "positions": [ ], "outcomes": [ ], "results": [ ], "performance": [ ], "columns": [ ], "metrics": [ ], "statistics": [ ] } ================================================ FILE: presets/racket-sports/squash.json ================================================ { "name": "Squash", "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Draw", "condition" : "=" } ], "results": [ { "name" : "G1", "description" : "1st game" }, { "name" : "G2", "description" : "2nd game" }, { "name" : "G3", "description" : "3rd game" }, { "name" : "G4", "description" : "4th game" }, { "name" : "G5", "description" : "5th game" }, { "name" : "T", "id" : "points", "description" : "Total points", "primary" : 1 } ], "performance": [ ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win", "priority" : 1, "description" : "Wins" }, { "name" : "D", "equation" : "$draw", "description" : "Draws" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "F", "equation" : "$pointsfor", "priority" : 3, "description" : "Points for" }, { "name" : "A", "equation" : "$pointsagainst", "description" : "Points against" }, { "name" : "Pts", "equation" : "$pointsfor - $pointsagainst", "priority" : 2, "description" : "Total points" } ], "metrics": [ { "name" : "Height", "description" : "Player height" }, { "name" : "Weight", "description" : "Player weight" } ], "statistics": [ ], "options": { "mode" : "player" } } ================================================ FILE: presets/racket-sports/table-tennis.json ================================================ { "name": "Table Tennis", "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, "Forfeit" ], "results": [ { "name" : "1", "description" : "1st set" }, { "name" : "2", "description" : "2nd set" }, { "name" : "3", "description" : "3rd set" }, { "name" : "4", "description" : "4th set" }, { "name" : "5", "description" : "5th set" }, { "name" : "Sets", "description" : "Sets won", "primary" : 1 } ], "performance": [ ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "F", "equation" : "$setsfor", "description" : "Sets for" }, { "name" : "A", "equation" : "$setsagainst", "description" : "Sets against" }, { "name" : "%", "id" : "percent", "equation" : "$setsfor / $setsagainst * 100", "precision" : 2, "description" : "For/against ratio", "priority" : 2 }, { "name" : "Points", "equation" : "$win * 3 + $loss", "priority" : 1 } ], "metrics": [ "Height", "Weight" ], "statistics": [ ], "options": { "mode" : "player" } } ================================================ FILE: presets/racket-sports/tennis.json ================================================ { "name": "Tennis", "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, "Unfinished" ], "results": [ { "name" : "S1", "description" : "1st set" }, { "name" : "S2", "description" : "2nd set" }, { "name" : "S3", "description" : "3rd set" }, { "name" : "S4", "description" : "4th set" }, { "name" : "S5", "description" : "5th set" }, { "name" : "T", "id" : "points", "description" : "Total points", "primary" : 1 } ], "performance": [ ], "columns": [ { "name" : "Wins", "equation" : "$win", "description" : "Wins" }, { "name" : "Losses", "equation" : "$loss", "description" : "Losses" }, { "name" : "Win %", "id" : "winpct", "equation" : "$win / $eventsplayed * 100", "precision" : 2, "description" : "Win percentage", "priority" : 2 }, { "name" : "Points", "equation" : "$win * 2 + $loss - $unfinished", "priority" : 1 } ], "metrics": [ "Height", "Weight" ], "statistics": [ ], "options": { "mode" : "player" } } ================================================ FILE: presets/target-sports/darts.json ================================================ { "name": "Darts", "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Draw", "condition" : "=" } ], "results": [ "Legs" ], "performance": [ ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win", "priority" : 1, "description" : "Wins" }, { "name" : "D", "equation" : "$draw", "description" : "Draws" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "Legs", "equation" : "$legs", "priority" : 2 }, { "name" : "Pts", "equation" : "$win * 2 + $draw", "priority" : 1, "description" : "Total points" } ], "metrics": [ ], "statistics": [ ], "options": { "mode" : "player" } } ================================================ FILE: presets/target-sports/golf.json ================================================ { "name": "Golf", "positions": [ ], "outcomes": [ { "name" : "Win", "condition" : "<", "description" : "Won" }, { "name" : "Finish", "condition" : "else", "description" : "Finished" } ], "results": [ { "name" : "Par", "equation" : "$strokes - $par", "description" : "Reported score", "primary" : 1 }, { "name" : "FH", "description" : "Fairways hit" }, { "name" : "GIR", "description" : "Greens in regulation" }, { "name" : "Avg. Drive", "id" : "avgdrive", "description" : "Average drive (yards)" }, { "name" : "Putts", "description" : "Number of putts" }, { "name" : "Score", "equation" : "$strokes", "description" : "Total score" } ], "performance": [ { "name" : "1", "id" : "one", "description" : "Hole 1" }, { "name" : "2", "id" : "two", "description" : "Hole 2" }, { "name" : "3", "id" : "three", "description" : "Hole 3" }, { "name" : "4", "id" : "four", "description" : "Hole 4" }, { "name" : "5", "id" : "five", "description" : "Hole 5" }, { "name" : "6", "id" : "six", "description" : "Hole 6" }, { "name" : "7", "id" : "seven", "description" : "Hole 7" }, { "name" : "8", "id" : "eight", "description" : "Hole 8" }, { "name" : "9", "id" : "nine", "description" : "Hole 9" }, { "name" : "10", "id" : "ten", "description" : "Hole 10" }, { "name" : "11", "id" : "eleven", "description" : "Hole 11" }, { "name" : "12", "id" : "twelve", "description" : "Hole 12" }, { "name" : "13", "id" : "thirteen", "description" : "Hole 13" }, { "name" : "14", "id" : "fourteen", "description" : "Hole 14" }, { "name" : "15", "id" : "fifteen", "description" : "Hole 15" }, { "name" : "16", "id" : "sixteen", "description" : "Hole 16" }, { "name" : "17", "id" : "seventeen", "description" : "Hole 17" }, { "name" : "18", "id" : "eighteen", "description" : "Hole 18" } ], "columns": [ { "name" : "Par", "equation" : "$parfor", "priority" : 1, "order" : "ASC", "description" : "Reported score" }, { "name" : "R1", "equation" : "$scorefor 1", "description" : "Round 1 Score" }, { "name" : "R2", "equation" : "$scorefor 2", "description" : "Round 2 Score" }, { "name" : "R3", "equation" : "$scorefor 3", "description" : "Round 3 Score" }, { "name" : "R4", "equation" : "$scorefor 4", "description" : "Round 4 Score" }, { "name" : "Total", "equation" : "$scorefor", "priority" : 2, "order" : "ASC", "description" : "Total Score" } ], "metrics": [ { "name" : "Height", "description" : "Player height" }, { "name" : "Weight", "description" : "Player weight" } ], "statistics": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Events played" }, { "name" : "FH", "equation" : "$fhfor", "description" : "Fairways hit" }, { "name" : "GIR", "equation" : "$girfor", "description" : "Greens in regulation" } ], "options": { "mode" : "player", "event_teams" : "0", "event_show_players" : "yes", "event_show_total" : "no", "event_performance_mode" : "values", "event_show_player_numbers" : "no", "event_split_players_by_team" : "no", "event_split_players_by_position" : "no", "event_performance_sections" : -1 } } ================================================ FILE: presets/target-sports/snooker.json ================================================ { "name": "Snooker", "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Draw", "condition" : "=" } ], "results": [ { "name" : "Score", "description" : "Total points", "primary" : 1 } ], "performance": [ "1st Frame", "2nd Frame" ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "W", "equation" : "$win", "priority" : 2, "description" : "Wins" }, { "name" : "D", "equation" : "$draw", "description" : "Draws" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "F", "equation" : "$scorefor", "description" : "Points for", "priority" : 3 }, { "name" : "A", "equation" : "$scoreagainst", "description" : "Points against" }, { "name" : "+-", "equation" : "$win - $loss", "description" : "Point difference", "priority" : 2 }, { "name" : "PTS", "equation" : "$scorefor", "priority" : 1, "description" : "Points", "priority" : 1 } ], "statistics": [ { "name" : "Games Played", "equation" : "$eventsplayed" }, { "name" : "Games Won", "equation" : "$win" }, { "name" : "Win Percentage", "equation" : "$win / $eventsplayed * 100", "precision" : 2, "type" : "average" } ], "options": { "mode" : "player" } } ================================================ FILE: presets/team-sports/baseball.json ================================================ { "name": "Baseball", "positions": [ { "name" : "Pitcher", "sections" : [ 0, 1 ] }, { "name" : "Catcher", "sections" : [ 0 ] }, { "name" : "First base", "sections" : [ 0 ] }, { "name" : "Second base", "sections" : [ 0 ] }, { "name" : "Third base", "sections" : [ 0 ] }, { "name" : "Shortstop", "sections" : [ 0 ] }, { "name" : "Left field", "sections" : [ 0 ] }, { "name" : "Center field", "sections" : [ 0 ] }, { "name" : "Right field", "sections" : [ 0 ] } ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Tie", "condition" : "=" } ], "results": [ { "name" : "1", "description" : "1st inning runs" }, { "name" : "2", "description" : "2nd inning runs" }, { "name" : "3", "description" : "3rd inning runs" }, { "name" : "4", "description" : "4th inning runs" }, { "name" : "5", "description" : "5th inning runs" }, { "name" : "6", "description" : "6th inning runs" }, { "name" : "7", "description" : "7th inning runs" }, { "name" : "8", "description" : "8th inning runs" }, { "name" : "9", "description" : "9th inning runs" }, { "name" : "10", "description" : "10th inning runs" }, { "name" : "R", "description" : "Total runs", "primary" : 1 }, { "name" : "H", "description" : "Hits" }, { "name" : "E", "description" : "Errors" } ], "performance": [ { "name" : "AB", "section" : 0, "description" : "At bat" }, { "name" : "R", "section" : 0, "description" : "Runs" }, { "name" : "H", "section" : 0, "description" : "Hits" }, { "name" : "RBI", "section" : 0, "description" : "Runs batted in" }, { "name" : "2B", "id" : "doubles", "section" : 0, "description" : "Doubles" }, { "name" : "3B", "id" : "triples", "section" : 0, "description" : "Triples" }, { "name" : "HR", "section" : 0, "description" : "Home runs" }, { "name" : "SB", "section" : 0, "description" : "Stolen bases" }, { "name" : "BB", "section" : 0, "description" : "Base on balls" }, { "name" : "SO", "section" : 0, "description" : "Strike outs" }, { "name" : "LOB", "section" : 0, "description" : "Left on base" }, { "name" : "IP", "id" : "pitcher_ip", "section" : 1, "description" : "Innings pitched" }, { "name" : "H", "id" : "pitcher_h", "section" : 1, "description" : "Hits allowed" }, { "name" : "R", "id" : "pitcher_r", "section" : 1, "description" : "Runs allowed" }, { "name" : "ER", "id" : "pitcher_er", "section" : 1, "description" : "Earned runs allowed" }, { "name" : "BB", "id" : "pitcher_bb", "section" : 1, "description" : "Base on balls allowed" }, { "name" : "SO", "id" : "pitcher_so", "section" : 1, "description" : "Strike outs pitched" }, { "name" : "HR", "id" : "pitcher_hr", "section" : 1, "description" : "Home runs allowed" } ], "columns": [ { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "Pct", "equation" : "$win / $eventsplayed", "precision" : 3, "priority" : 1, "description" : "Win percentage" }, { "name" : "GB", "equation" : "$gamesback", "precision" : 1, "description" : "Games back" }, { "name" : "RS", "equation" : "$rfor", "description" : "Runs scored" }, { "name" : "RA", "equation" : "$ragainst", "description" : "Runs allowed" }, { "name" : "Diff", "equation" : "$rfor - $ragainst", "description" : "Run differential" }, { "name" : "Home", "equation" : "$homerecord", "description" : "Home record" }, { "name" : "Road", "equation" : "$awayrecord", "description" : "Road record" }, { "name" : "L10", "equation" : "$last10", "description" : "Last 10 games" }, { "name" : "Strk", "equation" : "$streak", "description" : "Current streak" } ], "metrics": [ { "name" : "B/T", "description": "Bats / Throws" }, { "name" : "Ht", "description": "Height" }, { "name" : "Wt", "description": "Weight" } ], "statistics": [ { "name" : "G", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "AVG", "equation" : "$h / $ab", "precision" : 3, "type" : "average", "description" : "Batting average" } ], "options": { "mode" : "team", "event_teams" : "2", "event_hide_child_positions" : "yes", "event_show_players" : "yes", "event_show_total" : "yes", "event_reverse_teams" : "yes", "event_performance_mode" : "values", "event_show_player_numbers" : "yes", "event_show_position" : "no", "event_split_players_by_team" : "yes", "event_split_players_by_position" : "yes", "event_total_performance" : "all", "event_performance_sections" : 0, "player_performance_sections" : 0, "player_show_total" : "yes" } } ================================================ FILE: presets/team-sports/basketball.json ================================================ { "name": "Basketball", "positions": [ "Guard", "Forward-Guard", "Forward", "Forward-Center", "Center" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" } ], "results": [ { "name" : "1", "description" : "1st quarter points" }, { "name" : "2", "description" : "2nd quarter points" }, { "name" : "3", "description" : "3rd quarter points" }, { "name" : "4", "description" : "4th quarter points" }, { "name" : "OT", "id" : "ot", "description" : "Overtime points" }, { "name" : "T", "id" : "points", "description" : "Total points", "primary" : 1 } ], "performance": [ { "name" : "PTS", "description" : "Points" }, { "name" : "REB", "format" : "equation", "equation" : "$off + $def", "description" : "Rebounds" }, { "name" : "AST", "description" : "Assists" }, { "name" : "STL", "description" : "Steals" }, { "name" : "BLK", "description" : "Blocks" }, { "name" : "FGM", "description" : "Field goals made" }, { "name" : "FGA", "description" : "Field goals attempted" }, { "name" : "FG%", "format" : "equation", "precision" : 1, "equation" : "( $fgm / $fga ) * 100", "description" : "Field goal percentage" }, { "name" : "3PM", "description" : "3-pointers made" }, { "name" : "3PA", "description" : "3-pointers attempted" }, { "name" : "3P%", "format" : "equation", "precision" : 1, "equation" : "( $threepm / $threepa ) * 100", "description" : "3-pointer percentage" }, { "name" : "FTM", "description" : "Free throws made" }, { "name" : "FTA", "description" : "Free throws attempted" }, { "name" : "FT%", "format" : "equation", "precision" : 1, "equation" : "( $ftm / $fta ) * 100", "description" : "Free throw percentage" }, { "name" : "OFF", "description" : "Offensive rebounds" }, { "name" : "DEF", "description" : "Defensive rebounds" }, { "name" : "TO", "description" : "Turnovers" }, { "name" : "PF", "description" : "Personal fouls" } ], "columns": [ { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "PCT", "equation" : "$win / $eventsplayed", "precision" : 3, "priority" : 1, "description" : "Win percentage" }, { "name" : "GB", "equation" : "$gamesback", "precision" : 1, "description" : "Games back" }, { "name" : "Home", "equation" : "$homerecord", "description" : "Home record" }, { "name" : "Road", "equation" : "$awayrecord", "description" : "Road record" }, { "name" : "L10", "equation" : "$last10", "description" : "Last 10 games" }, { "name" : "STRK", "equation" : "$streak", "description" : "Current streak" }, { "name" : "PF", "equation" : "$pointsfor / $eventsplayed", "priority" : 3, "description" : "Average points for" }, { "name" : "PA", "equation" : "$pointsagainst / $eventsplayed", "description" : "Average points against" }, { "name" : "DIFF", "equation" : "( $pointsfor - $pointsagainst ) / $eventsplayed", "priority" : 2, "description" : "Average point differential" } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "G", "equation" : "$eventsattended", "description" : "Games played" }, { "name" : "GS", "equation" : "$eventsstarted", "description" : "Games started" }, { "name" : "FG%", "equation" : "( $fgm / $fga ) * 100", "precision" : 3, "type" : "average", "description" : "Field goal percentage" }, { "name" : "FT%", "equation" : "( $ftm / $fta ) * 100", "precision" : 3, "type" : "average", "description" : "Free throw percentage" }, { "name" : "3P%", "equation" : "( $threepm / $threepa ) * 100", "precision" : 3, "type" : "average", "description" : "3-pointer percentage" }, { "name" : "RPG", "equation" : "( $off + $def ) / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Rebounds per game" }, { "name" : "APG", "equation" : "$ast / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Assists per game" }, { "name" : "SPG", "equation" : "$stl / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Steals per game" }, { "name" : "BPG", "equation" : "$blk / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Blocks per game" }, { "name" : "PPG", "equation" : "$pts / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Points per game" }, { "name" : "EFF", "equation" : "$pts + $off + $def + $ast + $stl + $blk - $fga + $fgm - $fta + $ftm - $to", "type" : "average", "description" : "Efficiency rating" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/cricket.json ================================================ { "name": "Cricket", "positions": [ { "name" : "Batsman", "sections" : [ 0 ] }, { "name" : "Bowler", "sections" : [ 0, 1 ] } ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, "Draw", { "name" : "Tie", "condition" : "=" }, "No Result" ], "results": [ { "name" : "Runs", "equation" : "$runs", "description" : "Runs", "primary" : 1 }, { "name" : "Wickets Lost", "description" : "Wickets lost" }, { "name" : "Overs", "equation" : "$o", "description" : "Overs" }, { "name" : "BP", "description" : "Bonus points"} ], "performance": [ { "name" : " ", "id" : "notes", "section" : 0, "format" : "text", "description" : "Notes" }, { "name" : "R", "id" : "runs", "section" : 0, "description" : "Runs" }, { "name" : "B", "section" : 0, "description" : "Balls" }, { "name" : "4s", "section" : 0, "description" : "Fours" }, { "name" : "6s", "section" : 0, "description" : "Sixes" }, { "name" : "O", "section" : 1, "description" : "Overs bowled" }, { "name" : "M", "section" : 1, "description" : "Maidens" }, { "name" : "R", "section" : 1, "description" : "Runs" }, { "name" : "W", "section" : 1, "description" : "Wickets taken" } ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win", "priority" : 2, "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "D", "equation" : "$draw", "description" : "Draws" }, { "name" : "T", "equation" : "$tie", "description" : "Ties" }, { "name" : "NR", "equation" : "$noresult", "description" : "No results" }, { "name" : "BP", "equation" : "$bpfor", "description" : "Bonus points" }, { "name" : "Points", "equation" : "$win * 2 + $draw", "priority" : 1, "description" : "Total points" }, { "name" : "NRR", "equation" : "( $runsfor / $oversfor ) - ( $runsagainst / $oversagainst )", "priority" : 3, "precision" : 3, "description" : "Net run rate" } ], "metrics": [ "Height", "Weight", "Bat Brand" ], "statistics": [ { "name" : "Mat", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "SR", "equation" : "( $runs / $b ) * 100", "precision" : 2, "type" : "average", "description" : "Strike Rate" } ], "options": { "mode" : "team", "event_teams" : "2", "event_logos_show_team_names" : "no", "event_logos_show_results" : "yes", "event_reverse_teams" : "no", "event_show_outcome" : "yes", "event_show_players" : "yes", "event_show_total" : "yes", "event_performance_mode" : "values", "event_show_player_numbers" : "no", "event_show_position" : "no", "event_total_performance" : "primary", "event_performance_sections" : 0 } } ================================================ FILE: presets/team-sports/floorball.json ================================================ { "name": "Floorball", "positions": [ { "name" : "Forward", "sections" : [ 0 ] }, { "name" : "Defenseman", "sections" : [ 0 ] }, { "name" : "Goalkeeper", "sections" : [ 0, 1 ] } ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Tie", "condition" : "=" } ], "results": [ { "name" : "1st", "description" : "1st period goals" }, { "name" : "2nd", "description" : "2nd period goals" }, { "name" : "3rd", "description" : "3rd period goals" }, { "name" : "OT", "description" : "Overtime goals" }, { "name" : "PPG", "description" : "Power play goals" }, { "name" : "PPO", "description" : "Power play opportunities" }, { "name" : "T", "id" : "goals", "description" : "Total goals", "primary" : 1 } ], "performance": [ { "name" : "G", "description" : "Goals" }, { "name" : "A", "description" : "Assists" }, { "name" : "SOG", "id" : "s", "description" : "Shots on goal" }, { "name" : "PIM", "description" : "Penalty in minutes" }, { "name" : "SA", "description" : "Shots against" }, { "name" : "GA", "description" : "Goals against" }, { "name" : "SV", "description" : "Saves" } ], "columns": [ { "name" : "GP", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "PTS", "equation" : "$win * 2 + $tie", "priority" : 1, "description" : "Points" }, { "name" : "GF", "equation" : "$goalsfor", "priority" : 3, "description" : "Goals for" }, { "name" : "GA", "equation" : "$goalsagainst", "description" : "Goals against" }, { "name" : "Diff", "equation" : "$goalsfor - $goalsagainst", "priority" : 2, "description" : "Goal differential" }, { "name" : "PPG", "equation" : "$ppgfor", "description" : "Power play goals" }, { "name" : "PPO", "equation" : "$ppofor", "description" : "Power play opportunities" }, { "name" : "PP%", "equation" : "$ppgfor / $ppofor * 100", "precision" : 1, "description" : "Power play percentage" }, { "name" : "PPGA", "equation" : "$ppgagainst", "description" : "Power play goals against" }, { "name" : "PPOA", "equation" : "$ppoagainst", "description" : "Power play opportunities against" }, { "name" : "PK%", "equation" : "( $ppoagainst - $ppgagainst ) / $ppoagainst * 100", "precision" : 1, "description" : "Penalty kill percentage" } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "GP", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "P", "equation" : "$g + $assists", "description" : "Points" }, { "name" : "GAA", "equation" : "$ga / $eventsplayed", "precision" : 2, "type" : "average", "description" : "Goals against average" }, { "name" : "S%", "equation" : "$g / $s * 100", "precision" : 2, "type" : "average", "description" : "Shot percentage" }, { "name" : "SV%", "equation" : "$sv / $sa * 100", "precision" : 2, "type" : "average", "description" : "Save percentage" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/football.json ================================================ { "name": "American Football", "positions": [ "Quarterback", "Running back", "Wide receiver", "Tight end", "Center", "Offensive guard", "Offensive tackle", "Defensive tackle", "Defensive end", "Middle linebacker", "Outside linebacker", "Cornerback", "Safety" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Tie", "condition" : "=" } ], "results": [ { "name" : "1", "description" : "1st quarter points" }, { "name" : "2", "description" : "2nd quarter points" }, { "name" : "3", "description" : "3rd quarter points" }, { "name" : "4", "description" : "4th quarter points" }, { "name" : "OT", "description" : "Overtime points" }, { "name" : "TD", "description" : "Touchdowns" }, { "name" : "T", "id" : "points", "description" : "Total points", "primary" : 1 } ], "performance": [ { "name" : "Comp", "description" : "Completions" }, { "name" : "Att", "description" : "Attempts" }, { "name" : "Yds", "description" : "Rushing yards" }, { "name" : "Rec", "description" : "Total receptions" }, { "name" : "Rec Yds", "description" : "Receiving yards" }, { "name" : "TD", "description" : "Touchdowns" }, { "name" : "Int", "description" : "Interceptions thrown" }, { "name" : "Lng", "description" : "Longest" }, { "name" : "Fum", "description" : "Total fumbles" }, { "name" : "Lost", "description" : "Fumbles lost" } ], "columns": [ { "name" : "W", "equation" : "$win", "priority" : 1, "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "T", "equation" : "$tie", "priority" : 2, "description" : "Ties" }, { "name" : "Pct", "equation" : "$win / $eventsplayed", "description" : "Win percentage" }, { "name" : "PF", "equation" : "$pointsfor", "priority" : 3, "description" : "Points for" }, { "name" : "PA", "equation" : "$pointsagainst", "description" : "Points against" }, { "name" : "Net Pts", "equation" : "$pointsfor - $pointsagainst", "priority" : 2, "description" : "Net Points" }, { "name" : "TD", "equation" : "$td", "description" : "Touchdowns" }, { "name" : "Streak", "equation" : "$streak", "description" : "Current streak" } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "G", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "GS", "equation" : "$eventsstarted", "description" : "Games started" }, { "name" : "Avg", "equation" : "$yds / $att", "precision" : 1, "type" : "average", "description" : "Average yards per carry" }, { "name" : "Rec Avg", "equation" : "$recyds / $rec", "precision" : 1, "type" : "average", "description" : "Average yards per reception" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/footy.json ================================================ { "name": "Australian Rules Football", "positions": [ "Defender", "Midfielder", "Forward" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Draw", "condition" : "=" } ], "results": [ { "name" : "Q1", "description" : "First quarter points" }, { "name" : "Q2", "description" : "Second quarter points" }, { "name" : "Q3", "description" : "Third quarter points" }, { "name" : "Q4", "description" : "Fourth quarter points" }, "Goals", "Behinds", { "name" : "Total", "id" : "points", "description" : "Total points", "primary" : 1 } ], "performance": [ "Kicks", "Handballs", "Disposals", "Marks", "Hitouts", "Tackles", "Goals" ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "D", "equation" : "$draw", "description" : "Draws" }, { "name" : "F", "equation" : "$pointsfor", "priority" : 3, "description" : "Points for" }, { "name" : "A", "equation" : "$pointsagainst", "description" : "Points against" }, { "name" : "%", "id" : "pct", "equation" : "$win / $eventsplayed", "priority" : 2, "description" : "Season percentage" }, { "name" : "Pts", "equation" : "$win * 4 + $draw * 2", "priority" : 1, "description" : "Points" } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "Games played", "equation" : "$eventsplayed" }, { "name" : "K", "equation" : "$kicks / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Average kicks per game" }, { "name" : "H", "equation" : "$handballs / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Average handballs per game" }, { "name" : "D", "equation" : "$disposals / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Average disposals per game" }, { "name" : "M", "equation" : "$marks / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Average marks per game" }, { "name" : "HO", "equation" : "$hitouts / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Average hitouts per game" }, { "name" : "T", "equation" : "$tackles / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Average tackles per game" }, { "name" : "G", "equation" : "$goals / $eventsplayed", "precision" : 1, "type" : "average", "description" : "Average goals per game" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/handball.json ================================================ { "name": "Handball", "positions": [ { "name" : "Goalkeeper", "sections" : [ 0, 1 ] }, { "name" : "Center back", "sections" : [ 0 ] }, { "name" : "Left back", "sections" : [ 0 ] }, { "name" : "Right back", "sections" : [ 0 ] }, { "name" : "Pivot", "sections" : [ 0 ] }, { "name" : "Left wing", "sections" : [ 0 ] }, { "name" : "Right wing", "sections" : [ 0 ] } ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Draw", "condition" : "=" } ], "results": [ { "name" : "1st Half", "description" : "1st half goals" }, { "name" : "2nd Half", "description" : "2nd half goals" }, { "name" : "Goals", "description" : "Total goals", "primary" : 1 } ], "performance": [ "Goals", "Interceptions" ], "columns": [ { "name" : "T", "equation" : "$eventsplayed", "description" : "Total matches" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "D", "equation" : "$draw", "description" : "Draws" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "F", "equation" : "$goalsfor", "priority" : 3, "description" : "Goals for" }, { "name" : "A", "equation" : "$goalsagainst", "description" : "Goals against" }, { "name" : "DIFF", "equation" : "$goalsfor - $goalsagainst", "priority" : 2, "description" : "Goal difference" }, { "name" : "Pts", "equation" : "$win * 2 + $draw", "priority" : 1, "description" : "Team points" } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "Appearances", "equation" : "$eventsplayed", "description" : "Matches played" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/ice-hockey.json ================================================ { "name": "Ice Hockey", "positions": [ { "name" : "Skater", "sections" : [ 0 ] }, { "name" : "Goalie", "sections" : [ 0, 1 ] } ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Overtime loss", "abbreviation" : "OT" } ], "results": [ { "name" : "1st", "description" : "1st period goals" }, { "name" : "2nd", "description" : "2nd period goals" }, { "name" : "3rd", "description" : "3rd period goals" }, { "name" : "OT", "description" : "Overtime goals" }, { "name" : "PPG", "description" : "Power play goals" }, { "name" : "PPO", "description" : "Power play opportunities" }, { "name" : "T", "id" : "goals", "description" : "Total goals", "primary" : 1 } ], "performance": [ { "name" : "G", "position" : "Skater", "description" : "Goals" }, { "name" : "A", "position" : "Skater", "description" : "Assists" }, { "name" : "H", "position" : "Skater", "description" : "Hits" }, { "name" : "SOG", "position" : "Skater", "id" : "s", "description" : "Shots on goal" }, { "name" : "PIM", "position" : "Skater", "description" : "Penalty in minutes" }, { "name" : "SA", "position" : "Goalie", "description" : "Shots against" }, { "name" : "GA", "position" : "Goalie", "description" : "Goals against" }, { "name" : "SV", "position" : "Goalie", "description" : "Saves" } ], "columns": [ { "name" : "GP", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "OT", "equation" : "$overtimeloss", "description" : "Overtime Losses" }, { "name" : "PTS", "equation" : "$win * 2 + $overtimeloss", "priority" : 1, "description" : "Points" }, { "name" : "GF", "equation" : "$goalsfor", "priority" : 3, "description" : "Goals for" }, { "name" : "GA", "equation" : "$goalsagainst", "description" : "Goals against" }, { "name" : "Diff", "equation" : "$goalsfor - $goalsagainst", "priority" : 2, "description" : "Goal differential" }, { "name" : "PPG", "equation" : "$ppgfor", "description" : "Power play goals" }, { "name" : "PPO", "equation" : "$ppofor", "description" : "Power play opportunities" }, { "name" : "PP%", "equation" : "$ppgfor / $ppofor * 100", "precision" : 1, "description" : "Power play percentage" }, { "name" : "PPGA", "equation" : "$ppgagainst", "description" : "Power play goals against" }, { "name" : "PPOA", "equation" : "$ppoagainst", "description" : "Power play opportunities against" }, { "name" : "PK%", "equation" : "( $ppoagainst - $ppgagainst ) / $ppoagainst * 100", "precision" : 1, "description" : "Penalty kill percentage" }, { "name" : "L10", "equation" : "$last10", "description" : "Last 10" }, { "name" : "Strk", "equation" : "$streak", "description" : "Current streak" } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "GP", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "P", "equation" : "$g + $assists", "description" : "Points" }, { "name" : "S%", "equation" : "$g / $s * 100", "precision" : 2, "type" : "average", "description" : "Shot percentage" }, { "name" : "SV%", "equation" : "$sv / $sa * 100", "precision" : 2, "type" : "average", "description" : "Save percentage" } ], "options": { "mode" : "team", "event_teams" : "2", "event_show_players" : "yes", "event_show_total" : "yes", "event_performance_mode" : "values", "event_show_player_numbers" : "yes", "event_split_players_by_team" : "yes", "event_split_players_by_position" : "yes", "event_total_performance" : "all" } } ================================================ FILE: presets/team-sports/lacrosse.json ================================================ { "name": "Lacrosse", "positions": [ "Goalie", "Defense", "Midfield", "Attack" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Tie", "condition" : "=" }, "Overtime" ], "results": [ { "name" : "1", "description" : "1st quarter goals" }, { "name" : "2", "description" : "2nd quarter goals" }, { "name" : "3", "description" : "3rd quarter goals" }, { "name" : "4", "description" : "4th quarter goals" }, { "name" : "OT", "id" : "ot", "description" : "Overtime goals" }, { "name" : "T", "id" : "goals", "description" : "Total goals", "primary" : 1 } ], "performance": [ "Goals", "Assists", "Shots", { "name" : "SoG", "description" : "Shots on goal" }, "Penalties" ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "T", "equation" : "$tie", "description" : "Ties" }, { "name" : "F", "equation" : "$goalsfor", "priority" : 3, "description" : "Goals for" }, { "name" : "A", "equation" : "$goalsagainst", "description" : "Goals against" }, { "name" : "+/-", "equation" : "$goalsfor - $goalsagainst", "priority" : 2, "description" : "Goal difference" }, { "name" : "Pts", "equation" : "$win * 2 + $tie", "priority" : 1, "description" : "Team points" } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "Games", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "Shooting %", "equation" : "$goals / $shots", "precision" : 1, "type" : "average", "description" : "Shooting percentage" }, { "name" : "SoG %", "equation" : "$sog / $shots", "precision" : 1, "type" : "average", "description" : "Shots on goal percentage" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/netball.json ================================================ { "name": "Netball", "positions": [ "Goal Keeper", "Goal Defense", "Wing Defense", "Center", "Wing Attack", "Goal Attack", "Goal Shooter" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" } ], "results": [ { "name" : "1st", "description" : "1st quarter goals" }, { "name" : "2nd", "description" : "2nd quarter goals" }, { "name" : "3rd", "description" : "3rd quarter goals" }, { "name" : "4th", "description" : "4th quarter goals" }, { "name" : "Total", "id" : "goals", "description" : "Total goals", "primary" : 1 } ], "performance": [ { "name" : "G", "description" : "Goals" }, { "name" : "A", "description" : "Attempts" }, { "name" : "GA", "description" : "Goal assists" }, { "name" : "R", "description" : "Rebounds" }, { "name" : "CPR", "description" : "Centre pass receives" }, { "name" : "I", "description" : "Intercepts" }, { "name" : "D", "description" : "Deflections" }, { "name" : "P", "description" : "Penalties" }, { "name" : "T", "description" : "Turnovers" } ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "GF", "equation" : "$goalsfor", "description" : "Goals for" }, { "name" : "GA", "equation" : "$goalsagainst", "description" : "Goals against" }, { "name" : "GD", "equation" : "$goalsfor - $goalsagainst", "priority" : 2, "description" : "Goal difference" }, { "name" : "GF", "equation" : "$win / $eventsplayed * 100", "precision" : 1, "priority" : 3, "description" : "Win percentage" }, { "name" : "Pts", "equation" : "$win * 2", "priority" : 1, "description" : "Team points" } ], "metrics": [ "Height" ], "statistics": [ { "name" : "Appearances", "equation" : "$eventsplayed", "description" : "Matches played" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/rugby-league.json ================================================ { "name": "Rugby League", "positions": [ "Fullback", "Wing", "Centre", "Five-Eighth", "Halfback", "Hooker", "Prop", "Second-row", "Lock" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Draw", "condition" : "=" } ], "results": [ "Tries", "Conversions", { "name" : "BP", "description" : "Bonus points" }, { "name" : "Points", "description" : "Total points", "primary" : 1 } ], "performance": [ { "name" : "T", "description" : "Tries" }, { "name" : "C", "description" : "Conversions" }, { "name" : "P", "description" : "Penalty goals" }, { "name" : "DG", "description" : "Drop goals" } ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win", "description" : "Matches won" }, { "name" : "L", "equation" : "$loss", "description" : "Matches lost" }, { "name" : "D", "equation" : "$draw", "description" : "Matches drawn" }, { "name" : "PF", "equation" : "$pointsfor", "description" : "Points for", "priority" : 3 }, { "name" : "PA", "equation" : "$pointsagainst", "description" : "Points against" }, { "name" : "PD", "equation" : "$pointsfor - $pointsagainst", "description" : "Points difference", "priority" : 2 }, { "name" : "BP", "equation" : "$bp", "description" : "Bonus points" }, { "name" : "Pts", "equation" : "$points", "description" : "Total points", "priority" : 1 } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "A", "equation" : "$eventsplayed", "description" : "Appearances" }, { "name" : "Pts", "equation" : "$t * 5 + $c * 2 + $p * 3 + $dg * 3", "description" : "Points" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/rugby-union.json ================================================ { "name": "Rugby Union", "positions": [ "Full-back", "Wing", "Centre", "Fly-half", "Scrum-half", "Number Eight", "Flanker", "Lock", "Hooker", "Prop" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Draw", "condition" : "=" } ], "results": [ "Tries", "Conversions", { "name" : "BP", "description" : "Bonus points" }, { "name" : "Points", "description" : "Total points", "primary" : 1 } ], "performance": [ { "name" : "T", "description" : "Tries" }, { "name" : "C", "description" : "Conversions" }, { "name" : "P", "description" : "Penalty goals" }, { "name" : "DG", "description" : "Drop goals" } ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win", "description" : "Matches won" }, { "name" : "L", "equation" : "$loss", "description" : "Matches lost" }, { "name" : "D", "equation" : "$draw", "description" : "Matches drawn" }, { "name" : "PF", "equation" : "$pointsfor", "description" : "Points for", "priority" : 3 }, { "name" : "PA", "equation" : "$pointsagainst", "description" : "Points against" }, { "name" : "PD", "equation" : "$pointsfor - $pointsagainst", "description" : "Points difference", "priority" : 2 }, { "name" : "BP", "equation" : "$bp", "description" : "Bonus points" }, { "name" : "Pts", "equation" : "$points", "description" : "Total points", "priority" : 1 } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "A", "equation" : "$eventsplayed", "description" : "Appearances" }, { "name" : "Pts", "equation" : "$t * 5 + $c * 2 + $p * 3 + $dg * 3", "description" : "Points" } ], "options": { "mode" : "team" } } ================================================ FILE: presets/team-sports/soccer.json ================================================ { "name": "Football", "positions": [ "Goalkeeper", "Defender", "Midfielder", "Forward" ], "outcomes": [ { "name" : "Win", "condition" : ">", "description" : "Wins" }, { "name" : "Draw", "condition" : "=", "description" : "Draws" }, { "name" : "Loss", "condition" : "<", "description" : "Losses" } ], "results": [ { "name" : "1st Half", "description" : "1st half goals" }, { "name" : "2nd Half", "description" : "2nd half goals" }, { "name" : "Goals", "description" : "Total goals", "primary" : 1 } ], "performance": [ { "name" : "Goals", "description" : "Goals", "singular" : "Goal", "icon" : "soccerball", "color" : "#222222" }, { "name" : "Assists", "description" : "Assists", "singular" : "Assist", "icon" : "shoe", "color" : "#222222", "timed" : 0 }, { "name" : "Yellow Cards", "description" : "Yellow cards", "singular" : "Yellow Card", "icon" : "card", "color" : "#f4d014" }, { "name" : "Red Cards", "description" : "Red cards", "singular" : "Red Card", "icon" : "card", "color" : "#d4000f" } ], "columns": [ { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "D", "equation" : "$draw", "description" : "Draws" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "F", "equation" : "$goalsfor", "priority" : 3, "description" : "Goals for" }, { "name" : "A", "equation" : "$goalsagainst", "description" : "Goals against" }, { "name" : "GD", "equation" : "$goalsfor - $goalsagainst", "priority" : 2, "description" : "Goal difference" }, { "name" : "Pts", "equation" : "$win * 3 + $draw", "priority" : 1, "description" : "Team points" } ], "metrics": [ { "name" : "Height", "description" : "Player height" }, { "name" : "Weight", "description" : "Player weight" } ], "statistics": [ { "name" : "Appearances", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "Win Ratio", "equation" : "$win / $eventsplayed * 100", "precision" : 2, "type" : "average", "description" : "Win ratio" }, { "name" : "Draw Ratio", "equation" : "$draw / $eventsplayed * 100", "precision" : 2, "type" : "average", "description" : "Draw ratio" }, { "name" : "Loss Ratio", "equation" : "$loss / $eventsplayed * 100", "precision" : 2, "type" : "average", "description" : "Loss ratio" } ], "options": { "mode" : "team", "event_teams" : "2", "event_show_players" : "yes", "event_show_total" : "no", "event_performance_mode" : "icons", "event_show_player_numbers" : "yes", "event_performance_show_minutes": "yes", "event_split_players_by_team" : "yes", "event_split_players_by_position" : "no", "event_total_performance" : "all" } } ================================================ FILE: presets/team-sports/softball.json ================================================ { "name": "Softball", "positions": [ { "name" : "Pitcher", "sections" : [ 0, 1 ] }, { "name" : "Catcher", "sections" : [ 0 ] }, { "name" : "First base", "sections" : [ 0 ] }, { "name" : "Second base", "sections" : [ 0 ] }, { "name" : "Third base", "sections" : [ 0 ] }, { "name" : "Shortstop", "sections" : [ 0 ] }, { "name" : "Left field", "sections" : [ 0 ] }, { "name" : "Center field", "sections" : [ 0 ] }, { "name" : "Right field", "sections" : [ 0 ] } ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" } ], "results": [ { "name" : "1", "description" : "1st inning runs" }, { "name" : "2", "description" : "2nd inning runs" }, { "name" : "3", "description" : "3rd inning runs" }, { "name" : "4", "description" : "4th inning runs" }, { "name" : "5", "description" : "5th inning runs" }, { "name" : "6", "description" : "6th inning runs" }, { "name" : "7", "description" : "7th inning runs" }, { "name" : " ", "id" : "extra", "description" : "Extra inning runs" }, { "name" : "R", "description" : "Total runs", "primary" : 1 }, { "name" : "H", "description" : "Hits" }, { "name" : "E", "description" : "Errors" } ], "performance": [ { "name" : "AB", "position" : "Batter", "description" : "At bat" }, { "name" : "R", "position" : "Batter", "description" : "Runs" }, { "name" : "H", "position" : "Batter", "description" : "Hits" }, { "name" : "RBI", "position" : "Batter", "description" : "Runs batted in" }, { "name" : "2B", "id" : "doubles", "position" : "Batter", "description" : "Doubles" }, { "name" : "3B", "id" : "triples", "position" : "Batter", "description" : "Triples" }, { "name" : "HR", "position" : "Batter", "description" : "Home runs" }, { "name" : "SB", "position" : "Batter", "description" : "Stolen bases" }, { "name" : "BB", "position" : "Batter", "description" : "Base on balls" }, { "name" : "SO", "position" : "Batter", "description" : "Strike outs" }, { "name" : "LOB", "position" : "Batter", "description" : "Left on base" }, { "name" : "IP", "id" : "pitcher_ip", "position" : "Pitcher", "description" : "Innings pitched" }, { "name" : "H", "id" : "pitcher_h", "position" : "Pitcher", "description" : "Hits allowed" }, { "name" : "R", "id" : "pitcher_r", "position" : "Pitcher", "description" : "Runs allowed" }, { "name" : "ER", "id" : "pitcher_er", "position" : "Pitcher", "description" : "Earned runs allowed" }, { "name" : "BB", "id" : "pitcher_bb", "position" : "Pitcher", "description" : "Base on balls allowed" }, { "name" : "SO", "id" : "pitcher_so", "position" : "Pitcher", "description" : "Strike outs pitched" }, { "name" : "HR", "id" : "pitcher_hr", "position" : "Pitcher", "description" : "Home runs allowed" } ], "columns": [ { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "Pct", "equation" : "$win / $eventsplayed", "precision" : 3, "priority" : 1, "description" : "Win percentage" }, { "name" : "GB", "equation" : "$gamesback", "precision" : 1, "description" : "Games back" }, { "name" : "RS", "equation" : "$rfor", "description" : "Runs scored" }, { "name" : "RA", "equation" : "$ragainst", "description" : "Runs allowed" }, { "name" : "Diff", "equation" : "$rfor - $ragainst", "description" : "Run differential" }, { "name" : "Home", "equation" : "$homerecord", "description" : "Home record" }, { "name" : "Road", "equation" : "$awayrecord", "description" : "Road record" }, { "name" : "L10", "equation" : "$last10", "description" : "Last 10 games" }, { "name" : "Strk", "equation" : "$streak", "description" : "Current streak" } ], "metrics": [ { "name" : "B/T", "description": "Bats / Throws" }, { "name" : "Ht", "description": "Height" }, { "name" : "Wt", "description": "Weight" } ], "statistics": [ { "name" : "G", "equation" : "$eventsplayed", "description" : "Games played" }, { "name" : "AVG", "equation" : "$h / $ab", "precision" : 3, "type" : "average", "description" : "Batting average" } ], "options": { "mode" : "team", "event_teams" : "2", "event_hide_child_positions" : "yes", "event_show_players" : "yes", "event_show_total" : "yes", "event_reverse_teams" : "yes", "event_performance_mode" : "values", "event_show_player_numbers" : "no", "event_split_players_by_team" : "yes", "event_split_players_by_position" : "yes", "event_total_performance" : "all" } } ================================================ FILE: presets/team-sports/volleyball.json ================================================ { "name": "Volleyball", "positions": [ "Outside Hitter", "Middle Blocker", "Setter", "Opposite", "Defensive Specialist", "Libero" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Overtime win", "abbreviation" : "OTW" }, { "name" : "Overtime loss", "abbreviation" : "OTL" } ], "results": [ { "name" : "1", "description" : "1st set points" }, { "name" : "2", "description" : "2nd set points" }, { "name" : "3", "description" : "3rd set points" }, { "name" : "4", "description" : "4th set points" }, { "name" : "5", "description" : "5th set points" }, { "name" : "T", "id" : "points", "description" : "Total points", "primary" : 1 } ], "performance": [ { "name" : "1", "format" : "checkbox", "description" : "1st set" }, { "name" : "2", "format" : "checkbox", "description" : "2nd set" }, { "name" : "3", "format" : "checkbox", "description" : "3rd set" }, { "name" : "4", "format" : "checkbox", "description" : "4th set" }, { "name" : "5", "format" : "checkbox", "description" : "5th set" }, { "name" : "S", "id" : "sets", "description" : "Sets played" }, { "name" : "K", "description" : "Kills" }, { "name" : "E", "description" : "Attack errors" }, { "name" : "TA", "description" : "Total attacks" }, { "name" : "B", "description" : "Blocks" }, { "name" : "PTS", "id" : "points", "description" : "Points" } ], "columns": [ { "name" : "Pts", "equation" : "$win * 3 + $overtimewin * 2 + $overtimeloss", "priority" : 1, "description" : "Total points" }, { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "W", "equation" : "$win + $overtimewin", "priority" : 2, "description" : "Wins" }, { "name" : "L", "equation" : "$loss + $overtimeloss", "description" : "Losses" }, { "name" : "PW", "equation" : "$pointsfor", "description" : "Points won" }, { "name" : "PL", "equation" : "$pointsagainst", "description" : "Points lost" }, { "name" : "Ratio", "equation" : "$pointsfor / $pointsagainst", "precision" : 3, "priority" : 2 } ], "metrics": [ "Height" ], "statistics": [ { "name" : "Pct", "equation" : "( $k - $e ) / $ta", "type" : "average", "description" : "Hitting percentage" }, { "name" : "B/S", "equation" : "$b / $sets", "type" : "average", "description" : "Blocks per set" }, { "name" : "A/S", "equation" : "$a / $sets", "type" : "average", "description" : "Assists per set" } ], "options": { "mode" : "team", "event_teams" : "2", "event_teams_delimiter" : "-", "event_show_full_time" : "no", "event_reverse_teams" : "no", "event_performance_mode" : "values", "event_show_player_numbers" : "yes", "event_show_position" : "no" } } ================================================ FILE: presets/water-sports/water-polo.json ================================================ { "name": "Water Polo", "positions": [ "Offense", "Defense", "Goalie" ], "positions": [ "Goalkeeper", "Driver", "Hole Set", "Hole Guard" ], "outcomes": [ { "name" : "Win", "condition" : ">" }, { "name" : "Loss", "condition" : "<" }, { "name" : "Draw", "condition" : "=" } ], "results": [ { "name" : "1st Quarter", "description" : "1st quarter goals" }, { "name" : "2nd Quarter", "description" : "2nd quarter goals" }, { "name" : "3rd Quarter", "description" : "3rd quarter goals" }, { "name" : "4rd Quarter", "description" : "4th quarter goals" }, { "name" : "PS", "description" : "Five Meter Penalty" }, { "name" : "Goals", "description" : "Total goals", "primary" : 1 } ], "performance": [ "Goals", "Assists", "Exclusion Foul", "Brutality Foul", "Misconduct Foul" ], "columns": [ { "name" : "T", "equation" : "$eventsplayed", "description" : "Total matches" }, { "name" : "W", "equation" : "$win", "description" : "Wins" }, { "name" : "D", "equation" : "$draw", "description" : "Draws" }, { "name" : "L", "equation" : "$loss", "description" : "Losses" }, { "name" : "F", "equation" : "$goalsfor", "priority" : 3, "description" : "Goals for" }, { "name" : "A", "equation" : "$goalsagainst", "description" : "Goals against" }, { "name" : "DIFF", "equation" : "$goalsfor - $goalsagainst", "priority" : 2, "description" : "Goal difference" }, { "name" : "Pts", "equation" : "$win * 2 + $draw", "priority" : 1, "description" : "Team points" } ], "metrics": [ "Height", "Weight" ], "statistics": [ { "name" : "Appearances", "equation" : "$eventsplayed", "description" : "Matches played" }, { "name" : "Win Ratio", "equation" : "$win / $eventsplayed * 100", "precision" : 2, "type" : "average" }, { "name" : "Draw Ratio", "equation" : "$draw / $eventsplayed * 100", "precision" : 2, "type" : "average" }, { "name" : "Loss Ratio", "equation" : "$loss / $eventsplayed * 100", "precision" : 2, "type" : "average" } ], "options": { "mode" : "team" } } ================================================ FILE: readme.txt ================================================ === SportsPress - Sports Club & League Manager === Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi Tags: club, event, fixtures, league, sports Donate link: http://tboy.co/donate Requires at least: 5.0 Tested up to: 6.9 Stable tag: 2.7.29 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html SportsPress 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. == Description == = Create a Professional Sports Website = Transform 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. [youtube http://www.youtube.com/watch?v=KQyga_C5a6M] = Industry Reviews = > "*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) > > "*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) > > "*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/) = Features = * Equation Builder * Club Profiles with Player List * Automated League Standings with Club Logos * Events (Fixtures & Results) with Player Performance * Events Calendar * Player Profiles & Statistics * Player Lists * Staff Profiles * Select Current Club and Previous Clubs * Season Archives * Venue Information & Maps * Statistics & League Table Columns Configuration * Sport Presets * Switch Between Club vs Club and Player vs Player Mode. * Import Events, Clubs, Players, and Staff from CSV Files * Easy Shortcodes Menu in Editor * Events Integrate with iCal * Certified compatibility with [WPML](http://wpml.org/plugin/sportspress/) More details about each feature are available on the [SportsPress Website](http://tboy.co/pro). = Free Extensions = * [SportsPress for Baseball](https://wordpress.org/plugins/sportspress-for-baseball/) * [SportsPress for Basketball](https://wordpress.org/plugins/sportspress-for-basketball/) * [SportsPress for Cricket](https://wordpress.org/plugins/sportspress-for-cricket/) * [SportsPress for Football (Soccer)](https://wordpress.org/plugins/sportspress-for-soccer/) * [SportsPress for Golf](https://wordpress.org/plugins/sportspress-for-golf/) * [SportsPress for Volleyball](https://wordpress.org/plugins/sportspress-for-volleyball/) = SportsPress Pro = Looking 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. = Available Languages = * English – English ( en_US ) * Arabic – العربية ( ar ) * Armenian – Հայերեն ( hy ) * Bulgarian – Български ( bg_BG ) * Chinese (China) – 中文 ( zh_CN ) * Croatian – Hrvatski ( hr ) * Czech – Čeština ( cs_CZ ) * Danish – Dansk ( da_DK ) * Dutch – Nederlands ( nl_NL ) * French – Français ( fr_FR ) * Finnish – Suomi ( fi ) * German – Deutsch ( de_DE ) * Greek – Ελληνικά ( el_GR ) * Hungarian – Magyar ( hu_HU ) * Italian – Italiano ( it_IT ) * Japanese – 日本語 ( ja ) * Korean – 한국어 ( ko_KR ) * Macedonian – македонски ( mk_MK ) * Norwegian Bokmål – Norsk bokmål ( nb_NO ) * Persian – فارسی ( fa_IR ) * Polish – Polski ( pl_PL ) * Portuguese (Brazil) – Português do Brasil ( pt_BR ) * Portuguese (Portugal) – Português ( pt_PT ) * Romanian – Română ( ro_RO ) * Russian – Русский ( ru_RU ) * Slovak – Slovenčina ( sk_SK ) * Slovenian – Slovenija ( sl_SI ) * Spanish – Español ( es_ES ) * Swedish – Svenska ( sv_SE ) * Tagalog - Tagalog ( tl ) * Tamil – தமிழ் ( ta_IN ) * Thai – ไทย ( th ) * Turkish – Türkçe ( tr_TR ) = Sport Presets Included = * American Football * Association Football (Soccer) * Australian Rules Football * Baseball * Basketball * Cricket * Darts * Golf * Handball * Ice Hockey * Lacrosse * Netball * Rugby League * Rugby Union * Snooker * Softball * Squash * Table Tennis * Tennis * Volleyball * Water Polo = Esports Presets = * Counter-Strike: Global Offensive * Dota 2 * League of Legends = SportsPress Themes for Clubs = * [Courtside](http://tboy.co/courtside) * [Emblem](http://tboy.co/emblem) * [Football Club](http://tboy.co/fc) * [Marquee](http://tboy.co/marquee) * [Premier](http://tboy.co/premier) * [Rookie Plus](http://tboy.co/rp) * [Varsity](http://tboy.co/varsity) = Get Involved = Feel free to share your suggestions with us so we can continue to develop awesome sports club features for you guys! Developers can contribute via the [SportsPress GitHub Repository](https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md). Translators can contribute to SportsPress translations through [GlotPress](https://translate.wordpress.org/projects/wp-plugins/sportspress). = Stay Current = To keep up with the latest updates and new features, be sure to do the following: * Visit the [SportsPress Pro homepage](http://tboy.co/pro). * Subscribe to our [YouTube channel](http://tboy.co/youtube). * Follow ThemeBoy on [Facebook](http://tboy.co/facebook) & [Twitter](http://tboy.co/twitter). = Please Rate, Vote, and Enjoy! = Your feedback is much appreciated and makes all the difference in improving SportsPress. == Installation == = Minimum Requirements = * WordPress 3.8 or greater * PHP version 5.2.4 or greater * MySQL version 5.0 or greater [youtube http://www.youtube.com/watch?v=nE8-RlbotmU] = Automatic Installation = Automatic 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. In 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. = Manual Installation = The manual installation method involves downloading our sports plugin and uploading it to your webserver via your favorite FTP application. 1. Download the plugin file to your computer and unzip it 2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation's wp-content/plugins/ directory. 3. Activate the plugin from the Plugins menu within the WordPress admin. = Upgrading = Automatic updates should work like a charm; as always though, ensure you backup your site just in case. If 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. == Screenshots == 1. Add a suite of widgets to your site to display your own sports data. 2. Generate automated standings that update whenever results are published. 3. Schedule matches and display details, results, box scores, and a map to the venue. 4. Register teams and players on your site and create lineups for each team. 5. Display player profiles with configurable details and career stats. 6. Select your sport to automatically install presets and sample data. 7. Each team has a unique logo and website URL. Optionally link teams from your blog to their official websites. 8. The overview page provides a birds-eye view of your entire sports network. 9. Configure variables used throughout the plugin to fit your sport. Presets are provided for some sports, and will automatically populate these options. 10. Design your own points system using the custom drag-and-drop equation builder. == Frequently Asked Questions == = Which sports does this plugin support? = The 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. = Will SportsPress work with my theme? = Yes; SportsPress will work with any theme, but may require some styling to make it match nicely. = Where can I report bugs or contribute to the project? = Bugs can be reported either in our support forum or preferably on the [SportsPress GitHub repository](https://github.com/ThemeBoy/SportsPress/issues). = Will SportsPress work with my sport? = The 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. = Can I import teams/players/staff/matches? = Yes, 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). = What's the difference between the free and Pro plugin? = SportsPress 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. Limitations? 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. [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. The current modules that are available exclusively to SportsPress Pro are: * Tournaments: Create and display tournaments in a bracket/knockout cup format. * Timelines: Display a visual timeline of player performance in events. * Scoreboard: Display multiple event results in a horizontal scoreboard. * Sponsors: Add your sponsors on your website and track each of their clicks and impressions. * Staff Directories: Show contact information of your key personnel so people know who to get in touch with. * Team Access: Assign users to a specific team and limit their access to data related to that team. * Team Colors: Make each team's profile page unique by displaying their team colors. * League Menu: Display a global navigation bar at the top of your website for easy navigation from one team to the next. * Twitter: Add a Twitter feed to team, player, and staff pages. * Branding: Instantly rebrands your admin panel to reflect your organization's brand. * Duplicator: Clone anything with just one click. Great for creating multiple events. There are [3 different licenses](http://tboy.co/pro) that you can choose from: Club, League, and Agency. When 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. == Changelog == = 2.7.29 = * Fix - Error when extensions add null values. * Fix - Non-numeric metrics being converted to numeric values. = 2.7.27 = * Fix - Security issues. = 2.7.26 = * Tweak - Make SportsPress compatible with the Polylang plugin. * Fix - Non-numeric value error in player list. * Fix - Countdown widget null parameter deprecation. * Fix - Deprecated functiong get_page_by_title(). = 2.7.24 = * Update - Leaflet version to 1.9.4. * Tweak - Refactor equation builder to support nested conditional equations. * Tweak - Add option to filter events by venue in admin. * Tweak - Include events with no status in countdown widget. * Fix - Errors related to PHP version 8. * Fix - Statistic format not saving. * Fix - Position stats in offense and defense not saving. * Fix - Google error: Date/time not in ISO 8601 format. * Fix - Minutes in league table. * Fix = Fatal error due to wrong type. = 2.7.23 = * Update - Version bump for SportsPress Pro. = 2.7.22 = * Fix - Security issues. = 2.7.21 = * Fix - Add nonce checks to hide notice links. = 2.7.20 = * Fix - Permalink access for non-admins. = 2.7.19 = * Fix - Games back showing as zero. = 2.7.18 = * Tweak - Only get staff template if enabled. * Tweak - Show visible option only when "Auto" mode is selected. * Fix - "None" option disappeared from dropdowns. * Fix - Minutes not shown when image used as icon. * Fix - Deprecated urlencode() notice. * Fix - Null parameter notice. * Fix - Undefined array key warnings. * Fix - Add user capability check and nonce check when updating permalinks. = 2.7.17 = * Fix - PHP 8.2.x deprecated code warnings. * Fix - Next team not working in shortcodes. * Fix - Links rendering in event specs. * Localization - Update translatable strings. = 2.7.16 = * Update - WP version tested up to 6.1. * Update - Leaflet version to 1.8.0. * Tweak - Datepicker support for event blocks, list, and calendar widgets. * Fix - Toggle between absolute and resltive dates in shortcodes. * Fix - Undefined variables showdob and showage. * Fix - Date range error in player lists. * Fix - Loss condition not applied on event results. * Fix - Can't set statistic variable for player positions. * Fix - API error when using _fields. * Fix - Event map and video not being displayed. * Fix - Escape functions in admin. = 2.7.15 = * Feature - Sports news widget in dashboard. * Fix - Fixture importer bug with extended characters in league and season name. * Fix - Player list not loading (too many resources). * Fix - Performance format not updating. * Fix - Trim whitespace on geo coordinates to avoid import error. = 2.7.14 = * Fix - Error when non-value added as adjustment. * Fix - Map links not escaped properly. * Fix - Event blocks missing attributes. * Fix - Player statistics meta escaping. = 2.7.13 = * Fix - Theme notice escaping. * Fix - Timezone dropdown selection now shown in general settings. * Fix - Double header when multiple player lists are displayed in team. * Fix - Dropdown options not saving in settings. * Fix - Setup page conflict with WooCommerce. = 2.7.12 = * Fix - OpenStreetMap not displaying map after update. = 2.7.11 = * Fix - Player status selector not reflecting changes in match edit screen. * Fix - Player dropdown template not displaying names. * Fix - Staff dropdown template not displaying names. = 2.7.10 = * Fix - Players not selectable in event edit page. * Fix - Videos embedded in post content not rendering. = 2.7.9 = * Tweak - Add support for event format in REST API. * Tweak - Add "Order" and "Order by" selection fields for countdown widget. * Tweak - Add option to display event status in countdown widget. * Tweak - Add ability to filter events by format in calendar template. * Tweak - Update TGM plugin activation library. * Fix - Remove plugin headers from modules for improved compatibility. * Fix - Reverse order not applying to teams in event lists. * Fix - Add validation to user inputs for improved security. * Fix - Sanitize all user inputs for improved security. * Fix - Escape all outputs in admin for improved security. * Fix - Filtering based on format for event blocks. * Fix - Last week and next week filter not applying to player lists. * Fix - Deselecting a selected team in settings. * Fix - PHP 8.0 deprecated warnings. * Localization - Add nationalities and flags for French Guiana, French Polynesia, Guadeloupe, Greenland, Martinique, Reunion, and Sint Maarten. = 2.7.8 = * Fix - Event results, box scores, and players stats not updating via REST API. = 2.7.7 = * Fix - Events not appearing due to filter malfunction. = 2.7.6 = * Feature - Add ability to bulk set events as on time. * Fix - Players in events not being filtered by team. = 2.7.5 = * Tweak - Add ability to filter events by team and match day in one query. * Tweak - Improve performance by updating leaflet script and only loading when required. * Tweak - Add overtime notation compatibility for minutes played. * Fix - Issue with event edit page where the scripts were not working. * Fix - No records when format is default in event list shortcode. = 2.7.4 = * Tweak - Add option to display birthday, age, or both in birthdays widget. * Fix - Player list data showing zeroes in some cases. = 2.7.3 = * Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary. * Tweak - Avoid showing minutes box for subs when not needed. * Tweak - Improve filtering speed for queries without leagues or seasons. * Tweak - Apply reverse order setting in event lists. * Tweak - Enable filtering a player's events played on a specific team. * Fix - Include future events in REST API for WordPress 5.5. * Fix - Enable updating player metrics using the REST API. * Fix - Deprecated code for PHP 7.4. * Fix - Elementor compatibility. * Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini. * Localization - Adjust RTL stylesheet for event performance icons. = 2.7.2 = * Tweak - Sanitize delimiter field in event settings. = 2.7.1 = * Feature - Enable player list filtering by nationality. * Feature - Add option to display date of birth in player lists. * Tweak - Exclude postponed and canceled events from countdowns. * Tweak - Apply reverse order option to event results. * Tweak - When a team has more than one home venue, separate with commas. * Fix - Venue address containing pluses in events. * Fix - Event blocks showing the wrong dates when embedded within other event pages. * Fix - Statistics not adding manual values when not based on equations. * Fix - Event lists ignoring the format parameter. * Fix - League table order when displaying multiple tables in team profiles. * Fix - Error when deleting configuration columns. * Fix - Player lists not including past players in some cases. * Fix - Prevent error when viewing event calendar in some cases. = 2.7 = * Feature - New bulk actions to postpone and cancel multiple events. * Feature - Add date of birth to player importer. * Feature - Automatically select the home team's venue as the default venue when importing fixtures. * Feature - Add ability to turn on comment for team profiles. * Feature - Filter league tables by event status. * Tweak - When an icon is used for player performance, display the icon in player lists and profiles. * Tweak - Add title attribute for player statistic icons. * Tweak - Default stylesheet sorting icon width. * Fix - Icon color picker rendering issue. * Fix - Image selector not working for player statistics. * Fix - Enqueue scripts and styles for OpenStreetMap when used in shortcodes. * Localization - Add translation options for countdown units. = Full Changelog = * For older versions, [view the full changelog](https://github.com/ThemeBoy/SportsPress/blob/master/changelog.txt). ================================================ FILE: sportspress.php ================================================ define_constants(); // Include required files $this->includes(); // Hooks add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) ); add_action( 'init', array( $this, 'init' ), 0 ); add_action( 'init', array( 'SP_Shortcodes', 'init' ) ); add_action( 'after_setup_theme', array( $this, 'setup_environment' ) ); add_action( 'tgmpa_register', array( $this, 'extension' ) ); // Include core modules $this->include_modules(); // Loaded action do_action( 'sportspress_loaded' ); } /** * Show action links on the plugin screen. * * @param mixed $links * @return array */ public function action_links( $links ) { return array_merge( array( '' . esc_attr__( 'Settings', 'sportspress' ) . '', '' . esc_attr__( 'Docs', 'sportspress' ) . '', '' . esc_attr__( 'Upgrade', 'sportspress' ) . '', ), $links ); } /** * Auto-load SP classes on demand to reduce memory consumption. * * @param mixed $class * @return void */ public function autoload( $class ) { $path = null; $class = strtolower( $class ); $file = 'class-' . str_replace( '_', '-', $class ) . '.php'; if ( strpos( $class, 'sp_shortcode_' ) === 0 ) { $path = $this->plugin_path() . '/includes/shortcodes/'; } elseif ( strpos( $class, 'sp_meta_box' ) === 0 ) { $path = $this->plugin_path() . '/includes/admin/post-types/meta-boxes/'; } elseif ( strpos( $class, 'sp_admin' ) === 0 ) { $path = $this->plugin_path() . '/includes/admin/'; } if ( $path && is_readable( $path . $file ) ) { include_once $path . $file; return; } // Fallback if ( strpos( $class, 'sp_' ) === 0 ) { $path = $this->plugin_path() . '/includes/'; } if ( $path && is_readable( $path . $file ) ) { include_once $path . $file; return; } } /** * Define SP Constants. */ private function define_constants() { define( 'SP_PLUGIN_FILE', __FILE__ ); define( 'SP_VERSION', $this->version ); if ( ! defined( 'SP_TEMPLATE_PATH' ) ) { define( 'SP_TEMPLATE_PATH', $this->template_path() ); } if ( ! defined( 'SP_DELIMITER' ) ) { define( 'SP_DELIMITER', '|' ); } } /** * Include required core files used in admin and on the frontend. */ private function includes() { include_once 'includes/sp-core-functions.php'; include_once 'includes/class-sp-install.php'; if ( is_admin() ) { include_once 'includes/admin/class-sp-admin.php'; } if ( defined( 'DOING_AJAX' ) ) { $this->ajax_includes(); } if ( ! is_admin() || defined( 'DOING_AJAX' ) ) { $this->frontend_includes(); } // Post types include_once 'includes/class-sp-post-types.php'; // Registers post types // Include abstract classes include_once 'includes/abstracts/abstract-sp-custom-post.php'; // Custom posts include_once 'includes/abstracts/abstract-sp-secondary-post.php'; // Secondary posts // Classes (used on all pages) include_once 'includes/class-sp-modules.php'; // Defines available modules include_once 'includes/class-sp-countries.php'; // Defines continents and countries include_once 'includes/class-sp-formats.php'; // Defines custom post type formats include_once 'includes/class-sp-templates.php'; // Defines custom post type templates include_once 'includes/class-sp-feeds.php'; // Adds feeds // Include template functions making them pluggable by plugins and themes. include_once 'includes/sp-template-functions.php'; // Include template hooks in time for themes to remove/modify them include_once 'includes/sp-template-hooks.php'; // WPML-related localization hooks include_once 'includes/class-sp-wpml.php'; // REST API include_once 'includes/api/class-sp-rest-api.php'; // TGMPA include_once 'includes/libraries/class-tgm-plugin-activation.php'; } /** * Include required ajax files. */ public function ajax_includes() { include_once 'includes/class-sp-ajax.php'; // Ajax functions for admin and the front-end } /** * Include required frontend files. */ public function frontend_includes() { include_once 'includes/class-sp-template-loader.php'; // Template Loader include_once 'includes/class-sp-frontend-scripts.php'; // Frontend Scripts include_once 'includes/class-sp-shortcodes.php'; // Shortcodes class } /** * Include core modules. */ private function include_modules() { $dir = scandir( $this->plugin_path() . '/modules' ); if ( $dir ) { $path = $this->plugin_path() . '/modules/'; foreach ( $dir as $module ) { if ( $path && substr( $module, 0, 1 ) !== '.' ) { if ( is_readable( $path . $module ) ) { include_once $path . $module; } } } } } /** * Init SportsPress when WordPress Initialises. */ public function init() { // Before init action do_action( 'before_sportspress_init' ); // Set up localisation $this->load_plugin_textdomain(); // Load class instances $this->modules = new SP_Modules(); // Modules class $this->countries = new SP_Countries(); // Countries class $this->formats = new SP_Formats(); // Formats class $this->templates = new SP_Templates(); // Templates class $this->feeds = new SP_Feeds(); // Feeds class // Load string options $this->text = get_option( 'sportspress_text', array() ); // Init action do_action( 'sportspress_init' ); } /** * Load Localisation files. * * Note: the first-loaded translation file overrides any following ones if the same translation is present */ public function load_plugin_textdomain() { $locale = apply_filters( 'plugin_locale', get_locale(), 'sportspress' ); // Global + Frontend Locale load_textdomain( 'sportspress', WP_LANG_DIR . "/sportspress/sportspress-$locale.mo" ); load_plugin_textdomain( 'sportspress', false, plugin_basename( dirname( __FILE__ ) . '/languages' ) ); } /** * Ensure theme and server variable compatibility and setup image sizes. */ public function setup_environment() { if ( ! current_theme_supports( 'post-thumbnails' ) ) { add_theme_support( 'post-thumbnails' ); } // Add image sizes add_image_size( 'sportspress-crop-medium', 300, 300, true ); add_image_size( 'sportspress-fit-medium', 300, 300, false ); add_image_size( 'sportspress-fit-icon', 128, 128, false ); add_image_size( 'sportspress-fit-mini', 32, 32, false ); } /** * Recommend SportsPress extension for available sports. */ public static function extension() { $sport = sp_array_value( $_POST, 'sportspress_sport', get_option( 'sportspress_sport', null ), 'key' ); if ( ! $sport ) { return; } $plugins = array(); switch ( $sport ) : case 'baseball': $plugins[] = array( 'name' => 'SportsPress for Baseball', 'slug' => 'sportspress-for-baseball', 'required' => false, 'version' => '1.0', ); break; case 'basketball': $plugins[] = array( 'name' => 'SportsPress for Basketball', 'slug' => 'sportspress-for-basketball', 'required' => false, 'version' => '0.9.1', ); break; case 'cricket': $plugins[] = array( 'name' => 'SportsPress for Cricket', 'slug' => 'sportspress-for-cricket', 'required' => false, 'version' => '1.1.1', ); break; case 'golf': $plugins[] = array( 'name' => 'SportsPress for Golf', 'slug' => 'sportspress-for-golf', 'required' => false, 'version' => '0.9.1', ); break; case 'soccer': $plugins[] = array( 'name' => 'SportsPress for Football (Soccer)', 'slug' => 'sportspress-for-soccer', 'required' => false, 'version' => '0.9.6', ); break; case 'volleyball': $plugins[] = array( 'name' => 'SportsPress for Volleyball', 'slug' => 'sportspress-for-volleyball', 'required' => false, 'version' => '0.9', ); break; endswitch; $config = array( 'id' => 'sportspress', 'default_path' => '', 'menu' => 'tgmpa-install-plugins', 'parent_slug' => 'plugins.php', 'capability' => 'manage_options', 'has_notices' => true, 'dismissable' => true, 'is_automatic' => true, 'message' => '', 'strings' => array( 'nag_type' => 'updated', ), ); tgmpa( $plugins, $config ); } /** Helper functions ******************************************************/ /** * Get the plugin url. * * @return string */ public function plugin_url() { return untrailingslashit( plugins_url( '/', __FILE__ ) ); } /** * Get the plugin path. * * @return string */ public function plugin_path() { return untrailingslashit( plugin_dir_path( __FILE__ ) ); } /** * Get the template path. * * @return string */ public function template_path() { return apply_filters( 'SP_TEMPLATE_PATH', 'sportspress/' ); } } endif; if ( ! function_exists( 'SP' ) ) : /** * Returns the main instance of SP to prevent the need to use globals. * * @since 0.7 * @return SportsPress */ function SP() { return SportsPress::instance(); } endif; SP(); /** * Want to work with us? * * @link https://www.themeboy.com/jobs/ */ ================================================ FILE: templates/birthdays.php ================================================ 'day', 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'size' => 'sportspress-fit-medium', 'birthday_format' => 'birthday', 'show_player_birthday' => get_option( 'sportspress_player_show_birthday', 'no' ) == 'yes' ? true : false, 'show_staff_birthday' => get_option( 'sportspress_staff_show_birthday', 'no' ) == 'yes' ? true : false, 'link_players' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, 'link_staff' => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); $args = array( 'post_type' => array( 'sp_player', 'sp_staff' ), 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'ASC', 'monthnum' => date( 'n' ), ); if ( $date == 'day' ) { $args['day'] = date( 'j' ); } if ( $date == 'week' ) { unset( $args['monthnum'] ); $args['date_query'] = array( array( 'month' => date( 'n' ), 'day' => date( 'j' ), ), array( 'month' => date( 'n', strtotime( '+1 day' ) ), 'day' => date( 'j', strtotime( '+1 day' ) ), ), array( 'month' => date( 'n', strtotime( '+2 days' ) ), 'day' => date( 'j', strtotime( '+2 days' ) ), ), array( 'month' => date( 'n', strtotime( '+3 days' ) ), 'day' => date( 'j', strtotime( '+3 days' ) ), ), array( 'month' => date( 'n', strtotime( '+4 days' ) ), 'day' => date( 'j', strtotime( '+4 days' ) ), ), array( 'month' => date( 'n', strtotime( '+5 days' ) ), 'day' => date( 'j', strtotime( '+5 days' ) ), ), array( 'month' => date( 'n', strtotime( '+6 days' ) ), 'day' => date( 'j', strtotime( '+6 days' ) ), ), array( 'month' => date( 'n', strtotime( '+1 week' ) ), 'day' => date( 'j', strtotime( '+1 week' ) ), ), 'relation' => 'OR', ); } $posts = get_posts( $args ); foreach ( $posts as $post ) { echo '\n"; } ================================================ FILE: templates/countdown.php ================================================ null, 'calendar' => null, 'order' => null, 'orderby' => null, 'league' => null, 'season' => null, 'id' => null, 'title' => null, 'live' => get_option( 'sportspress_enable_live_countdowns', 'yes' ) == 'yes' ? true : false, 'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_venues' => get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false, 'show_logos' => get_option( 'sportspress_countdown_show_logos', 'no' ) == 'yes' ? true : false, 'show_thumbnail' => get_option( 'sportspress_countdown_show_thumbnail', 'no' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); if ( isset( $show_excluded ) && $show_excluded ) { $excluded_statuses = array(); } else { $excluded_statuses = apply_filters( 'sp_countdown_excluded_statuses', array( 'postponed', 'cancelled', ) ); } if ( isset( $id ) ) : $post = get_post( $id ); elseif ( $calendar ) : $calendar = new SP_Calendar( $calendar ); if ( $team ) { $calendar->team = $team; } $calendar->status = 'future'; if ( $order ) { $calendar->order = $order; } else { $calendar->order = 'ASC'; } if ( $orderby ) { $calendar->orderby = $orderby; } $data = $calendar->data(); /** * Exclude postponed or cancelled events. */ while ( $post = array_shift( $data ) ) { $sp_status = get_post_meta( $post->ID, 'sp_status', true ); if ( ! in_array( $sp_status, $excluded_statuses ) ) { break; } } else : $args = array(); if ( isset( $team ) ) { $args['meta_query'] = array( array( 'key' => 'sp_team', 'value' => $team, ), ); } if ( isset( $league ) || isset( $season ) ) { $args['tax_query'] = array( 'relation' => 'AND' ); if ( isset( $league ) ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'terms' => $league, ); } if ( isset( $season ) ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'terms' => $season, ); } } /** * Exclude postponed or cancelled events. */ $args['meta_query'][] = array( 'relation' => 'OR', array( 'key' => 'sp_status', 'compare' => 'NOT IN', 'value' => $excluded_statuses, ), array( 'key' => 'sp_status', 'compare' => 'NOT EXISTS', ), ); $post = sp_get_next_event( $args ); endif; if ( ! isset( $post ) || ! $post ) { return; } if ( $title ) { echo '

    ' . wp_kses_post( $title ) . '

    '; } $title = $post->post_title; if ( $link_events ) { $title = '' . $title . ''; } if ( isset( $show_status ) && $show_status ) { $sp_status = get_post_meta( $post->ID, 'sp_status', true ); // Avoid Undefined index warnings if no status is set (i.e. during import) if ( $sp_status == '' ) { $sp_status = 'ok'; } $statuses = apply_filters( 'sportspress_event_statuses', array( 'ok' => esc_attr__( 'On time', 'sportspress' ), 'tbd' => esc_attr__( 'TBD', 'sportspress' ), 'postponed' => esc_attr__( 'Postponed', 'sportspress' ), 'cancelled' => esc_attr__( 'Canceled', 'sportspress' ), ) ); $title = $title . ' (' . $statuses[ $sp_status ] . ')'; } ?>

    ID, 'sp_team' ) ); $i = 0; if ( is_array( $teams ) ) { foreach ( $teams as $team ) { $i++; if ( has_post_thumbnail( $team ) ) { if ( $link_teams ) { echo ''; } else { echo get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) ) ); } } } } } ?>

    ID, 'sp_venue' ); if ( $venues ) : ?>
    ID, 'sp_venue' ); } else { $venue_names = array(); foreach ( $venues as $venue ) { $venue_names[] = $venue->name; } echo wp_kses_post( implode( '/', $venue_names ) ); } ?>
    ID, 'sp_league' ); if ( $leagues ) : foreach ( $leagues as $league ) : $term = get_term( $league->term_id, 'sp_league' ); ?>
    name ); ?>
    post_date ); $interval = date_diff( $now, $date ); $days = $interval->invert ? 0 : $interval->days; $h = $interval->invert ? 0 : $interval->h; $i = $interval->invert ? 0 : $interval->i; $s = $interval->invert ? 0 : $interval->s; ?>

    ================================================ FILE: templates/event-blocks.php ================================================ null, 'event' => null, 'title' => false, 'status' => 'default', 'format' => 'default', 'date' => 'default', 'date_from' => 'default', 'date_to' => 'default', 'date_past' => 'default', 'date_future' => 'default', 'date_relative' => 'default', 'day' => 'default', 'league' => null, 'season' => null, 'venue' => null, 'team' => null, 'teams_past' => null, 'date_before' => null, 'player' => null, 'number' => -1, 'show_team_logo' => get_option( 'sportspress_event_blocks_show_logos', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_event_blocks_rows', 5 ), 'orderby' => 'default', 'order' => 'default', 'columns' => null, 'show_all_events_link' => false, 'show_title' => get_option( 'sportspress_event_blocks_show_title', 'no' ) == 'yes' ? true : false, 'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false, 'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false, 'show_matchday' => get_option( 'sportspress_event_blocks_show_matchday', 'no' ) == 'yes' ? true : false, 'show_venue' => get_option( 'sportspress_event_blocks_show_venue', 'no' ) == 'yes' ? true : false, 'hide_if_empty' => false, ); extract( $defaults, EXTR_SKIP ); $calendar = new SP_Calendar( $id ); if ( $status != 'default' ) { $calendar->status = $status; } if ( $format != 'default' ) { $calendar->event_format = $format; } if ( $date != 'default' ) { $calendar->date = $date; } if ( $date_from != 'default' ) { $calendar->from = $date_from; } if ( $date_to != 'default' ) { $calendar->to = $date_to; } if ( $date_past != 'default' ) { $calendar->past = $date_past; } if ( $date_future != 'default' ) { $calendar->future = $date_future; } if ( $date_relative != 'default' ) { $calendar->relative = $date_relative; } if ( $event ) { $calendar->event = $event; } if ( $league ) { $calendar->league = $league; } if ( $season ) { $calendar->season = $season; } if ( $venue ) { $calendar->venue = $venue; } if ( $team ) { $calendar->team = $team; } if ( $teams_past ) { $calendar->teams_past = $teams_past; } if ( $date_before ) { $calendar->date_before = $date_before; } if ( $player ) { $calendar->player = $player; } if ( $order != 'default' ) { $calendar->order = $order; } if ( $orderby != 'default' ) { $calendar->orderby = $orderby; } if ( $day != 'default' ) { $calendar->day = $day; } $data = $calendar->data(); $usecolumns = $calendar->columns; if ( isset( $columns ) ) : if ( is_array( $columns ) ) { $usecolumns = $columns; } else { $usecolumns = explode( ',', $columns ); } endif; if ( $hide_if_empty && empty( $data ) ) { return false; } if ( $show_title && false === $title && $id ) : $caption = $calendar->caption; if ( $caption ) { $title = $caption; } else { $title = get_the_title( $id ); } endif; if ( $title ) { echo '

    ' . wp_kses_post( $title ) . '

    '; } ?>
    0 ) { $limit = $number; } foreach ( $data as $event ) : if ( isset( $limit ) && $i >= $limit ) { continue; } $permalink = get_post_permalink( $event, false, true ); $results = sp_get_main_results_or_time( $event ); $teams = array_unique( get_post_meta( $event->ID, 'sp_team' ) ); $teams = array_filter( $teams, 'sp_filter_positive' ); $logos = array(); $event_status = get_post_meta( $event->ID, 'sp_status', true ); if ( get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ) { $teams = array_reverse( $teams, true ); $results = array_reverse( $results, true ); } if ( $show_team_logo ) : $j = 0; foreach ( $teams as $team ) : $j++; $team_name = get_the_title( $team ); if ( has_post_thumbnail( $team ) ) : $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'itemprop' => 'logo' ) ); if ( $link_teams ) : $team_permalink = get_permalink( $team, false, true ); $logo = ''; endif; $logo = ''; else : $logo = ''; endif; $logos[] = $logo; endforeach; endif; if ( 'day' === $calendar->orderby ) : $event_group = get_post_meta( $event->ID, 'sp_day', true ); if ( ! isset( $group ) || $event_group !== $group ) : $group = $event_group; echo ''; endif; endif; ?>
    ', esc_attr__( 'Match Day', 'sportspress' ), ' ', wp_kses_post( $group ), '
    ID, 'sp_day', true ); if ( $matchday != '' ) : ?>
    ()
    ' . implode( ' - ', apply_filters( 'sportspress_event_blocks_team_result_or_time', $results, $event->ID ) ) . '', $permalink, $link_events ) ); ?>
    name ); ?>
    name ); ?>
    name ); ?>

    post_title, $permalink, $link_events ) ); ?>

    ' . esc_attr__( 'View all events', 'sportspress' ) . '
    '; } ?>
    ================================================ FILE: templates/event-calendar.php ================================================ null, 'status' => 'default', 'format' => 'default', 'date' => 'default', 'date_from' => 'default', 'date_to' => 'default', 'date_past' => 'default', 'date_future' => 'default', 'date_relative' => 'default', 'day' => 'default', 'league' => null, 'season' => null, 'venue' => null, 'team' => null, 'player' => null, 'initial' => true, 'caption_tag' => 'caption', 'show_all_events_link' => false, 'override_global_date' => false, ); extract( $defaults, EXTR_SKIP ); $calendar = new SP_Calendar( $id ); if ( $status != 'default' ) { $calendar->status = $status; } if ( $format != 'default' ) { $calendar->event_format = $format; } if ( $date != 'default' ) { $calendar->date = $date; } if ( $date_from != 'default' ) { $calendar->from = $date_from; } if ( $date_to != 'default' ) { $calendar->to = $date_to; } if ( $date_past != 'default' ) { $calendar->past = $date_past; } if ( $date_future != 'default' ) { $calendar->future = $date_future; } if ( $date_relative != 'default' ) { $calendar->relative = $date_relative; } if ( $day != 'default' ) { $calendar->day = $day; } if ( $league ) { $calendar->league = $league; } if ( $season ) { $calendar->season = $season; } if ( $venue ) { $calendar->venue = $venue; } if ( $team ) { $calendar->team = $team; } if ( $player ) { $calendar->player = $player; } if ( $override_global_date ) { $year = gmdate( 'Y', current_time( 'timestamp' ) ); $monthnum = gmdate( 'm', current_time( 'timestamp' ) ); } $events = $calendar->data(); if ( empty( $events ) ) { $in = 'AND 1 = 0'; // False logic to prevent SQL error } else { $event_ids = wp_list_pluck( $events, 'ID' ); $in = 'AND ID IN (' . implode( ', ', $event_ids ) . ')'; } // week_begins = 0 stands for Sunday $week_begins = intval( get_option( 'start_of_week' ) ); // Get year and month from query vars $year = isset( $_GET['sp_year'] ) ? sanitize_text_field( wp_unslash( $_GET['sp_year'] ) ) : $year; $monthnum = isset( $_GET['sp_month'] ) ? sanitize_text_field( wp_unslash( $_GET['sp_month'] ) ) : $monthnum; // Let's figure out when we are if ( ! empty( $monthnum ) && ! empty( $year ) ) { $thismonth = '' . zeroise( intval( $monthnum ), 2 ); $thisyear = '' . intval( $year ); } elseif ( ! empty( $w ) ) { // We need to get the month from MySQL $thisyear = '' . intval( substr( $m, 0, 4 ) ); $d = ( ( $w - 1 ) * 7 ) + 6; // it seems MySQL's weeks disagree with PHP's $thismonth = $wpdb->get_var( "SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')" ); } elseif ( ! empty( $m ) ) { $thisyear = '' . intval( substr( $m, 0, 4 ) ); if ( strlen( $m ) < 6 ) { $thismonth = '01'; } else { $thismonth = '' . zeroise( intval( substr( $m, 4, 2 ) ), 2 ); } } else { $thisyear = gmdate( 'Y', current_time( 'timestamp' ) ); $thismonth = gmdate( 'm', current_time( 'timestamp' ) ); } $unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear ); $last_day = date( 't', $unixmonth ); // Get the next and previous month and year with at least one post $previous = $wpdb->get_row( "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date < '$thisyear-$thismonth-01' AND post_type = 'sp_event' AND ( post_status = 'publish' OR post_status = 'future' ) $in ORDER BY post_date DESC LIMIT 1" ); $next = $wpdb->get_row( "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59' AND post_type = 'sp_event' AND ( post_status = 'publish' OR post_status = 'future' ) $in ORDER BY post_date ASC LIMIT 1" ); /* translators: Calendar caption: 1: month name, 2: 4-digit year */ $calendar_caption = _x( '%1$s %2$s', 'calendar caption', 'sportspress' ); $calendar_output = '
    '; $myweek = array(); for ( $wdcount = 0; $wdcount <= 6; $wdcount++ ) { $myweek[] = $wp_locale->get_weekday( ( $wdcount + $week_begins ) % 7 ); } foreach ( $myweek as $wd ) { $day_name = ( true == $initial ) ? $wp_locale->get_weekday_initial( $wd ) : $wp_locale->get_weekday_abbrev( $wd ); $wd = esc_attr( $wd ); $calendar_output .= "\n\t\t"; } $calendar_output .= ' '; if ( $previous ) { $calendar_output .= "\n\t\t" . ''; } else { $calendar_output .= "\n\t\t" . ''; } $calendar_output .= "\n\t\t" . ''; if ( $next ) { $calendar_output .= "\n\t\t" . ''; } else { $calendar_output .= "\n\t\t" . ''; } $calendar_output .= ' '; // Get days with posts $dayswithposts = $wpdb->get_results( "SELECT DAYOFMONTH(post_date), ID FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' AND post_type = 'sp_event' AND ( post_status = 'publish' OR post_status = 'future' ) $in AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N ); if ( $dayswithposts ) { foreach ( (array) $dayswithposts as $daywith ) { $daywithpost[ $daywith[0] ][] = $daywith[1]; } } else { $daywithpost = array(); } if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) && preg_match( '/(MSIE|camino|safari)/', wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $ak_title_separator = "\n"; } else { $ak_title_separator = ', '; } $ak_titles_for_day = array(); $ak_post_titles = $wpdb->get_results( 'SELECT ID, post_title, post_date, DAYOFMONTH(post_date) as dom ' . "FROM $wpdb->posts " . "WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' " . "AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' " . "AND post_type = 'sp_event' AND ( post_status = 'publish' OR post_status = 'future' ) " . "$in" ); if ( $ak_post_titles ) { foreach ( (array) $ak_post_titles as $ak_post_title ) { /** This filter is documented in wp-includes/post-template.php */ $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 ) ); if ( empty( $ak_titles_for_day[ 'day_' . $ak_post_title->dom ] ) ) { $ak_titles_for_day[ 'day_' . $ak_post_title->dom ] = ''; } if ( empty( $ak_titles_for_day[ "$ak_post_title->dom" ] ) ) { // first one $ak_titles_for_day[ "$ak_post_title->dom" ] = $post_title; } else { $ak_titles_for_day[ "$ak_post_title->dom" ] .= $ak_title_separator . $post_title; } } } // See how much we should pad in the beginning $pad = calendar_week_mod( date( 'w', $unixmonth ) - $week_begins ); if ( 0 != $pad ) { $calendar_output .= "\n\t\t" . ''; } $daysinmonth = intval( date( 't', $unixmonth ) ); for ( $day = 1; $day <= $daysinmonth; ++$day ) { if ( isset( $newrow ) && $newrow ) { $calendar_output .= "\n\t\n\t\n\t\t"; } $newrow = false; $day_has_posts = array_key_exists( $day, $daywithpost ); $td_properties = ''; if ( $day == gmdate( 'j', current_time( 'timestamp' ) ) && $thismonth == gmdate( 'm', current_time( 'timestamp' ) ) && $thisyear == gmdate( 'Y', current_time( 'timestamp' ) ) ) { $td_properties .= ' id="today" class="sp-highlight"'; } if ( $day_has_posts ) { $td_properties .= ' itemscope itemtype="http://schema.org/SportsEvent"'; } $calendar_output .= ''; if ( $day_has_posts ) { // any posts today? $calendar_output .= '$day"; } else { $calendar_output .= $day; } $calendar_output .= ''; if ( 6 == calendar_week_mod( date( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) { $newrow = true; } } $pad = 7 - calendar_week_mod( date( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ); if ( $pad != 0 && $pad != 7 ) { $calendar_output .= "\n\t\t" . ''; } $calendar_output .= "\n\t\n\t\n\t
    ' . ( $caption_tag == 'caption' ? '' : '<' . $caption_tag . '>' ) . sprintf( $calendar_caption, $wp_locale->get_month( $thismonth ), date( 'Y', $unixmonth ) ) . ( $caption_tag == 'caption' ? '' : '' ) . '
    $day_name
    « ' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $previous->month ) ) . '  ' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $next->month ) ) . ' » 
     
     
    \n\t
    "; if ( $id && $show_all_events_link ) { $calendar_output .= ''; } ?>
    ================================================ FILE: templates/event-details.php ================================================ null, 'sp_season' => null, ) ); foreach ( $taxonomies as $taxonomy => $post_type ) : $terms = get_the_terms( $id, $taxonomy ); if ( $terms ) : $obj = get_taxonomy( $taxonomy ); $term = array_shift( $terms ); $data[ $obj->labels->singular_name ] = $term->name; endif; endforeach; if ( 'yes' === get_option( 'sportspress_event_show_day', 'yes' ) ) { $day = get_post_meta( $id, 'sp_day', true ); if ( '' !== $day ) { $data[ esc_attr__( 'Match Day', 'sportspress' ) ] = $day; } } if ( 'yes' === get_option( 'sportspress_event_show_full_time', 'yes' ) ) { $full_time = get_post_meta( $id, 'sp_minutes', true ); if ( '' === $full_time ) { $full_time = get_option( 'sportspress_event_minutes', 90 ); } $data[ esc_attr__( 'Full Time', 'sportspress' ) ] = $full_time . '\''; } $data = apply_filters( 'sportspress_event_details', $data, $id ); if ( ! sizeof( $data ) ) { return; } ?>

    $value ) : ?>
    ================================================ FILE: templates/event-fixtures-results.php ================================================ null, 'date' => 'default', 'date_from' => 'default', 'date_to' => 'default', 'league' => null, 'season' => null, 'team' => null, 'player' => null, 'number' => -1, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_event_blocks_rows', 5 ), 'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false, 'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false, 'show_venue' => get_option( 'sportspress_event_blocks_show_venue', 'no' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); $calendar = new SP_Calendar( $id ); if ( $date != 'default' ) { $calendar->date = $date; } if ( $date_from != 'default' ) { $calendar->from = $date_from; } if ( $date_to != 'default' ) { $calendar->to = $date_to; } if ( $league ) { $calendar->league = $league; } if ( $season ) { $calendar->season = $season; } if ( $team ) { $calendar->team = $team; } if ( $player ) { $calendar->player = $player; } $args = array( 'id' => $id, 'title' => esc_attr__( 'Fixtures', 'sportspress' ), 'status' => 'future', 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'league' => $league, 'season' => $season, 'team' => $team, 'player' => $player, 'number' => $number, 'link_teams' => $link_teams, 'link_events' => $link_events, 'paginated' => $paginated, 'rows' => $rows, 'order' => 'ASC', 'show_all_events_link' => false, 'show_title' => true, 'show_league' => $show_league, 'show_season' => $show_season, 'show_venue' => $show_venue, 'hide_if_empty' => true, ); echo '
    '; ob_start(); sp_get_template( 'event-blocks.php', $args ); $fixtures = ob_get_clean(); $args['title'] = esc_attr__( 'Results', 'sportspress' ); $args['status'] = 'publish'; $args['order'] = 'DESC'; ob_start(); sp_get_template( 'event-blocks.php', $args ); $results = ob_get_clean(); if ( false == $fixtures || false == $results ) { echo $fixtures; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $results; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { echo '
    '; echo $fixtures; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '
    '; echo '
    '; echo $results; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '
    '; } echo '
    '; ================================================ FILE: templates/event-list.php ================================================ null, 'title' => false, 'status' => 'default', 'format' => 'default', 'date' => 'default', 'date_from' => 'default', 'date_to' => 'default', 'date_past' => 'default', 'date_future' => 'default', 'date_relative' => 'default', 'day' => 'default', 'league' => null, 'season' => null, 'venue' => null, 'team' => null, 'teams_past' => null, 'date_before' => null, 'player' => null, 'number' => -1, 'show_team_logo' => get_option( 'sportspress_event_list_show_logos', 'no' ) == 'yes' ? true : false, 'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_venues' => get_option( 'sportspress_link_venues', 'yes' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_event_list_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_event_list_rows', 10 ), 'order' => 'default', 'columns' => null, 'show_all_events_link' => false, 'show_title' => get_option( 'sportspress_event_list_show_title', 'yes' ) == 'yes' ? true : false, 'title_format' => get_option( 'sportspress_event_list_title_format', 'title' ), 'time_format' => get_option( 'sportspress_event_list_time_format', 'combined' ), ); extract( $defaults, EXTR_SKIP ); $calendar = new SP_Calendar( $id ); if ( $status != 'default' ) { $calendar->status = $status; } if ( $format != 'default' ) { $calendar->event_format = $format; } if ( $date != 'default' ) { $calendar->date = $date; } if ( $date_from != 'default' ) { $calendar->from = $date_from; } if ( $date_to != 'default' ) { $calendar->to = $date_to; } if ( $date_past != 'default' ) { $calendar->past = $date_past; } if ( $date_future != 'default' ) { $calendar->future = $date_future; } if ( $date_relative != 'default' ) { $calendar->relative = $date_relative; } if ( $league ) { $calendar->league = $league; } if ( $season ) { $calendar->season = $season; } if ( $venue ) { $calendar->venue = $venue; } if ( $team ) { $calendar->team = $team; } if ( $teams_past ) { $calendar->teams_past = $teams_past; } if ( $date_before ) { $calendar->date_before = $date_before; } if ( $player ) { $calendar->player = $player; } if ( $order != 'default' ) { $calendar->order = $order; } if ( $day != 'default' ) { $calendar->day = $day; } $data = $calendar->data(); $usecolumns = $calendar->columns; if ( isset( $columns ) ) : if ( is_array( $columns ) ) { $usecolumns = $columns; } else { $usecolumns = explode( ',', $columns ); } endif; if ( $show_title && false === $title && $id ) : $caption = $calendar->caption; if ( $caption ) { $title = $caption; } else { $title = get_the_title( $id ); } endif; $labels = array(); // Create a unique identifier based on the current time in microseconds $identifier = uniqid( 'eventlist_' ); ?>

    ' . esc_attr__( 'Date', 'sportspress' ) . ''; switch ( $title_format ) { case 'homeaway': if ( sp_column_active( $usecolumns, 'event' ) ) { echo ''; } if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) { echo ''; $labels[] = esc_attr__( 'Time/Results', 'sportspress' ); } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) { echo ''; } if ( sp_column_active( $usecolumns, 'event' ) ) { echo ''; } if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) { echo ''; } break; default: if ( sp_column_active( $usecolumns, 'event' ) ) { if ( $title_format == 'teams' ) { echo ''; } else { echo ''; } } switch ( $time_format ) { case 'separate': if ( sp_column_active( $usecolumns, 'time' ) ) { echo ''; } if ( sp_column_active( $usecolumns, 'results' ) ) { echo ''; } break; case 'time': if ( sp_column_active( $usecolumns, 'time' ) ) { echo ''; } break; case 'results': if ( sp_column_active( $usecolumns, 'results' ) ) { echo ''; } break; default: if ( sp_column_active( $usecolumns, 'time' ) ) { echo ''; } } } if ( sp_column_active( $usecolumns, 'league' ) ) { echo ''; } if ( sp_column_active( $usecolumns, 'season' ) ) { echo ''; } if ( sp_column_active( $usecolumns, 'venue' ) ) { echo ''; } else { echo ''; } if ( sp_column_active( $usecolumns, 'article' ) ) { echo ''; } if ( sp_column_active( $usecolumns, 'day' ) ) { echo ''; } do_action( 'sportspress_event_list_head_row', $usecolumns ); ?> 0 ) { $limit = $number; } foreach ( $data as $event ) : if ( isset( $limit ) && $i >= $limit ) { continue; } $teams = get_post_meta( $event->ID, 'sp_team' ); $video = get_post_meta( $event->ID, 'sp_video', true ); $status = get_post_meta( $event->ID, 'sp_status', true ); $main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID ); $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false; if ( $reverse_teams ) { $main_results = array_reverse( $main_results, true ); } $teams_output = ''; $team_class = ''; $teams_array = array(); $team_logos = array(); if ( $teams ) : foreach ( $teams as $t => $team ) : $name = sp_team_short_name( $team ); if ( $name ) : $name = '' . $name; if ( $show_team_logo ) : if ( has_post_thumbnail( $team ) ) : $logo = ''; $team_logos[] = $logo; $team_class .= ' has-logo'; if ( $t ) : $name = $logo . ' ' . $name; else : $name .= ' ' . $logo; endif; endif; endif; if ( $link_teams ) : $team_output = ''; else : $team_output = $name; endif; $team_result = sp_array_value( $main_results, $team, null ); if ( $team_result != null ) : if ( $usecolumns != null && ! in_array( 'time', $usecolumns ) ) : $team_output .= ' (' . $team_result . ')'; endif; endif; $teams_array[] = $team_output; $teams_output .= $team_output . '
    '; endif; endforeach; else : $teams_output .= '—'; endif; echo ''; $date_html = '' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '' . apply_filters( 'sportspress_event_date', get_post_time( get_option( 'date_format' ), false, $event, true ), $event->ID ); if ( $link_events ) { $date_html = ''; } echo ''; // Check if the reverse_teams option is selected and alter the teams order if ( $reverse_teams ) { $teams_array = array_reverse( $teams_array, true ); } switch ( $title_format ) { case 'homeaway': if ( sp_column_active( $usecolumns, 'event' ) ) { $team = array_shift( $teams_array ); echo ''; } if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) { echo ''; } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) { echo ''; } if ( sp_column_active( $usecolumns, 'event' ) ) { $team = array_shift( $teams_array ); echo ''; } if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) { echo ''; } break; default: if ( sp_column_active( $usecolumns, 'event' ) ) { if ( $title_format == 'teams' ) { echo ''; } else { $title_html = implode( ' ', $team_logos ) . ' ' . $event->post_title; if ( $link_events ) { $title_html = '' . $title_html . ''; } echo ''; } } switch ( $time_format ) { case 'separate': if ( sp_column_active( $usecolumns, 'time' ) ) { echo ''; } if ( sp_column_active( $usecolumns, 'results' ) ) { echo ''; } break; case 'time': if ( sp_column_active( $usecolumns, 'time' ) ) { echo ''; } break; case 'results': if ( sp_column_active( $usecolumns, 'results' ) ) { echo ''; } break; default: if ( sp_column_active( $usecolumns, 'time' ) ) { echo ''; } } } if ( sp_column_active( $usecolumns, 'league' ) ) : echo ''; endif; if ( sp_column_active( $usecolumns, 'season' ) ) : echo ''; endif; if ( sp_column_active( $usecolumns, 'venue' ) ) : echo ''; else : echo ''; endif; if ( sp_column_active( $usecolumns, 'article' ) ) : echo ''; endif; if ( sp_column_active( $usecolumns, 'day' ) ) : echo ''; endif; do_action( 'sportspress_event_list_row', $event, $usecolumns ); echo ''; $i++; endforeach; ?>
    ' . esc_attr__( 'Home', 'sportspress' ) . '' . esc_attr__( 'Time/Results', 'sportspress' ) . '' . esc_attr__( 'Results', 'sportspress' ) . '' . esc_attr__( 'Away', 'sportspress' ) . '' . esc_attr__( 'Time', 'sportspress' ) . '' . esc_attr__( 'Teams', 'sportspress' ) . '' . esc_attr__( 'Event', 'sportspress' ) . '' . esc_attr__( 'Time', 'sportspress' ) . '' . esc_attr__( 'Results', 'sportspress' ) . '' . esc_attr__( 'Time', 'sportspress' ) . '' . esc_attr__( 'Results', 'sportspress' ) . '' . esc_attr__( 'Time/Results', 'sportspress' ) . '' . esc_attr__( 'League', 'sportspress' ) . '' . esc_attr__( 'Season', 'sportspress' ) . '' . esc_attr__( 'Venue', 'sportspress' ) . '' . esc_attr__( 'Article', 'sportspress' ) . '' . esc_attr__( 'Match Day', 'sportspress' ) . '
    ' . wp_kses( $date_html, array( 'a' => array( 'href' => array(), 'itemprop' => array() ), 'date' => array() ) ) . '' . wp_kses_post( $team ) . ''; if ( $link_events ) { echo ''; } echo ''; if ( $link_events ) { echo ''; } echo '' . wp_kses_post( $team ) . ''; if ( $link_events ) { echo ''; } echo '' . wp_kses_post( $teams_output ) . '' . wp_kses_post( $title_html ) . ''; if ( $link_events ) { echo ''; } echo ''; if ( $link_events ) { echo ''; } echo ''; if ( $link_events ) { echo ''; } echo ''; if ( $link_events ) { echo ''; } echo ''; if ( $link_events ) { echo ''; } echo ''; $leagues = get_the_terms( $event->ID, 'sp_league' ); if ( $leagues ) : echo wp_kses_post( implode( ', ', wp_list_pluck( $leagues, 'name' ) ) ); endif; echo ''; $seasons = get_the_terms( $event->ID, 'sp_season' ); if ( $seasons ) : echo wp_kses_post( implode( ', ', wp_list_pluck( $seasons, 'name' ) ) ); endif; echo ''; echo '
    '; if ( $link_venues ) : the_terms( $event->ID, 'sp_venue' ); else : $venues = get_the_terms( $event->ID, 'sp_venue' ); if ( $venues ) : echo wp_kses_post( implode( ', ', wp_list_pluck( $venues, 'name' ) ) ); endif; endif; echo '
    '; echo '
    '; if ( $link_events ) { echo ''; } echo ''; $day = get_post_meta( $event->ID, 'sp_day', true ); if ( '' == $day ) { echo '-'; } else { echo wp_kses_post( $day ); } echo '
    ' . esc_attr__( 'View all events', 'sportspress' ) . '
    '; } ?>
    ================================================ FILE: templates/event-logos-block.php ================================================
    ' . sp_team_short_name( $team ) . ''; } else { $logo = '' . sp_team_short_name( $team ) . ' ' . $logo; } } if ( $link_teams ) : $logo = ''; else : $logo = ''; endif; echo wp_kses_post( $logo ); endforeach; ?>
    ' . wp_kses_post( apply_filters( 'sportspress_event_time', sp_get_time( $id ), $id ) ) . ''; ?>
    ' . wp_kses_post( implode( ' - ', apply_filters( 'sportspress_event_blocks_team_result_or_time', $results, $id ) ) ) . ''; ?>
    ================================================ FILE: templates/event-logos-inline.php ================================================ ' . sp_team_short_name( $team ) . ''; } else { $logo = '' . sp_team_short_name( $team ) . ' ' . $logo; } } // Add link if ( $link_teams ) { $logo = '' . $logo . ''; } // Add result if ( $show_results && ! empty( $results ) ) { $team_result = array_shift( $results ); $team_result = apply_filters( 'sportspress_event_logos_team_result', $team_result, $id, $team ); if ( $alt ) { $logo = '' . $team_result . ' ' . $logo; } else { $logo .= ' ' . $team_result . ''; } } // Add logo to array if ( '' !== $logo ) { $team_logos[] = ''; $i++; } endforeach; $team_logos = array_filter( $team_logos ); if ( ! empty( $team_logos ) ) : echo '
    '; // Assign delimiter if ( $show_time && sizeof( $teams ) <= 2 ) { $delimiter = '' . apply_filters( 'sportspress_event_time', get_the_time( get_option( 'time_format' ), $id ), $id ) . ''; } else { $delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' ); } echo wp_kses_post( implode( ' ' . $delimiter . ' ', $team_logos ) ); echo '
    '; endif; ================================================ FILE: templates/event-logos.php ================================================ $id, 'teams' => $teams, 'results' => $results, 'show_team_names' => $show_team_names, 'show_time' => $show_time, 'show_results' => $show_results, 'link_teams' => $link_teams, ) ); do_action( 'sportspress_after_event_logos', $id ); ================================================ FILE: templates/event-officials-list.php ================================================

    $label ) { $appointed_officials = (array) sp_array_value( $data, $key, array() ); if ( empty( $appointed_officials ) ) { continue; } echo '
    ' . wp_kses_post( $label ) . '
    '; foreach ( $appointed_officials as $official_id => $official_name ) { if ( $link_officials && sp_post_exists( $official_id ) ) { $official_name = '' . $official_name . ''; } echo '
    ' . wp_kses_post( $official_name ) . '
    '; } } ?>
    ================================================ FILE: templates/event-officials-table.php ================================================

    ' . wp_kses_post( $label ) . ''; } ?> $official_name ) { if ( $link_officials && sp_post_exists( $official_id ) ) { $appointed_officials[ $official_id ] = '' . $official_name . ''; } } echo ''; } ?>
    ' . wp_kses_post( implode( '
    ', $appointed_officials ) ) . '
    ================================================ FILE: templates/event-officials.php ================================================ appointments(); // Return if no officials are in event if ( empty( $data ) ) { return; } // The first row should be column labels $labels = $data[0]; unset( $data[0] ); $link_officials = get_option( 'sportspress_link_officials', 'no' ) == 'yes' ? true : false; $format = get_option( 'sportspress_event_officials_format', 'table' ); switch ( $format ) : case 'list': sp_get_template( 'event-officials-list.php', array( 'labels' => $labels, 'data' => $data, 'link_officials' => $link_officials, ) ); break; default: sp_get_template( 'event-officials-table.php', array( 'labels' => $labels, 'data' => $data, 'link_officials' => $link_officials, ) ); endswitch; ================================================ FILE: templates/event-overview.php ================================================
    ================================================ FILE: templates/event-performance-table.php ================================================

    $label ) : ?> $sub ) : if ( ! $sub_id ) { continue; } $i = sp_array_value( $sub, 'sub', 0 ); $lineup_sub_relation[ $i ] = $sub_id; endforeach; $data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode ); $stars_type = get_option( 'sportspress_event_performance_stars_type', 0 ); foreach ( $data as $player_id => $row ) : if ( ! $player_id ) { continue; } $name = get_the_title( $player_id ); if ( ! $name ) { continue; } echo ''; if ( apply_filters( 'sportspress_event_performance_show_numbers', $show_numbers, $section ) ) { $number = sp_array_value( $row, 'number', ' ' ); // Player number echo ''; } if ( $link_posts ) : $permalink = get_post_permalink( $player_id ); $name = '' . wp_kses_post( $name ) . ''; endif; if ( $stars_type ) : $player_stars = sp_array_value( $stars, $player_id, 0 ); if ( $player_stars ) : switch ( $stars_type ) : case 1: $name .= ' '; break; case 2: $name .= ' ' . str_repeat( '', $player_stars ) . ''; break; case 3: $name .= ' ' . $player_stars . ''; break; endswitch; endif; endif; if ( array_key_exists( $player_id, $lineup_sub_relation ) ) : $name .= ' ' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . ''; elseif ( isset( $row['sub'] ) && $row['sub'] ) : $subbed = (int) $row['sub']; $name .= ' ' . sp_array_value( sp_array_value( $data, $subbed, array() ), 'number', null ) . ''; endif; $content = ''; $position = null; foreach ( $labels as $key => $label ) : if ( 'name' == $key ) { continue; } $format = sp_array_value( $formats, $key, 'number' ); $placeholder = sp_get_format_placeholder( $format ); if ( ! array_key_exists( $key, $totals ) ) : $totals[ $key ] = $placeholder; endif; if ( 'time' === $format ) : $totals[ $key ] = ' '; endif; $value = '-'; if ( $key == 'position' ) : $positions = array(); if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ) : $position_ids = (array) $row[ $key ]; else : $position_ids = (array) sp_get_the_term_id( $player_id, 'sp_position' ); endif; foreach ( $position_ids as $position_id ) { $player_position = get_term_by( 'id', $position_id, 'sp_position' ); if ( $player_position ) { $positions[] = $player_position->name; } } $positions = array_unique( $positions ); if ( sizeof( $positions ) ) : $value = $position = implode( ', ', $positions ); endif; else : if ( array_key_exists( $key, $row ) && $row[ $key ] !== '' ) : if ( 'checkbox' === $format ) : $value = '' . $row[ $key ] . ''; else : $value = $row[ $key ]; endif; else : $value = $placeholder; endif; if ( 'number' === $format ) : $add = apply_filters( 'sportspress_event_performance_add_value', floatval( $value ), $key ); $totals[ $key ] += $add; endif; endif; if ( $mode == 'values' ) : $content .= ''; elseif ( intval( $value ) && $mode == 'icons' ) : $performance_id = sp_array_value( $performance_ids, $key, null ); $icons = ''; if ( $performance_id && has_post_thumbnail( $performance_id ) ) : preg_match( '#\((.*?)\)#', $value, $match ); if ( ! empty( $match ) && isset( $match[1] ) ) { $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ' . $match[1] . ' ', intval( $value ) ); } else { $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', intval( $value ) ); } endif; $content .= apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value ); endif; endforeach; if ( isset( $position ) && $mode == 'icons' ) : $name .= ' ' . $position . ''; endif; echo ''; if ( $mode == 'icons' ) : echo ''; else : echo wp_kses_post( $content ); endif; echo ''; $i++; endforeach; foreach ( $labels as $key => $label ) : $format = sp_array_value( $formats, $key, 'number' ); if ( 'equation' === $format ) : $post = get_page_by_path( $key, OBJECT, 'sp_performance' ); if ( $post ) { $totals[ $key ] = sp_solve( get_post_meta( $post->ID, 'sp_equation', true ), $totals, get_post_meta( $post->ID, 'sp_precision', true ) ); } endif; endforeach; ?> <>  '; } if ( $mode == 'values' ) : echo ''; endif; endif; $row = sp_array_value( $data, 0, array() ); if ( $mode == 'icons' ) { echo ''; } else { echo ''; } elseif ( intval( $value ) && $mode == 'icons' ) : $performance_id = sp_array_value( $performance_ids, $key, null ); $icons = ''; if ( $performance_id && has_post_thumbnail( $performance_id ) ) : $icons = get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ); endif; echo wp_kses_post( apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, 1 ) . $value . ' ' ); endif; endforeach; if ( $mode == 'icons' ) { echo ''; } ?> >
    #
    ' . wp_kses_post( $number ) . '' . $value . '' . wp_kses_post( $name ) . '' . wp_kses_post( $content ) . '
    ' . esc_attr__( 'Total', 'sportspress' ) . ''; } foreach ( $labels as $key => $label ) : $format = sp_array_value( $formats, $key, 'number' ); if ( 'name' == $key ) { continue; } if ( $key == 'position' ) : $value = ' '; else : if ( $primary && $key !== $primary ) : $value = ' '; elseif ( 'equation' !== $format && array_key_exists( $key, $row ) && $row[ $key ] != '' ) : $value = $row[ $key ]; else : $value = apply_filters( 'sportspress_event_performance_table_total_value', sp_array_value( $totals, $key, 0 ), $data, $key ); endif; endif; if ( $mode == 'values' ) : if ( $key == 'position' ) { echo '' . wp_kses_post( $value ) . '' . wp_kses_post( $value ) . '
    $id, 'index' => $index, ) ); if ( $template_content !== null ) { echo wp_kses_post( $template_content ); } } ?>
    ================================================ FILE: templates/event-performance.php ================================================ performance(); $stars = $event->stars(); $link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false; $scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; $sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false; $mode = get_option( 'sportspress_event_performance_mode', 'values' ); // The first row should be column labels $labels = apply_filters( 'sportspress_event_box_score_labels', $performance[0], $event, $mode ); // Add position to labels if selected if ( $show_position ) { $labels = array_merge( array( 'position' => esc_attr__( 'Position', 'sportspress' ) ), $labels ); } // Remove the first row to leave us with the actual data unset( $performance[0] ); $performance = array_filter( $performance ); $status = $event->status(); if ( 'future' == $status ) { $show_total = false; } // Get performance ids for icons if ( $mode == 'icons' ) : $performance_ids = array(); $performance_posts = get_posts( array( 'posts_per_page' => -1, 'post_type' => 'sp_performance', ) ); foreach ( $performance_posts as $post ) : $performance_ids[ $post->post_name ] = $post->ID; endforeach; endif; if ( $reverse_teams ) { $teams = array_reverse( $teams, true ); } // Get performance columns $args = array( 'post_type' => 'sp_performance', 'numberposts' => 100, 'posts_per_page' => 100, 'orderby' => 'menu_order', 'order' => 'ASC', ); $columns = get_posts( $args ); // Get formats $formats = array(); // Add to formats foreach ( $columns as $column ) { $format = get_post_meta( $column->ID, 'sp_format', true ); if ( '' === $format ) { $format = 'number'; } $formats[ $column->post_name ] = $format; } do_action( 'sportspress_before_event_performance', $columns ); if ( $is_individual ) { // Combined table $data = array(); foreach ( $performance as $players ) { foreach ( $players as $player_id => $player ) { if ( $player_id == 0 ) { continue; } $data[ $player_id ] = $player; } } sp_get_template( 'event-performance-table.php', array( 'scrollable' => $scrollable, 'sortable' => $sortable, 'show_players' => $show_players, 'show_numbers' => $show_numbers, 'show_minutes' => $show_minutes, 'show_total' => $show_total, 'caption' => esc_attr__( 'Box Score', 'sportspress' ), 'labels' => $labels, 'formats' => $formats, 'mode' => $mode, 'data' => $data, 'event' => $event, 'stars' => $stars, 'link_posts' => $link_posts, 'performance_ids' => isset( $performance_ids ) ? $performance_ids : null, 'primary' => 'primary' == $total ? $primary : null, ) ); } else { // Prepare for offense and defense sections if ( -1 != $sections ) { // Determine order of sections if ( 1 == $sections ) { $section_order = array( 1 => esc_attr__( 'Defense', 'sportspress' ), 0 => esc_attr__( 'Offense', 'sportspress' ), ); } else { $section_order = array( esc_attr__( 'Offense', 'sportspress' ), esc_attr__( 'Defense', 'sportspress' ) ); } // Initialize labels $selected = $labels; $labels = array( array(), array() ); // Add positions if applicable if ( $show_position ) { $labels[0]['position'] = $labels[1]['position'] = esc_attr__( 'Position', 'sportspress' ); } // Get labels by section foreach ( $columns as $column ) : if ( ! array_key_exists( $column->post_name, $selected ) ) { continue; } $section = get_post_meta( $column->ID, 'sp_section', true ); if ( '' === $section ) { $section = -1; } switch ( $section ) : case 1: $labels[1][ $column->post_name ] = $column->post_title; break; case 0: $labels[0][ $column->post_name ] = $column->post_title; break; default: $labels[0][ $column->post_name ] = $column->post_title; $labels[1][ $column->post_name ] = $column->post_title; endswitch; endforeach; } foreach ( $teams as $index => $team_id ) { if ( -1 == $team_id ) { continue; } // Get results for players in the team $players = sp_array_between( (array) get_post_meta( $id, 'sp_player', false ), 0, $index ); $has_players = sizeof( $players ) > 1; $players = apply_filters( 'sportspress_event_performance_split_team_players', $players ); $show_team_players = $show_players && $has_players; if ( ! $show_team_players && ! $show_staff && ! $show_total ) { continue; } if ( $show_team_players || $show_total ) { if ( -1 != $sections ) { $data = array(); $offense = (array) get_post_meta( $id, 'sp_offense', false ); $defense = (array) get_post_meta( $id, 'sp_defense', false ); if ( sizeof( $offense ) || sizeof( $defense ) ) { // Get results for offensive players in the team $offense = sp_array_between( $offense, 0, $index ); $data[0] = sp_array_combine( $offense, sp_array_value( $performance, $team_id, array() ) ); // Get results for defensive players in the team $defense = sp_array_between( $defense, 0, $index ); $data[1] = sp_array_combine( $defense, sp_array_value( $performance, $team_id, array() ) ); } else { // Get results for all players in the team $players = sp_array_between( (array) get_post_meta( $id, 'sp_player', false ), 0, $index ); $data[0] = $data[1] = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) ); } $s = 0; foreach ( $section_order as $section_id => $section_label ) { if ( sizeof( $data[ $section_id ] ) ) { if ( 1 == $section_id ) { $order = (array) get_post_meta( $id, 'sp_order', true ); if ( is_array( $order ) && sizeof( $order ) ) { $player_order = sp_array_value( $order, $team_id, array() ); if ( is_array( $player_order ) && sizeof( $player_order ) ) { $data[1] = sp_array_combine( $player_order, $data[1], true ); } } } sp_get_template( 'event-performance-table.php', array( 'id' => $id, 'index' => $index, 'section' => $section_id, 'section_label' => $section_label, 'scrollable' => $scrollable, 'sortable' => $sortable, 'show_players' => $show_team_players, 'show_numbers' => $show_numbers, 'show_minutes' => $show_minutes, 'show_total' => $show_total, 'caption' => 0 == $s && $team_id ? sp_team_short_name( $team_id ) : null, 'labels' => $labels[ $section_id ], 'formats' => $formats, 'mode' => $mode, 'data' => $data[ $section_id ], 'event' => $event, 'stars' => $stars, 'link_posts' => $link_posts, 'performance_ids' => isset( $performance_ids ) ? $performance_ids : null, 'primary' => 'primary' == $total ? $primary : null, '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, 'show_staff' => $show_staff, ) ); } $s++; } } else { if ( 0 < $team_id ) { $data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) ); } elseif ( 0 == $team_id ) { $data = array(); foreach ( $players as $player_id ) { if ( isset( $performance[ $player_id ][ $player_id ] ) ) { $data[ $player_id ] = $performance[ $player_id ][ $player_id ]; } } } else { $data = sp_array_value( array_values( $performance ), $index ); } sp_get_template( 'event-performance-table.php', array( 'id' => $id, 'index' => $index, 'scrollable' => $scrollable, 'sortable' => $sortable, 'show_players' => $show_team_players, 'show_staff' => $show_staff, 'show_numbers' => $show_numbers, 'show_minutes' => $show_minutes, 'show_total' => $show_total, 'caption' => $team_id ? sp_team_short_name( $team_id ) : null, 'labels' => $labels, 'formats' => $formats, 'mode' => $mode, 'data' => $data, 'event' => $event, 'stars' => $stars, 'link_posts' => $link_posts, 'performance_ids' => isset( $performance_ids ) ? $performance_ids : null, 'primary' => 'primary' == $total ? $primary : null, ) ); } } } ?>
    status(); if ( 'results' != $status ) { return; } if ( ! isset( $caption ) ) { $caption = esc_attr__( 'Results', 'sportspress' ); } // Get event result data $data = $event->results(); // The first row should be column labels $labels = $data[0]; // Remove the first row to leave us with the actual data unset( $data[0] ); $data = array_filter( $data ); if ( empty( $data ) ) { return false; } $scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; $link_teams = get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false; $show_outcomes = array_key_exists( 'outcome', $labels ); // Initialize $output = ''; $table_rows = ''; $i = 0; // Reverse teams order if the option "Events > Teams > Order > Reverse order" is enabled. $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false; if ( $reverse_teams ) { $data = array_reverse( $data, true ); } foreach ( $data as $team_id => $result ) : if ( $show_outcomes ) : $outcomes = array(); $result_outcome = sp_array_value( $result, 'outcome' ); if ( ! is_array( $result_outcome ) ) : $outcomes = array( '—' ); else : foreach ( $result_outcome as $outcome ) : $the_outcome = get_page_by_path( $outcome, OBJECT, 'sp_outcome' ); if ( is_object( $the_outcome ) ) : $outcomes[] = $the_outcome->post_title; endif; endforeach; endif; endif; unset( $result['outcome'] ); $table_rows .= ''; $team_name = sp_team_short_name( $team_id ); if ( $link_teams && sp_post_exists( $team_id ) ) : $team_name = '' . $team_name . ''; endif; $table_rows .= '' . $team_name . ''; foreach ( $labels as $key => $label ) : if ( in_array( $key, array( 'name', 'outcome' ) ) ) { continue; } if ( array_key_exists( $key, $result ) && $result[ $key ] != '' ) : $value = $result[ $key ]; else : $value = apply_filters( 'sportspress_event_empty_result_string', '—' ); endif; $table_rows .= '' . $value . ''; endforeach; if ( $show_outcomes ) : $table_rows .= '' . implode( ', ', $outcomes ) . ''; endif; $table_rows .= ''; $i++; endforeach; if ( empty( $table_rows ) ) : return false; else : $output .= '

    ' . $caption . '

    '; $output .= '
    ' . '' . ''; foreach ( $labels as $key => $label ) : $output .= ''; endforeach; $output .= '' . '' . ''; $output .= $table_rows; $output .= '' . '
    ' . esc_attr__( 'Team', 'sportspress' ) . '' . $label . '
    ' . '
    '; endif; ?>
    ================================================ FILE: templates/event-staff.php ================================================ get_the_ID(), 'index' => 0, 'link_posts' => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false, ); $staffs = array_filter( sp_array_between( (array) get_post_meta( $id, 'sp_staff', false ), 0, $index ) ); if ( ! $staffs ) { return; } extract( $defaults, EXTR_SKIP ); ?>

    roles(); if ( ! empty( $roles ) ) : $roles = wp_list_pluck( $roles, 'name' ); echo wp_kses_post( implode( '/', $roles ) ); else : esc_attr_e( 'Staff', 'sportspress' ); endif; echo ': '; if ( $link_posts ) : $permalink = get_post_permalink( $staff_id ); $name = '' . $name . ''; endif; echo wp_kses_post( $name ) . '
    '; endforeach; ?>

    ================================================ FILE: templates/event-venue.php ================================================ term_id; $meta = get_option( "taxonomy_$t_id" ); $name = $venue->name; if ( $link_venues ) { $name = '' . $name . ''; } $address = sp_array_value( $meta, 'sp_address', null ); if ( !is_null( $address ) ) { $address = urlencode( $address ); } ?>

    $meta ) ); ?>
    ================================================ FILE: templates/event-video.php ================================================

    autoembed( $video_url ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    ================================================ FILE: templates/league-table.php ================================================ get_the_ID(), 'number' => -1, 'columns' => null, 'highlight' => null, 'show_full_table_link' => false, 'title' => false, 'show_title' => get_option( 'sportspress_table_show_title', 'yes' ) == 'yes' ? true : false, 'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false, 'link_posts' => null, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_table_rows', 10 ), ); extract( $defaults, EXTR_SKIP ); if ( ! isset( $link_posts ) ) { if ( 'player' === sp_get_post_mode( $id ) ) { $link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false; } else { $link_posts = get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false; } } if ( ! isset( $highlight ) ) { $highlight = get_post_meta( $id, 'sp_highlight', true ); } $table = new SP_League_Table( $id ); if ( $show_title && false === $title && $id ) : $caption = $table->caption; if ( $caption ) { $title = $caption; } else { $title = get_the_title( $id ); } endif; // Check if we have event status sent from shortcode if ( isset( $show_published_events ) ) { $table->show_published_events = $show_published_events; } if ( isset( $show_future_events ) ) { $table->show_future_events = $show_future_events; } // Create a unique identifier based on the current time in microseconds $identifier = uniqid( 'table_' ); $output = ''; if ( $title ) { $output .= '

    ' . $title . '

    '; } $output .= '
    '; $output .= '' . '' . ''; $data = $table->data(); // The first row should be column labels $labels = $data[0]; // If responsive tables are enabled then load the inline css code if ( true == $responsive ) { // sportspress_responsive_tables_css( $identifier ); } // Remove the first row to leave us with the actual data unset( $data[0] ); if ( $columns === null ) { $columns = get_post_meta( $id, 'sp_columns', true ); } if ( null !== $columns && ! is_array( $columns ) ) { $columns = explode( ',', $columns ); } $output .= ''; foreach ( $labels as $key => $label ) : if ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) { $output .= ''; } endforeach; $output .= '' . '' . ''; $i = 0; $start = 0; if ( intval( $number ) > 0 ) : $limit = $number; // Trim table to center around highlighted team if ( $highlight && sizeof( $data ) > $limit && array_key_exists( $highlight, $data ) ) : // Number of teams in the table $size = sizeof( $data ); // Position of highlighted team in the table $key = array_search( $highlight, array_keys( $data ) ); // Get starting position $start = $key - ceil( $limit / 2 ) + 1; if ( $start < 0 ) { $start = 0; } // Trim table using starting position $trimmed = array_slice( $data, $start, $limit, true ); // Move starting position if we are too far down the table if ( sizeof( $trimmed ) < $limit && sizeof( $trimmed ) < $size ) : $offset = $limit - sizeof( $trimmed ); $start -= $offset; if ( $start < 0 ) { $start = 0; } $trimmed = array_slice( $data, $start, $limit, true ); endif; // Replace data $data = $trimmed; endif; endif; // Loop through the teams foreach ( $data as $team_id => $row ) : if ( isset( $limit ) && $i >= $limit ) { continue; } $name = sp_array_value( $row, 'name', null ); if ( ! $name ) { continue; } // Generate tags for highlighted team $tr_class = $td_class = ''; if ( $highlight == $team_id ) : $tr_class = ' highlighted'; $td_class = ' sp-highlight'; endif; $output .= ''; // Rank $output .= ''; $name_class = ''; if ( $show_team_logo ) : if ( has_post_thumbnail( $team_id ) ) : $logo = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon' ); $name = '' . $name; $name_class .= ' has-logo'; endif; endif; if ( $link_posts ) : $permalink = get_post_permalink( $team_id ); $name = '' . $name . ''; endif; $output .= ''; foreach ( $labels as $key => $value ) : if ( in_array( $key, array( 'pos', 'name' ) ) ) { continue; } if ( ! is_array( $columns ) || in_array( $key, $columns ) ) { $output .= ''; } endforeach; $output .= ''; $i++; $start++; endforeach; $output .= '' . '
    ' . esc_attr__( 'Pos', 'sportspress' ) . '' . $label . '
    ' . sp_array_value( $row, 'pos' ) . '' . $name . '' . sp_array_value( $row, $key, '—' ) . '
    '; $output .= '
    '; if ( $show_full_table_link ) { $output .= ''; } ?>
    ================================================ FILE: templates/official-details.php ================================================ get_option( 'sportspress_official_show_number', 'no' ) == 'yes' ? true : false, 'show_name' => get_option( 'sportspress_official_show_name', 'no' ) == 'yes' ? true : false, 'show_nationality' => get_option( 'sportspress_official_show_nationality', 'yes' ) == 'yes' ? true : false, 'show_positions' => get_option( 'sportspress_official_show_positions', 'yes' ) == 'yes' ? true : false, 'show_current_teams' => get_option( 'sportspress_official_show_current_teams', 'yes' ) == 'yes' ? true : false, 'show_past_teams' => get_option( 'sportspress_official_show_past_teams', 'yes' ) == 'yes' ? true : false, 'show_leagues' => get_option( 'sportspress_official_show_leagues', 'no' ) == 'yes' ? true : false, 'show_seasons' => get_option( 'sportspress_official_show_seasons', 'no' ) == 'yes' ? true : false, 'show_nationality_flags' => get_option( 'sportspress_official_show_flags', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); $countries = SP()->countries->countries; $official = new SP_Official( $id ); $metrics_before = $official->metrics( true ); $metrics_after = $official->metrics( false ); $common = array(); if ( $show_number ) : $common['#'] = $official->number; endif; if ( $show_name ) : $common[ esc_attr__( 'Name', 'sportspress' ) ] = $official->post->post_title; endif; if ( $show_nationality ) : $nationalities = $official->nationalities(); if ( $nationalities && is_array( $nationalities ) ) : $values = array(); foreach ( $nationalities as $nationality ) : $country_name = sp_array_value( $countries, $nationality, null ); $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—'; endforeach; $common[ esc_attr__( 'Nationality', 'sportspress' ) ] = implode( '
    ', $values ); endif; endif; if ( $show_positions ) : $positions = $official->positions(); if ( $positions && is_array( $positions ) ) : $position_names = array(); foreach ( $positions as $position ) : $position_names[] = $position->name; endforeach; $common[ esc_attr__( 'Position', 'sportspress' ) ] = implode( ', ', $position_names ); endif; endif; $data = array_merge( $metrics_before, $common, $metrics_after ); if ( $show_current_teams ) : $current_teams = $official->current_teams(); if ( $current_teams ) : $teams = array(); foreach ( $current_teams as $team ) : $team_name = sp_team_short_name( $team ); if ( $link_teams ) { $team_name = '' . $team_name . ''; } $teams[] = $team_name; endforeach; $data[ esc_attr__( 'Current Team', 'sportspress' ) ] = implode( ', ', $teams ); endif; endif; if ( $show_past_teams ) : $past_teams = $official->past_teams(); if ( $past_teams ) : $teams = array(); foreach ( $past_teams as $team ) : $team_name = sp_team_short_name( $team ); if ( $link_teams ) { $team_name = '' . $team_name . ''; } $teams[] = $team_name; endforeach; $data[ esc_attr__( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams ); endif; endif; if ( $show_leagues ) : $leagues = $official->leagues(); if ( $leagues && ! is_wp_error( $leagues ) ) : $terms = array(); foreach ( $leagues as $league ) { $terms[] = $league->name; } $data[ esc_attr__( 'Leagues', 'sportspress' ) ] = implode( ', ', $terms ); endif; endif; if ( $show_seasons ) : $seasons = $official->seasons(); if ( $seasons && ! is_wp_error( $seasons ) ) : $terms = array(); foreach ( $seasons as $season ) { $terms[] = $season->name; } $data[ esc_attr__( 'Seasons', 'sportspress' ) ] = implode( ', ', $terms ); endif; endif; $data = apply_filters( 'sportspress_official_details', $data, $id ); if ( empty( $data ) ) { return; } $output = '
    '; foreach ( $data as $label => $value ) : $output .= '
    ' . $label . '
    ' . $value . '
    '; endforeach; $output .= '
    '; echo wp_kses_post( $output ); ================================================ FILE: templates/player-details.php ================================================ get_option( 'sportspress_player_show_number', 'no' ) == 'yes' ? true : false, 'show_name' => get_option( 'sportspress_player_show_name', 'no' ) == 'yes' ? true : false, 'show_nationality' => get_option( 'sportspress_player_show_nationality', 'yes' ) == 'yes' ? true : false, 'show_positions' => get_option( 'sportspress_player_show_positions', 'yes' ) == 'yes' ? true : false, 'show_current_teams' => get_option( 'sportspress_player_show_current_teams', 'yes' ) == 'yes' ? true : false, 'show_past_teams' => get_option( 'sportspress_player_show_past_teams', 'yes' ) == 'yes' ? true : false, 'show_leagues' => get_option( 'sportspress_player_show_leagues', 'no' ) == 'yes' ? true : false, 'show_seasons' => get_option( 'sportspress_player_show_seasons', 'no' ) == 'yes' ? true : false, 'show_nationality_flags' => get_option( 'sportspress_player_show_flags', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); $countries = SP()->countries->countries; $player = new SP_Player( $id ); $metrics_before = $player->metrics( true ); $metrics_after = $player->metrics( false ); $common = array(); if ( $show_number ) : $common['#'] = $player->number; endif; if ( $show_name ) : $common[ esc_attr__( 'Name', 'sportspress' ) ] = $player->post->post_title; endif; if ( $show_nationality ) : $nationalities = $player->nationalities(); if ( $nationalities && is_array( $nationalities ) ) : $values = array(); foreach ( $nationalities as $nationality ) : $country_name = sp_array_value( $countries, $nationality, null ); $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—'; endforeach; $common[ esc_attr__( 'Nationality', 'sportspress' ) ] = implode( '
    ', $values ); endif; endif; if ( $show_positions ) : $positions = $player->positions(); if ( $positions && is_array( $positions ) ) : $position_names = array(); foreach ( $positions as $position ) : $position_names[] = $position->name; endforeach; $common[ esc_attr__( 'Position', 'sportspress' ) ] = implode( ', ', $position_names ); endif; endif; $data = array_merge( $metrics_before, $common, $metrics_after ); if ( $show_current_teams ) : $current_teams = array_filter( $player->current_teams() ); if ( $current_teams ) : $teams = array(); foreach ( $current_teams as $team ) : $team_name = sp_team_short_name( $team ); if ( $link_teams ) { $team_name = '' . $team_name . ''; } $teams[] = $team_name; endforeach; $data[ esc_attr__( 'Current Team', 'sportspress' ) ] = implode( ', ', $teams ); endif; endif; if ( $show_past_teams ) : $past_teams = array_filter( $player->past_teams() ); if ( $past_teams ) : $teams = array(); foreach ( $past_teams as $team ) : $team_name = sp_team_short_name( $team ); if ( $link_teams ) { $team_name = '' . $team_name . ''; } $teams[] = $team_name; endforeach; $data[ esc_attr__( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams ); endif; endif; if ( $show_leagues ) : $leagues = $player->leagues(); if ( $leagues && ! is_wp_error( $leagues ) ) : $terms = array(); foreach ( $leagues as $league ) { $terms[] = $league->name; } $data[ esc_attr__( 'Leagues', 'sportspress' ) ] = implode( ', ', $terms ); endif; endif; if ( $show_seasons ) : $seasons = $player->seasons(); if ( $seasons && ! is_wp_error( $seasons ) ) : $terms = array(); foreach ( $seasons as $season ) { $terms[] = $season->name; } $data[ esc_attr__( 'Seasons', 'sportspress' ) ] = implode( ', ', $terms ); endif; endif; $data = apply_filters( 'sportspress_player_details', $data, $id ); if ( empty( $data ) ) { return; } $output = '
    '; foreach ( $data as $label => $value ) : $output .= '
    ' . $label . '
    ' . $value . '
    '; endforeach; $output .= '
    '; echo wp_kses_post( $output ); ================================================ FILE: templates/player-events.php ================================================ $id ) ); } elseif ( 'list' === $format ) { $args = array( 'player' => $id, 'title_format' => 'homeaway', 'time_format' => 'separate', 'columns' => array( 'event', 'time', 'results' ), 'order' => 'DESC', ); $args = apply_filters( 'sp_player_events_list_args', $args ); sp_get_template( 'event-list.php', $args ); } else { sp_get_template( 'event-fixtures-results.php', array( 'player' => $id ) ); } ================================================ FILE: templates/player-gallery-thumbnail.php ================================================ null, 'icontag' => 'dt', 'captiontag' => 'dd', 'caption' => null, 'size' => 'sportspress-crop-medium', 'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); // Add player number to caption if available $player_number = get_post_meta( $id, 'sp_number', true ); if ( '' !== $player_number ) { $caption = '' . $player_number . ' ' . $caption; } // Add caption tag if has caption if ( $captiontag && $caption ) { $caption = '<' . $captiontag . ' class="wp-caption-text gallery-caption small-3 columns' . ( '' !== $player_number ? ' has-number' : '' ) . '">' . wptexturize( $caption ) . ''; } if ( $link_posts ) { $caption = '' . $caption . ''; } if ( has_post_thumbnail( $id ) ) { $thumbnail = get_the_post_thumbnail( $id, $size ); } else { $thumbnail = ''; } echo wp_kses_post( "<{$itemtag} class='gallery-item'>" ); echo wp_kses_post( " <{$icontag} class='gallery-icon portrait'>" . '' . $thumbnail . '' . "" ); echo wp_kses_post( $caption ); echo wp_kses_post( "" ); ================================================ FILE: templates/player-gallery.php ================================================ get_the_ID(), 'title' => false, 'number' => -1, 'grouping' => null, 'orderby' => 'default', 'order' => 'ASC', 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'grouptag' => 'h4', 'columns' => 3, 'size' => 'sportspress-crop-medium', 'show_all_players_link' => false, 'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); // Determine number of players to display if ( -1 === $number ) : $number = (int) get_post_meta( $id, 'sp_number', true ); if ( $number <= 0 ) { $number = -1; } endif; $itemtag = tag_escape( $itemtag ); $captiontag = tag_escape( $captiontag ); $icontag = tag_escape( $icontag ); $valid_tags = wp_kses_allowed_html( 'post' ); if ( ! isset( $valid_tags[ $itemtag ] ) ) { $itemtag = 'dl'; } if ( ! isset( $valid_tags[ $captiontag ] ) ) { $captiontag = 'dd'; } if ( ! isset( $valid_tags[ $icontag ] ) ) { $icontag = 'dt'; } $columns = intval( $columns ); $itemwidth = $columns > 0 ? floor( 100 / $columns ) : 100; $size = $size; $float = is_rtl() ? 'right' : 'left'; $selector = 'sp-player-gallery-' . $id; $list = new SP_Player_List( $id ); $data = $list->data(); // Remove the first row to leave us with the actual data unset( $data[0] ); if ( $grouping === null || $grouping === 'default' ) : $grouping = $list->grouping; endif; if ( $orderby == 'default' ) : $orderby = $list->orderby; $order = $list->order; elseif ( $orderby == 'rand' ) : uasort( $data, 'sp_sort_random' ); else : $list->priorities = array( array( 'key' => $orderby, 'order' => $order, ), ); uasort( $data, array( $list, 'sort' ) ); endif; if ( $title ) { echo '

    ' . wp_kses_post( $title ) . '

    '; } $gallery_style = $gallery_div = ''; if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) { $gallery_style = " "; } $size_class = sanitize_html_class( $size ); $gallery_div = "\n"; ================================================ FILE: templates/player-list.php ================================================ get_the_ID(), 'title' => false, 'number' => -1, 'grouptag' => 'h4', 'columns' => null, 'grouping' => null, 'orderby' => 'default', 'order' => 'ASC', 'show_all_players_link' => false, 'show_title' => get_option( 'sportspress_list_show_title', 'yes' ) == 'yes' ? true : false, 'show_player_photo' => get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false, 'show_player_flag' => get_option( 'sportspress_list_show_flags', 'no' ) == 'yes' ? true : false, 'team_format' => get_option( 'sportspress_list_team_format', 'name' ), 'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_list_rows', 10 ), 'leagues' => null, 'seasons' => null, 'team' => null, ); extract( $defaults, EXTR_SKIP ); // Backward compatibility if ( isset( $performance ) ) { $columns = $performance; } // Determine number of players to display if ( -1 === $number ) : $number = (int) get_post_meta( $id, 'sp_number', true ); if ( $number <= 0 ) { $number = -1; } endif; // Explode into array if ( null !== $columns && ! is_array( $columns ) ) { $columns = explode( ',', $columns ); } $list = new SP_Player_List( $id ); if ( isset( $columns ) && null !== $columns ) : $list->columns = $columns; endif; $data = apply_filters( 'sportspress_player_list_data', $list->data( false, $leagues, $seasons, $team ), $id ); // The first row should be labels $labels = $data[0]; // Create a unique identifier based on the current time in microseconds $identifier = uniqid( 'playerlist_' ); // If responsive tables are enabled then load the inline css code if ( true == $responsive ) { // sportspress_responsive_tables_css( $identifier ); } // Remove the first row and 'head' row to leave us with the actual data unset( $data[0] ); if ( $grouping === null || $grouping === 'default' ) : $grouping = $list->grouping; endif; if ( $orderby == 'default' ) : $orderby = $list->orderby; $order = $list->order; else : $list->priorities = array( array( 'key' => $orderby, 'order' => $order, ), ); uasort( $data, array( $list, 'sort' ) ); endif; $output = ''; if ( $grouping === 'position' ) : $groups = get_terms( 'sp_position', array( 'orderby' => 'meta_value_num', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'sp_order', 'compare' => 'NOT EXISTS', ), array( 'key' => 'sp_order', 'compare' => 'EXISTS', ), ), ) ); else : if ( $show_title && false === $title && $id ) : $caption = $list->caption; if ( $caption ) { $title = $caption; } else { $title = get_the_title( $id ); } endif; if ( $title ) { $output .= '<' . $grouptag . ' class="sp-table-caption">' . $title . ''; } $group = new stdClass(); $group->term_id = null; $group->name = null; $group->slug = null; $groups = array( $group ); endif; foreach ( $groups as $group ) : $i = 0; if ( intval( $number ) > 0 ) { $limit = $number; } $thead = '' . ''; if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ) : if ( in_array( $orderby, array( 'number', 'name' ) ) ) : $thead .= '#'; else : $thead .= '' . esc_attr__( 'Rank', 'sportspress' ) . ''; endif; endif; foreach ( $labels as $key => $label ) : if ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) ) { $thead .= '' . $label . ''; } endforeach; $thead .= '' . ''; $tbody = ''; foreach ( $data as $player_id => $row ) : if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ) : if ( isset( $limit ) && $i >= $limit ) { continue; } $name = sp_array_value( $row, 'name', null ); if ( ! $name ) { continue; } $tbody .= ''; // Rank or number if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ) : if ( isset( $orderby ) && $orderby != 'number' ) : $tbody .= '' . ( $i + 1 ) . ''; else : $tbody .= '' . sp_array_value( $row, 'number', ' ' ) . ''; endif; endif; $name_class = ''; if ( $show_player_photo ) : if ( has_post_thumbnail( $player_id ) ) : $logo = get_the_post_thumbnail( $player_id, 'sportspress-fit-icon' ); $name = '' . $logo . '' . $name; $name_class .= ' has-photo'; endif; endif; if ( $show_player_flag ) : $player = new SP_Player( $player_id ); $nationalities = $player->nationalities(); if ( ! empty( $nationalities ) ) : foreach ( $nationalities as $nationality ) : $name = '' . sp_flags( $nationality ) . '' . $name; endforeach; $name_class .= ' has-photo'; endif; endif; if ( $link_posts ) : $permalink = get_post_permalink( $player_id ); $name = '' . $name . ''; endif; $tbody .= '' . $name . ''; if ( array_key_exists( 'team', $labels ) ) : $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_current_team', true ) ); $team_name = $team ? sp_team_short_name( $team ) : '-'; if ( $team_format == 'logo' && has_post_thumbnail( $team ) ) { $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'title' => '' . $team_name . '' ) ); $team_name = ''; } if ( $link_teams && false !== get_post_status( $team ) ) : $team_name = '' . $team_name . ''; endif; $tbody .= '' . $team_name . ''; endif; if ( array_key_exists( 'position', $labels ) ) : $position = sp_array_value( $row, 'position', null ); if ( null === $position || ! $position ) : $positions = wp_strip_all_tags( get_the_term_list( $player_id, 'sp_position', '', ', ' ) ); else : $position_term = get_term_by( 'id', $position, 'sp_position', ARRAY_A ); $positions = sp_array_value( $position_term, 'name', '—' ); endif; $tbody .= '' . $positions . ''; endif; foreach ( $labels as $key => $value ) : if ( in_array( $key, array( 'number', 'name', 'team', 'position' ) ) ) { continue; } if ( ! is_array( $columns ) || in_array( $key, $columns ) ) { $label = $labels[ $key ]; if ( preg_match( '/title="(.*?)"/', $value, $new_label ) ) { $label = $new_label[1]; } $tbody .= '' . sp_array_value( $row, $key, '—' ) . ''; } endforeach; $tbody .= ''; $i++; endif; endforeach; if ( $i === 0 ) { continue; } $output .= '
    '; if ( ! empty( $group->name ) ) : $output .= ''; $output .= '<' . $grouptag . ' class="sp-table-caption player-group-name player-list-group-name">' . $group->name . ''; endif; $output .= '
    ' . ''; $output .= $thead . ''; $output .= $tbody; $output .= '' . '
    ' . '
    '; if ( $show_all_players_link ) : $output .= ''; endif; $output .= '
    '; endforeach; ?>
    'sp_player', 'numberposts' => 500, 'posts_per_page' => 500, 'meta_key' => 'sp_number', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'tax_query' => array( 'relation' => 'AND', ), ); if ( $league_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ); endif; if ( $season_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season_ids, ); endif; if ( $team ) : $args['meta_query'] = array( array( 'key' => 'sp_current_team', 'value' => $team, ), ); endif; $args = apply_filters( 'sportspress_players_selector_args', $args ); $players = get_posts( $args ); $options = array(); if ( $players && is_array( $players ) ) : foreach ( $players as $player ) : $name = $player->post_title; $number = get_post_meta( $player->ID, 'sp_number', true ); if ( isset( $number ) && '' !== $number ) : $name = $number . '. ' . $name; endif; $options[] = ''; endforeach; endif; if ( sizeof( $options ) > 1 ) : ?>
    ' . $caption . '' . '
    ' . '' . '' . ''; foreach ( $labels as $key => $label ) : if ( isset( $hide_teams ) && 'team' == $key ) { continue; } $output .= ''; endforeach; $output .= '' . '' . ''; $i = 0; foreach ( $data as $season_id => $row ) : $output .= ''; foreach ( $labels as $key => $value ) : if ( isset( $hide_teams ) && 'team' == $key ) { continue; } $output .= ''; endforeach; $output .= ''; $i++; endforeach; $output .= '' . '
    ' . $label . '
    ' . sp_array_value( $row, $key, '' ) . '
    ' . '
    '; ?>
    ================================================ FILE: templates/player-statistics.php ================================================ $league ) { $leagues[ $key ]->sp_order = get_term_meta( $league->term_id, 'sp_order', true ); } if ( ! function_exists( 'sortByOrder' ) ) { function sortByOrder( $a, $b ) { return (int) $a->sp_order - (int) $b->sp_order; } } usort( $leagues, 'sortByOrder' ); $positions = $player->positions(); $player_sections = array(); if ( $positions ) { foreach ( $positions as $position ) { $player_sections = array_merge( $player_sections, sp_get_term_sections( $position->term_id ) ); } } // Determine order of sections if ( 1 == $sections ) { $section_order = array( 1 => esc_attr__( 'Defense', 'sportspress' ), 0 => esc_attr__( 'Offense', 'sportspress' ), ); } elseif ( 0 == $sections ) { $section_order = array( esc_attr__( 'Offense', 'sportspress' ), esc_attr__( 'Defense', 'sportspress' ) ); } else { $section_order = array( -1 => null ); } // Loop through statistics for each league if ( is_array( $leagues ) ) : foreach ( $section_order as $section_id => $section_label ) { if ( -1 !== $section_id && ! empty( $player_sections ) && ! in_array( $section_id, $player_sections ) ) { continue; } if ( sizeof( $leagues ) > 1 ) { if ( null !== $section_label ) { printf( '

    %s

    ', wp_kses_post( $section_label ) ); } } foreach ( $leagues as $league ) : $caption = $league->name; if ( null !== $section_label ) { if ( sizeof( $leagues ) === 1 ) { $caption = $section_label; } } $args = array( 'data' => $player->data( $league->term_id, false, $section_id ), 'caption' => $caption, 'scrollable' => $scrollable, 'league_id' => $league->term_id, ); if ( ! $show_teams ) { $args['hide_teams'] = true; } sp_get_template( 'player-statistics-league.php', $args ); endforeach; if ( $show_career_totals ) { sp_get_template( 'player-statistics-league.php', array( 'data' => $player->data( 0, false, $section_id ), 'caption' => esc_attr__( 'Career Total', 'sportspress' ), 'scrollable' => $scrollable, 'hide_teams' => true, ) ); } } endif; ================================================ FILE: templates/post-excerpt.php ================================================ post_excerpt; if ( $excerpt ) { ?>

    post_content; if ( $content ) { ?>
    get_option( 'sportspress_staff_show_nationality', 'yes' ) == 'yes' ? true : false, 'show_current_teams' => get_option( 'sportspress_staff_show_current_teams', 'yes' ) == 'yes' ? true : false, 'show_past_teams' => get_option( 'sportspress_staff_show_past_teams', 'yes' ) == 'yes' ? true : false, 'show_nationality_flags' => get_option( 'sportspress_staff_show_flags', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); $countries = SP()->countries->countries; $staff = new SP_Staff( $id ); $nationalities = $staff->nationalities(); $current_teams = $staff->current_teams(); $past_teams = $staff->past_teams(); $data = array(); if ( $show_nationality && $nationalities && is_array( $nationalities ) ) : $values = array(); foreach ( $nationalities as $nationality ) : if ( 2 == strlen( $nationality ) ) : $legacy = SP()->countries->legacy; $nationality = strtolower( $nationality ); $nationality = sp_array_value( $legacy, $nationality, null ); endif; $country_name = sp_array_value( $countries, $nationality, null ); $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—'; endforeach; $data[ esc_attr__( 'Nationality', 'sportspress' ) ] = implode( '
    ', $values ); endif; if ( $show_current_teams && $current_teams ) : $teams = array(); foreach ( $current_teams as $team ) : $team_name = sp_team_short_name( $team ); if ( $link_teams ) { $team_name = '' . $team_name . ''; } $teams[] = $team_name; endforeach; $data[ esc_attr__( 'Current Team', 'sportspress' ) ] = implode( ', ', $teams ); endif; if ( $show_past_teams && $past_teams ) : $teams = array(); foreach ( $past_teams as $team ) : $team_name = sp_team_short_name( $team ); if ( $link_teams ) { $team_name = '' . $team_name . ''; } $teams[] = $team_name; endforeach; $data[ esc_attr__( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams ); endif; $data = apply_filters( 'sportspress_staff_details', $data, $id ); if ( empty( $data ) ) { return; } $output = '
    ' . '
    '; foreach ( $data as $label => $value ) : $output .= '
    ' . $label . '
    ' . $value . '
    '; endforeach; $output .= '
    '; ?>
    ================================================ FILE: templates/staff-excerpt.php ================================================ post_excerpt; if ( $excerpt ) { ?>

    post_title; if ( $title ) { $staff = new SP_Staff( $id ); $role = $staff->role(); if ( $role ) { $title = '' . $role->name . ' ' . $title; } ?>

    'sp_staff', 'numberposts' => 500, 'posts_per_page' => 500, 'orderby' => 'title', 'order' => 'ASC', 'tax_query' => array( 'relation' => 'AND', ), ); if ( $league_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'term_id', 'terms' => $league_ids, ); endif; if ( $season_ids ) : $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'term_id', 'terms' => $season_ids, ); endif; if ( $team ) : $args['meta_query'] = array( array( 'key' => 'sp_team', 'value' => $team, ), ); endif; $staffs = get_posts( $args ); $options = array(); if ( $staffs && is_array( $staffs ) ) : foreach ( $staffs as $staff ) : $options[] = ''; endforeach; endif; if ( sizeof( $options ) > 1 ) : ?>
    name; endforeach; $data[ esc_attr__( 'Leagues', 'sportspress' ) ] = implode( ', ', $leagues ); endif; $terms = get_the_terms( $id, 'sp_season' ); if ( $terms ) : $seasons = array(); foreach ( $terms as $term ) : $seasons[] = $term->name; endforeach; $data[ esc_attr__( 'Seasons', 'sportspress' ) ] = implode( ', ', $seasons ); endif; $terms = get_the_terms( $id, 'sp_venue' ); if ( $terms ) : if ( get_option( 'sportspress_team_link_venues', 'no' ) === 'yes' ) : $data[ esc_attr__( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue', '', ', ' ); else : $venues = array(); foreach ( $terms as $term ) : $venues[] = $term->name; endforeach; $data[ esc_attr__( 'Home', 'sportspress' ) ] = implode( ', ', $venues ); endif; endif; $output = '
    ' . '
    '; foreach ( $data as $label => $value ) : $output .= '
    ' . $label . '
    ' . $value . '
    '; endforeach; $output .= '
    '; ?>
    ================================================ FILE: templates/team-events.php ================================================ $id ) ); } elseif ( 'list' === $format ) { $args = array( 'team' => $id, 'league' => apply_filters( 'sp_team_events_league', 0 ), 'season' => apply_filters( 'sp_team_events_season', 0 ), 'title_format' => 'homeaway', 'time_format' => 'separate', 'columns' => array( 'event', 'time', 'results' ), 'order' => 'DESC', ); $args = apply_filters( 'sp_team_events_list_args', $args ); sp_get_template( 'event-list.php', $args ); } else { sp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) ); } ================================================ FILE: templates/team-gallery-thumbnail.php ================================================ null, 'icontag' => 'dt', 'captiontag' => 'dd', 'caption' => null, 'size' => 'sportspress-crop-medium', 'link_posts' => get_option( 'sportspress_link_teams', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); // Add caption tag if has caption if ( $captiontag && $caption ) { $caption = '<' . $captiontag . ' class="wp-caption-text gallery-caption small-3 columns">' . wptexturize( $caption ) . ''; } if ( $link_posts ) { $caption = '' . $caption . ''; } if ( has_post_thumbnail( $id ) ) { $thumbnail = get_the_post_thumbnail( $id, $size ); } else { $thumbnail = ''; } echo wp_kses_post( "<{$itemtag} class='gallery-item'>" ); echo wp_kses_post( " <{$icontag} class='gallery-icon portrait'>" . '' . $thumbnail . '' . "" ); echo wp_kses_post( $caption ); echo wp_kses_post( "" ); ================================================ FILE: templates/team-gallery.php ================================================ get_the_ID(), 'title' => false, 'number' => -1, 'orderby' => 'default', 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'sportspress-crop-medium', 'show_all_teams_link' => false, 'link_posts' => get_option( 'sportspress_link_teams', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); // Determine number of teams to display if ( -1 === $number ) : $number = (int) get_post_meta( $id, 'sp_number', true ); if ( $number <= 0 ) { $number = -1; } endif; $itemtag = tag_escape( $itemtag ); $captiontag = tag_escape( $captiontag ); $icontag = tag_escape( $icontag ); $valid_tags = wp_kses_allowed_html( 'post' ); if ( ! isset( $valid_tags[ $itemtag ] ) ) { $itemtag = 'dl'; } if ( ! isset( $valid_tags[ $captiontag ] ) ) { $captiontag = 'dd'; } if ( ! isset( $valid_tags[ $icontag ] ) ) { $icontag = 'dt'; } $columns = intval( $columns ); $itemwidth = $columns > 0 ? floor( 100 / $columns ) : 100; $size = $size; $float = is_rtl() ? 'right' : 'left'; $selector = 'sp-team-gallery-' . $id; $table = new SP_League_Table( $id ); $data = $table->data(); // Remove the first row to leave us with the actual data unset( $data[0] ); if ( $orderby == 'name' ) : uasort( $data, 'sp_sort_by_name' ); elseif ( $orderby == 'rand' ) : uasort( $data, 'sp_sort_random' ); endif; if ( $title ) { echo '

    ' . wp_kses_post( $title ) . '

    '; } $gallery_style = $gallery_div = ''; if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) { $gallery_style = " "; } $size_class = sanitize_html_class( $size ); $gallery_div = "\n"; ================================================ FILE: templates/team-link.php ================================================
    target="_blank">

    ================================================ FILE: templates/team-lists.php ================================================ lists(); foreach ( $lists as $list ) : $id = $list->ID; $grouping = get_post_meta( $id, 'sp_grouping', true ); if ( $grouping == 'position' && sizeof( $lists ) > 1 ) : ?>

    post_title ); ?>

    formats->list ) ) { sp_get_template( 'player-' . $format . '.php', array( 'id' => $id ) ); } else { sp_get_template( 'player-list.php', array( 'id' => $id ) ); } endforeach; ================================================ FILE: templates/team-logo.php ================================================ staff(); $link_staff = get_option( 'sportspress_team_link_staff', 'no' ) === 'yes' ? true : false; foreach ( $members as $staff ) : $id = $staff->ID; $name = $staff->post_title; $staff = new SP_Staff( $id ); $roles = $staff->roles(); if ( ! empty( $roles ) ) : $roles = wp_list_pluck( $roles, 'name' ); $name = '' . implode( '/', $roles ) . ' ' . $name; endif; ?>

    ' . wp_kses_post( $name ) . '' : wp_kses_post( $name ); ?>

    $id ) ); sp_get_template( 'staff-details.php', array( 'id' => $id ) ); endforeach; ================================================ FILE: templates/team-tables.php ================================================ tables(); foreach ( $tables as $table ) : if ( ! $table ) { continue; } sp_get_template( 'league-table.php', array( 'id' => $table->ID, 'highlight' => $id, ) ); endforeach; ================================================ FILE: templates/venue-map.php ================================================