| 1 |
<?php |
| 2 |
require '/wordpress/wp-load.php'; |
| 3 |
|
| 4 |
// Narrow paragraph + a button block. The width matters: a paragraph |
| 5 |
// inside a small container reproduces the "edit box reads as too short" |
| 6 |
// half of the bug — the LinkControl popover gets sized to the canvas |
| 7 |
// (which tracks the live block) when positioning is broken. |
| 8 |
$content = "<!-- wp:group {\"layout\":{\"type\":\"constrained\",\"contentSize\":\"320px\"}} -->\n" |
| 9 |
. "<div class=\"wp-block-group\">\n" |
| 10 |
. "<!-- wp:paragraph -->\n" |
| 11 |
. "<p>Edit the link inside this paragraph for testing.</p>\n" |
| 12 |
. "<!-- /wp:paragraph -->\n" |
| 13 |
. "</div>\n" |
| 14 |
. "<!-- /wp:group -->\n\n" |
| 15 |
. "<!-- wp:buttons -->\n" |
| 16 |
. "<div class=\"wp-block-buttons\">\n" |
| 17 |
. "<!-- wp:button -->\n" |
| 18 |
. "<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https://example.com\">Open my long button link</a></div>\n" |
| 19 |
. "<!-- /wp:button -->\n" |
| 20 |
. "</div>\n" |
| 21 |
. "<!-- /wp:buttons -->\n"; |
| 22 |
|
| 23 |
$pageId = wp_insert_post([ |
| 24 |
'post_type' => 'page', |
| 25 |
'post_status' => 'publish', |
| 26 |
'post_title' => 'Link Popover Test Home', |
| 27 |
'post_content' => $content, |
| 28 |
]); |
| 29 |
|
| 30 |
update_option('show_on_front', 'page'); |
| 31 |
update_option('page_on_front', $pageId); |
| 32 |
|