[wp-trac] [WordPress Trac] #20564: Framework for storing revisions of Post Meta

WordPress Trac noreply at wordpress.org
Mon Jul 7 20:21:19 UTC 2014

#20564: Framework for storing revisions of Post Meta
 Reporter:  alexkingorg                          |       Owner:
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
Component:  Revisions                            |  Release
 Severity:  normal                               |     Version:  3.4
 Keywords:  needs-testing needs-codex dev-       |  Resolution:
  feedback                                       |     Focuses:

Comment (by adamsilverstein):

 The issue is that when retrieving meta, WordPress returns blank if the
 meta is not set, OR if the meta is blank - so not storing the meta is
 **the same** as storing blank meta :) (unless I'm missing something)

 the trick here is that because I am tracking which metas are 'revisioned'
 for each stored revision, i know that a meta that is revisioned and for
 which no value was stored is in fact blank; therefore, when restoring a
 revision with a meta that is missing (but which was tracked), that meta is
 considered blank, and the restored value is set as blank (guess I could
 just delete it).

 Does that make sense?  in short, I am tracking blank metas, just not
 bothering to store them.

 Replying to [comment:105 p51labs]:
 > Replying to [comment:102 adamsilverstein]:
 > > In [attachment:20564.15.diff]:
 > >
 > >  * Don't store blank meta values
 > >  * Track meta keys stored for each revision
 > >  * Updated unit test to test restoring blank meta
 > I think that blank meta should be stored if exists on the current post.
 Sometimes a blank value is the intended value. A case an point would be a
 field with checkboxes, by setting a blank value I know they purposely
 didn't select anything from the list.
 > Thoughts?

Ticket URL: <https://core.trac.wordpress.org/ticket/20564#comment:106>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list