Created
June 6, 2017 20:45
-
-
Save luizbills/526d007f2ba637ef7846a2dad8b0f689 to your computer and use it in GitHub Desktop.
WordPress Front-end Optimizations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'style_loader_src', 'generate_remove_cssjs_ver', 10, 2 ); | |
| add_filter( 'script_loader_src', 'generate_remove_cssjs_ver', 10, 2 ); | |
| function generate_remove_cssjs_ver( $src ) { | |
| if( strpos( $src, '?ver=' ) ) $src = remove_query_arg( 'ver', $src ); | |
| return $src; | |
| } | |
| add_action( 'init', 'generate_disable_wp_emojicons' ); | |
| function generate_disable_wp_emojicons() | |
| { | |
| // all actions related to emojis | |
| remove_action( 'admin_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' ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment