Repository navigation
Add write abilities wrapping the bibliography write routes (Phase 05 M5) - #148
Merged
Merged
Conversation
Six abilities on WordPress 6.9+: borges/add-citations, update-citation, delete-citation, reorder-citations, update-bibliography-settings, and reformat-bibliography. They are registered only when the write-routes filter is on. Each builds the request its route would get and calls the route's own callback, so edit_post, dry run, and the ETag check (etag input sent as If-Match) are one code path for both surfaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #148 +/- ##
============================================
+ Coverage 87.88% 88.28% +0.39%
Complexity 22 22
============================================
Files 60 61 +1
Lines 7060 7290 +230
Branches 690 690
============================================
+ Hits 6205 6436 +231
+ Misses 292 291 -1
Partials 563 563 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dknauss
marked this pull request as ready for review
October 14, 2026 22:21
# Conflicts: # CHANGELOG.md # docs/current-metrics.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds Phase 05 M5: six write abilities on WordPress 6.9+, in the new
includes/write-abilities.php.borges/add-citationsPOST …/citationsborges/update-citationPATCH …/citations/<id>borges/delete-citationDELETE …/citations/<id>borges/reorder-citationsPUT …/citations/orderborges/update-bibliography-settingsPATCH …/bibliographies/<ref>borges/reformat-bibliographyPOST …/reformatbibliography_builder_enable_write_routesis true, the same flag as the routes. They join the existingbibliographycategory.edit_post), dry run (defaulttrue), validation, and the ETag check can't drift between REST and Abilities. Theetaginput is sent asIf-Match, so a save is refused with428without one and412with a stale one.readonly: false. Onlydelete-citationis marked destructive. Update, reorder, settings and reformat are marked idempotent.docs/rest-write-routes.md;[Unreleased]entry;This PR is independent of the particle-sort PR, #147. Each has its own CHANGELOG
[Unreleased]entry, so whichever merges second will need a one-line conflict fix.Validation
composer lint:php,composer analyze:php,npm run lint:i18n: passWriteAbilitiesTestcovers:edit_postand the 404 for a missing post;428,412and a real save that changes only the target block;bibliography_idand by index;409), the settings refusal ofcitationStyle, and reformat.WP_REST_Requestmock gainsset_url_params()andset_body(), mirroring core.composer verify:metrics: passNot covered: the runtime matrix doesn't exercise any abilities over real WordPress yet, read or write.
Checklist
[Unreleased]entry🤖 Generated with Claude Code
https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
Generated by Claude Code