Post deletion and custom tables data

Support MB Custom Table Post deletion and custom tables dataResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33312
    Nicholas CoxNicholas Cox
    Participant

    Hi

    I have been looking around but and wondered when a post is deleted and its custom meta is linked to a custom table, does the data from the custom table supposed to automatically get deleted too?

    #33318
    Long NguyenLong Nguyen
    Moderator

    Hi,

    In short, no. The data in the custom table is not deleted automatically. You can hook a function that calls the delete API of the custom table to the action delete_post to remove all data associated with that post.

    Refer to the documentation https://developer.wordpress.org/reference/hooks/delete_post/
    https://docs.metabox.io/extensions/mb-custom-table/#delete

    #33361
    Nicholas CoxNicholas Cox
    Participant

    Hi

    Ok thanks. Ill take a look

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.