johnwatkins0/wp-autoload

There is no license information available for the latest version (1.0.0) of this package.

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.

1.0.0 2019-01-13 22:02 UTC

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' );