[wp-trac] Re: [WordPress Trac] #8146: Quick tag/category edit appears to be using filtered data

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 17 20:33:24 GMT 2008

#8146: Quick tag/category edit appears to be using filtered data
 Reporter:  jhodgdon                                |        Owner:  anonymous
     Type:  defect                                  |       Status:  reopened 
 Priority:  normal                                  |    Milestone:  2.7      
Component:  Administration                          |      Version:  2.7      
 Severity:  normal                                  |   Resolution:           
 Keywords:  tag, category, edit, filter, has-patch  |  
Comment (by jhodgdon):

 Just a note: My copy of "PHP in a Nutshell" says "From PHP 5 onward,
 objects are always handled as references.". So my comment about
 wp_cache_add storing a reference may be specific to PHP 5 (which is what
 my test server is running, where I concluded that the cache was behaving
 this way). I guess in PHP 4, that might not have been the case.

 Anyway, assuming we want get_term and its caching to work in PHP 5, you
 would need to clone the object after retrieving it from the cache. The
 Nutshell book suggests something like this, which I'd put in get_term
 right after retrieval/adding to cache and before filtering:

    $_term = clone $_term;

 I'm not sure whether the clone keyword exists in PHP 4. ???

Ticket URL: <http://trac.wordpress.org/ticket/8146#comment:29>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list