Use WordPress So long has been very annoying WordPress article revision and auto-save function, also used Super switch plugin can prohibit WordPress article revision and auto-save function, but their blog plugin has enough, Had to modify the WordPress main program to achieve the prohibition of article revision and automatic saving function. But this method has a bad place is that every time the WordPress upgrade, you have to change the WordPress source code, it is very troublesome. Today accidentally bumped into the ZWW blog found this non-plug-in without modification of the code to implement the WordPress ban article revision and automatic saving method, share to everyone!
The use of the method is simple, as long as the functions.php in the theme directory to add the appropriate code, the code is as follows:
Copy the Code code as follows:
/* Remove auto-save and revision */
Remove_action (' pre_post_update ', ' wp_save_post_revision ');
Add_action (' wp_print_scripts ', ' disable_autosave ');
function Disable_autosave () {
Wp_deregister_script (' AutoSave ');
}
Test environment: WordPress 3.1.2, the principle of more than 3.0 support.