Skip to content

Commit a974904

Browse files
committed
Lib: Provide initial page path and context for the site editor.
1 parent 7b0c38d commit a974904

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/edit-site-page.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ function gutenberg_edit_site_init( $hook ) {
168168
$settings['templatePartIds'] = array_values( $template_part_ids );
169169
$settings['styles'] = gutenberg_get_editor_styles();
170170

171+
$settings['page'] = array(
172+
'path' => '/',
173+
'context' => array(
174+
'postType' => 'page',
175+
'postId' => get_option( 'page_on_front' ),
176+
),
177+
);
178+
171179
// This is so other parts of the code can hook their own settings.
172180
// Example: Global Styles.
173181
global $post;

0 commit comments

Comments
 (0)