-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
88 lines (69 loc) · 1.83 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
use Toybox\Core\Components\AdminBar;
use Toybox\Core\Components\Comments;
use Toybox\Core\Components\Embeds;
use Toybox\Core\Components\Emoji;
use Toybox\Core\Components\HTTP;
use Toybox\Core\Components\Menus;
use Toybox\Core\Components\Misc;
use Toybox\Core\Components\Settings;
use Toybox\Core\Components\Visitor;
use Toybox\Core\Components\XMLRPC;
use Toybox\Core\Debug\ErrorHandler;
use Toybox\Core\Theme;
if (! defined("TOYBOX_DIR")) {
define("TOYBOX_DIR", __DIR__);
}
require_once(get_theme_file_path("vendor/autoload.php"));
// Enable pretty page errors
ErrorHandler::boot(E_ALL & ~E_DEPRECATED);
// Boot the theme up
Theme::boot();
// Register any nav menus
Menus::set([
'header_nav' => __("Header Navigation", "toybox"),
'footer_nav' => __("Footer Navigation", "toybox"),
]);
// Set custom image sizes
Misc::setImageSizes([
"toybox-small" => [
"name" => "Square (small)",
"width" => 64,
"height" => 64,
"crop" => true,
],
"toybox-medium" => [
"name" => "Square (medium)",
"width" => 128,
"height" => 128,
"crop" => true,
],
"toybox-large" => [
"name" => "Square (large)",
"width" => 256,
"height" => 256,
"crop" => true,
],
]);
// Disable the WordPress admin bar
AdminBar::disable();
// Disable emoji
Emoji::disable();
// Disable embeds
Embeds::disable();
// Disable comments
Comments::disable();
// Stop WordPress auto-changing "Wordpress" to "WordPress".
Misc::disableCapitalPDangit();
// Disable XMLRPC.
XMLRPC::disable();
// Adds support for additional file types
Misc::addFileSupport([
"svg" => "image/svg+xml",
"webp" => "image/webp",
]);
// Preload assets
HTTP::preload();
// Add early hints
HTTP::hint(mix('/assets/css/critical.css'), "rel=preload; as=style");
// You're all done.