Created
April 10, 2015 21:04
-
-
Save grok/d4c2044e95cc761d685d to your computer and use it in GitHub Desktop.
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
| /** | |
| * Excludes our theme from the WordPress update API calls. | |
| * | |
| * @param array $request The arguments used in an HTTP request | |
| * @param string $url The request URL. | |
| * @return array $request The arguments used in an HTTP request. | |
| */ | |
| public function excludeFromThemeUpdates($request, $url) | |
| { | |
| if(0 !== strpos($url, 'https://api.wordpress.org/themes/update-check')) | |
| { | |
| return $request; // Not a theme update request. Bail immediately. | |
| } | |
| $themes = unserialize($request['body']['themes']); | |
| unset($themes[get_option('template')]); | |
| unset($themes[get_option('stylesheet')]); | |
| $request['body']['themes'] = serialize($themes); | |
| return $request; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment