[wp-hackers] 'option_update_plugins' filter won't run

Stephen Rider wp-hackers at striderweb.com
Wed Feb 11 03:33:51 GMT 2009


On Feb 10, 2009, at 12:32 AM, Ryan Boren wrote:

> On Mon, Feb 9, 2009 at 9:56 PM, Stephen Rider <wp-hackers at striderweb.com 
> > wrote:
>>
(added some code to clarify...)

I'm working on a third-party plugin version checker.

function add_filters() {
       error_log( 'running add_filters()' );
       add_filter( 'option_update_plugins', 'filter_update_plugins' );
}

function filter_update_plugins( $data ) {
	error_log( 'filter_update_plugins()' );
	return $data;
}

Also added an error_log() at the beginning of the core get_option()  
function.

Logs give me:

running add_filters()
get_option('update_plugins')
get_option('update_plugins')
get_option('update_plugins')
get_option('update_plugins')

Any idea why this doesn't work?  I'm running WP 2.8 bleeding.

> Are you using an add-on object cache backend like memcached, APC, or
> xcache?  If so, update_plugins is not stored as an option but is
> instead stored in the cache.  We're experimenting with having
> transient data such as update_plugins stored in the cache whenever a
> persistent object cache backend is installed so that we can avoid
> cluttering up the options table.  See
> http://trac.wordpress.org/ticket/9048
>
> Transients have transient_* filters that behave the same as option_*.
> Hook your function to both option_update_plugins and
> transient_update_plugins.  option_update_plugins will be run for 2.7
> and earlier.  transient_update_plugins will be run for 2.8.

I'm not using any cache plugins.  Actually, I added an error_log() to  
the actual get_option() function, so the log excerpt above shows the  
actual get_option() function being run.  The function is running, and  
calling the 'update_plugins' settings, but the 'option_update_plugins'  
filter is apparently not firing.  The code is pretty straightforward  
-- I can't imagine why it isn't working.

Any other idea?

Thanks,
Steve

P.S. -- When I get it working, I'll be sure to hook  
transient_update_plugins as well. :)

-- 
Stephen Rider
http://striderweb.com/






More information about the wp-hackers mailing list