Fix autoload error of Capabilities
This commit is contained in:
parent
1d473b1b6c
commit
c3366e7d15
|
@ -41,11 +41,16 @@ function tainacan_autoload($class_name){
|
||||||
}
|
}
|
||||||
elseif ($class_path[0] == 'Tainacan') {
|
elseif ($class_path[0] == 'Tainacan') {
|
||||||
$sliced = array_slice($class_path, 1, count($class_path) -2);
|
$sliced = array_slice($class_path, 1, count($class_path) -2);
|
||||||
$lower = $sliced[0];
|
|
||||||
$sliced[0] = strtolower($lower);
|
|
||||||
|
|
||||||
$dir = CLASSES_DIR.implode(DIRECTORY_SEPARATOR, $sliced ) . '/';
|
if($sliced) {
|
||||||
$dir = str_replace('_', '-', $dir);
|
$lower = $sliced[0];
|
||||||
|
$sliced[0] = strtolower( $lower );
|
||||||
|
|
||||||
|
$dir = CLASSES_DIR . implode( DIRECTORY_SEPARATOR, $sliced ) . '/';
|
||||||
|
$dir = str_replace( '_', '-', $dir );
|
||||||
|
} else {
|
||||||
|
$dir = CLASSES_DIR;
|
||||||
|
}
|
||||||
|
|
||||||
if( in_array('Field_Types', $class_path) ){
|
if( in_array('Field_Types', $class_path) ){
|
||||||
$dir.= strtolower(str_replace('_', '-' , $class_name)).'/';
|
$dir.= strtolower(str_replace('_', '-' , $class_name)).'/';
|
||||||
|
|
Loading…
Reference in New Issue