Created
November 29, 2012 19:05
-
-
Save ryanhellyer/4171155 to your computer and use it in GitHub Desktop.
Code to disable WordPress theme updates
This file contains hidden or 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 | |
/* | |
* Disable theme updates | |
* | |
* @param array $r Response header | |
* @param string $url The update URL | |
*/ | |
function slug_hidden_theme( $r, $url ) { | |
if ( 0 !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) ) | |
return $r; // Not a theme update request. Bail immediately. | |
$themes = unserialize( $r['body']['themes'] ); | |
unset( $themes[ get_option( 'template' ) ] ); | |
unset( $themes[ get_option( 'stylesheet' ) ] ); | |
$r['body']['themes'] = serialize( $themes ); | |
return $r; | |
} | |
add_filter( 'http_request_args', 'slug_hidden_theme', 5, 2 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment