| 1 |
<?php |
| 2 |
require '/wordpress/wp-load.php'; |
| 3 |
|
| 4 |
$content = "<!-- wp:paragraph -->\n" |
| 5 |
. "<p>A plain paragraph that can take a text alignment.</p>\n" |
| 6 |
. "<!-- /wp:paragraph -->\n\n" |
| 7 |
. "<!-- wp:heading -->\n" |
| 8 |
. "<h2 class=\"wp-block-heading\">A heading that can take a text alignment.</h2>\n" |
| 9 |
. "<!-- /wp:heading -->\n\n" |
| 10 |
. "<!-- wp:buttons -->\n" |
| 11 |
. "<div class=\"wp-block-buttons\"><!-- wp:button -->\n" |
| 12 |
. "<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"#\">Browse Collection</a></div>\n" |
| 13 |
. "<!-- /wp:button --></div>\n" |
| 14 |
. "<!-- /wp:buttons -->\n\n" |
| 15 |
. "<!-- wp:image -->\n" |
| 16 |
. "<figure class=\"wp-block-image\"><img src=\"https://images-resource.extendify.com/test.jpg\" alt=\"\"/></figure>\n" |
| 17 |
. "<!-- /wp:image -->\n"; |
| 18 |
|
| 19 |
$pageId = wp_insert_post([ |
| 20 |
'post_type' => 'page', |
| 21 |
'post_status' => 'publish', |
| 22 |
'post_title' => 'Text Alignment Test Home', |
| 23 |
'post_content' => $content, |
| 24 |
]); |
| 25 |
|
| 26 |
update_option('show_on_front', 'page'); |
| 27 |
update_option('page_on_front', $pageId); |
| 28 |
|