Skip to content

Commit

Permalink
Ratings Block: Avoid warnings when the postId context is not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 committed Jan 9, 2025
1 parent 8751663 commit 435c085
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mu-plugins/blocks/ratings-bars/render.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$current_post_id = $block->context['postId'];
$current_post_id = $block->context['postId'] ?? 0;
if ( ! $current_post_id ) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion mu-plugins/blocks/ratings-stars/render.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$current_post_id = $block->context['postId'];
$current_post_id = $block->context['postId'] ?? 0;
if ( ! $current_post_id ) {
return;
}
Expand Down

0 comments on commit 435c085

Please sign in to comment.