Exercise 3: Why "Named Bundles of Capabilities" Is Worth Knowing Before Any Code — Possible Solution ==================================================================== WHAT THIS CHAPTER MEANS BY "NAMED BUNDLES OF CAPABILITIES" ------------------------------ Per this chapter, "WordPress actually checks individual, granular capabilities... not the role label itself. 'Editor' is simply the name WordPress gives to one specific, pre-assembled bundle of these capabilities." In other words, a role like "Editor" isn't a real, independently-meaningful thing WordPress directly understands - it's just a convenient, human-readable label attached to a specific collection of smaller, individually-checked permissions like publish_posts or edit_others_posts. WHY THIS IS DIFFERENT FROM ASSUMING ROLES ARE THE REAL MECHANISM ------------------------------ A learner could reasonably assume "Editor" is itself the thing WordPress checks - as if the software asked "is this user's role literally set to Editor?" every time it needs to decide what they can do. This chapter's own distinction reveals that assumption is wrong: the real check happens at the level of individual capabilities, and the role is just a convenient shortcut for granting a whole bundle of them at once. WHY THIS MATTERS EVEN BEFORE SEEING ANY REAL CODE ------------------------------ Understanding that capabilities, not role names, are the real underlying unit explains things that would otherwise seem confusing or arbitrary - for instance, why WordPress can support custom roles or custom capability combinations at all (per this chapter's own mention of plugins that "allow finer-grained, custom capability combinations beyond the five defaults"). If roles were themselves the fundamental mechanism, arbitrary custom combinations wouldn't make sense; since capabilities are the real fundamental unit and roles are just named bundles of them, creating a new custom bundle is a natural, expected possibility rather than an exotic workaround. WHY THIS CHAPTER INTRODUCES IT AS A "MENTAL MODEL" RATHER THAN TEACHING THE CODE ------------------------------ Per this chapter's own tip-box, "this distinction is presented here purely as a mental model," with the actual PHP mechanism (current_user_can()) deferred to WordPress Intermediate/Advanced 8. Understanding the concept first, without the code, means that when the real mechanism is introduced later, it will read as a direct confirmation of something already understood conceptually, rather than as an entirely new idea to learn from scratch at the same time as new PHP syntax. WHY THIS WORKS AS AN ANSWER ------------------------------ It restates the chapter's own precise distinction between roles and capabilities, explains what a learner might otherwise wrongly assume without it, and connects the concept's value specifically to how it prepares for material this chapter explicitly defers to a later chapter, rather than treating it as an isolated fact.