Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add category filter for the categories in the blocks #1528

Merged
merged 3 commits into from
Sep 14, 2023

Conversation

laurelfulford
Copy link
Contributor

@laurelfulford laurelfulford commented Sep 14, 2023

All Submissions:

Changes proposed in this Pull Request:

This PR adds the filter newspack_block_categories to the post category output used by the Homepage Posts and Carousel blocks, similar to the newspack_theme_categories filter used in the themes.

This addresses a publisher specific request related to how one of our smaller plugins works on single posts but not Homepage Posts, but it could have some other uses!

See 1205368557216686-as-1205459019020490.

How to test the changes in this Pull Request:

  1. Apply the PR and run npm run build.
  2. Add a Homepage Posts and Carousel block to the editor; set the categories to display. Confirm there are no issues.
  3. Set up something to filter newspack_blocks_categories, or test this plugin with: 115-gh-automattic/newspack-custom-code
  4. Confirm that the filtered content is showing up after the categories for both blocks, on the front-end and in the editor.

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?

Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

Tests well and good call moving the logic to a separate function, it's much better to read now!

@laurelfulford
Copy link
Contributor Author

Thanks @miguelpeixe!

@laurelfulford laurelfulford merged commit ebbfce9 into master Sep 14, 2023
8 checks passed
@laurelfulford laurelfulford deleted the feat/add-category-filter branch September 14, 2023 20:32
matticbot pushed a commit that referenced this pull request Sep 15, 2023
# [1.75.0-alpha.1](v1.74.0...v1.75.0-alpha.1) (2023-09-15)

### Features

* add category filter for the categories in the blocks ([#1528](#1528)) ([ebbfce9](ebbfce9))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.75.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Sep 25, 2023
# [1.75.0](v1.74.2...v1.75.0) (2023-09-25)

### Features

* add category filter for the categories in the blocks ([#1528](#1528)) ([ebbfce9](ebbfce9))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.75.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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