forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Editor: Fix post editor layout when Post Content has no attributes.
Changes output of `wp_get_post_content_block_attributes` to return null if Post Content block doesn’t exist or empty array if it has no attributes. Props flixos90, mukesh27. Fixes #59358. git-svn-id: https://develop.svn.wordpress.org/trunk@56629 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information
1 parent
a0cce39
commit bee2dc4
Showing
7 changed files
with
144 additions
and
7 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
7 changes: 7 additions & 0 deletions
7
tests/phpunit/data/themedir1/block-theme-post-content-default/style.css
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,7 @@ | ||
/* | ||
Theme Name: Block Theme Post Content Default | ||
Theme URI: https://wordpress.org/ | ||
Description: For testing purposes only. | ||
Version: 1.0.0 | ||
Text Domain: block-theme-post-content-default | ||
*/ |
3 changes: 3 additions & 0 deletions
3
tests/phpunit/data/themedir1/block-theme-post-content-default/templates/index.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:paragraph --> | ||
<p>Index Template</p> | ||
<!-- /wp:paragraph --> |
2 changes: 2 additions & 0 deletions
2
tests/phpunit/data/themedir1/block-theme-post-content-default/templates/single.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,2 @@ | ||
<!-- wp:post-title {"level":1,"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|40"}}}} /--> | ||
<!-- wp:post-content /--> |
104 changes: 104 additions & 0 deletions
104
tests/phpunit/data/themedir1/block-theme-post-content-default/theme.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,104 @@ | ||
{ | ||
"version": 1, | ||
"title": "Block theme", | ||
"settings": { | ||
"color": { | ||
"palette": [ | ||
{ | ||
"slug": "light", | ||
"name": "Light", | ||
"color": "#f5f7f9" | ||
}, | ||
{ | ||
"slug": "dark", | ||
"name": "Dark", | ||
"color": "#000" | ||
} | ||
], | ||
"gradients": [ | ||
{ | ||
"name": "Custom gradient", | ||
"gradient": "linear-gradient(135deg,rgba(0,0,0) 0%,rgb(0,0,0) 100%)", | ||
"slug": "custom-gradient" | ||
} | ||
], | ||
"duotone": [ | ||
{ | ||
"colors": [ "#333333", "#aaaaaa" ], | ||
"slug": "custom-duotone", | ||
"name": "Custom Duotone" | ||
} | ||
], | ||
"custom": false, | ||
"customGradient": false | ||
}, | ||
"typography": { | ||
"fontSizes": [ | ||
{ | ||
"name": "Custom", | ||
"slug": "custom", | ||
"size": "100px" | ||
} | ||
], | ||
"customFontSize": false, | ||
"customLineHeight": true | ||
}, | ||
"spacing": { | ||
"units": ["rem"], | ||
"customPadding": true, | ||
"blockGap": true | ||
}, | ||
"blocks": { | ||
"core/paragraph": { | ||
"color": { | ||
"palette": [ | ||
{ | ||
"slug": "light", | ||
"name": "Light", | ||
"color": "#f5f7f9" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"styles" : { | ||
"blocks" :{ | ||
"core/post-featured-image": { | ||
"shadow": "10px 10px 5px 0px rgba(0,0,0,0.66)", | ||
"filter": { | ||
"duotone": "var(--wp--preset--duotone--custom-duotone)" | ||
} | ||
} | ||
}, | ||
"elements": { | ||
"button": { | ||
"shadow": "10px 10px 5px 0px rgba(0,0,0,0.66)" | ||
}, | ||
"link": { | ||
"typography": { | ||
"textDecoration": "none" | ||
}, | ||
"border": { | ||
"bottom": { | ||
"width": "2px", | ||
"color": "currentColor", | ||
"style": "solid" | ||
} | ||
}, | ||
":hover": { | ||
"typography": { | ||
"textDecoration": "none" | ||
}, | ||
"border": { | ||
"bottom": { | ||
"width": "2px", | ||
"color": "#000", | ||
"style": "dotted" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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