-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathassets.php
More file actions
52 lines (40 loc) · 1.12 KB
/
assets.php
File metadata and controls
52 lines (40 loc) · 1.12 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
<?php
/**
* De-registers WordPress default
*
* @link https://developer.wordpress.org/reference/functions/wp_dequeue_style/
*/
add_action(
'wp_enqueue_scripts',
function () {
wp_dequeue_style( 'wp-block-library' ); // WordPress block libaray styles
wp_dequeue_style( 'global-styles' );// WordPress global styles generated from theme.json
}
);
/**
* Remove oEmbed-specific JavaScript from the front-end and back-end.
*
* @link https://developer.wordpress.org/reference/functions/wp_oembed_add_host_js/
*/
remove_action( 'wp_head', 'wp_oembed_add_host_js' );
/**
* Remove WordPress version from scripts
*/
function remove_script_version( $src ) {
global $wp_version;
$parts = explode( "?ver=$wp_version", $src );
return $parts[0];
}
add_filter( 'script_loader_src', 'remove_script_version', 15, 1 );
add_filter( 'style_loader_src', 'remove_script_version', 15, 1 );
/**
* Remove type from style and script tags
*
* @link https://developer.wordpress.org/reference/functions/add_theme_support/#html5
*/
add_action(
'after_setup_theme',
function () {
add_theme_support( 'html5', array( 'script', 'style' ) );
}
);