Skip to content

Instantly share code, notes, and snippets.

@willmot
Created May 29, 2012 21:08

Revisions

  1. willmot renamed this gist Jul 4, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. willmot created this gist May 29, 2012.
    33 changes: 33 additions & 0 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    <?php

    // Don't disable on dev
    if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {

    // Disable core update checking
    add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
    remove_action( 'admin_init', '_maybe_update_core' );
    remove_action( 'wp_version_check', 'wp_version_check' );

    // Remove the updates menu item
    function yell_remove_update_menu() {
    remove_submenu_page( 'index.php', 'update-core.php' );
    }
    add_filter( 'admin_menu', 'yell_remove_update_menu' );

    // Disable plugin update checking
    remove_action( 'load-plugins.php', 'wp_update_plugins' );
    remove_action( 'load-update.php', 'wp_update_plugins' );
    remove_action( 'load-update-core.php', 'wp_update_plugins' );
    remove_action( 'admin_init', '_maybe_update_plugins' );
    remove_action( 'wp_update_plugins', 'wp_update_plugins' );
    add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );

    // Disable theme update checking
    remove_action( 'load-themes.php', 'wp_update_themes' );
    remove_action( 'load-update.php', 'wp_update_themes' );
    remove_action( 'load-update-core.php', 'wp_update_themes' );
    remove_action( 'admin_init', '_maybe_update_themes' );
    remove_action( 'wp_update_themes', 'wp_update_themes' );
    add_filter( 'pre_site_transient_update_themes', create_function( '$a', "return null;" ) );

    }