-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
executable file
·61 lines (51 loc) · 1.94 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
<?php
/**
* Mihael includes
*
* The $mihael_includes array determines the code library included in your theme.
* Add or remove files to the array as needed. Supports child theme overrides.
*
* Please note that missing files will produce a fatal error.
*
*/
define( 'MIHAEL_MINIMUM_PHP_VERSION', '5.4.0' );
// Check if site meets theme requirements
if ( version_compare(phpversion(), MIHAEL_MINIMUM_PHP_VERSION, '<') ) :
add_action('after_switch_theme', 'mihael_revert_switch', 1, 2);
function mihael_revert_switch($old_theme_name, $old_theme = false) {
// Theme not activated info message.
add_action( 'admin_notices', 'mihael_admin_notice' );
function mihael_admin_notice() {
?>
<div class="update-nag">
<?php esc_html_e( 'You need to update your PHP version to run the Mihael Keehl Theme.', 'mihael-keehl' ); ?> <br />
<?php esc_html_e( 'Actual version is:', 'mihael-keehl' ) ?>
<strong><?php echo phpversion(); ?></strong>,
<?php esc_html_e( 'minimum required is', 'mihael-keehl' ) ?>
<strong><?php echo MIHAEL_MINIMUM_PHP_VERSION; ?></strong>
</div>
<?php
}
// Switch back to previous theme.
switch_theme( $old_theme->stylesheet );
return false;
}
else :
// Bootstrap the theme
$mihael_includes = array(
'lib/extras.php', // Custom functions
'lib/setup.php', // Theme setup
'lib/titles.php', // Page titles
'lib/wrapper.php', // Theme wrapper class
'lib/customizer.php', // Theme customizer
'lib/styles.php', // Dynamic custom styles
'lib/template-tags.php' // Custom template tags
);
foreach ($mihael_includes as $file) {
if (!$filepath = locate_template($file)) {
trigger_error(sprintf(__('Error locating %s for inclusion', 'mihael-keehl'), $file), E_USER_ERROR);
}
require_once $filepath;
}
unset($file, $filepath);
endif;