Posted By

redconservatory on 07/29/11


Tagged

wordpress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

logik42


Wordpress: Plugin code


 / Published in: Other
 

plugins reside in the plugins folder wp-content/plugins

The following code must go at the top of your plugin file

  1. /*
  2. Plugin Name: NAME-GOES-HERE
  3. Plugin URI: LINK-TO-THE-PLUGIN-WEBSITE
  4. Description: DESCRIPTION
  5. Author: AUTHOR
  6. Version: VERSION
  7. Author URI: LINK TO AUTHOR'S WEBSITE
  8. */
  9.  
  10. // On activation, do the following
  11. function activation_handler() {
  12. // create database or tables
  13. // create options
  14. }
  15.  
  16. register_activation_hook(__FILE__, "activation_handler");
  17.  
  18. // Handle plugin deactivate
  19. function deactivate_handler() {
  20. // clean up
  21. }
  22.  
  23. register_deactivation_hook(__FILE__, "deactivation_handler");

Report this snippet  

You need to login to post a comment.