• I wrote a small custom plugin for my site. When I went to the plugins admin panel to activate it, it tells me there is a newer version and offers to update it. Huh?

Viewing 3 replies - 1 through 3 (of 3 total)
  • you’ve named it the same as one available in the repository.

    Thread Starter bmb

    (@bmb)

    Named it where? in the comments at the top it has a unique name. anywhere else?

    directory name?

    you could always add a version number ridiculously high or…

    and apologies to whomever I got this from, use something like this:

    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’ve yet to test it out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom plugin update?’ is closed to new replies.