| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) or die( 'This plugin requires WordPress' ); |
| 4 |
|
| 5 |
spl_autoload_register( function( $class ){ |
| 6 |
foreach( new \DirectoryIterator( __DIR__ ) as $file ){ |
| 7 |
if( $file->isFile() && __FILE__ !== $file->getPathname() ){ |
| 8 |
$class = $file->getBasename( '.php' ); |
| 9 |
if( false === strpos( $class, '.' ) ){ |
| 10 |
require_once( $file->getPathname() ); |
| 11 |
} |
| 12 |
} |
| 13 |
} |
| 14 |
} ); |