-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Block Hooks API: Create helper function for creating WP_Block_Template object for $context #6278
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
Closed
tjcafferkey
wants to merge
111
commits into
WordPress:trunk
from
ockham:add/block-template-from-post-helper-function
Closed
Changes from all commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
3034818
Block Hooks: Remove references to files in test
ockham 7feddde
Block Hooks: Add test to verify that correct context is passed to fil…
ockham 5c99e4f
Coding Standards
ockham 2d9d585
Fix failing block-template-utils test
tjcafferkey 1bfb892
Map incoming data to build object
tjcafferkey cd92831
Revert mock post_content values back to 'Content'
tjcafferkey fc4b1cf
Coding standards
tjcafferkey b00199a
Fix test
ockham 3cda15c
Add some more coverage
ockham 4800ae5
Remove commented-out line
ockham b906ae1
Move global to top of function
ockham 9742450
Rearrange comment
ockham ee06af0
Include author
ockham ba39f47
Rewrite assertion
ockham 9e8f963
Add TODO comment
ockham 33ebc94
Make sure template exists
ockham 95dc554
Cover origin
ockham fc78209
Test post type
ockham 218e33d
Cover post name
ockham 0b9bc72
Cover theme and ID
ockham b0591af
Remove whitespace
tjcafferkey 67e1c47
Rephrase comment
ockham 945670a
Whitespace, my raison d'etre
ockham dee0a86
Madness
ockham 045ebee
Rewrite a bit
ockham d70d1fe
Add ticket number to test
ockham d25f35a
Get test to pass
ockham 6a76a07
Rename static post var to template_post
ockham a757995
Attempt fixing controller test
ockham 79f715f
Rename argument to changes
ockham 3318e86
Remove temp var
ockham 817be39
Polyfill missing information in changes from existing template post
ockham 494de75
Revert now-obsolete change to the controller
ockham 8720bc9
Remove now-obsolete test fixtures
ockham 1cae0ca
Add helper function to create a WP_Block_Template object from
tjcafferkey 1cdb1cd
Question above post_name
tjcafferkey 48c7fec
Remove hooked blocks algorithm from new helper function
tjcafferkey ec5c8fb
Remove default values as theyre set in the class declaration
tjcafferkey 7ee78fa
Add post to template mapping
tjcafferkey 377da4c
Updated to missing default fields and is_custom
tjcafferkey 6462922
Update safety checks
tjcafferkey 7812ce7
Update condition
tjcafferkey 1cda30a
Compute has_theme_file inside helper
ockham 36c3597
Alignment
ockham 7fc1800
source is hard-wired to 'custom'
ockham 631ff10
Whitespace
ockham dd74e43
Still whitespace
ockham 0d35323
Build template ID from values
tjcafferkey 95d679b
Guard against class properties
tjcafferkey 6490f66
Whitespace
tjcafferkey bf05a79
Whitespace
ockham c974de8
Refactor derived template object value assignment
tjcafferkey 9274b8d
Remove from derived values
tjcafferkey b59b2d8
Tabs to spaces
tjcafferkey 7e60e5a
Remove space
tjcafferkey fb03812
Comment
tjcafferkey efe5dbe
Add ID to additional fields
tjcafferkey 535b1f3
Tabs to space
tjcafferkey db647c1
Make more explicit
ockham c0807cc
Even closer to original
ockham a22a6c4
Remove now-obsolete PHPDoc
ockham 2faaab7
Break additional_fields into terms and meta
ockham 1f4a05e
Remove unnecessary `get_post` call.
ockham 6612330
Revert "Remove unnecessary `get_post` call."
ockham b38be2c
Whitespace
ockham f3d3e51
Taxonomy is called wp_theme
ockham 35b3b5e
Base terms on tax_input
ockham 13bf527
Rename terms to type_terms
ockham f70aa76
Rearrange logic a bit
ockham fac17bb
Whitespace
ockham 6c969e9
Some more streamlining
ockham a0be4c4
Missed one additional_fields instance
ockham 86e8f3c
Move meta below terms
ockham fd736a5
Add missing properties to
tjcafferkey 3d6b2fe
Return if error
tjcafferkey d0a00d2
Return error to prepare_item_for_database method if template is a wp_…
tjcafferkey c2ebc06
Provide terms fallback
ockham 4f9759d
Provide meta fallback
ockham a12bca6
Correctly set area
ockham 605f1c8
Update function return value doc
tjcafferkey 19f553b
Inidividual assertions
ockham 6f5148d
Set ID on in test
tjcafferkey 0925386
Coding standards
tjcafferkey 619e3d3
Remove now-obsolete filter mocks
ockham 4329b14
Remove now-obsolete post name stubbing
ockham c28a0fd
Change filter args
ockham f063167
Rewrite a bit to make more legible
ockham 827dc59
Add assertions to cover fallback
ockham 6e3829d
Add test coverage for template parts
ockham fe00325
Remove now-obsolete request arg
ockham 0e4dae0
Whitespace
ockham eef7df8
Remove wp_ infix
ockham 4459f05
Fix PHPDoc
ockham 383a903
Add unit test to cover the file-based template case
ockham 9c07f47
Move revision handling out of _build_block_template_object_from_post_…
ockham 52ea662
Remove some extraneous assertions
ockham 8270b57
Add coverage for template part
ockham bc2c5ef
Move tests to separate file
ockham 86fbd45
Remove now-obsolete covers PHPDoc
ockham afaed48
Rename some tests
ockham 15e9a59
Add check for origin field
ockham ad89464
Add some more explanatory PHPDoc
ockham 1affcf6
Add test coverage for newly created template and template part
ockham 5b00591
Change order of tests
ockham ef3f0b0
Remove unnecessary trailing slash
ockham df3483d
Bump since to 6.5.1
ockham 02e7d7c
Update src/wp-includes/block-template-utils.php
tjcafferkey 11b38f6
PHP Tests update array assignments
tjcafferkey e8fe56d
Add back second filter argument as deprecated
ockham afd10e7
Only pass one argument during test
ockham f0d1818
Remove default priority argument
ockham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.