[wp-trac] [WordPress Trac] #5297: Unexpected behavior with plugins and global variables

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 31 21:07:48 GMT 2007


#5297: Unexpected behavior with plugins and global variables
----------------------------+-----------------------------------------------
 Reporter:  PaulButler      |       Owner:  anonymous
     Type:  defect          |      Status:  new      
 Priority:  normal          |   Milestone:  2.5      
Component:  Administration  |     Version:           
 Severity:  normal          |    Keywords:           
----------------------------+-----------------------------------------------
 When a plugin is written as a class, if a class variable is modified in
 the 'content_save_pre', by the time WordPress calls the 'notices' action
 the class variable has the same value it did before 'content_save_pre'. I
 have attached a plugin called test.php to demonstrate this. Make and save
 a new post in the post editor to test it. This may be a symptom of a
 larger problem (or feature?) that global variables are not preserved
 between those two calls (as demonstrated in testglobal.php)

 I am using WordPress 2.3.1 on PHP 5 (mod_php) on an Apache2 server.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5297>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list