edit shortcode

This commit is contained in:
hanyixuanten
2026-08-11 17:31:08 +08:00
parent b718294d3c
commit 093f97c184
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ Contest data is provided by [OI-contest-fetch](https://github.com/hanyixuanten/O
- Adds an **Upcoming OI Contests** widget to the WordPress dashboard.
- Provides a **vblg OI Contest Schedule** block for posts and pages.
- Keeps the `[oi_contest_schedule]` shortcode available for compatibility and templates.
- Keeps the `[oics_oi_contest_schedule]` shortcode available for compatibility and templates.
- Shows contest platform, title, start and end times, and a live countdown.
- Identifies contests that are currently running.
- Supports responsive and compact layouts.
@@ -49,7 +49,7 @@ The block is rendered dynamically, so contest data remains current without editi
For classic editors or templates, the shortcode remains available:
```text
[oi_contest_schedule]
[oics_oi_contest_schedule]
```
The shortcode accepts the following attributes:
+2 -2
View File
@@ -10,7 +10,7 @@ vblg OI Contest Schedule 是一款轻量级 WordPress 插件,可在 WordPress
- 在 WordPress 仪表盘中添加“即将到来的 OI 赛事”小组件。
- 提供“**OI 赛事日程**”区块,可直接插入文章或页面。
- 保留 `[oi_contest_schedule]` 短代码,兼容经典编辑器和模板。
- 保留 `[oics_oi_contest_schedule]` 短代码,兼容经典编辑器和模板。
- 展示比赛平台、标题、开始和结束时间,以及实时倒计时。
- 自动标记正在进行的比赛。
- 支持响应式布局和紧凑布局。
@@ -49,7 +49,7 @@ vblg OI Contest Schedule 是一款轻量级 WordPress 插件,可在 WordPress
经典编辑器或模板仍可使用以下短代码:
```text
[oi_contest_schedule]
[oics_oi_contest_schedule]
```
短代码支持以下属性:
+2 -2
View File
@@ -21,7 +21,7 @@ final class OICS_Plugin {
add_action( 'wp_dashboard_setup', array( $this, 'register_dashboard_widget' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_assets' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
add_shortcode( 'oi_contest_schedule', array( $this, 'render_shortcode' ) );
add_shortcode( 'oics_oi_contest_schedule', array( $this, 'render_shortcode' ) );
}
public function register_block() {
@@ -89,7 +89,7 @@ final class OICS_Plugin {
public function enqueue_frontend_assets() {
$post = get_post();
if ( ! $post || ( ! has_shortcode( $post->post_content, 'oi_contest_schedule' ) && ! has_block( 'oics/contest-schedule', $post ) ) ) {
if ( ! $post || ( ! has_shortcode( $post->post_content, 'oics_oi_contest_schedule' ) && ! has_block( 'oics/contest-schedule', $post ) ) ) {
return;
}
+2 -2
View File
@@ -33,7 +33,7 @@ Add the **vblg OI Contest Schedule** block from the block inserter. Its settings
The shortcode remains available for classic editors and templates. By default it displays up to 10 contests:
`[oi_contest_schedule]`
`[oics_oi_contest_schedule]`
Use `limit` to display between 1 and 50 contests:
@@ -91,7 +91,7 @@ Service and data source:
* Added the upcoming contest dashboard widget.
* Added the **vblg OI Contest Schedule** editor block with limit and compact layout settings.
* Added the `[oi_contest_schedule]` shortcode with `limit` and `compact` options.
* Added the `[oics_oi_contest_schedule]` shortcode with `limit` and `compact` options.
* Added visitor-local time formatting and live countdowns.
* Added platform styling and responsive layouts.
* Added five-minute transient caching for the contest feed.