I just had to look this up from my own comment to a support question on the WordPress codex so I’m posting it here for my future reference. However, this pattern is a good pattern to use when needing to add an activate function call for your plugin.


$activateFunction = 'activateMyPlugin'; // change this;
add_action( 'activate_' . preg_replace( '/.*wp-content.plugins./','',__FILE__ ), $activateFunction ); 

Older Posts:
wordpress plugins
"Options Form From Code Required Save Settings. Php Function PluginNameSaveOptions $options Get_option 'pluginShortNameSettings' $options 'settingA' Stripslashes $_POST 'settingA' $options 'settingB' Stripslashes"

quick solution to vexing http post problem
"Googling Phrase I'm Posting Php Code Form Using Http Post Forbidden Here Solution Simple .htaccess File Folder Script Single Line It. SecFilterInheritance"

bumptop - new windows desktop interface
"Full Blown Desktop Replacement Installed Machine. Check Out."
Newer Posts:printing from windows vista to windows xp
"Laptop Running Windows Vista. Wanted Print HP LaserJet 4L Connected Desktop Running Windows XP. Problem Kept Getting Access Denied Error. Keep Reading Work This. Ended Several Tutorials Different Approaches"

Something to say?