How to set an expiry date to a (custom) post type?

Support MB Frontend Submission How to set an expiry date to a (custom) post type?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19770
    EddyPiVEddyPiV
    Participant

    Hi,

    I am using the plugin Post Expirator for setting expiry dates to posts.
    Is there a way to set the post expiry date to +2 days upon successfull adding in the frontend?

    Perhaps even better: is there a way to make the expiry date dependent on a custom field (no. of days) in the frontend?

    #19776
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The extension supports an action hook rwmb_frontend_after_process which helps you fire an action after saving/updating the post. You can use this action hook to update the post meta _expiration-date with this function update_post_meta().
    https://codex.wordpress.org/Function_Reference/update_post_meta

    #19782
    EddyPiVEddyPiV
    Participant

    Okay, but then I still have to do a calculation in one way or the other. I was hoping that such function would exist somewhere in the toolbox.
    I have solved it by using yet another plugin... I was trying to avoid it, but I am not a skilled coder...

    Thanks, consider it solved.

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