Skip to content

Commit

Permalink
check if post id is int
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Nov 1, 2024
1 parent ce7d479 commit 809405e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/compat/wordpress-6.8/preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
function gutenberg_block_editor_preload_paths_6_8( $paths, $context ) {
if ( 'core/edit-site' === $context->name ) {
if ( ! empty( $_GET['postId'] ) ) {
$post = get_post( $_GET['postId'] );
$post_id = (int) $_GET['postId'];
if ( $post_id ) {
$post = get_post( $post_id );
}
}

if ( $post ) {
Expand Down

0 comments on commit 809405e

Please sign in to comment.