johnwatkins0 / wp-autoload
Autoloader for WordPress classes, traits, and interfaces.
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 524
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/johnwatkins0/wp-autoload
Requires (Dev)
- phpunit/phpunit: ^7.5
- squizlabs/php_codesniffer: ^3.4
- wp-coding-standards/wpcs: ^1.2
This package is auto-updated.
Last update: 2025-06-11 16:38:29 UTC
README
Registers an SPL autoloader that loads classes, interfaces, and traits using WordPress file naming conventions.
Example
| functions.php
| inc
class-my-class.php
trait-my-trait.php
interface-my-interface.php
<?php namespace My_Namespace; class My_Class implements My_Interface { use My_Trait; }
// functions.php register_wp_autoload( 'My_Namespace', __DIR__ . '/inc' );