-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a06916
commit 2fbd5d9
Showing
13 changed files
with
122 additions
and
8 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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks } from '@wordpress/block-editor'; | ||
|
||
const deprecated = [ | ||
// Version with NO wrapper `div` element. | ||
{ | ||
attributes: { | ||
queryId: { | ||
type: 'number', | ||
}, | ||
query: { | ||
type: 'object', | ||
default: { | ||
perPage: null, | ||
pages: 0, | ||
offset: 0, | ||
postType: 'post', | ||
categoryIds: [], | ||
tagIds: [], | ||
order: 'desc', | ||
orderBy: 'date', | ||
author: '', | ||
search: '', | ||
exclude: [], | ||
sticky: '', | ||
inherit: true, | ||
}, | ||
}, | ||
layout: { | ||
type: 'object', | ||
default: { | ||
type: 'list', | ||
}, | ||
}, | ||
}, | ||
supports: { | ||
html: false, | ||
}, | ||
save() { | ||
return <InnerBlocks.Content />; | ||
}, | ||
}, | ||
]; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks } from '@wordpress/block-editor'; | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
|
||
export default function QuerySave() { | ||
return <InnerBlocks.Content />; | ||
return ( | ||
<div { ...useBlockProps.save() }> | ||
<InnerBlocks.Content /> | ||
</div> | ||
); | ||
} |
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 +1,3 @@ | ||
<!-- wp:query /--> | ||
<!-- wp:query --> | ||
<div class="wp-block-query"></div> | ||
<!-- /wp:query --> |
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 |
---|---|---|
|
@@ -24,6 +24,6 @@ | |
} | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "" | ||
"originalContent": "<div class=\"wp-block-query\"></div>" | ||
} | ||
] |
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: 3 additions & 1 deletion
4
packages/e2e-tests/fixtures/blocks/core__query.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 +1,3 @@ | ||
<!-- wp:query /--> | ||
<!-- wp:query --> | ||
<div class="wp-block-query"></div> | ||
<!-- /wp:query --> |
1 change: 1 addition & 0 deletions
1
packages/e2e-tests/fixtures/blocks/core__query__deprecated-1.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 /--> |
29 changes: 29 additions & 0 deletions
29
packages/e2e-tests/fixtures/blocks/core__query__deprecated-1.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,29 @@ | ||
[ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "core/query", | ||
"isValid": true, | ||
"attributes": { | ||
"query": { | ||
"perPage": null, | ||
"pages": 0, | ||
"offset": 0, | ||
"postType": "post", | ||
"categoryIds": [], | ||
"tagIds": [], | ||
"order": "desc", | ||
"orderBy": "date", | ||
"author": "", | ||
"search": "", | ||
"exclude": [], | ||
"sticky": "", | ||
"inherit": true | ||
}, | ||
"layout": { | ||
"type": "list" | ||
} | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "" | ||
} | ||
] |
18 changes: 18 additions & 0 deletions
18
packages/e2e-tests/fixtures/blocks/core__query__deprecated-1.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,18 @@ | ||
[ | ||
{ | ||
"blockName": "core/query", | ||
"attrs": {}, | ||
"innerBlocks": [], | ||
"innerHTML": "", | ||
"innerContent": [] | ||
}, | ||
{ | ||
"blockName": null, | ||
"attrs": {}, | ||
"innerBlocks": [], | ||
"innerHTML": "\n", | ||
"innerContent": [ | ||
"\n" | ||
] | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
packages/e2e-tests/fixtures/blocks/core__query__deprecated-1.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,3 @@ | ||
<!-- wp:query {"query":{"perPage":null,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"type":"list"}} --> | ||
<div class="wp-block-query"></div> | ||
<!-- /wp:query --> |