fix: bound CHRNX editorial queries

This commit is contained in:
chrnx committed 2026-08-11 15:49:58 -05:00
1 parent 52f08a1efd
commit a181f405bf
5 files changed
+429 -87

No files matched your search

+4 -3
View File
@@ -11,10 +11,11 @@ $chrnx_ids = chrnx_get_related_post_ids( $chrnx_post_id, $chrnx_limit );
if ( empty( $chrnx_ids ) ) {
return;
}
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 2, 2 );
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 2, 2 );
$chrnx_title_id = wp_unique_id( 'chrnx-related-posts-title-' );
?>
<section <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-related-posts' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> aria-labelledby="chrnx-related-posts-title-<?php echo esc_attr( $chrnx_post_id ); ?>">
<h<?php echo esc_attr( $chrnx_heading ); ?> id="chrnx-related-posts-title-<?php echo esc_attr( $chrnx_post_id ); ?>"><?php echo esc_html__( 'Related stories', 'chrnx' ); ?></h<?php echo esc_attr( $chrnx_heading ); ?>>
<section <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-related-posts' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> aria-labelledby="<?php echo esc_attr( $chrnx_title_id ); ?>">
<h<?php echo esc_attr( $chrnx_heading ); ?> id="<?php echo esc_attr( $chrnx_title_id ); ?>"><?php echo esc_html__( 'Related stories', 'chrnx' ); ?></h<?php echo esc_attr( $chrnx_heading ); ?>>
<div class="chrnx-related-posts__grid">
<?php
foreach ( $chrnx_ids as $chrnx_related_id ) {