Move Sage includes from autoloader back to functions.php to fix issues including in Bedrock
This commit is contained in:
@@ -23,6 +23,31 @@ add_action('after_switch_theme', function () {
|
||||
basename($stylesheet) == 'templates' || update_option('stylesheet', $stylesheet . '/templates');
|
||||
});
|
||||
|
||||
/**
|
||||
* Sage includes
|
||||
*
|
||||
* The $sage_includes array determines the code library included in your theme.
|
||||
* Add or remove files to the array as needed. Supports child theme overrides.
|
||||
*
|
||||
* Please note that missing files will produce a fatal error.
|
||||
*
|
||||
* @link https://github.com/roots/sage/pull/1042
|
||||
*/
|
||||
$sage_includes = [
|
||||
'src/helpers.php', // Helper functions
|
||||
'src/setup.php', // Theme setup
|
||||
'src/filters.php', // Filters
|
||||
'src/admin.php' // Admin
|
||||
];
|
||||
|
||||
foreach ($sage_includes as $file) {
|
||||
if (!$filepath = locate_template($file)) {
|
||||
trigger_error(sprintf(__('Error locating %s for inclusion', 'sage'), $file), E_USER_ERROR);
|
||||
}
|
||||
require_once $filepath;
|
||||
}
|
||||
unset($file, $filepath);
|
||||
|
||||
/**
|
||||
* Require composer autoloader
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user