| 1 |
<?php |
| 2 |
require '/wordpress/wp-load.php'; |
| 3 |
|
| 4 |
// Seeds blocks that have no Quick Edit modal (group, media+text). After |
| 5 |
// the selector-unification refactor these become selectable — the hover |
| 6 |
// outline appears and the Ask AI pill renders — but the Quick Edit pill |
| 7 |
// stays hidden because hasQuickEditModalFor() is false for these types. |
| 8 |
// Padding on the group gives it hover surface above + below the heading. |
| 9 |
// Without it, the heading fills the group's bounding box and a center |
| 10 |
// hover lands on the heading (innermost-tagged wins), |
| 11 |
// making the group itself unreachable. Real content always |
| 12 |
// has spacing between blocks; the test fixture has to expose that. |
| 13 |
$content = "<!-- wp:group {\"layout\":{\"type\":\"constrained\"},\"style\":{\"spacing\":{\"padding\":{\"top\":\"80px\",\"bottom\":\"80px\",\"left\":\"40px\",\"right\":\"40px\"}}}} -->\n" |
| 14 |
. "<div class=\"wp-block-group\" id=\"group-target\" style=\"padding-top:80px;padding-right:40px;padding-bottom:80px;padding-left:40px\">\n" |
| 15 |
. "<!-- wp:heading -->\n" |
| 16 |
. "<h2 class=\"wp-block-heading\">Inside a group container.</h2>\n" |
| 17 |
. "<!-- /wp:heading -->\n" |
| 18 |
. "</div>\n" |
| 19 |
. "<!-- /wp:group -->\n\n" |
| 20 |
. "<!-- wp:media-text {\"mediaId\":0,\"mediaType\":\"image\"} -->\n" |
| 21 |
. "<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\" id=\"media-text-target\">" |
| 22 |
. "<figure class=\"wp-block-media-text__media\"></figure>" |
| 23 |
. "<div class=\"wp-block-media-text__content\">" |
| 24 |
. "<p>Media + text body copy.</p>" |
| 25 |
. "</div>" |
| 26 |
. "</div>\n" |
| 27 |
. "<!-- /wp:media-text -->\n"; |
| 28 |
|
| 29 |
$pageId = wp_insert_post([ |
| 30 |
'post_type' => 'page', |
| 31 |
'post_status' => 'publish', |
| 32 |
'post_title' => 'QE Unsupported Blocks Home', |
| 33 |
'post_content' => $content, |
| 34 |
]); |
| 35 |
|
| 36 |
update_option('show_on_front', 'page'); |
| 37 |
update_option('page_on_front', $pageId); |
| 38 |
|