Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to hide just update messages for deactivated plugins in WP 3.4+?

share|improve this question
2  
yes, it is possible (answer above), but that doesn't address the problem. a plugin, even deactivated, can pose a security issue if left out of date. if you don't need the plugin, best to remove it from the site all together. –  Norcross Dec 24 '12 at 19:15
add comment

1 Answer

Yep Its possible if you hook a function to site_transient_update_plugins filter hook and check if plugin is activated using is_plugin_active like this:

add_filter('site_transient_update_plugins', 'remove_update_nag_for_deactivated');
function remove_update_nag_for_deactivated($value) {
    foreach($value->response as $key => $val){
        if (!is_plugin_active($val))
            unset($value->response[ $key]);
    }   
    return $value;
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.