
Rifqi Fahmi
23,164 Pointswhat is handler ??
I have been studying PHP dev for a while. But I still confused what is 'handler' mean in PHP function?? Such as in this video, Zac make the handler is 'foundationd_css' . Can i type whatever handler name which i want ?? is there can someone elaborate what it mean ??
wp_enqueue_style('foundation_css', get_template_directory_uri(). '/css/foundation.css' );
Thanks :)
1 Answer

Kevin Korte
28,078 PointsYes, this is a custom function written in wordpress. You won't fine "handler" in regular php documentation since it's it's really just an argument to the wp_enqueue_style
function defined in the wordpress ecosystem.
Handler can be any valid string. You get to decide.
https://codex.wordpress.org/Function_Reference/wp_enqueue_style
Rifqi Fahmi
23,164 PointsRifqi Fahmi
23,164 Pointsso handle just a reference of an object or to give a name to that object just like identifier ??
Kevin Korte
28,078 PointsKevin Korte
28,078 PointsBasically. If you look at the example below on the link I provided, in the Load stylesheet only on a plugin's options page example you can see they use
wp_register_style
with a handler, and than later they just callwp_enqueue_style
with only the same handler name as an argument, and it works.