templates for self-hosting game jams (or any other kind of jam tbh)
at main 2.0 kB view raw
1<?php 2 3use Roots\Acorn\Application; 4 5/* 6|-------------------------------------------------------------------------- 7| Register The Auto Loader 8|-------------------------------------------------------------------------- 9| 10| Composer provides a convenient, automatically generated class loader for 11| our theme. We will simply require it into the script here so that we 12| don't have to worry about manually loading any of our classes later on. 13| 14*/ 15 16if (! file_exists($composer = __DIR__.'/vendor/autoload.php')) { 17 wp_die(__('Error locating autoloader. Please run <code>composer install</code>.', 'sage')); 18} 19 20require $composer; 21 22/* 23|-------------------------------------------------------------------------- 24| Register The Bootloader 25|-------------------------------------------------------------------------- 26| 27| The first thing we will do is schedule a new Acorn application container 28| to boot when WordPress is finished loading the theme. The application 29| serves as the "glue" for all the components of Laravel and is 30| the IoC container for the system binding all of the various parts. 31| 32*/ 33 34Application::configure() 35 ->withProviders([ 36 App\Providers\ThemeServiceProvider::class, 37 ]) 38 ->boot(); 39 40/* 41|-------------------------------------------------------------------------- 42| Register Sage Theme Files 43|-------------------------------------------------------------------------- 44| 45| Out of the box, Sage ships with categorically named theme files 46| containing common functionality and setup to be bootstrapped with your 47| theme. Simply add (or remove) files from the array below to change what 48| is registered alongside Sage. 49| 50*/ 51 52collect(['setup', 'filters']) 53 ->each(function ($file) { 54 if (! locate_template($file = "app/{$file}.php", true, true)) { 55 wp_die( 56 /* translators: %s is replaced with the relative file path */ 57 sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file) 58 ); 59 } 60 });