| 1 |
<?php |
| 2 |
require '/wordpress/wp-load.php'; |
| 3 |
|
| 4 |
// One core/image block — the picker dropdown anchors to it. URL-only (no |
| 5 |
// attachment id) is acceptable; Image schema's apply() handles the no-id |
| 6 |
// path so /quick-edit/save doesn't validate the URL points at a real |
| 7 |
// media item. The placeholder URL is a known wp.org-served asset so the |
| 8 |
// initial GET doesn't 404 in the browser before the test mocks land. |
| 9 |
$content = "<!-- wp:image -->\n" |
| 10 |
. '<figure class="wp-block-image"><img src="https://s.w.org/style/images/about/WordPress-logotype-wmark.png" alt="WordPress mark" /></figure>' |
| 11 |
. "\n<!-- /wp:image -->\n"; |
| 12 |
|
| 13 |
$pageId = wp_insert_post([ |
| 14 |
'post_type' => 'page', |
| 15 |
'post_status' => 'publish', |
| 16 |
'post_title' => 'QE Image Flows Home', |
| 17 |
'post_content' => $content, |
| 18 |
]); |
| 19 |
|
| 20 |
update_option('show_on_front', 'page'); |
| 21 |
update_option('page_on_front', $pageId); |
| 22 |
|