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(homepage-posts): add custom taxonomy exclusions filter #1641

Merged
merged 6 commits into from
Jan 16, 2024

Conversation

chickenn00dle
Copy link
Contributor

@chickenn00dle chickenn00dle commented Jan 10, 2024

All Submissions:

Changes proposed in this Pull Request:

Closes 1200550061930446/1206047301605777

This PR adds custom taxonomy exclusions to the Homepage Posts block:

Screenshot 2024-01-11 at 12 41 10

This provides some more flexibility for the type of content that can be displayed (or not displayed) via the block.

How to test the changes in this Pull Request:

  1. Ensure you have some posts with a custom taxonomy, for example brands via Newspack Multibranded Site extension.
  2. Go to your homepage, and add/select the homepage posts block
  3. In block settings, scroll down until you see the Show Advanced Filters link
  4. Click the link and confirm you see options to filter by your custom taxonomy
  5. Search and select a taxonomy term in the relevant custom taxonomy field, then update
  6. Confirm the homepage post block in the editor has filtered out posts of that taxonomy term. Confirm the same for the front-end of the site
  7. Repeat the above with multiple taxonomies, and multiple terms

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?

@chickenn00dle chickenn00dle changed the title feat(newspack blocks): handle taxonomy exclusions feat(newspack blocks): hpp block filter by custom taxonomy Jan 10, 2024
@chickenn00dle chickenn00dle changed the title feat(newspack blocks): hpp block filter by custom taxonomy feat(homepage-posts-block): hpp block filter by custom taxonomy Jan 11, 2024
@chickenn00dle chickenn00dle changed the title feat(homepage-posts-block): hpp block filter by custom taxonomy feat(homepage-posts-block): add custom taxonomy exclusions filter Jan 11, 2024
@chickenn00dle chickenn00dle changed the title feat(homepage-posts-block): add custom taxonomy exclusions filter feat(homepage-posts): add custom taxonomy exclusions filter Jan 11, 2024
@chickenn00dle chickenn00dle marked this pull request as ready for review January 11, 2024 23:52
@chickenn00dle chickenn00dle requested a review from a team as a code owner January 11, 2024 23:52
Copy link
Member

@adekbadek adekbadek left a comment

Choose a reason for hiding this comment

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

🙌

Copy link
Member

@adekbadek adekbadek left a comment

Choose a reason for hiding this comment

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

Now that block attributes contain a non-string value, a vestige of AMP support (deprecated now) (see https://github.com/Automattic/newspack-blocks/pull/265/files#diff-6030d9ddb75c1e252eda025a57277461c424c954a8d7462cecfff99c6df6d109R105) came to light via a PHP warning. I've pushed a small change in c505807

@chickenn00dle chickenn00dle merged commit b140a99 into master Jan 16, 2024
3 checks passed
@chickenn00dle chickenn00dle deleted the feat/hpp-block-filter-brands branch January 16, 2024 18:35
dkoo pushed a commit that referenced this pull request Jan 24, 2024
This PR adds custom taxonomy exclusions to the Homepage Posts block, providing some more flexibility for the type of content that can be displayed (or not displayed) via the block.
@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.0.0-epic-test-epic-release-flow-raz.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.0.0-epic-ras-acc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Feb 8, 2024
# [3.0.0-alpha.1](v2.6.2...v3.0.0-alpha.1) (2024-02-08)

### Bug Fixes

* **homepage-articles:** use map_deep to construct articles_rest_url and resolve PHP 8.1 warnings ([#1655](#1655)) ([24085d8](24085d8))
* prevent error in modal-checkout check ([7e2a6c7](7e2a6c7))

### Features

* **ci:** add `epic/*` release workflow and rename `master` to `trunk` ([#1656](#1656)) ([c788e55](c788e55))
* deprecate streamlined (Stripe) Donate block version ([#1638](#1638)) ([11bd0d6](11bd0d6))
* **homepage-posts:** add custom taxonomy exclusions filter ([#1641](#1641)) ([b140a99](b140a99))
* **reader-revenue:** make NYP and Stripe Gateway optional ([#1645](#1645)) ([1322d7c](1322d7c))

### BREAKING CHANGES

* streamlined (Stripe) Donate block version is no more
@matticbot
Copy link
Contributor

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

The release is available on:

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Feb 20, 2024
# [3.0.0](v2.6.2...v3.0.0) (2024-02-20)

### Bug Fixes

* **homepage-articles:** use map_deep to construct articles_rest_url and resolve PHP 8.1 warnings ([#1655](#1655)) ([24085d8](24085d8))
* prevent error in modal-checkout check ([7e2a6c7](7e2a6c7))

### Features

* **ci:** add `epic/*` release workflow and rename `master` to `trunk` ([#1656](#1656)) ([c788e55](c788e55))
* deprecate streamlined (Stripe) Donate block version ([#1638](#1638)) ([11bd0d6](11bd0d6))
* **homepage-posts:** add custom taxonomy exclusions filter ([#1641](#1641)) ([b140a99](b140a99))
* **reader-revenue:** make NYP and Stripe Gateway optional ([#1645](#1645)) ([1322d7c](1322d7c))

### BREAKING CHANGES

* streamlined (Stripe) Donate block version is no more
@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.0.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