This file contains 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 | |
remove_action( 'wp_head', 'rsd_link' ); | |
remove_action( 'wp_head', 'wlwmanifest_link' ); | |
remove_action( 'wp_head', 'start_post_rel_link' ); | |
remove_action( 'wp_head', 'index_rel_link' ); | |
remove_action( 'wp_head', 'adjacent_posts_rel_link' ); |
This file contains 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 | |
function my_profiler() | |
{ | |
printf( | |
'<!-- %d queries in %.3f seconds using %.2fMB memory -->', | |
get_num_queries(), | |
timer_stop( 0, 3 ), | |
memory_get_peak_usage() / 1024 / 1024 | |
); | |
} |
This file contains 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 | |
/** | |
* Prefetch DNS for given domains | |
* | |
* @param array $domains List of domain names | |
* | |
* More info: https://css-tricks.com/prefetching-preloading-prebrowsing/ | |
*/ | |
function my_dns_prefetch( $domains = array() ) { | |
if ( ! $domains ) { |
This file contains 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 | |
function my_compat_jquery() { | |
echo "<script>var $ = $ || jQuery;</script>\n"; | |
} | |
add_action( 'wp_head', 'my_compat_jquery', 11 ); |
This file contains 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 | |
function my_file_version( $file ) { | |
global $wp_version; | |
$version = $wp_version; | |
if ( file_exists( $file ) ) { | |
$version = filemtime( $file ); | |
} |
This file contains 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 | |
function my_allow_svg( $mimetypes ) { | |
$mimetypes['svg'] = 'image/svg+xml'; | |
$mimetypes['svgz'] = 'image/svg+xml'; | |
return $mimetypes; | |
} | |
add_filter( 'upload_mimes', 'my_allow_svg' ); |
This file contains 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 | |
// Source: https://github.com/ResponsiveImagesCG/wp-tevko-responsive-images | |
// Requires ImageMagick-PHP-Extension | |
function custom_theme_setup() { | |
add_theme_support( 'advanced-image-compression' ); | |
} | |
add_action( 'after_setup_theme', 'custom_theme_setup' ); |
This file contains 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 | |
function my_unregister_taxonomies() | |
{ | |
unregister_taxonomy_for_object_type( 'category', 'post' ); | |
unregister_taxonomy_for_object_type( 'category', 'pages' ); | |
unregister_taxonomy_for_object_type( 'post_tag', 'pages' ); | |
} | |
add_action( 'init', 'my_unregister_taxonomies' ); |
This file contains 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( 'auto_update_plugin', '__return_false' ); | |
add_filter( 'auto_update_theme', '__return_false' ); |
This file contains 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 | |
function my_http_api_curl( $handle ) { | |
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 180 ); | |
curl_setopt( $handle, CURLOPT_TIMEOUT, 180 ); | |
} | |
add_action( 'http_api_curl', 'my_http_api_curl', 100, 1 ); |
OlderNewer