Advertisement
pusatdata

WP-Trik: Disable AutoDraft

Nov 6th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. The simplest solution is to go into your active theme and add this code to your theme’s functions.php file (found in /wp-content/themes/[your-theme-name]/functions.php):
  2. /* Disable AutoSave */
  3. function disableAutoSave() {
  4. wp_deregister_script('autosave');
  5. }
  6. add_action( 'wp_print_scripts', 'disableAutoSave' );
  7.  
  8.  
  9. =============================
  10. Here is a similar tactic (from Mark / t31os), also for your theme’s functions.php file:
  11. /* Disable AutoSave, hacky-style */
  12. function hacky_autosave_disabler( $src, $handle ) {
  13. if( 'autosave' != $handle )
  14. return $src;
  15. return '';
  16. }
  17. add_filter( 'script_loader_src', 'hacky_autosave_disabler', 10, 2 );
  18.  
  19. Mark says the above tactic “simply wipes out the src value for the autosave script, which in
  20.  
  21. =======================
  22.  
  23. http://www.plaxee.com/wordpress/how-to-disable-auto-draft
  24.  
  25. Step 1. Editing /wp-includes/default-filters.php file.
  26. i. Open default-filters.php file.
  27. ii. Find the line item add_action( ‘pre_post_update’, ‘wp_save_post_revision’ );
  28. iii. Comment out this line item with a double slash in front as shown in the image below.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement