Skip to content
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

Search Block: Add button, label, and width options #24666

Merged
merged 22 commits into from
Sep 3, 2020
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ce2fb8b
Add support in the editor for button position, and changing the butto…
apeatling Aug 19, 2020
ba2d64e
Add search label toggle option.
apeatling Aug 19, 2020
67f28c1
Use updated icons.
apeatling Aug 19, 2020
0afaa32
Update icons, and add resizing of the search form.
apeatling Aug 23, 2020
cd3c185
Add width sidebar input field
apeatling Aug 23, 2020
c9f1be9
First pass at basic front end rendering support for button only, widt…
apeatling Aug 24, 2020
45b51dd
Add front end rendering support for new attribute classnames, and ico…
apeatling Aug 24, 2020
f3f1632
Add styles for button inside selection on front end.
apeatling Aug 25, 2020
c4dddad
Remove duplicated editor styles
apeatling Aug 25, 2020
eaa56a8
Better preservation of visuals when moving from the previous version …
apeatling Aug 25, 2020
47ba4e6
Do not show the drag handle when the block is not selected.
apeatling Aug 25, 2020
4c4390c
Remove bounds restriction on resize as this breaks when the parent is…
apeatling Aug 25, 2020
08c474d
Group all button options in the block toolbar together.
apeatling Aug 26, 2020
df1699b
Add support for setting percentage widths.
apeatling Aug 27, 2020
1b6dd6c
Add missing widthUnit attribute.
apeatling Aug 27, 2020
c167723
Make sure that the search block cannot be resized beyond the width of…
apeatling Sep 2, 2020
453d338
Fix e2e tests for search block.
apeatling Sep 2, 2020
b2b0932
Update button labels to sentence case to match other core blocks.
apeatling Sep 2, 2020
ba33fda
Convert px usage to em.
apeatling Sep 3, 2020
4b426ba
Fix missed px to em converts
apeatling Sep 3, 2020
34c3082
Fix PHP lint issues.
apeatling Sep 3, 2020
357998f
Replace tab with space for line alignment.
apeatling Sep 3, 2020
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
Add missing widthUnit attribute.
  • Loading branch information
apeatling committed Sep 3, 2020
commit 1b6dd6cd18b9098c8f19cb127c92c1f2e1bfb1db
3 changes: 3 additions & 0 deletions packages/block-library/src/search/block.json
Original file line number Diff line number Diff line change
@@ -14,6 +14,9 @@
"default": ""
},
"width": {
"type": "number"
},
"widthUnit": {
"type": "string"
},
"buttonText": {
4 changes: 2 additions & 2 deletions packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
@@ -85,9 +85,9 @@ function render_block_core_search( $attributes ) {
);
}

if ( ! empty( $attributes['width'] ) ) {
if ( ! empty( $attributes['width'] ) && ! empty( $attributes['widthUnit'] ) ) {
if ( ! empty( $attributes['buttonPosition'] ) && 'button-only' !== $attributes['buttonPosition'] ) {
$width_styles = ' style="width: ' . $attributes['width'] . 'px;"';
$width_styles = ' style="width: ' . $attributes['width'] . $attributes['widthUnit'] . ';"';
}
}