3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

Hi guys,

what it the utility of using add_action with a custom tag to call a custom function?

For example:

add_action(‘my_custom_tag’, ‘my_custom_function’);



19 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 50 000 and 100 000 dollars
ermark says

You can start to have some features easy to add in place creating some kind of framework, this way the code is reusable..

For example our Admin has a toolbar and if we include a new php in functions.php we’re adding more features in the toolbar without modifying in the original admin html :)

252 posts
  • Elite Author
  • Won a Competition
  • Has been a member for 5-6 years
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
der says

I use do_action() on the framework, and add_action() on the (framework’s) modules/extensions. This way you have a modular framework, easily extendible.