Skip to main content

🔗 Relationship Between Components

Component Diagram


🧩 Key Components​

Application​

Application is a static helper class that cannot be instantiated directly. It serves as a central utility for managing the application lifecycle by:

  • Context Initialization: Uses getContext(env) to initialize and retrieve application contexts for specific environments
  • Hook Registration: Provides registerHooks() to register custom hooks that extend or modify application behavior
  • Configuration Management: Manages global and environment-specific configurations passed to contexts during initialization

Context​

A Context is a scoped environment created for a specific execution cycle — for example, a single HTTP request or task run. It provides isolated, request-level instances of configuration, role resolution, session data, and utilities.

Current​

Current represents the active session state and includes:

  • User – The active WordPress user and their associated roles.
  • Site – The current site context, if applicable (in multisite setups).
  • Blog – The current blog context (in multisite setups).

These components reflect the identity and environment of the ongoing execution cycle.

Utils​

Utils offers contextual helper utilities used by other components like:

  • post, query, term, site, and more.

These are injected per context to ensure isolation and consistency across independent execution scopes.