Last active
November 11, 2016 22:08
-
-
Save wpsmith/4444552 to your computer and use it in GitHub Desktop.
PHP: Disable initial autosave/autodraft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_enqueue_scripts', 'wps_cpt_admin_enqueue_scripts' ); | |
/** | |
* Disable initial autosave/autodraft | |
*/ | |
function wps_cpt_admin_enqueue_scripts() { | |
if ( 'cpt' == get_post_type() ) | |
wp_dequeue_script( 'autosave' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment