WP 3.4: register_activation_hook() inside of a class issue
-
One of my plugins stopped firing activation hook after I updated to WordPress 3.4. My register_activation_hook() function is a Codex “text book” example runs inside __construct() method of my class like this:
register_activation_hook( __FILE__, array( $this, 'YOUR_METHOD_NAME' ) );
To make it work in WP 3.4 I had to change it to this:
register_activation_hook( __FILE__, call_user_func(array( $this, 'YOUR_METHOD_NAME' )) );
I don’t know if it’s a bug in WP 3.4 or Codex needs to be updated. Would be nice if some one cleared this up for me. Thanks.
- The topic ‘WP 3.4: register_activation_hook() inside of a class issue’ is closed to new replies.