Custom Fields
Re-Envisioned
Support MB Frontend Submission How to set an expiry date to a (custom) post type?

  • Creator
    Topic
  • #19770
    Resolved EddyPiV
    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #19776
    Long 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
    EddyPiV
    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 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.