Created
November 14, 2013 15:26
-
-
Save ramseyp/7468731 to your computer and use it in GitHub Desktop.
Useful code if you don't want your WordPress them to show an update notice.
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 | |
/** | |
* Keep your theme from updating | |
* http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/ | |
*/ | |
function s25_no_update_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', 's25_no_update_theme', 5, 2 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment