Support » Plugins » Proper use of activate_ hook?

  • I’m writing a plugin which will put some default values into the options table through a function called by the activate_ hook. However, this needs a somewhat hardcoded URL, meaning that the user needs to save the plugin file at a predefined location.

    So I was wondering, if the current location of the plugin file can be determined and passed to the hook? This way, the user could put the plugin in a subdirectory or where he wants it.

    Cheers, Jeriko

Viewing 1 replies (of 1 total)
  • Try using register_activation_hook (in wp-includes/plugin.php) to register the hook using the filename of the plugin from __FILE__

Viewing 1 replies (of 1 total)
  • The topic ‘Proper use of activate_ hook?’ is closed to new replies.