Enable/disable post revisions programmatically

To keep posts updated, I am working with WordPress 4.4 and to enable/disable post revisions programmatically use:

remove_action( 'post_updated', 'wp_save_post_revision' );
$post_id = wp_update_post( $arg );
add_action( 'post_updated', 'wp_save_post_revision' );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)