-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.php
More file actions
44 lines (35 loc) · 1.09 KB
/
functions.php
File metadata and controls
44 lines (35 loc) · 1.09 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
<?php
add_action( 'wp_enqueue_scripts', 'themeslug_assets' );
function themeslug_assets() {
$asset = include get_parent_theme_file_path( 'public/css/screen.asset.php' );
wp_enqueue_style(
'themeslug-style',
get_parent_theme_file_uri( 'public/css/screen.css' ),
$asset['dependencies'],
$asset['version']
);
}
add_action( 'after_setup_theme', 'themeslug_editor_styles' );
function themeslug_editor_styles() {
add_editor_style( [
get_parent_theme_file_uri( 'public/css/screen.css' )
] );
}
add_action( 'enqueue_block_editor_assets', 'themeslug_editor_assets' );
function themeslug_editor_assets() {
$script_asset = include get_parent_theme_file_path( 'public/js/editor.asset.php' );
$style_asset = include get_parent_theme_file_path( 'public/css/editor.asset.php' );
wp_enqueue_script(
'themeslug-editor',
get_parent_theme_file_uri( 'public/js/editor.js' ),
$script_asset['dependencies'],
$script_asset['version'],
true
);
wp_enqueue_style(
'themeslug-editor',
get_parent_theme_file_uri( 'public/css/editor.css' ),
$style_asset['dependencies'],
$style_asset['version']
);
}