A perfect way to achieve WordPress ban on articles revision and automatic saving _php instance

Source: Internet
Author: User

Using WordPress for so long has been very annoying WordPress article revision and automatic save function, also used the Super Switch plugin can prohibit WordPress article revision and automatic save function, but their blog plug-ins have enough, Have to modify the WordPress main program to prevent article revision and automatic save function. But this method has a bad place is, each WordPress upgrade, you have to change the WordPress source code, it is very troublesome. I accidentally bumped into the ZWW blog on the discovery of this plugin-free to modify the source code to achieve WordPress ban revision and automatic preservation of the method, share to everyone!

Using the method is simple, as long as the functions.php in the subject directory to add the appropriate code, the code is as follows:

Copy Code code as follows:

/* Remove auto Save and revise version * *
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.