Skip to content

Instantly share code, notes, and snippets.

@alicanatas
Last active September 18, 2017 10:08
Show Gist options
  • Save alicanatas/cdaf2e6ce9983dd3aab21cfe702cac32 to your computer and use it in GitHub Desktop.
Save alicanatas/cdaf2e6ce9983dd3aab21cfe702cac32 to your computer and use it in GitHub Desktop.
<?php
function etkinliksil() {
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' );
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'start_post_rel_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'adjacent_posts_rel_link');
remove_action('wp_head', 'wp_shortlink_wp_head');
remove_action('wp_head', 'rest_output_link_wp_head', 10);
remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
remove_action('template_redirect', 'rest_output_link_header', 11, 0);
add_filter( 'json_enabled', '__return_false' );
add_filter( 'json_jsonp_enabled', '__return_false' );
add_filter( 'rest_enabled', '__return_false' );
add_filter( 'rest_jsonp_enabled', '__return_false' );
remove_action( 'xmlrpc_rsd_apis', 'rest_output_rsd' );
remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
remove_action( 'template_redirect', 'rest_output_link_header', 11 );
}
add_action( 'init', 'etkinliksil' );
function qsTemizle( $src ){
return remove_query_arg( 'ver', $src );
}
add_filter( 'script_loader_src', 'qsTemizle', 15, 1 );
add_filter( 'style_loader_src', 'qsTemizle', 15, 1 );
add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat');
}
function wpb_disable_feed() {
wp_die( __('RSS Feed Devre Dışıdır. Lütfen <a href="'. get_bloginfo('url') .'">anasayfa</a>ya Dönünüz!') );
}
add_action('do_feed', 'wpb_disable_feed', 1);
add_action('do_feed_rdf', 'wpb_disable_feed', 1);
add_action('do_feed_rss', 'wpb_disable_feed', 1);
add_action('do_feed_rss2', 'wpb_disable_feed', 1);
add_action('do_feed_atom', 'wpb_disable_feed', 1);
add_action('do_feed_rss2_comments', 'wpb_disable_feed', 1);
add_action('do_feed_atom_comments', 'wpb_disable_feed', 1);
add_filter('xmlrpc_enabled', '__return_false');
function no_self_ping( &$links ) {
$home = get_option( 'home' );
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, $home ) )
unset($links[$l]);
}
add_action( 'pre_ping', 'no_self_ping' );
function no_wordpress_errors(){
return 'Ay bana bişeyler oluyor!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment