Update post date to modified date automatically
I would like to find a function that will automatically change a posts date to the modified post date.
I’m using wp User front end plugin so that visitors can add and edit a custom post. I’m also using the Post expirator plugin so that their post will automatically be set to draft after 1 month. The user will then be emailed and asked to update their post for it to go back on line. The problem is that the plugin only sees the post date. So once a user logs back in and edits their post (using front end user) the expirator date isn’t reset to be 1 month from the modified date, instead it still uses the original date. Hope that all makes sense.
So my choices are to either try and write my own function to handle the post expiration based on the modified date or to try and force the posts date to change to the same as the modified date once it has been updated.
Can anyone help me with either solution? I’m guessing the latter solution would be the most straight forward to implement but willing to head advice.
I’ve tried the suggestions below but have not managed to get this to work. Can anyone offer a solution to this?