fix(block-theme): ensure newsletter templates are treated as default CPT templates#168
Open
laurelfulford wants to merge 2 commits into
Open
fix(block-theme): ensure newsletter templates are treated as default CPT templates#168laurelfulford wants to merge 2 commits into
laurelfulford wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates how the Newspack Block Theme exposes templates for the Newsletter custom post type so they behave like proper CPT hierarchy templates (used automatically for newsletters) instead of appearing as assignable “custom templates” when editing posts/pages.
Changes:
- Replace the
get_block_templates-based title override with adefault_template_typesfilter registration for Newsletter template types. - Define human-friendly titles/descriptions for
single-newspack_nl_cptandarchive-newspack_nl_cptas default template types.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
This PR changes how the single and archive templates for the Newsletter CPT are added to the block theme. The original approach treated them like custom general templates, so they would show up for selection when editing a post or a page.
With this change, the templates should be treated like proper default templates for the CPTs.
How to test the changes in this Pull Request:
Other information: