[wp-trac] Re: [WordPress Trac] #8899: has_action no reporting existing action hook

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 20 15:11:21 GMT 2009


#8899: has_action no reporting existing action hook
--------------------------+-------------------------------------------------
 Reporter:  firebird75    |        Owner:         
     Type:  defect (bug)  |       Status:  closed 
 Priority:  normal        |    Milestone:         
Component:  Plugins       |      Version:         
 Severity:  normal        |   Resolution:  invalid
 Keywords:                |  
--------------------------+-------------------------------------------------
Changes (by filosofo):

  * status:  new => closed
  * version:  2.7 =>
  * resolution:  => invalid
  * milestone:  2.8 =>

Comment:

 Replying to [ticket:8899 firebird75]:
 > 4/ Wordpress goes through myplugin_activation() and the
 (!has_action('myplugin_monthly_cron_hook','myplugin_monthly_cron')) test
 is entered while the action hasn't been removed (since the plugin wasn't
 deactivated manually). This is where the bug is, I cannot figure out why
 the has_action is returning false here while the action is indeed there...

 I don't think you're understanding how the
 [http://codex.wordpress.org/Plugin_API action hook API] works.  An action
 hook isn't something that can be registered just once when a plugin is
 activated (registered action hooks are not stored in the database).
 Rather, it must be done for every script load.

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


More information about the wp-trac mailing list