Wordpress: create custom wordpress hooks


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

Create your own wordpress hooks easily and simply. Just rename the function to whatever you like.


Copy this code and paste it in your HTML
  1. /**
  2. * Usage: add_action('custom_hook', 'my_new_function')
  3. * Just place custom_hook(); somewhere in your theme.
  4. **/
  5.  
  6. function custom_hook(){
  7. do_action('custom_hook');
  8. }
  9.  
  10. function my_new_function(){
  11. //do something
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.