-
Notifications
You must be signed in to change notification settings - Fork 26
Addressing PR comments #1204
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
Addressing PR comments #1204
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -103,7 +103,7 @@ public function feedzy_register_block_type() { | |||||
| ), | ||||||
| 'max' => array( | ||||||
| 'type' => 'number', | ||||||
| 'default' => '5', | ||||||
| 'default' => 10, | ||||||
|
||||||
| 'default' => 10, | |
| 'default' => 5, |
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max is registered with 'type' => 'number' but its default is set as a string ('10'). Using a numeric literal for the default keeps the attribute schema consistent and avoids subtle type/coercion differences during block parsing/serialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR changes the shortcode default/fallback for
maxto 10, but there’s no unit test asserting the default behavior whenmaxis omitted/empty/invalid. Since the repo already has PHPUnit coverage for the admin abstract, add a test thatget_short_code_attributes([])defaultsmaxto 10 and thatsanitize_attr()falls back to 10 for empty/non-numeric values (while preserving explicit numeric values like 5).