Better naming for WordPress hooks

Next time you're out there writing some code for a custom WordPress theme or plugin, try thinking about adding colons or dots to your hook names. It makes it much more readable and easier to understand the separation between components and the function of the hook.


# before
# after


# before
# after

It's really fun and makes keeping track of what your hooks really do a little easier. Have fun!

Josh Friend

A.D. of Software Engineering at Ramsey Solutions. I build mostly using Ruby on Rails, React, Laravel, and Kotlin/Spring Boot. I always wanted to be an inventor when I grew up, so now I enjoy providing simple, intuitive solutions to complex problems.

Nashville, Tennessee

Subscribe to joshwhatk

Get the latest posts delivered right to your inbox.