| 1 |
<?php |
| 2 |
require '/wordpress/wp-load.php'; |
| 3 |
|
| 4 |
// Auto-save-on-implicit-close seed. Three quick-editable headings: A + B |
| 5 |
// drive the cross-block gesture (edit A, click B → A auto-saves and QE |
| 6 |
// opens on B), C drives the click-outside gesture (edit C, click the |
| 7 |
// footer → C auto-saves and the canvas tears down). Headings get both |
| 8 |
// pills and open QE on click, so the spec never has to touch a pill. |
| 9 |
$content = "<!-- wp:heading -->\n" |
| 10 |
. "<h2 class=\"wp-block-heading\">Heading A for cross-block auto-save.</h2>\n" |
| 11 |
. "<!-- /wp:heading -->\n\n" |
| 12 |
. "<!-- wp:heading -->\n" |
| 13 |
. "<h2 class=\"wp-block-heading\">Heading B is the cross-block target.</h2>\n" |
| 14 |
. "<!-- /wp:heading -->\n\n" |
| 15 |
. "<!-- wp:heading -->\n" |
| 16 |
. "<h2 class=\"wp-block-heading\">Heading C for click-outside auto-save.</h2>\n" |
| 17 |
. "<!-- /wp:heading -->\n"; |
| 18 |
|
| 19 |
$pageId = wp_insert_post([ |
| 20 |
'post_type' => 'page', |
| 21 |
'post_status' => 'publish', |
| 22 |
'post_title' => 'QE Auto-Save Home', |
| 23 |
'post_content' => $content, |
| 24 |
]); |
| 25 |
|
| 26 |
update_option('show_on_front', 'page'); |
| 27 |
update_option('page_on_front', $pageId); |
| 28 |
|