Skip to content

Commit

Permalink
fix(homepage-posts): placement for inline styles (#1611)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe authored Nov 27, 2023
1 parent 91adb52 commit 1831ba0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/blocks/homepage-articles/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function newspack_blocks_render_block_homepage_articles( $attributes ) {
$block_name = apply_filters( 'newspack_blocks_block_name', 'newspack-blocks/homepage-articles' );

// Gather all Homepage Articles blocks on the page and output only the needed CSS.
// This CSS will be printed right after .entry-content.
// This CSS will be printed along with the first found block markup.
global $newspack_blocks_hpb_all_blocks;
$inline_style_html = '';
if ( ! is_array( $newspack_blocks_hpb_all_blocks ) ) {
Expand Down Expand Up @@ -358,6 +358,7 @@ function( $attribute ) {
class="<?php echo esc_attr( $classes ); ?>"
style="<?php echo esc_attr( $styles ); ?>"
>
<?php echo $inline_style_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<div data-posts data-current-post-id="<?php the_ID(); ?>">
<?php if ( '' !== $attributes['sectionHeader'] ) : ?>
<h2 class="article-section-title">
Expand Down Expand Up @@ -404,7 +405,7 @@ class="<?php echo esc_attr( $classes ); ?>"
$content = ob_get_clean();
Newspack_Blocks::enqueue_view_assets( 'homepage-articles' );

return $inline_style_html . $content;
return $content;
}

/**
Expand Down

0 comments on commit 1831ba0

Please sign in to comment.