* Created on: 17/08/2018
*
* @package Neve
*/
define( 'NEVE_VERSION', '3.8.2' );
define( 'NEVE_INC_DIR', trailingslashit( get_template_directory() ) . 'inc/' );
define( 'NEVE_ASSETS_URL', trailingslashit( get_template_directory_uri() ) . 'assets/' );
define( 'NEVE_MAIN_DIR', get_template_directory() . '/' );
define( 'NEVE_BASENAME', basename( NEVE_MAIN_DIR ) );
define( 'NEVE_PLUGINS_DIR', plugin_dir_path( dirname( __DIR__ ) ) . 'plugins/' );
if ( ! defined( 'NEVE_DEBUG' ) ) {
define( 'NEVE_DEBUG', false );
}
define( 'NEVE_NEW_DYNAMIC_STYLE', true );
/**
* Buffer which holds errors during theme inititalization.
*
* @var WP_Error $_neve_bootstrap_errors
*/
global $_neve_bootstrap_errors;
$_neve_bootstrap_errors = new WP_Error();
if ( version_compare( PHP_VERSION, '7.0' ) < 0 ) {
$_neve_bootstrap_errors->add(
'minimum_php_version',
sprintf(
/* translators: %s message to upgrade PHP to the latest version */
__( "Hey, we've noticed that you're running an outdated version of PHP which is no longer supported. Make sure your site is fast and secure, by %1\$s. Neve's minimal requirement is PHP%2\$s.", 'neve' ),
sprintf(
/* translators: %s message to upgrade PHP to the latest version */
'%s',
__( 'upgrading PHP to the latest version', 'neve' )
),
'7.0'
)
);
}
/**
* A list of files to check for existance before bootstraping.
*
* @var array Files to check for existance.
*/
$_files_to_check = defined( 'NEVE_IGNORE_SOURCE_CHECK' ) ? [] : [
NEVE_MAIN_DIR . 'vendor/autoload.php',
NEVE_MAIN_DIR . 'style-main-new.css',
NEVE_MAIN_DIR . 'assets/js/build/modern/frontend.js',
NEVE_MAIN_DIR . 'assets/apps/dashboard/build/dashboard.js',
NEVE_MAIN_DIR . 'assets/apps/customizer-controls/build/controls.js',
];
foreach ( $_files_to_check as $_file_to_check ) {
if ( ! is_file( $_file_to_check ) ) {
$_neve_bootstrap_errors->add(
'build_missing',
sprintf(
/* translators: %s: commands to run the theme */
__( 'You appear to be running the Neve theme from source code. Please finish installation by running %s.', 'neve' ), // phpcs:ignore WordPress.Security.EscapeOutput
'composer install --no-dev && yarn install --frozen-lockfile && yarn run build
'
)
);
break;
}
}
/**
* Adds notice bootstraping errors.
*
* @internal
* @global WP_Error $_neve_bootstrap_errors
*/
function _neve_bootstrap_errors() {
global $_neve_bootstrap_errors;
printf( '
%1$s