context['postId'] ) ? absint( $block->context['postId'] ) : get_the_ID(); $chrnx_limit = isset( $attributes['limit'] ) && is_int( $attributes['limit'] ) && 5 === $attributes['limit'] ? 5 : 3; $chrnx_layout = isset( $attributes['layout'] ) && is_string( $attributes['layout'] ) && in_array( $attributes['layout'], array( 'adaptive', 'grid', 'carousel' ), true ) ? $attributes['layout'] : 'adaptive'; $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_title_id = wp_unique_id( 'chrnx-related-posts-title-' ); $chrnx_carousel_capable = 'grid' !== $chrnx_layout; $chrnx_section_class_name = 'chrnx-related-posts is-layout-' . $chrnx_layout; ?>
$chrnx_section_class_name ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> aria-labelledby=""> id="">>