<?php /** * Neve functions.php file * * Author: Andrei Baicus <andrei@themeisle.com> * Created on: 17/08/2018 * * @package Neve */ define( 'NEVE_VERSION', '3.8.16' ); 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 */ '<a href="https://wordpress.org/support/upgrade-php/">%s</a>', __( '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 '<code>composer install --no-dev && yarn install --frozen-lockfile && yarn run build</code>' ) ); break; } } /** * Adds notice bootstraping errors. * * @internal * @global WP_Error $_neve_bootstrap_errors */ function _neve_bootstrap_errors() { global $_neve_bootstrap_errors; printf( '<div class="notice notice-error"><p>%1$s</p></div>', $_neve_bootstrap_errors->get_error_message() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } if ( $_neve_bootstrap_errors->has_errors() ) { /** * Add notice for PHP upgrade. */ add_filter( 'template_include', '__return_null', 99 ); switch_theme( WP_DEFAULT_THEME ); unset( $_GET['activated'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended add_action( 'admin_notices', '_neve_bootstrap_errors' ); return; } /** * Themeisle SDK filter. * * @param array $products products array. * * @return array */ function neve_filter_sdk( $products ) { $products[] = get_template_directory() . '/style.css'; return $products; } add_filter( 'themeisle_sdk_products', 'neve_filter_sdk' ); add_filter( 'themeisle_sdk_compatibilities/' . NEVE_BASENAME, function ( $compatibilities ) { $compatibilities['NevePro'] = [ 'basefile' => defined( 'NEVE_PRO_BASEFILE' ) ? NEVE_PRO_BASEFILE : '', 'required' => '2.4', 'tested_up' => '2.8', ]; return $compatibilities; } ); require_once 'globals/migrations.php'; require_once 'globals/utilities.php'; require_once 'globals/hooks.php'; require_once 'globals/sanitize-functions.php'; require_once get_template_directory() . '/start.php'; /** * If the new widget editor is available, * we re-assign the widgets to hfg_footer */ if ( neve_is_new_widget_editor() ) { /** * Re-assign the widgets to hfg_footer * * @param array $section_args The section arguments. * @param string $section_id The section ID. * @param string $sidebar_id The sidebar ID. * * @return mixed */ function neve_customizer_custom_widget_areas( $section_args, $section_id, $sidebar_id ) { if ( strpos( $section_id, 'widgets-footer' ) ) { $section_args['panel'] = 'hfg_footer'; } return $section_args; } add_filter( 'customizer_widgets_section_args', 'neve_customizer_custom_widget_areas', 10, 3 ); } require_once get_template_directory() . '/header-footer-grid/loader.php'; add_filter( 'neve_welcome_metadata', function() { return [ 'is_enabled' => ! defined( 'NEVE_PRO_VERSION' ), 'pro_name' => 'Neve Pro Addon', 'logo' => get_template_directory_uri() . '/assets/img/dashboard/logo.svg', 'cta_link' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/?discount=LOYALUSER582&dvalue=50', 'neve-welcome', 'notice' ), 'query' ), ]; } ); add_filter( 'themeisle_sdk_enable_telemetry', '__return_true' );
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
assets | Folder | 0755 |
|
|
docs | Folder | 0755 |
|
|
globals | Folder | 0755 |
|
|
header-footer-grid | Folder | 0755 |
|
|
inc | Folder | 0755 |
|
|
languages | Folder | 0755 |
|
|
page-templates | Folder | 0755 |
|
|
template-parts | Folder | 0755 |
|
|
vendor | Folder | 0755 |
|
|
views | Folder | 0755 |
|
|
woocommerce | Folder | 0755 |
|
|
404.php | File | 108 B | 0644 |
|
500.php | File | 178 B | 0644 |
|
CHANGELOG.md | File | 58.28 KB | 0644 |
|
LICENSE.txt | File | 17.67 KB | 0644 |
|
archive-download.php | File | 1.06 KB | 0644 |
|
autoloader.php | File | 4.05 KB | 0644 |
|
comments.php | File | 295 B | 0644 |
|
footer-pwa.php | File | 147 B | 0644 |
|
footer.php | File | 1.21 KB | 0644 |
|
functions.php | File | 5.03 KB | 0644 |
|
header-pwa.php | File | 680 B | 0644 |
|
header.php | File | 2.63 KB | 0644 |
|
index.php | File | 4.09 KB | 0644 |
|
offline.php | File | 178 B | 0644 |
|
page.php | File | 1.59 KB | 0644 |
|
readme.md | File | 41.69 KB | 0644 |
|
readme.txt | File | 41.6 KB | 0644 |
|
screenshot-mobile.png | File | 17.77 KB | 0644 |
|
screenshot.png | File | 610.36 KB | 0644 |
|
search.php | File | 1.18 KB | 0644 |
|
searchform.php | File | 1.97 KB | 0644 |
|
sidebar-shop.php | File | 325 B | 0644 |
|
sidebar.php | File | 306 B | 0644 |
|
single-download.php | File | 1.21 KB | 0644 |
|
single.php | File | 1.17 KB | 0644 |
|
start.php | File | 2.38 KB | 0644 |
|
style-main-new-rtl.css | File | 45.37 KB | 0644 |
|
style-main-new-rtl.min.css | File | 38.12 KB | 0644 |
|
style-main-new.css | File | 45.4 KB | 0644 |
|
style-main-new.min.css | File | 38.1 KB | 0644 |
|
style.css | File | 1.63 KB | 0644 |
|
taxonomy-download_category.php | File | 1.07 KB | 0644 |
|
taxonomy-download_tag.php | File | 1.07 KB | 0644 |
|
toolset-config.json | File | 4.33 KB | 0644 |
|
wpml-config.xml | File | 1.08 KB | 0644 |
|