Skip to content

Commit

Permalink
refactor: cast ref value to int
Browse files Browse the repository at this point in the history
  • Loading branch information
theodesp committed Jan 21, 2025
1 parent 3bbe3e4 commit 550aaf4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/Data/ContentBlocksResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ private static function populate_navigation_blocks( array $block ): array {
return $block;
}

$navigation_post = get_post( $block['attrs']['ref'] );
$ref = absint( $block['attrs']['ref'] );
$navigation_post = get_post( $ref );

if ( ! $navigation_post || 'publish' !== $navigation_post->post_status ) {
return $block;
Expand Down Expand Up @@ -378,7 +379,7 @@ private static function filter_allowed_blocks( array $blocks, array $allowed_blo

return array_filter(
$blocks,
static function ( $block ) use ( $allowed_block_names ) {
static function ( $block ) use ($allowed_block_names) {
return in_array( $block['blockName'], $allowed_block_names, true );
}
);
Expand Down

0 comments on commit 550aaf4

Please sign in to comment.