-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
68 lines (59 loc) · 1.79 KB
/
functions.php
File metadata and controls
68 lines (59 loc) · 1.79 KB
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
<?php
/**
* Theme definitions.
*
* @package Purple_Turtle_Creative
*/
namespace PTC_Theme;
defined( 'ABSPATH' ) || die();
$wp_theme = wp_get_theme();
define( 'PTC_Theme\THEME_VERSION', $wp_theme->get( 'Version' ) );
define( 'PTC_Theme\THEME_NAME', $wp_theme->get( 'Name' ) );
define( 'PTC_Theme\THEME_BASENAME', basename( __DIR__ ) );
define( 'PTC_Theme\THEME_PATH', __DIR__ );
define( 'PTC_Theme\REST_API_NAMESPACE_V1', 'ptc-theme/v1' );
$theme_directory_uri = get_template_directory_uri();
define( 'PTC_Theme\IMAGES_URI', $theme_directory_uri . '/assets/images' );
define( 'PTC_Theme\STYLES_URI', $theme_directory_uri . '/assets/styles' );
define( 'PTC_Theme\SCRIPTS_URI', $theme_directory_uri . '/assets/scripts' );
// Scripts with "defer" always execute when the DOM is ready (but before DOMContentLoaded event).
define(
'PTC_Theme\DEFER_SCRIPTS',
array(
'jquery-core',
'jquery-migrate',
'wp-embed',
'ptc-theme-script',
'ptc-completionist-landing-page-script',
'block-acf-ptc-block-mailing-list-subscribe',
'ptc-block-core-details-view-script',
)
);
// Scripts with "async" load in the background and run when ready.
define(
'PTC_Theme\ASYNC_SCRIPTS',
array(
'cf-turnstile',
)
);
// Require all custom theme functions.
foreach ( glob( THEME_PATH . '/functions/*.php' ) as $file ) {
require_once $file;
}
// Require all public classes.
foreach ( glob( THEME_PATH . '/classes/public/class-*.php' ) as $file ) {
require_once $file;
}
Captcha::register();
HTML_Routes::register();
Mailing_Lists::register();
Manual_Downloads::register();
// WP Rocket - https://docs.wp-rocket.me/article/1835-automatic-lazy-rendering
add_filter(
'rocket_lrc_exclusions',
function ( $exclusions ) {
$exclusions[] = 'class="wave-trim-bottom"';
$exclusions[] = 'class="wave-trim-top"';
return $exclusions;
}
);