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.

Filter:

# before
apply_filter('jwk_podcasts_default_url');
# after
apply_filter('jwk:podcasts:default_url');

Action:

# before
do_action('jwk_podcasts_rest_api_init');
# after
do_action('jwk:podcasts:rest_api:init');

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

Josh Friend

I am a builder at heart, blending technology, creativity, and leadership to create tools and experiences that serve families, teams, and communities. My work spans product strategy, software development, education, and creative media, with a focus on clarity, craftsmanship, and long-term impact. I enjoy turning complex ideas into practical systems, whether that is a thoughtfully designed app, a clear decision-making framework, or a meaningful piece of creative work. Much of what I build lives at the intersection of faith, family, and technology, always aiming to help people grow, steward well, and move forward with purpose.

Nashville, Tennessee

Subscribe to joshwhatk

Get the latest posts delivered right to your inbox.