From 9c522ed9f441cd8c632d9a73ce0cdea594b65891 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Fri, 30 Dec 2016 12:51:55 -0700 Subject: [PATCH] Fix conflict with WP core --- functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index 208556f..3835777 100644 --- a/functions.php +++ b/functions.php @@ -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 = 'roots.io/sage/docs'; $message = "

{$title}
{$subtitle}

{$message}

{$footer}

"; @@ -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 composer install 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 %s for inclusion.', 'sage'), $file), 'File not found'); + $sage_error(sprintf(__('Error locating %s for inclusion.', 'sage'), $file), 'File not found'); } }, ['helpers', 'setup', 'filters', 'admin']);