Skip to content

Conversation

@leogermani
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

Adds the same behavior of the Content Loop block and exclude it from feeds

How to test the changes in this Pull Request:

  1. Add a carousel block to a post
  2. Make sure it works as expected both in the editor and in the frontend
  3. Confirm it's no longer included in feeds

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@leogermani leogermani self-assigned this Nov 27, 2025
@leogermani leogermani requested a review from a team as a code owner November 27, 2025 18:12
Copy link
Member

@rbcorrales rbcorrales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was doing this for Pugpig feeds only:

	/**
	 * Prevent carousel blocks from rendering in the Pugpig feed.
	 *
	 * @param string|null $pre_render The pre-rendered content. Default null.
	 * @param array       $parsed_block An associative array of the block being rendered.
	 * @return string|null The pre-rendered content.
	 */
	public static function prevent_carousel_rendering( $pre_render, $parsed_block ) {
		if ( Utils::is_pugpig_feed() && 'newspack-blocks/carousel' === ( $parsed_block['blockName'] ?? '' ) ) {
			return '';
		}

		return $pre_render;
	}

But if we don't want to see it anywhere, this is better.

@leogermani leogermani merged commit d0c6ad1 into trunk Dec 2, 2025
9 checks passed
@leogermani leogermani deleted the feat/supress-carousel-from-feeds branch December 2, 2025 20:47
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Hey @leogermani, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants