This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
57 lines (53 loc) · 1.59 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
<?php
/**
* This theme was built using Sage 8.4.2 by Roots
* Available here: https://github.com/roots/sage/releases/tag/8.4.2
*
* -----------------------------------------------------------------------------
*
* Sage includes
*
* The $sage_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.
*
* @link https://github.com/roots/sage/pull/1042
*/
$sage_includes = array(
'lib/assets.php', // Scripts and stylesheets
'lib/commands.php', // WP-CLI commands
'lib/custom-post-types.php', // Register custom post types
'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
);
foreach ($sage_includes as $file) {
if (!$filepath = locate_template($file)) {
trigger_error(sprintf(__('Error locating %s for inclusion', 'sage'), $file), E_USER_ERROR);
}
require_once $filepath;
}
unset($file, $filepath);
/**
* Get the current version of WP
*
* This is provided for external resources to resolve the current wp_version
*
* @return string
*/
function moj_wp_version()
{
global $wp_version;
return $wp_version;
}
if (function_exists("add_action")) {
add_action('rest_api_init', function () {
register_rest_route('moj', '/version', array(
'methods' => 'GET',
'callback' => 'moj_wp_version'
));
});
}