• Sorry for my bad english but I’m french..

    when I want to delete an autoload option (with the autoload column is set to ‘yes’) from the cache, this not work.

    why? because the wp_cache_delete function not delete the cache of the $alloption array. But get_option try to get option in this array.

    function get_option($setting) {
    	...
    	$alloptions = wp_load_alloptions();
    
    	if ( isset($alloptions[$setting]) ) {
    		$value = $alloptions[$setting];
    	} else {
    	...
    	return apply_filters( 'option_' . $setting, maybe_unserialize($value) );
    }
    function wp_cache_delete($id, $flag = '') {
    	global $wp_object_cache;
    
    	return $wp_object_cache->delete($id, $flag);
    }
    
    class WP_Object_Cache {
    	...
    	function delete($id, $group = 'default', $force = false) {
    		if (empty ($group))
    			$group = 'default';
    
    		if (!$force && false === $this->get($id, $group, false))
    			return false;
    	...
    	}
    }

    And the WP_Object_Cache::get() don’t get the option in $alloption array.

    right ?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_cache_delete not work with options autoloaded’ is closed to new replies.