Protect GatherPress meta from Custom Fields panel to prevent stale data overwrites.#1383
Protect GatherPress meta from Custom Fields panel to prevent stale data overwrites.#1383
Conversation
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Preview changes with PlaygroundYou can preview the recent changes for PR#1383 with the following PHP versions: PHP Version 8.4
PHP Version 8.2
PHP Version 7.4
Download Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions. |
carstingaxion
left a comment
There was a problem hiding this comment.
Looking at the used by section for this filter, makes me wonder if this is maybe to rigid, to protect all "gatherpress_" meta fields.
But in general, I absolutely like the way, this looks clean and straightforward.
I was thinking about that too, but in the end, I can't think of a meta field we'd put out that'd we'd want people to use the Custom Fields metaboxes or any other alternative ways to make changes to; we'd always want our UI to make changes to our meta fields. This also makes us not have to manage any new meta fields and adding it to a list. If it becomes too much of an issue, we can always extend it with a filter to bypass some |
Description of the Change
When Custom Fields are enabled in the block editor, saving an event triggers two saves - one from JavaScript with updated data, then one from the Custom Fields metabox with stale data loaded at page load. This overwrites datetime changes.
Fix: Mark all
gatherpress_meta keys as protected so they don't appear in Custom Fields.How to test the Change
gatherpress_*fields don't appear in Custom Fields panelChangelog Entry
Credits
Props @mauteri @carstingaxion
Checklist: