Ready to get started?Download WordPress


Can't get register_activation_hook to work (1 post)

  1. Rebecca Schaefer
    Posted 5 years ago #

    I've used it before, but for some reason it isn't working now.

    register_activation_hook("pluginfile.php", "installPlugin");
    function installPlugin() {
       add_option("option_name", "option_default", "", "yes");

    This isn't working. The option isn't being added. If I just drop in add_option(...) somewhere on the page, it works fine.

    Does this hook not work for reactivated plugins?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 5 years ago by Rebecca Schaefer
  • This topic is not resolved
  • WordPress version: 2.7


No tags yet.