Plugin Directory

Changeset 1879890


Ignore:
Timestamp:
05/23/2018 09:31:50 AM (8 years ago)
Author:
emarten
Message:

removes emojis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dsgvo/trunk/eu-dsgvo-helper.php

    r1879884 r1879890  
    33    /*
    44        Plugin Name: EU DSGVO Helper
    5         Description: This Plugin will be further developed. It so far caches google webfonts locally and replaces youtube embeded videos with a preview-image which becomes an embeded video on-click. More functions will be added soon.
    6         Version: 1.0.1.2
     5        Description: This Plugin will be further developed. It so far caches google webfonts locally and replaces youtube embeded videos with a preview-image which becomes an embeded video on-click. Removes Emojis. More functions will be added soon.
     6        Version: 1.0.2.1
    77        Author: Eric Marten
    88        Author URL: https://www.herr-marten.de/
     
    185185        });
    186186    });
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201    /*
     202        Disable the emoji's
     203    */
     204    function disable_emojis_remove_dns_prefetch( $urls, $relation_type )
     205    {
     206        if ( 'dns-prefetch' == $relation_type )
     207        {
     208            /** This filter is documented in wp-includes/formatting.php */
     209            $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/' );
     210            $urls = array_diff( $urls, array( $emoji_svg_url ) );
     211            $emoji_svg_url = apply_filters( 'emoji_svg_url', '//s.w.org' );
     212            $urls = array_diff( $urls, array( $emoji_svg_url ) );
     213        }
     214        return $urls;
     215    }
     216    function disable_emojis_tinymce( $plugins )
     217    {
     218        if ( is_array( $plugins ) )
     219        {
     220            return array_diff( $plugins, array( 'wpemoji' ) );
     221        }
     222        else
     223        {
     224            return array();
     225        }
     226    }
     227    function disable_emojis()
     228    {
     229        remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
     230        remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
     231        remove_action( 'wp_print_styles', 'print_emoji_styles' );
     232        remove_action( 'admin_print_styles', 'print_emoji_styles' );
     233        remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
     234        remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
     235        remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
     236        add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
     237        add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
     238    }
     239    add_action( 'init', 'disable_emojis' );
     240
     241
     242
     243    remove_action('wp_head', 'rsd_link');
     244    remove_action( 'wp_head', 'rest_output_link_wp_head');
     245
     246    remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
     247    #add_action( 'wp_enqueue_scripts', 'remove_default_scripts');
     248
     249
     250    // Remove html5shivmin.js from WordPress Head (Frontend)
     251    /*function remove_default_scripts3( ){
     252          wp_deregister_script( 'html5shiv' );
     253    }
     254    add_action( 'wp_enqueue_scripts', 'remove_default_scripts3');
     255
     256    /*
     257        // Remove Dashicons from WordPress Head (Frontend) (And all styles of the admin-bar)
     258        function remove_default_scripts2( ){
     259                wp_deregister_style( 'dashicons' );
     260        }
     261        add_action( 'wp_enqueue_scripts', 'remove_default_scripts2');
     262    */
     263
     264    remove_action('wp_head', 'wlwmanifest_link');
     265    #remove_action('wp_head', 'wp_generator');
     266
     267    remove_action('wp_head', 'start_post_rel_link');
     268    remove_action('wp_head', 'index_rel_link');
     269
     270    #remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
     271    #remove_action('wp_head', 'adjacent_posts_rel_link');
     272
     273    remove_action( 'wp_head', 'wp_resource_hints', 2 );
     274    #remove_action( 'wp_head', 'feed_links', 2 );
Note: See TracChangeset for help on using the changeset viewer.