Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //disable CORE updates
- /*
- // Automatic Updated (https://codex.wordpress.org/Configuring_Automatic_Background_Updates )
- // 0=>enable WP AUTO UPDATE, 1=>disabled AUTO UPDATE 2=> disable, plus remove "UPDATE is available" notification
- define ('DISABLE_CORE_UPDATES' , 0); define ('DISABLE_PLUGIN_UPDATES', 0); define ('DISABLE_THEME_UPDATES', 0);
- //add_filter( 'automatic_updater_disabled', '__return_true' ); // DISABLE all automatic updates
- function removeUPD_FUNC() { global $wp_version; return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,); }
- if (defined('DISABLE_CORE_UPDATES')){
- if(definedVALUE('DISABLE_CORE_UPDATES')==1) { add_filter( 'auto_update_core', '__return_false' ); }
- elseif(definedVALUE('DISABLE_CORE_UPDATES')==2) { add_filter( 'auto_update_core', '__return_false' ); add_action('after_setup_theme','remove_core_updates'); }
- //else, just send me mail on update
- else{ } //apply_filters( 'auto_core_update_send_email', true);
- function remove_core_updates() {
- if(!current_user_can('update_core')){return;}
- add_action('init', create_function('$a',"remove_action( 'init', 'wp_version_check' );"),2);
- add_filter('pre_option_update_core','__return_null');
- add_filter('pre_site_transient_update_core','__return_null'); //add_filter('pre_site_transient_update_core','removeUPD_FUNC');
- }
- }
- // to disable PLUGIN updates
- if (defined('DISABLE_PLUGIN_UPDATES')){
- if(definedVALUE('DISABLE_CORE_UPDATES')==1) { add_filter( 'auto_update_plugin', '__return_false' ); }
- elseif(definedVALUE('DISABLE_CORE_UPDATES')==2) { add_filter( 'auto_update_plugin', '__return_false' );
- remove_action('load-update-core.php','wp_update_plugins');
- add_filter('pre_site_transient_update_plugins','__return_null'); //add_filter('pre_site_transient_update_plugins','removeUPD_FUNC');
- }
- }
- // to disable THEME updates
- if (defined('DISABLE_THEME_UPDATES')){
- if(definedVALUE('DISABLE_THEME_UPDATES')==1) {add_filter('auto_update_theme', '__return_false' ); }
- elseif(definedVALUE('DISABLE_THEME_UPDATES')==2) {add_filter('auto_update_theme', '__return_false' ); add_filter('pre_site_transient_update_themes', 'removeUPD_FUNC'); }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement