API Reference
This section documents all attributes, interfaces, and core classes in Foehn.
Attributes
Attributes are PHP 8 annotations that enable auto-discovery and registration of WordPress components.
Hooks
| Attribute | Description |
|---|---|
#[AsAction] | Register a WordPress action hook |
#[AsFilter] | Register a WordPress filter hook |
#[AsShortcode] | Register a shortcode handler |
Content Types
| Attribute | Description |
|---|---|
#[AsPostType] | Register a custom post type |
#[AsTaxonomy] | Register a custom taxonomy |
#[AsTimberModel] | Map Timber class without type registration |
Views
| Attribute | Description |
|---|---|
#[AsViewComposer] | Add data to specific templates |
#[AsTemplateController] | Handle template rendering |
Blocks
| Attribute | Description |
|---|---|
#[AsBlock] | Register a native Gutenberg block |
#[AsAcfBlock] | Register an ACF block |
#[AsBlockPattern] | Register a block pattern |
#[AsBlockCategory] | Register a block category |
API & CLI
| Attribute | Description |
|---|---|
#[AsRestRoute] | Register a REST API endpoint |
#[AsCliCommand] | Register a WP-CLI command |
Interfaces
Interfaces define contracts for classes used with specific attributes.
| Interface | Used with |
|---|---|
BlockInterface | #[AsBlock] |
InteractiveBlockInterface | #[AsBlock] with interactivity |
AcfBlockInterface | #[AsAcfBlock] |
ViewComposerInterface | #[AsViewComposer] |
TemplateControllerInterface | #[AsTemplateController] |
BlockPatternInterface | #[AsBlockPattern] (optional) |
Core
| Class | Description |
|---|---|
Kernel | Main bootstrap class |
Helpers | Global helper functions |