How can I restrict users (based on Capabilities) from editing their published posts after a custom amount of time.
For instance, a user that can publish_posts
(authors) can not edit a their post if it is older than 3 days, and a user that can moderate_comments
(editors) can not edit any posts that are older than 20 days. Obviously, admins can edit anytime.
How is such thing possible?
I took the example code from the WordPress user_has_cap filter codex page and modified it. Add this code to your theme functions.php: