Skip to content

Instantly share code, notes, and snippets.

@david-strejc
Created October 24, 2020 08:16
Show Gist options
  • Save david-strejc/fcba0960f9c917ae904adfb0182de310 to your computer and use it in GitHub Desktop.
Save david-strejc/fcba0960f9c917ae904adfb0182de310 to your computer and use it in GitHub Desktop.
add_action( 'elementor/frontend/after_register_styles',function() {
foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
wp_deregister_style( 'elementor-icons-fa-' . $style );
}
}, 20 );
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
//* Disable FontAwesome
add_action( ‘wp_enqueue_scripts’, function() { wp_dequeue_style( ‘font-awesome’ ); }, 50 );
//* To remove the Font Awesome http request as well
add_action( ‘elementor/frontend/after_enqueue_styles’, function () { wp_dequeue_style( ‘font-awesome’ ); } );
//add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
//wp_deregister_style( 'amethyst-dashicons-style' );
wp_deregister_style( 'dashicons' );
}
// Function to Disable Emojis in TinyMCE Editor
function kill_emojis_on_tinymce( $plugins ) {
if ( is_array( $plugins ) ) {
return array_diff( $plugins, array( 'wpemoji' ) );
} else {
return array();
}
}
// Function to Disable Emoji-Specific Functions
function kill_wp_emojis() {
// Remove Emoji
remove_action( '
_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
// Remove TinyMCE emojis via Filter
add_filter( 'tiny_mce_plugins', 'kill_emojis_on_tinymce' );
// Remove DNS Prefetch for Emojis via Filter
add_filter( 'emoji_svg_url', '__return_false' );
}
add_action( 'init', 'kill_wp_emojis' );
//* Disable FontAwesome
add_action( ‘wp_enqueue_scripts’, function() { wp_dequeue_style( ‘font-awesome’ ); }, 50 );
//* To remove the Font Awesome http request as well
add_action( ‘elementor/frontend/after_enqueue_styles’, function () { wp_dequeue_style( ‘font-awesome’ ); } );
// Deactivate Eicons at Elementor
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 );
function remove_default_stylesheet() {
// Don't remove it in the backend
if ( is_admin() || current_user_can( 'manage_options' ) ) {
return;
}
wp_deregister_style( 'elementor-icons' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment