1

I see from the activation link, wordpress is using the plugin's dir. Also, when many plugins use add_action to hook on activation, they use

add_action('activate_' . plugin_basename(), 'name_activation');

If the plugin dir is word/ , the plugin name is Press, then, this will be:

add_action('activate_word', 'press_activation'');

So, WP identify the plugin as "word" or "press" ? I know that by using 'activate_word', WP gets to know which file to activate. I also tested that the "Press" got activated and running. But, is there any potential trouble to consider?

1

Plugins are identified by the path to the file containing the plugin headers. For instance the debug bar plugin would be identified as: debug-bar/debug-bar.php

See activate_plugin

To add an action on activation you need to register the hook using register_activation_hook( $file, $function )

example: register_activation_hook( __FILE__, 'activation_function' );

  • So, beside showing up on the plugins list, the plugin name doesn't make any sense to WP? – Jenny May 15 '12 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.