-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query Pagination: Don't render an empty container (#35092)
* Query Pagination: Don't render an empty container * ESLint: Add missing semicolon * Update block fixtures * Call get_block_wrapper_attributes directly
- Loading branch information
Showing
12 changed files
with
76 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
|
||
const deprecated = [ | ||
// Version with wrapper `div` element. | ||
{ | ||
save() { | ||
return ( | ||
<div { ...useBlockProps.save() }> | ||
<InnerBlocks.Content /> | ||
</div> | ||
); | ||
}, | ||
}, | ||
]; | ||
|
||
export default deprecated; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
import { InnerBlocks } from '@wordpress/block-editor'; | ||
|
||
export default function save() { | ||
return ( | ||
<div { ...useBlockProps.save() }> | ||
<InnerBlocks.Content /> | ||
</div> | ||
); | ||
return <InnerBlocks.Content />; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
<!-- wp:query-pagination --> | ||
<div class="wp-block-query-pagination"></div> | ||
<!-- /wp:query-pagination --> |
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
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
4 changes: 1 addition & 3 deletions
4
test/integration/fixtures/blocks/core__query-pagination.serialized.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
<!-- wp:query-pagination --> | ||
<div class="wp-block-query-pagination"></div> | ||
<!-- /wp:query-pagination --> | ||
<!-- wp:query-pagination /--> |
3 changes: 3 additions & 0 deletions
3
test/integration/fixtures/blocks/core__query-pagination__deprecated.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!-- wp:query-pagination --> | ||
<div class="wp-block-query-pagination"></div> | ||
<!-- /wp:query-pagination --> |
10 changes: 10 additions & 0 deletions
10
test/integration/fixtures/blocks/core__query-pagination__deprecated.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "core/query-pagination", | ||
"isValid": true, | ||
"attributes": {}, | ||
"innerBlocks": [], | ||
"originalContent": "<div class=\"wp-block-query-pagination\"></div>" | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
test/integration/fixtures/blocks/core__query-pagination__deprecated.parsed.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"blockName": "core/query-pagination", | ||
"attrs": {}, | ||
"innerBlocks": [], | ||
"innerHTML": "\n<div class=\"wp-block-query-pagination\"></div>\n", | ||
"innerContent": [ | ||
"\n<div class=\"wp-block-query-pagination\"></div>\n" | ||
] | ||
} | ||
] |
1 change: 1 addition & 0 deletions
1
test/integration/fixtures/blocks/core__query-pagination__deprecated.serialized.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- wp:query-pagination /--> |