Is there a hook/function combination that can be added to my theme’s functions.php
to properly disable REVISIONS and AUTOSAVE for the entire wordpress installation? What about if just for a certain custom post type? Searching online gives various hacks from deregistering scripts to tampering with core files. What’s the acceptable/correct way to do this?
Leave a Reply
You must be logged in to post a comment.
This should be placed in your
wp-config.php
(and no where else):I’m also looking for how to disable autosave. But here’s what I was told in a Trac ticket:
Placing the defines in wp-config.php is fine until you turn WP_DEBUG on when you will get ‘already defined’ PHP notices in the debug.log every couple of minutes. Others claim placing these defines above the ABSPATH define will help.
However, I can categorically confirm the best place to put your defines is in a plugin, because the activated plugins are loaded before the WP default defines.
The default defines are protected with if exists tests, hence your plugin loaded defines will take precedence and will not cause a clash nor the repetitive PHP notices in the debug log.