Automattic / Automattic/custom-metadata
Support the HTML5 step attribute on number fields
- Dominant language
- PHP
- Stars
- 190
- Forks
- 46
- Avg merge
- 46m
- Merged PRs (30d)
- 15
Description
## Enhancement
Number fields render `` with optional `min` and `max`, but there is no way to set `step`, so users cannot constrain the increment (for example, steps of 5, or decimals).
## Proposal
Add an optional `step` field argument and emit `step="…"` on the input when it is set, cast and escaped like the existing `min`/`max` handling, plus an entry in `custom_metadata_examples.php`.
## History
Originally proposed in #112 by @sonnyt (2014). That PR no longer applies cleanly, so it is being closed in favour of a fresh, clean implementation tracked here.
Contributor guide
Research direction
Start by locating the number-field rendering and its existing min/max handling, then inspect custom_metadata_examples.php for the corresponding example. Add the optional step argument using the same casting and escaping behavior as min/max, emit step when set, and update the example to demonstrate it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 75/100