Autoloader兼容性回调。
原型
__autoload( string $classname )
参数
$classname
(string)
(Required)
尝试自动加载的类。
源文件
路径:wp-includes/spl-autoload-compat.php
<?php
...
function __autoload( $classname ) {
global $_wp_spl_autoloaders;
foreach ( $_wp_spl_autoloaders as $autoloader ) {
if ( ! is_callable( $autoloader ) ) {
// Avoid the extra warning if the autoloader isn't callable.
continue;
}
call_user_func( $autoloader, $classname );
// If it has been autoloaded, stop processing.
if ( class_exists( $classname, false ) ) {
return;
}
}
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/__autoload/