WP_Filesystem_Base * @return void */ function loco_autoload( $name ){ if( 'Loco_' === substr($name,0,5) ){ loco_include( 'src/'.strtr( substr($name,5), '_', '/' ).'.php' ); } else if( file_exists( $path = loco_plugin_root().'/src/compat/'.$name.'.php') ){ require $path; } else if( file_exists( $path = ABSPATH.'wp-admin/includes/class-'.strtr(strtolower($name),'_','-').'.php' ) ){ require_once $path; } } spl_autoload_register( 'loco_autoload', false ); // provide safe directory for custom translations that won't be deleted during auto-updates if( ! defined('LOCO_LANG_DIR') ){ define( 'LOCO_LANG_DIR', rtrim(loco_constant('WP_LANG_DIR'),'/').'/loco' ); } // text domain loading helper for custom file locations. disable by setting constant empty if( LOCO_LANG_DIR ){ new Loco_hooks_LoadHelper; } // initialize hooks for admin screens if( is_admin() ){ Loco_hooks_AdminHooks::init(); }