PluginProbe
Extendify / 3.1.0
Extendify v3.1.0
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / tests / playwright / Agent / sidebar-mode-scroll / setup.php

setup.php in Extendify 3.1.0, at tests/playwright/Agent/sidebar-mode-scroll/setup.php

31 lines 993 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 require '/wordpress/wp-load.php';
3
4 // Sidebar-mode scroll guards need a page tall enough to scroll
5 // inside the wp-site-blocks container, plus a tagged block low enough on
6 // the page that scroll-position changes are observable via getBoundingClientRect.
7 $paragraphs = [];
8 for ($i = 1; $i <= 30; $i++) {
9 $paragraphs[] = "<!-- wp:paragraph -->\n"
10 . "<p>Filler paragraph {$i} to make the page taller than the viewport.</p>\n"
11 . '<!-- /wp:paragraph -->';
12 }
13
14 $content = "<!-- wp:heading -->\n"
15 . "<h2 class=\"wp-block-heading\">Top heading.</h2>\n"
16 . "<!-- /wp:heading -->\n\n"
17 . implode("\n\n", $paragraphs)
18 . "\n\n<!-- wp:heading -->\n"
19 . "<h2 class=\"wp-block-heading\">Scroll target heading.</h2>\n"
20 . "<!-- /wp:heading -->\n";
21
22 $pageId = wp_insert_post([
23 'post_type' => 'page',
24 'post_status' => 'publish',
25 'post_title' => 'Sidebar Mode Scroll Home',
26 'post_content' => $content,
27 ]);
28
29 update_option('show_on_front', 'page');
30 update_option('page_on_front', $pageId);
31