fix(runtime): use compatible WordPress jQuery

This commit is contained in:
2026-09-05 20:48:18 +08:00
parent d64c4cf1b4
commit 4a12de38cb
3 changed files with 9 additions and 9 deletions
@@ -40,10 +40,12 @@ test('published post content reaches the front submit editor unchanged', () => {
assert.match(editor, /wp_editor\(\(string\) \$ctx\['current_content'\], 'post_content', \$editor_settings\);/);
});
test('front submit uses the registered local jQuery runtime', () => {
test('front submit uses the WordPress-managed jQuery runtime', () => {
const source = read('src/Core/ScriptsPart1b.php');
assert.match(source, /wp_register_script\('jquery', \$base_uri \. '\/assets\/js\/runtime\/libs\/jquery\.min\.js', \[\], '1\.9\.1', false\)/);
assert.match(source, /wp_enqueue_script\('jquery'\)/);
assert.doesNotMatch(source, /wp_deregister_script\('jquery'\)/);
assert.doesNotMatch(source, /wp_register_script\('jquery'/);
assert.doesNotMatch(source, /jquery-migrate/);
const page = read('templates/pages/page-submit.php');