-
Notifications
You must be signed in to change notification settings - Fork 4
Autoloading
Daryll Doyle edited this page Mar 13, 2025
·
1 revision
WP Framework follows the PSR‑4 autoloading standard. It builds on the module autoloader formerly used in WP‑Scaffold. Instead of extending a base Module class, you now implement the ModuleInterface and use the provided Module trait.
namespace YourNamespace;
use TenupFramework\ModuleInterface;
use TenupFramework\Module;
class YourModule implements ModuleInterface {
use Module;
public function can_register(): bool {
return true;
}
public function register(): void {
// Register hooks and filters here.
}
}- Follow PSR‑4 naming and directory conventions.
- Use the
Moduletrait for a basic implementation ofModuleInterface. - Keep module registration lean—only attach what’s necessary.