-
Notifications
You must be signed in to change notification settings - Fork 2
/
functions.php
44 lines (41 loc) · 1.09 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
<?php
/**
* Sending Theme functions
*/
define( 'SENDIG_THEME_VERSION', '1.0.0' );
/**
* Register the custom block styles JavaScript for the theme
*/
add_action( 'enqueue_block_editor_assets', 'sendig_editor_assets' );
function sendig_editor_assets() {
$asset_file = include get_template_directory() . '/build/index.asset.php';
$dependencies = $asset_file['dependencies'];
$dependencies[] = 'wp-edit-site';
$version = $asset_file['version'];
wp_enqueue_script(
'sendig-block-styles-script',
get_theme_file_uri( '/assets/js/sendig-custom.js' ),
array( 'wp-blocks', 'wp-i18n' ),
SENDIG_THEME_VERSION,
true
);
wp_set_script_translations( 'sendig-block-styles-script', 'sendig' );
wp_enqueue_script(
'sendig-block-extensions-script',
get_theme_file_uri( '/build/index.js' ),
$dependencies,
$version,
true
);
}
/**
* Register the custom block styles CSS for the theme
*/
add_action( 'enqueue_block_assets', 'sendig_block_styles' );
function sendig_block_styles() {
wp_enqueue_style(
'sendig-block-styles',
get_theme_file_uri( '/assets/css/sendig-custom.css' ),
false
);
}