forked from woocommerce/storefront
-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
70 lines (57 loc) · 2.07 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Storefront engine room
*
* @package storefront
*/
/**
* Assign the Storefront version to a var
*/
$theme = wp_get_theme( 'storefront' );
$storefront_version = $theme['Version'];
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) ) {
$content_width = 980; /* pixels */
}
$storefront = (object) array(
'version' => $storefront_version,
/**
* Initialize all the things.
*/
'main' => require 'inc/class-storefront.php',
'customizer' => require 'inc/customizer/class-storefront-customizer.php',
);
require 'inc/storefront-functions.php';
require 'inc/storefront-template-hooks.php';
require 'inc/storefront-template-functions.php';
if ( class_exists( 'Jetpack' ) ) {
$storefront->jetpack = require 'inc/jetpack/class-storefront-jetpack.php';
}
if ( storefront_is_woocommerce_activated() ) {
$storefront->woocommerce = require 'inc/woocommerce/class-storefront-woocommerce.php';
$storefront->woocommerce_customizer = require 'inc/woocommerce/class-storefront-woocommerce-customizer.php';
require 'inc/woocommerce/storefront-woocommerce-template-hooks.php';
require 'inc/woocommerce/storefront-woocommerce-template-functions.php';
}
if ( is_admin() ) {
$storefront->admin = require 'inc/admin/class-storefront-admin.php';
require 'inc/admin/class-storefront-plugin-install.php';
}
/**
* NUX
* Only load if wp version is 4.7.3 or above because of this issue;
* https://core.trac.wordpress.org/ticket/39610?cversion=1&cnum_hist=2
*/
if ( version_compare( get_bloginfo( 'version' ), '4.7.3', '>=' ) && ( is_admin() || is_customize_preview() ) ) {
require 'inc/nux/class-storefront-nux-admin.php';
require 'inc/nux/class-storefront-nux-guided-tour.php';
if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '3.0.0', '>=' ) ) {
require 'inc/nux/class-storefront-nux-starter-content.php';
}
}
/**
* Note: Do not add any custom code here. Please use a custom plugin so that your customizations aren't lost during updates.
* https://github.com/woocommerce/theme-customisations
*/