[wp-hackers] register_activation_hook is acting funny

scribu scribu at gmail.com
Sat Aug 7 12:37:49 UTC 2010

On Sat, Aug 7, 2010 at 6:11 AM, Scott Kingsley Clark <scott at skcdev.com>wrote:

> Plugin could not be activated because it triggered a fatal error.
> Fatal error: Cannot redeclare my_menu() (previously declared in
> /home/path/to/my/site/wp-content/plugins/my-plugin/my-plugin.php:16) in
> /home/path/to/my/site/wp-content/plugins/my-plugin/my-plugin.php on line 26
> This is weird, as the activation is happening, it seems to some how be
> tripping the activation when it gets another file (whether using include or
> file_get_contents) and includes my plugin TWICE (or it seems to apparently
> from the error), so pretty stumped on this one.
> Has anyone experienced an issue like this before?

Yes, I got that kind of error several times and it was always caused by my
code. The problem is that I could never quite figure out what I was doing
wrong. Just trial and error.


More information about the wp-hackers mailing list