Skip to content

Commit

Permalink
Correctly access the page ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwelcher committed May 21, 2024
1 parent 2b6ef55 commit 14a048a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _blueprint/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ function () {
'post_title' => '',
'post_content' => '<!-- wp:to-do-mvc/to-do-mvc /-->'
];
$page = wp_insert_post( $page_args );
$page_id = wp_insert_post( $page_args );

if ( ! is_wp_error( $page ) ) {
if ( ! is_wp_error( $page_id ) ) {
// Set the site to show the page on the front.
update_option( 'show_on_front', 'page' );

update_option( 'page_on_front', $page->ID );
update_option( 'page_on_front', $page_id );
}
}
);

0 comments on commit 14a048a

Please sign in to comment.