functions.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. // ############### require ################## //
  3. //require get_stylesheet_directory() . '/inc/cust-func.php';
  4. // ############### wp_head ################## //
  5. remove_action('wp_head', 'index_rel_link' );
  6. remove_action('wp_head', 'rel_canonical');
  7. remove_action('wp_head', 'start_post_rel_link', 10);
  8. remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);
  9. remove_action('wp_head', 'wp_shortlink_wp_head', 10);
  10. remove_action('wp_head', 'parent_post_rel_link', 10);
  11. remove_action('wp_head', 'rsd_link');
  12. remove_action('wp_head', 'wlwmanifest_link');
  13. remove_action('wp_head', 'wp_generator');
  14. remove_action('wp_head', 'feed_links_extra', 3 );
  15. remove_action('wp_head', 'feed_links', 2 );
  16. remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
  17. remove_action('wp_head', 'wp_oembed_add_host_js', 10);
  18. remove_action('wp_head', 'rest_output_link_wp_head', 10);
  19. remove_action('template_redirect', 'rest_output_link_header', 11, 0);
  20. function dwp_remove_wp_ver_css_js( $src ) {
  21. if ( strpos( $src, 'ver=' ) )
  22. $src = remove_query_arg( 'ver', $src );
  23. return $src;
  24. }
  25. add_filter( 'style_loader_src', 'dwp_remove_wp_ver_css_js', 9999 );
  26. add_filter( 'script_loader_src', 'dwp_remove_wp_ver_css_js', 9999 );
  27. add_filter( 'xmlrpc_enabled', '__return_false' );
  28. add_filter( 'wp_headers', 'dwp_disable_x_pingback' );
  29. function dwp_disable_x_pingback( $headers ) {
  30. unset( $headers['X-Pingback'] );
  31. return $headers;
  32. }
  33. // ############### Emojis ################## //
  34. function dwp_disable_emojis() {
  35. remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
  36. remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
  37. remove_action( 'wp_print_styles', 'print_emoji_styles' );
  38. remove_action( 'admin_print_styles', 'print_emoji_styles' );
  39. remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  40. remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
  41. remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
  42. add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
  43. add_filter( 'emoji_svg_url', '__return_false' );
  44. }
  45. add_action( 'init', 'dwp_disable_emojis' );
  46. // ############### Emojis ################## //
  47. add_action( 'admin_menu', 'tc_remove_tools', 99 );
  48. function tc_remove_tools() {
  49. global $menu;
  50. global $submenu;
  51. remove_menu_page( 'tools.php' );
  52. //remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=category');
  53. remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=post_tag');
  54. remove_menu_page('edit-comments.php');
  55. remove_submenu_page('admin.php', 'admin.php?page=newsletter_main_welcome');
  56. }