| 1 |
<?php |
| 2 |
require '/wordpress/wp-load.php'; |
| 3 |
|
| 4 |
$imageBlock = "<!-- wp:image {\"width\":\"160px\",\"height\":\"160px\"} -->\n" |
| 5 |
. '<figure class="wp-block-image is-resized"><img src="https://s.w.org/style/images/about/WordPress-logotype-wmark.png" alt="WordPress mark" style="width:160px;height:160px;object-fit:contain" /></figure>' |
| 6 |
. "\n<!-- /wp:image -->\n"; |
| 7 |
|
| 8 |
$spacer = "<!-- wp:spacer {\"height\":\"40px\"} -->\n" |
| 9 |
. '<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>' |
| 10 |
. "\n<!-- /wp:spacer -->\n"; |
| 11 |
|
| 12 |
$paragraph = "<!-- wp:paragraph -->\n" |
| 13 |
. '<p>A paragraph above the images for the cross-block click test.</p>' |
| 14 |
. "\n<!-- /wp:paragraph -->\n"; |
| 15 |
|
| 16 |
$content = $paragraph . $spacer . $imageBlock . $spacer . $imageBlock; |
| 17 |
|
| 18 |
$pageId = wp_insert_post([ |
| 19 |
'post_type' => 'page', |
| 20 |
'post_status' => 'publish', |
| 21 |
'post_title' => 'QE Image Dropdown Orphan', |
| 22 |
'post_content' => $content, |
| 23 |
]); |
| 24 |
|
| 25 |
update_option('show_on_front', 'page'); |
| 26 |
update_option('page_on_front', $pageId); |
| 27 |
|