Custom Fields
Support MB Revision update_post_meta does not add new revision

  • Creator
  • #14973

    I've enabled MB Revision and it works great when I update a custom field through the admin panel but when I do it programmatically through update_post_meta, the change is not detected so there is no revision added.

    Is it Work As Intended ? Is there another utility function that would trigger the creation of a revision ? Another way to trigger it manually ?

    Thanks !

Viewing 1 replies (of 1 total)
  • Author
  • #15014
    Anh Tran

    Hi raphael,

    The update_post_meta is the low level API for adding post meta, while the revision stays in higher level of the WordPress app. So, if you use update_post_meta, that's the expected behavior.

    I think trigger the creation of a revision can be done with wp_insert_post. Here is the docs for it: Strangely, I couldn't find a programmatic way to create a revision. Probably WordPress doesn't support it yet.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.