|
0
|
1 |
<?php |
|
|
2 |
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); |
|
|
3 |
function my_theme_enqueue_styles() { |
|
|
4 |
|
|
|
5 |
$parent_style = 'twentynineteen-style'; |
|
|
6 |
|
|
|
7 |
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); |
|
|
8 |
wp_enqueue_style( 'twentynineteen-child-style', |
|
|
9 |
get_stylesheet_directory_uri() . '/style.css', |
|
|
10 |
array( $parent_style ), |
|
|
11 |
wp_get_theme()->get('Version') |
|
|
12 |
); |
|
22
|
13 |
} |
|
|
14 |
|
|
|
15 |
/** |
|
|
16 |
* Disable the emoji's |
|
|
17 |
*/ |
|
|
18 |
function disable_emojis() { |
|
|
19 |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); |
|
|
20 |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); |
|
|
21 |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); |
|
|
22 |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); |
|
|
23 |
remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); |
|
|
24 |
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); |
|
|
25 |
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); |
|
|
26 |
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); |
|
|
27 |
} |
|
|
28 |
add_action( 'init', 'disable_emojis' ); |
|
|
29 |
|
|
|
30 |
/** |
|
|
31 |
* Filter function used to remove the tinymce emoji plugin. |
|
|
32 |
* |
|
|
33 |
* @param array $plugins |
|
|
34 |
* @return array Difference betwen the two arrays |
|
|
35 |
*/ |
|
|
36 |
function disable_emojis_tinymce( $plugins ) { |
|
|
37 |
if ( is_array( $plugins ) ) { |
|
|
38 |
return array_diff( $plugins, array( 'wpemoji' ) ); |
|
|
39 |
} else { |
|
|
40 |
return array(); |
|
|
41 |
} |
|
0
|
42 |
} |