🚀
Zero Configuration
Auto-discovery of components via PHP 8 attributes. No registration boilerplate.
Attribute-based auto-discovery for hooks, post types, blocks, and more
<?php
// app/Hooks/ThemeHooks.php
namespace App\Hooks;
use Studiometa\Foehn\Attributes\AsAction;
use Studiometa\Foehn\Attributes\AsFilter;
final class ThemeHooks
{
#[AsAction('after_setup_theme')]
public function setupTheme(): void
{
add_theme_support('post-thumbnails');
add_theme_support('title-tag');
}
#[AsFilter('excerpt_length')]
public function excerptLength(): int
{
return 30;
}
}Foehn stands on the shoulders of giants. We're grateful to the following projects and their maintainers:
#[AsEventListener] and other attributes inspired our hook registration syntax