سؤال

Wordpress revision and autosave is keeping reverting my changes to a wordpress page. No matter how many changes I make always reverting to that point.

Is there some solution to stop doing that but not to disable revision to all site.

هل كانت مفيدة؟

المحلول

To Disable Autosave put the code below in your functions.php.

function disableAutoSave(){
     wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disableAutoSave' );

To Disable Post Revisions put the code below in your wp-config.php file.

define( 'WP_POST_REVISIONS', false ); // no revisions

Note: Using the above code will disable the Autosave and/or Post Revisions throughout the site.

نصائح أخرى

I believe the correct code should be as above code throws notification messages.

add_action( 'admin_init', 'disable_autosave' );
function disable_autosave() {
    wp_deregister_script( 'autosave' );
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top