helen / revision-notes Goto Github PK
View Code? Open in Web Editor NEWLike commit messages, except for your WordPress content.
Home Page: https://wordpress.org/plugins/revision-notes/
Like commit messages, except for your WordPress content.
Home Page: https://wordpress.org/plugins/revision-notes/
Hey @helen, in the interest of transparant publishing, I'd love it if there was a flag for revision notes that said "public", and a template tag to output them on the frontend.
Comments don't actually have revisions, which is its own problem, but in the meantime it seems like storing a note when saving changes to a comment could be quite useful. In particular, I am thinking about Make/Core, where our general practice is to edit objectionable comments instead of delete them, but don't really have a central way to store what the content used to be and why it was changed.
This seems to be related to using state (possibly related: WordPress/gutenberg#18755), which is being done primarily to avoid the unsaved changes warning being shown when the user hasn't done anything except load the page, because the field value does need to be cleared out on load (and post-save) but if that's dispatched to meta immediately it's considered a "save". However, this does come with a bug, in that if you don't end up changing the revision note I believe it will still save the old one underneath.
I think there are two paths here, both of which start with getting rid of state and going back to dispatching the change to the editor data directly in onChange
:
register_rest_field()
with an empty string for the get_callback
and updating the post meta in update_callback
, dispatching the change to said REST field. The existing routine will catch it for the revision. I believe @TimothyBJacobs mentioned something along these lines yesterday that I didn't quite fully grasp at the time, and @johnwatkins0 revived today.We use the plugin revision notes on some of the WordPress documentation pages. Now that we use block-editor on many of the page, it would be great if this plugin could be modified to work with the block editor.
See short discussion in the #docs channel: https://wordpress.slack.com/archives/C02RP4WU5/p1585236209042400
Checked two situations of attempting to leave a note with no other changes:
With no revisions, upon save, nothing in the UI changed. No revisions listed (makes sense). Once making any change to content and saving, the original revision note was applied to the initial revision, so that seemingly worked, though perhaps expected the revision UI to appear.
With existing revisions, it seemingly didn't work. I tried to leave a note with no changes, then changed something. The UI reflected each revision correctly with the no-update note seemingly lost.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.