Skip to content

feat(collections): allow overriding "collection" names and slugs#4033

Merged
rbcorrales merged 12 commits intotrunkfrom
feat/collection-custom-name
Jun 26, 2025
Merged

feat(collections): allow overriding "collection" names and slugs#4033
rbcorrales merged 12 commits intotrunkfrom
feat/collection-custom-name

Conversation

@rbcorrales
Copy link
Copy Markdown
Member

@rbcorrales rbcorrales commented Jun 13, 2025

All Submissions:

Changes proposed in this Pull Request:

This PR introduces a new feature that allows publishers to customize the "collection" terminology in the frontend. Publishers can now override the default "Collection"/"Collections" labels with their own custom names and slugs.

Closes NPPD-481, NPPD-482.

How to test the changes in this Pull Request:

  1. Enable Collections feature (wp config set NEWSPACK_COLLECTIONS_ENABLED true --raw)
  2. Navigate to the admin and go to Collections.
  3. Create a new collection.
  4. Check that the REST API endpoint /wp-json/wp/v2/newspack_collection works correctly and returns the expected data structure.
  5. Verify that collection archive pages use the default /collection/ URL structure and display correctly.
  6. Go to Newspack settings and enable custom naming for collections. Set custom names like "Issue" (singular) and "Issues" (plural) with slug "issue" and save the settings.
  7. Labels and messages across the admin should remain unchanged and the REST endpoint should keep working.
  8. Test that taxonomy URLs use the custom naming (e.g., /issue-category/ and /issue-section/).
  9. Create a new collection with the custom slug and verify that the archive page URL structure uses the custom slug.
  10. Test that taxonomy term pages work correctly with the new URL structure.

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?

@rbcorrales rbcorrales requested a review from a team as a code owner June 13, 2025 18:49
Base automatically changed from feat/collections-global-settings to trunk June 13, 2025 23:24
@rbcorrales rbcorrales force-pushed the feat/collection-custom-name branch from e41862f to 63ed396 Compare June 13, 2025 23:29
@rbcorrales rbcorrales changed the title feat(collections): allow overriding "collection" name with dynamic labels and slugs feat(collections): allow overriding "collection" names and slugs Jun 24, 2025
@rbcorrales rbcorrales force-pushed the feat/collection-custom-name branch from 99b9db4 to 89533c4 Compare June 24, 2025 18:26
@github-actions github-actions bot added the [Status] Approved The pull request has been reviewed and is ready to merge label Jun 25, 2025
@rbcorrales rbcorrales requested a review from adekbadek June 25, 2025 15:01
@rbcorrales rbcorrales dismissed adekbadek’s stale review June 26, 2025 17:45

Dismissing as the requested check was implemented. Thanks for flagging!

@rbcorrales rbcorrales merged commit f5523b0 into trunk Jun 26, 2025
9 checks passed
@rbcorrales rbcorrales deleted the feat/collection-custom-name branch June 26, 2025 17:55
@github-actions
Copy link
Copy Markdown

Hey @rbcorrales, 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! ❤️

matticbot pushed a commit that referenced this pull request Jul 3, 2025
# [6.12.0-alpha.1](v6.11.2...v6.12.0-alpha.1) (2025-07-03)

### Bug Fixes

* **menu:** don't hide sponsors menu if the user can't see the newspack dashboard ([#4041](#4041)) ([f988bd2](f988bd2))
* saving name when registering user ([#4050](#4050)) ([498028e](498028e))
* **woocommerce-memberships:** prevent membership expiry if there's another active subscription ([#4009](#4009)) ([6b42cbd](6b42cbd))

### Features

* **capabilities:** add caps for RSS Feeds ([#3908](#3908)) ([2620c54](2620c54))
* **collections:** add hierarchical fields ([#4051](#4051)) ([3f5a704](3f5a704))
* **collections:** allow overriding "collection" names and slugs ([#4033](#4033)) ([f5523b0](f5523b0))
* **collections:** support multiple CTAs in collections meta ([#4049](#4049)) ([d445444](d445444))
* modal checkout for My Account's reorders ([#3988](#3988)) ([fd347bc](fd347bc))
* **my-account:** subscription payment notice ([#4029](#4029)) ([4b78d7f](4b78d7f))
* **rss:** Custom Tracking snippet ([#4047](#4047)) ([2e682c5](2e682c5))
* **rss:** Hooks extending RSS ([#4055](#4055)) ([da97ff4](da97ff4))
* **rss:** Skip non-distributable images ([#4052](#4052)) ([9fdfe78](9fdfe78))
* show "deleted" label on segments if list, subscription, or plan was deleted [NPPM-2031] ([#4021](#4021)) ([4dec8bb](4dec8bb))
* **woocommerce:** rename WooCommerce Payments to WooPay ([#4048](#4048)) ([1528cad](1528cad))
@matticbot
Copy link
Copy Markdown
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jul 14, 2025
# [6.12.0](v6.11.3...v6.12.0) (2025-07-14)

### Bug Fixes

* **menu:** don't hide sponsors menu if the user can't see the newspack dashboard ([#4041](#4041)) ([f988bd2](f988bd2))
* saving name when registering user ([#4050](#4050)) ([498028e](498028e))
* **woocommerce-memberships:** prevent membership expiry if there's another active subscription ([#4009](#4009)) ([6b42cbd](6b42cbd))

### Features

* **capabilities:** add caps for RSS Feeds ([#3908](#3908)) ([2620c54](2620c54))
* **collections:** add hierarchical fields ([#4051](#4051)) ([3f5a704](3f5a704))
* **collections:** allow overriding "collection" names and slugs ([#4033](#4033)) ([f5523b0](f5523b0))
* **collections:** support multiple CTAs in collections meta ([#4049](#4049)) ([d445444](d445444))
* modal checkout for My Account's reorders ([#3988](#3988)) ([fd347bc](fd347bc))
* **my-account:** subscription payment notice ([#4029](#4029)) ([4b78d7f](4b78d7f))
* **rss:** Custom Tracking snippet ([#4047](#4047)) ([2e682c5](2e682c5))
* **rss:** Hooks extending RSS ([#4055](#4055)) ([da97ff4](da97ff4))
* **rss:** Skip non-distributable images ([#4052](#4052)) ([9fdfe78](9fdfe78))
* show "deleted" label on segments if list, subscription, or plan was deleted [NPPM-2031] ([#4021](#4021)) ([4dec8bb](4dec8bb))
* **woocommerce:** rename WooCommerce Payments to WooPay ([#4048](#4048)) ([1528cad](1528cad))
@matticbot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants