Fix conflict with WP core
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* @param string $subtitle
|
||||
* @param string $title
|
||||
*/
|
||||
$error = function ($message, $subtitle = '', $title = '') {
|
||||
$sage_error = function ($message, $subtitle = '', $title = '') {
|
||||
$title = $title ?: __('Sage › Error', 'sage');
|
||||
$footer = '<a href="https://roots.io/sage/docs">roots.io/sage/docs</a>';
|
||||
$message = "<h1>{$title}<br><small>{$subtitle}</small></h1><p>{$message}</p><p>{$footer}</p>";
|
||||
@@ -21,14 +21,14 @@ $error = function ($message, $subtitle = '', $title = '') {
|
||||
* Ensure compatible version of PHP is used
|
||||
*/
|
||||
if (version_compare('5.6.4', phpversion(), '>=')) {
|
||||
$error(__('You must be using PHP 5.6.4 or greater.', 'sage'), __('Invalid PHP version', 'sage'));
|
||||
$sage_error(__('You must be using PHP 5.6.4 or greater.', 'sage'), __('Invalid PHP version', 'sage'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure dependencies are loaded
|
||||
*/
|
||||
if (!file_exists($composer = __DIR__.'/vendor/autoload.php') && !class_exists('Roots\\Sage\\Container')) {
|
||||
$error(
|
||||
$sage_error(
|
||||
__('You must run <code>composer install</code> from the Sage directory.', 'sage'),
|
||||
__('Autoloader not found.', 'sage')
|
||||
);
|
||||
@@ -41,10 +41,10 @@ require_once $composer;
|
||||
* The mapped array determines the code library included in your theme.
|
||||
* Add or remove files to the array as needed. Supports child theme overrides.
|
||||
*/
|
||||
array_map(function ($file) use ($error) {
|
||||
array_map(function ($file) use ($sage_error) {
|
||||
$file = "src/{$file}.php";
|
||||
if (!locate_template($file, true, true)) {
|
||||
$error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file), 'File not found');
|
||||
$sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file), 'File not found');
|
||||
}
|
||||
}, ['helpers', 'setup', 'filters', 'admin']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user