fix(frontend): match the reference post format options in the page set modal

参考主题把文章格式固定为标准/图像/画廊/视频四项,动态读取
get_theme_support('post-formats') 会让本站多出 aside/quote/link
等注册格式,选项集偏离参考主题,故改为固定列表。
This commit is contained in:
kate522 committed 2026-10-06 12:55:04 +08:00
1 parent 6dbe1fe4c6
commit 962ab5c290
3 files changed
+44 -7

No files matched your search

@@ -197,6 +197,11 @@ test('frontend page edit ships gate, footer modal, and legacy ajax-save contract
assert.match(pageAdminSet, /update_post_meta\(\$post_id, '_aksrt_like_count', max\(0, \(int\) \$_POST\['like'\]\)\)/);
assert.match(pageAdminSet, /wp_update_term\(\$term_id, \(string\) \$term->taxonomy, \$data\)/);
assert.match(pageAdminSet, /set_post_format\(\$post_id, \$format === 'standard' \? '' : \$format\)/);
// 文章格式 mirrors the reference's fixed four-option list, not the theme's
// wider add_theme_support('post-formats') registration.
assert.match(pageAdminSet, /return \[\s*'standard' => __\('标准', 'aksrt'\),\s*'image' => __\('图像', 'aksrt'\),\s*'gallery' => __\('画廊', 'aksrt'\),\s*'video' => __\('视频', 'aksrt'\),\s*\];/s);
assert.doesNotMatch(pageAdminSet, /get_theme_support\('post-formats'\)\s*\?/);
assert.doesNotMatch(pageAdminSet, /get_post_format_string\(/);
// Page branch: 标题样式 + 模块布局(widgets_register) + 容器位置.
assert.match(pageAdminSet, /esc_attr\(\(string\) \(\$meta\['id'\] \?\? ''\)\) \. '\[\]" id="'/);
assert.match(pageAdminSet, /'page_header_style'/);