WordPress.org

Forums

Can't get register_activation_hook to work (1 post)

  1. Rebecca O'Brien
    Member
    Posted 6 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");
       //etc
    }

    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

Tags

No tags yet.