[wp-trac] Re: [WordPress Trac] #4540: wp_cache_delete don't work with option autoloaded

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 26 09:56:45 GMT 2007


#4540: wp_cache_delete don't work with option autoloaded
------------------------------------------------------+---------------------
 Reporter:  xorax                                     |        Owner:  westi   
     Type:  defect                                    |       Status:  assigned
 Priority:  normal                                    |    Milestone:  2.2.2   
Component:  General                                   |      Version:  2.2     
 Severity:  major                                     |   Resolution:          
 Keywords:  cache database options reporter-feedback  |  
------------------------------------------------------+---------------------
Comment (by xorax):

 I view an error in my code example, replace :

 {{{
 $alloptions = wp_load_alloptions();
 if ( isset($alloptions['readthis_posts2get']) ) {
   unset($alloptions['readthis_posts2get']);
   wp_cache_set('alloptions', $alloptions, 'options');
 }
 }}}

 by

 {{{
 $alloptions = wp_load_alloptions();
 if ( isset($alloptions['myoption']) ) {
   unset($alloptions['myoption']);
   wp_cache_set('alloptions', $alloptions, 'options');
 }
 }}}

 This work correctly if I use options API. But, in certain case, you must
 delete only the cache and there is no function for that.

 I'm french so it's very hard to explain why...

 but, for example, if you want to traduct your post with a SOAP in a
 plugin.
 you set value of an option 'confirm' to 'no' in the thread of the plugin.
 now you call SOAP, the service get your post in other thread and you set
 the value of the option 'confirm' to 'ok' for verified the service has
 really get your post.
 now, in your plugin thread, if the value of 'confirm' is 'ok', the SOAP
 has run correctly, else there was an error.

 did I explain correctly ?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4540#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list