WordPress.org

Ready to get started?Download WordPress

Forums

Stop plugin from showing update warning (8 posts)

  1. rawwebdesign
    Member
    Posted 4 years ago #

    Is there a way to disable the warning on a plugin that it needs to be updated? I don't want a client to upgrade a few plugins that have been customized.

    Thanks, Brad

  2. elfin
    Moderator
    Posted 4 years ago #

    function cws_hidden_plugin_12345( $r, $url ) {
    	if ( 0 !== strpos( $url, 'http://api.wordpress.org/plugins/update-check' ) )
    		return $r; // Not a plugin update request. Bail immediately.
    	$plugins = unserialize( $r['body']['plugins'] );
    	unset( $plugins->plugins[ plugin_basename( __FILE__ ) ] );
    	unset( $plugins->active[ array_search( plugin_basename( __FILE__ ), $plugins->active ) ] );
    	$r['body']['plugins'] = serialize( $plugins );
    	return $r;
    }
    
    add_filter( 'http_request_args', 'cws_hidden_plugin_12345', 5, 2 );

    I found that somewhere (sadly I can't recall where), and I have yet to test it.

  3. rawwebdesign
    Member
    Posted 4 years ago #

    Rich,

    Thanks man. That was fast!

    Question: That looks like it stops the update plugin function entirely. So will that block ALL plugins from showing the warning?

    Thanks,

    Brad

  4. elfin
    Moderator
    Posted 4 years ago #

    add it into the plugin itself, pretty sure it only blocks erm, itself.

  5. rawwebdesign
    Member
    Posted 4 years ago #

    Cool. I just gave it a shot to no avail. Any other ideas?

  6. Simon Prosser
    Theme Review Admin
    Posted 4 years ago #

    Probably would be far easier to just edit the plugin version to 9999

  7. elfin
    Moderator
    Posted 4 years ago #

    I found a similar function (virtually the same) here:
    http://developersmind.com/2010/06/12/preventing-wordpress-from-checking-for-updates-for-a-plugin/

    So it might be worth rechecking with the version found there.

  8. rawwebdesign
    Member
    Posted 4 years ago #

    Just want to say that his worked like a charm:

    Probably would be far easier to just edit the plugin version to 9999

    Thanks Pross!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags