Skip to content

Commit

Permalink
Set correct post id
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Feb 6, 2024
1 parent a26e8e3 commit 3d058ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.5/block-bindings/post-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function gutenberg_block_bindings_post_meta_callback( $source_attrs, $block_inst
return null;
}

$post_id = isset( $block_instance->context['postId'] );
$post_id = $block_instance->context['postId'];
// If a post isn't public, we need to prevent unauthorized users from accessing the post meta.
$post = get_post( $post_id );
if ( ( ! is_post_publicly_viewable( $post ) && ! current_user_can( 'read_post', $post_id ) ) || post_password_required( $post ) ) {
Expand Down

0 comments on commit 3d058ff

Please sign in to comment.