Skip to content

Instantly share code, notes, and snippets.

@thanh4890
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thanh4890/9561587 to your computer and use it in GitHub Desktop.
Save thanh4890/9561587 to your computer and use it in GitHub Desktop.
Remove specific theme from WordPress Core Updates.
<?php
// remove specific theme from WordPress Core Updates
add_filter('site_transient_update_themes', 'ndt_remove_theme_from_transient_update_themes');
function ndt_remove_theme_from_transient_update_themes( $transient ) {
if ( is_object( $transient ) && isset( $transient->checked ) && isset( $transient->response ) ) {
$checked = $transient->checked;
$response = $transient->response;
// replace nictitate slug by your theme slug
if ( isset( $checked['nictitate'] ) ) {
unset( $checked['nictitate'] );
$transient->checked = $checked;
}
if ( isset( $response['nictitate'] ) ) {
unset( $response['nictitate'] );
$transient->response = $response;
}
return $transient;
}
return $transient;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment