Last active
August 29, 2015 13:57
-
-
Save thanh4890/9561587 to your computer and use it in GitHub Desktop.
Remove specific theme from WordPress Core Updates.
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 | |
// 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