This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Set is_custom property on template and remove redundant code #5067
Merged
Conversation
This file contains 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
tjcafferkey
added
type: bug
The issue/PR concerns a confirmed bug.
focus: FSE
Work related to prepare WooCommerce for FSE.
focus: template
Related to API powering block template functionality in the Site Editor
labels
Nov 3, 2021
rubikuserbot
requested review from
a team and
frontdevde
and removed request for
a team
November 3, 2021 14:58
tjcafferkey
requested review from
dinhtungdu
and removed request for
frontdevde
November 3, 2021 14:58
Size Change: 0 B Total Size: 1.12 MB ℹ️ View Unchanged
|
dinhtungdu
approved these changes
Nov 3, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
nielslange
added
the
skip-changelog
PRs that you don't want to appear in the changelog.
label
Nov 16, 2021
jonny-bull
pushed a commit
to jonny-bull/woocommerce-gutenberg-products-block
that referenced
this pull request
Dec 14, 2021
jonny-bull
pushed a commit
to jonny-bull/woocommerce-gutenberg-products-block
that referenced
this pull request
Dec 16, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
focus: FSE
Work related to prepare WooCommerce for FSE.
focus: template
Related to API powering block template functionality in the Site Editor
skip-changelog
PRs that you don't want to appear in the changelog.
type: bug
The issue/PR concerns a confirmed bug.
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.
is_custom
property on$template
tofalse
. This will always be false as it's being loaded from the filesystem. Only templates that are edited and therefore saved in the database are considered custom.$default_template_types
only contains core WordPress default templates (not WooCommerce) so the removed if statements would never resolve.$template_type
is always going to bewp_template
and notwp_template_part
Testing
Manual Testing
This will mainly be regression testing.
Prerequisite: Please ensure you have a Block Template Theme activated such as TT1 and also the Gutenberg Plugin installed.
General templates
section.Once you have followed the above steps, add the same template files to your
theme-dir/block-templates
and change the file contents so you can differentiate between the Woo Block template and the Theme template. Repeat the above steps starting from Step 2 and confirm the Theme template is preferred over the Woo Blocks templateChangelog