Skip to content

Commit a26e8e3

Browse files
Remove possibility of passing post id from source
1 parent d5fb4b2 commit a26e8e3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/compat/wordpress-6.5/block-bindings/post-meta.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ function gutenberg_block_bindings_post_meta_callback( $source_attrs, $block_inst
1717
return null;
1818
}
1919

20-
// Use the postId attribute if available
21-
if ( isset( $source_attrs['postId'] ) ) {
22-
$post_id = $source_attrs['postId'];
23-
} else {
24-
$post_id = isset( $block_instance->context['postId'] ) ? $block_instance->context['postId'] : get_the_ID();
25-
}
26-
20+
$post_id = isset( $block_instance->context['postId'] );
2721
// If a post isn't public, we need to prevent unauthorized users from accessing the post meta.
2822
$post = get_post( $post_id );
2923
if ( ( ! is_post_publicly_viewable( $post ) && ! current_user_can( 'read_post', $post_id ) ) || post_password_required( $post ) ) {

0 commit comments

Comments
 (0)