Move Sage includes from autoloader back to functions.php to fix issues including in Bedrock
This commit is contained in:
@@ -26,13 +26,7 @@
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Roots\\Sage\\": "src/lib/Sage/"
|
||||
},
|
||||
"files": [
|
||||
"src/helpers.php",
|
||||
"src/setup.php",
|
||||
"src/filters.php",
|
||||
"src/admin.php"
|
||||
]
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.0",
|
||||
|
||||
2
composer.lock
generated
2
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "bae0265fe64b728b3ad0fd3ab2ca2df0",
|
||||
"hash": "7382dc6bb77190896306e1eb58b6589c",
|
||||
"content-hash": "75ad99c892e1d82404c58fe3bd989585",
|
||||
"packages": [
|
||||
{
|
||||
|
||||
@@ -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