The method of forbidding the automatic saving of WordPress articles

Before, Xiao Bian talked about it《solveWordPressarticleidA simple method of discontinuity》Mentioned inWordPress自动保存article的时间间隔的问题,And today we are talking about direct prohibitionWordPressarticle自动保存的方法,The method is simple,And it’s focused onfuntions.phpIn the file,The advantage is thatwpThere is no need to reset after the version is updated!

Now let’s ban this function!

Put the following code in theWordPressThematic funtions.phpwithin,Pay attention to the last one“?>”Before!In addition, please use professional code software to open!

  • //禁止article自动保存  
  • add_action( ‘wp_print_scripts’, ‘daxiawp_disable_autosave’ );  
  • function daxiawp_disable_autosave(){  
  •     wp_deregister_script(‘autosave’);  
  • }  
  • //禁止article修订版本功能  
  • remove_action(‘pre_post_update’, ‘wp_save_post_revision’ );  
  • Just save the code,AgainWordPressarticle编辑里看看?Is he not there?ha-ha,It’s easy, isn’t it!

    Related Article
    How to add user defined upload avatar function in WordPress

    Friends who use WordPress to build a website should know that WordPress itself does not have the function of uploading Read more

    WordPress displays the registration time of the login user in the frontend

    When using WordPress to build a website, some users want to display the user registration time in the frontend, but Read more

    WordPress adds the number of SQL queries at the bottom

    An excellent woodpress theme is definitely that the less SQL consulting is used, the better. How can we see how Read more

    Some WordPress articles can be seen after comments / replies

    If we want to hide part of the content of the article and need the user's comments and replies to Read more

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *
    To prove you're a person (not a spam script), type the security word shown in the picture.
    Anti-spam image