Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
63d381f
Read `uses_context` defined by sources
SantosGuillamot Feb 13, 2024
65e259a
Add `uses_context` to post meta source
SantosGuillamot Feb 13, 2024
68ce2a8
Change post meta `$post_id`
SantosGuillamot Feb 13, 2024
ade4119
Use `uses_context` in pattern overrides source
SantosGuillamot Feb 13, 2024
5011e16
Fix formatting
SantosGuillamot Feb 13, 2024
929afb6
Move logic to source registration
SantosGuillamot Feb 13, 2024
44125a4
Format latest changes
SantosGuillamot Feb 13, 2024
5a931f4
Remove empty line
SantosGuillamot Feb 13, 2024
dccef2e
Revert "Use `uses_context` in pattern overrides source"
SantosGuillamot Feb 13, 2024
016ec29
Add `uses_context` to pattern overrides source
SantosGuillamot Feb 13, 2024
e305f7c
Create `get_block_type_uses_context` filter
SantosGuillamot Feb 13, 2024
49a8b7a
Use `get_block_type_uses_context` in source registration
SantosGuillamot Feb 13, 2024
42575c4
Update docstrings
SantosGuillamot Feb 13, 2024
e41ba30
Move supported blocks to private variables
SantosGuillamot Feb 13, 2024
4ca8176
Remove unnecessary attributes from variable
SantosGuillamot Feb 13, 2024
46df776
Change `$support_blocks` comment
SantosGuillamot Feb 13, 2024
59746c0
Fix typo in comment
SantosGuillamot Feb 13, 2024
7bcc71e
Check the `uses_context` property is an array
SantosGuillamot Feb 13, 2024
5810180
Fix process bindings check
SantosGuillamot Feb 13, 2024
a578d5c
Use strict argument in `in_array`
SantosGuillamot Feb 13, 2024
9f01568
Use `empty` function in post meta source
SantosGuillamot Feb 13, 2024
ba7bf25
Update comments and descriptions
SantosGuillamot Feb 13, 2024
0c4a795
Remove variations and uses_context in `__set` function
SantosGuillamot Feb 14, 2024
7e80f5e
Add test to check if the value of the source context shows
SantosGuillamot Feb 15, 2024
d839f33
Test if the source result object properties are correct
SantosGuillamot Feb 15, 2024
e82879e
Test registration fails when `uses_context` is string
SantosGuillamot Feb 15, 2024
102c940
Test merging multiple sources `uses_context`
SantosGuillamot Feb 15, 2024
f4af4f7
Join variations and uses_context in the same conditional
SantosGuillamot Feb 15, 2024
f2b3b3a
Move multiple sources test to a different file
SantosGuillamot Feb 15, 2024
4f8668d
Provide error message in uses_context test
SantosGuillamot Feb 15, 2024
07a7317
Check allowed source properties in the registry
SantosGuillamot Feb 15, 2024
f14817f
Remove register_meta code
SantosGuillamot Feb 15, 2024
edaaffa
Remove spaces in $block_content in tests
SantosGuillamot Feb 15, 2024
03e66ee
Check that `uses_context` increase by three
SantosGuillamot Feb 15, 2024
0b49cc4
Update comment to use third person
SantosGuillamot Feb 15, 2024
9838fec
Don't use $merged_uses_context variable
SantosGuillamot Feb 15, 2024
59fde29
Change translators comment syntax to match standard
SantosGuillamot Feb 15, 2024
5f2ddc3
Add covers get_uses_context
SantosGuillamot Feb 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove spaces in $block_content in tests
  • Loading branch information
SantosGuillamot committed Feb 15, 2024
commit edaaffad0cceeef98ca9d982189057a25a364710
8 changes: 4 additions & 4 deletions tests/phpunit/tests/block-bindings/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ public function test_passing_uses_context_to_source() {
);

$block_content = <<<HTML
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"test/source", "args": {"key": "test"}}}}} -->
<p>This should not appear</p>
<!-- /wp:paragraph -->
HTML;
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"test/source", "args": {"key": "test"}}}}} -->
<p>This should not appear</p>
<!-- /wp:paragraph -->
HTML;
$parsed_blocks = parse_blocks( $block_content );
$block = new WP_Block( $parsed_blocks[0], array( 'sourceContext' => 'source context value' ) );
$result = $block->render();
Expand Down