• Resolved maudits

    (@maudits)


    I want to update a meta value when post is expire. Have you an action or filter i can use ?

Viewing 1 replies (of 1 total)
  • Plugin Author andergmartins

    (@andergmartins)

    Hi @maudits if you plan to use any currently available expiration actions, and want to update the meta value after it expires, that is possible using the action publishpressfuture_expire. That is the action that triggers the post expiration. You can hook directly into it using a priority number higher than 10, so you will be sure it runs after the post expires. But that action was not intended exactly for that, so it won’t provide any confirmation about the success of the process. You should create a check by yourself, checking if the post was indeed expired. This action passes 2 params: $postId and $force. Since you are not triggering it, but listening it, you can use just the first one to know what is the post being expired.

    In case the “post expiration” you expect is not related to taxonomy or post status change, but just changing the meta value, that is not currently supported. On this case the only way right now is choosing any expiration action and reverting it by yourself after it happens, using the same hook I mentioned here.

    I added 2 new discussions for feature requests that might be interesting to you.

    https://github.com/publishpress/PublishPress-Future/discussions/384

    https://github.com/publishpress/PublishPress-Future/discussions/383

    Feel free to go there and upvote or comment.

Viewing 1 replies (of 1 total)
  • The topic ‘It’s possible to update a meta field on post expire’ is closed to new replies.