我找到了以下代码:
define(\'my_revisions_amount\', 1); // let keep only one revision
define(\'my_autosave_interval\', 600); // 600 minutes is enough
if (is_admin()){
add_filter( \'wp_revisions_to_keep\', function(){
return my_revisions_amount;
} );
add_filter( \'wp_print_scripts\', function(){
wp_localize_script( \'autosave\', \'autosaveL10n\',
array(
\'autosaveInterval\'=> my_autosave_interval,
\'blog_id\' => get_current_blog_id(),
)
);
}, 11 );
}