| 1 |
<?php |
| 2 |
require '/wordpress/wp-load.php'; |
| 3 |
|
| 4 |
// Seed: paragraph directly below a heading. Two |
| 5 |
// arrangements: top-level siblings (each block tagged at depth=1 by |
| 6 |
// TagBlocks) and a group container (only the group is tagged). Both used |
| 7 |
// to resolve to the heading via the old `isRecognizedBlockEl` |
| 8 |
// preference in findTagged; with the type-gate dropped and the capture-rule |
| 9 |
// in place, the innermost tagged ancestor wins regardless of which child |
| 10 |
// happens to carry a recognized class. |
| 11 |
$homeContent = "<!-- wp:heading -->\n" |
| 12 |
. "<h2 class=\"wp-block-heading\" id=\"top-heading\">Top-level heading.</h2>\n" |
| 13 |
. "<!-- /wp:heading -->\n\n" |
| 14 |
. "<!-- wp:paragraph -->\n" |
| 15 |
. "<p id=\"top-paragraph\">Top-level paragraph sitting directly below the heading.</p>\n" |
| 16 |
. "<!-- /wp:paragraph -->\n\n" |
| 17 |
. "<!-- wp:group {\"layout\":{\"type\":\"constrained\"}} -->\n" |
| 18 |
. "<div class=\"wp-block-group\" id=\"group-target\">\n" |
| 19 |
. "<!-- wp:heading -->\n" |
| 20 |
. "<h2 class=\"wp-block-heading\" id=\"group-heading\">Heading inside group.</h2>\n" |
| 21 |
. "<!-- /wp:heading -->\n\n" |
| 22 |
. "<!-- wp:paragraph -->\n" |
| 23 |
. "<p id=\"group-paragraph\">Paragraph inside the group, directly below the heading.</p>\n" |
| 24 |
. "<!-- /wp:paragraph -->\n" |
| 25 |
. "</div>\n" |
| 26 |
. "<!-- /wp:group -->\n"; |
| 27 |
|
| 28 |
$pageId = wp_insert_post([ |
| 29 |
'post_type' => 'page', |
| 30 |
'post_status' => 'publish', |
| 31 |
'post_title' => 'QE Paragraph Below Heading Home', |
| 32 |
'post_content' => $homeContent, |
| 33 |
]); |
| 34 |
|
| 35 |
update_option('show_on_front', 'page'); |
| 36 |
update_option('page_on_front', $pageId); |
| 37 |
|