Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for storing and displaying a “percentage” value on Leges across the metabox, admin list/quick edit, shortcode rendering, and REST output.
Changes:
- Adds
_pdc-lege-percentageto Leges meta and exposes it via REST (percentage) and admin list column. - Updates shortcode rendering to output a percentage when set, and updates unit tests accordingly.
- Extends quick edit to include the percentage field and introduces 4-decimal sanitization in
NumberSanitizer. - Updates
composer.lockwith broad dependency upgrades.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Leges/Shortcode/ShortcodeTest.php | Adds unit test coverage for percentage shortcode output. |
| tests/Unit/Leges/Admin/QuickEdit/QuickEditServiceProviderTest.php | Updates quick edit row-actions tests for the new percentage meta attribute. |
| src/Leges/Traits/NumberSanitizer.php | Adds 4-decimal float sanitization via a shared helper. |
| src/Leges/Shortcode/Shortcode.php | Adds percentage meta extraction + early return rendering path. |
| src/Leges/RestAPI/Repositories/LegesRepository.php | Adds percentage field to REST transform output. |
| src/Leges/PostType/LegesPostTypeServiceProvider.php | Adds an admin column to display the percentage. |
| src/Leges/Metabox/Metabox.php | Adds a metabox field for percentage with 4-decimal sanitization. |
| src/Leges/Admin/QuickEdit/QuickEditServiceProvider.php | Adds percentage quick-edit handler + sanitize callback support; refactors field rendering. |
| composer.lock | Large set of dependency upgrades (WordPress, Symfony, WP-CLI, etc.). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
mvdhoek1
left a comment
There was a problem hiding this comment.
Moet er niet iets gedaan worden met het percentage? Bijvoorbeeld een procentuele verhoging doorvoeren ieder jaar? Of is het alleen voor display purposes only?
Er is een cron-job die de data checked van de leges waarop deze verhoogd moeten worden. Die vervangt de oude prijs met de nieuwe, vooraf ingestelde, prijs. Zou kunnen dat die nieuwe prijs bepaald moest worden o.b.v. het ingestelde percentage.
| }, | ||
| ], | ||
| 'percentage' => [ | ||
| 'title' => __('Lege percentage (%)', 'pdc-leges'), |
There was a problem hiding this comment.
Ik weet even niet meer wat het doel is van de percentages, wellicht een kleine omschrijving erbij plaatsen?
https://enkhuizen-openpdc.accept02.yard.nl/wp-admin/edit.php?post_type=pdc-leges