Wordpress: Plugin code


/ Published in: Other
Save to your folder(s)

plugins reside in the plugins folder
wp-content/plugins

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.