Repository navigation
Donations Block: admin defaults (frequency/amounts/toggles) - #48799
Conversation
Adds configurable defaults that authors set in the Inspector: - Default frequency (One-Time / Monthly / Yearly) used on first render - Default amount per frequency (with "None" fallback) - Configurable suggested custom amount placeholder - Admin toggle to hide the One-Time interval - Keep at least one interval enabled (disables last toggle, shows hint) - New Defaults panel section with consistent Flex layout - "View donation earnings" link moved into Defaults section Includes Phan baseline update.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 5 files.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
Stacked on top of #48415. Reviews can wait until that lands; this PR can be tested on Jetpack Beta in parallel.
Proposed changes
Adds admin-configurable frequency visibility controls and donation defaults to the Donations Form block.
Frequency visibility toggles
defaultIntervalto the next visible interval in the samesetAttributescall — no stale or invisible default can persist.view.jswas hardcoded tothis.interval = 'one-time'. The fix reads the initial interval fromdata-default-intervalon the wrapper instead.Frequency and amount defaults
customAmountPlaceholderalong with the existing per-interval amount reset.Related product discussion/links
Does this pull request change what data or activity we track or use?
No tracking or data changes.
Testing instructions
Frequency toggles
oneTimeDonation.showwas never set) — the One-Time toggle should show as on and the block should behave normally.Defaults section [screenshot]
5. Expand the Settings panel and locate the Defaults sub-section below the Show/hide toggles.
Recreated as a successor to #48464, which auto-closed when its base branch was deleted on merge of #48415. Same content; rebased onto trunk as a single squashable commit.