Created
January 10, 2016 23:41
-
-
Save rickrduncan/4ee4e5b3800a3d7195ef to your computer and use it in GitHub Desktop.
Code credit: Mark Jaquith (http://markjaquith.com/)
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 | |
| //* Do NOT include this comment or the opening php tag above | |
| //* Don't Update Theme | |
| //* @author Mark Jaquith | |
| //* @link http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/ | |
| add_filter( 'http_request_args', 'cws_hidden_theme_12345', 5, 2 ); | |
| function cws_hidden_theme_12345( $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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment