ELI5: Why are wp_enqueue_style and add_action both needed for styles to be loaded properly?

[ad_1]

Forgive me but I’m a little confused on why add\_action() is necessary once you’ve injected a style via wp\_enqueue\_style(). The former makes the hooks the style into the right place and the latter makes sure the style in hooked into the right place. It sounds like they do the same thing?

I heard an australian YouTuber just brush past and say “… simply enqueues the styles”. What? Huh? For many in the US (possibly most) we don’t hear the term “enqueue” every day, and while I know a queue is line with FIFO dynamics, that still doesn’t explain what enqueue means in the WordPress context. I’m looking for deep dive with the truthful storytelling eye of an Isaac Asimov — perhaps that’s too much to ask?

Programmers (e.g., Larry Wall, etc.) who invent new paradigms often pull from other concepts in different fields of life. For instance, Wikipedia states that Kent Beck and Ward Cunningham were inspired by architect and design theorist Christopher Alexander to originate what would eventually be known as “[Software Design Patterns]”.

In the same way that our term “design patterns” is derived from the field of architecture, the term “enqueue” — which literally nobody I know uses \*\*\*except in WordPress circles\*\*\* — as it is used in WordPress, obviously comes from somebody who developed that part of WP (maybe Matt, maybe somebody else?) and was familiar with it from some other aspect of daily life.

Any insight into who came up with the term enqueue in this sense, and what was their inspiration. I’m not looking for speculation — I can speculate that maybe they had to stand in line all day to get coffee and in England they call that a queue, (but in US its called online) — as I suspect that the true story is much more interesting.

So this question is basically seeking insight and the “whys” behind things rather than how-to.

Thanks for any help!

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer