內容簡介
這個外掛提供 WordPress 小工具,可實現 hockeydata Live.Online 統計 API 的可用統計數據小工具,如排名、賽程或得分手。這些小工具都以「hockeydata LOS」開頭。
要在 WordPress 頁面上實現小工具(例如賽程表),您需要安裝 WordPress 外掛(例如Page Builder by SiteOrigin),它允許在簡單頁面上添加 WordPress 小工具。或者,您也可以使用短代碼。
短代碼
所有 hockeydata LOS 小工具也可以使用短代碼實現:
[hd-los-game-full-report] = hockeydata.los.Game.FullReport
[hd-los-game-slider] = hockeydata.los.GameSlider
[hd-los-game-ticker] = hockeydata.los.GameTicker
[hd-los-knockout-stage] = hockeydata.los.KnockoutStage
[hd-los-knockout-stage-compact] = hockeydata.los.KnockoutStage.Compact
[hd-los-leaders] = hockeydata.los.Leaders
[hd-los-live-games] = hockeydata.los.LiveGames
[hd-los-player-full-page] = hockeydata.los.Player.FullPage
[hd-los-players] = hockeydata.los.Players
[hd-los-schedule] = hockeydata.los.Schedule
[hd-los-standings] = hockeydata.los.Standings
[hd-los-team-full-page] = hockeydata.los.Team.FullPage
[hd-los-team-stats] = hockeydata.los.TeamStats
所有小工具選項都必須以小寫和連字符提供,而不是以 CamelCase 格式在 JavaScript API 中定義。例如,division-id 而不是 divisionId。更多示例:
additional-columns › additionalColumns
column-set › columnSet
show-legend › showLegend
短代碼範例:
[hd-los-schedule division-id=ebel-gd]
升級通知
如果您從低於版本 1.2.0 的版本升級,請
檢查「設置 > hockeydata LOS」中的設置。
替換小工具和短代碼。
檢查所有小工具鏈接(rowLink、playerLink 等)。
第 2 點:在版本 1.2.0 中,我們不得不為短代碼和小工具 ID 添加前綴 hd- 和 hd_。不幸的是,在版本 1.2.0 之前實現的所有小工具都不再適用。但是,有個好消息:
您可以使用插件一次性替換所有舊的短代碼和小工具。以下是使用「Better Search Replace」執行此操作的示例:
安裝並啟用「Better Search Replace」插件(轉到「外掛程式」›「新增外掛程式」並搜尋「Better Search Replace」或從https://wordpress.org/plugins/better-search-replace/ 下載)。
轉到「工具」›「Better Search Replace」
替換以下字符串(不要啟用「大小寫不敏感」選項):
重要提示:在替換之前,請備份您的數據庫和文件。
搜尋 替換
[los-game-full-report [hd-los-game-full-report
[los-game-slider [hd-los-game-slider
[los-leaders [hd-los-leaders
[los-player-full-page [hd-los-player-full-page
[los-schedule [hd-los-schedule
[los-standings [hd-los-standings
[los-team-full-page [hd-los-team-ful
外掛標籤
開發者團隊
原文外掛簡介
This plugin provides WordPress widgets to implement the available statistics widgets of hockeydata Live.Online Statistics API, like standings, schedule or top scorers. All of these widgets start with “hockeydata LOS”.
To implement a widget, e.g. the schedule, on a WordPress page, you need to install a WordPress plugin (e.g. Page Builder by SiteOrigin) which allows adding WordPress widgets on simple pages. Alternatevely, you may also use shortcodes.
Shortcodes
All hockeydata LOS widgets can also be implemented with shortcodes:
[hd-los-game-full-report] = hockeydata.los.Game.FullReport
[hd-los-game-slider] = hockeydata.los.GameSlider
[hd-los-game-ticker] = hockeydata.los.GameTicker
[hd-los-knockout-stage] = hockeydata.los.KnockoutStage
[hd-los-knockout-stage-compact] = hockeydata.los.KnockoutStage.Compact
[hd-los-leaders] = hockeydata.los.Leaders
[hd-los-live-games] = hockeydata.los.LiveGames
[hd-los-player-full-page] = hockeydata.los.Player.FullPage
[hd-los-players] = hockeydata.los.Players
[hd-los-schedule] = hockeydata.los.Schedule
[hd-los-standings] = hockeydata.los.Standings
[hd-los-team-full-page] = hockeydata.los.Team.FullPage
[hd-los-team-stats] = hockeydata.los.TeamStats
All widgets options must be provided in lower case with hyphens, not as defined in the JavaScript API in CamelCase format. E.g. division-id instead of divisionId. More examples:
additional-columns › additionalColumns
column-set › columnSet
show-legend › showLegend
Shortcode example:
[hd-los-schedule division-id=ebel-gd]
Upgrade Notices
If you upgrade from a version lower than 1.2.0 please
Check the settings in Settings > hockeydata LOS.
Replace widgets and shortcodes.
Check all widget links (rowLink, playerLink, etc.).
Ad 2.: In version 1.2.0 we had to add the prefixes hd- and hd_ to the shortcodes and widget id’s, respectively. Unfortunately, all of your widgets you implemented prior to version 1.2.0 won’t work anymore. But there’s a silver lining:
You can use a plugin to replace all old shortcodes and widgets at once. Here is an example of how to do this with “Better Search Replace”:
Install and activate the plugin “Better Search Replace” (go to Plugins › Add New and search for “Better Search Replace” or download from https://wordpress.org/plugins/better-search-replace/).
Go to Tools › Better Search Replace
Replace the following strings (do not activate the option “Case-Insensitive?”):
Important: before replacing, please back up your database and files.
Search for Replace with
[los-game-full-report [hd-los-game-full-report
[los-game-slider [hd-los-game-slider
[los-leaders [hd-los-leaders
[los-player-full-page [hd-los-player-full-page
[los-schedule [hd-los-schedule
[los-standings [hd-los-standings
[los-team-full-page [hd-los-team-full-page
[los-team-stats [hd-los-team-stats
los_widget_game_full_report hd_los_widget_game_full_report
los_widget_game_slider hd_los_widget_game_slider
los_widget_leaders hd_los_widget_leaders
los_widget_player_full_page hd_los_widget_player_full_page
los_widget_schedule hd_los_widget_schedule
los_widget_standings hd_los_widget_standings
los_widget_team_full_page hd_los_widget_team_full_page
los_widget_team_stats hd_los_widget_team_stats
LOS_Widget_GameFullReport HD_LOS_Widget_GameFullReport
LOS_Widget_GameSlider HD_LOS_Widget_GameSlider
LOS_Widget_Leaders HD_LOS_Widget_Leaders
LOS_Widget_PlayerFullPage HD_LOS_Widget_PlayerFullPage
LOS_Widget_Schedule HD_LOS_Widget_Schedule
LOS_Widget_Standings HD_LOS_Widget_Standings
LOS_Widget_TeamFullPage HD_LOS_Widget_TeamFullPage
LOS_Widget_TeamStats HD_LOS_Widget_TeamStats
Of course you only need to replace strings containing the shortcodes and widgets you’re using. After you’re done replacing you can remove the plugin.
