Skip to content

Instantly share code, notes, and snippets.

View hdtvspace's full-sized avatar

tru hdtvspace

View GitHub Profile
@hdtvspace
hdtvspace / functions.php
Last active April 15, 2017 03:07
WordPress Tuning, jquery for defer loading and async loading of css files. But not for admin. It breaks then the wp editor.
// remove all this Worpress nonsens for tuning and better performance.
add_filter('xmlrpc_enabled', '__return_false' );
add_filter('got_rewrite', '__return_true', 999);
add_filter('wp_get_attachment_image_attributes', 'ipwp_img_attr', 10, 2); function ipwp_img_attr($attr) { $attr['itemprop'] = 'image'; return $attr;}
add_filter('xmlrpc_methods', function($methods) { unset($methods['wp.getUsersBlogs']); return $methods; });
add_filter('wp_headers', 'FastWP_remove_x_pingback' ); function FastWP_remove_x_pingback( $headers ) { unset( $headers['X-Pingback'] ); return $headers;}
function disable_emojis() {remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );