wp-cleaner.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. /*************************************************
  3. // ############### Emojis ################## //
  4. **************************************************/
  5. function boot23_disable_emojis() {
  6. remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
  7. remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
  8. remove_action( 'wp_print_styles', 'print_emoji_styles' );
  9. remove_action( 'admin_print_styles', 'print_emoji_styles' );
  10. remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  11. remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
  12. remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
  13. //add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
  14. add_filter( 'emoji_svg_url', '__return_false' );
  15. }
  16. add_action( 'init', 'boot23_disable_emojis' );
  17. /*************************************************
  18. // ############### wp_head ################## //
  19. **************************************************/
  20. remove_action('wp_head', 'index_rel_link' );
  21. remove_action('wp_head', 'rel_canonical');
  22. remove_action('wp_head', 'start_post_rel_link', 10);
  23. remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);
  24. remove_action('wp_head', 'wp_shortlink_wp_head', 10);
  25. remove_action('wp_head', 'parent_post_rel_link', 10);
  26. remove_action('wp_head', 'rsd_link');
  27. remove_action('wp_head', 'wlwmanifest_link');
  28. remove_action('wp_head', 'wp_generator');
  29. remove_action('wp_head', 'feed_links_extra', 3 );
  30. remove_action('wp_head', 'feed_links', 2 );
  31. remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
  32. remove_action('wp_head', 'wp_oembed_add_host_js', 10);
  33. remove_action('wp_head', 'rest_output_link_wp_head', 10);
  34. remove_action('template_redirect', 'rest_output_link_header', 11, 0);
  35. function boot23_remove_wp_ver_css_js( $src ) {
  36. if ( strpos( $src, 'ver=' ) )
  37. $src = remove_query_arg( 'ver', $src );
  38. return $src;
  39. }
  40. add_filter( 'style_loader_src', 'boot23_remove_wp_ver_css_js', 9999 );
  41. add_filter( 'script_loader_src', 'boot23_remove_wp_ver_css_js', 9999 );
  42. add_filter( 'xmlrpc_enabled', '__return_false' );
  43. function boot23_disable_x_pingback( $headers ) {
  44. unset( $headers['X-Pingback'] );
  45. return $headers;
  46. }
  47. add_filter( 'wp_headers', 'boot23_disable_x_pingback' );
  48. /*************************************************
  49. // ############# Admin Bar ################## //
  50. **************************************************/
  51. function boot23_admin_bar_render() {
  52. global $wp_admin_bar;
  53. $wp_admin_bar->remove_menu('comments');
  54. $wp_admin_bar->remove_menu('customize');
  55. $wp_admin_bar->remove_menu('new-content');
  56. $wp_admin_bar->remove_menu('wp-logo');
  57. }
  58. add_action( 'wp_before_admin_bar_render', 'boot23_admin_bar_render' );
  59. /*************************************************
  60. // ############## Admin pages ################ //
  61. **************************************************/
  62. function boot23_remove_admin_pages() {
  63. remove_menu_page( 'edit-comments.php' );
  64. remove_menu_page( 'link-manager.php' );
  65. //remove_menu_page( 'edit.php?post_type=donor' );
  66. //remove_menu_page( 'edit.php?post_type=funds' );
  67. //remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=post_tag');
  68. }
  69. add_action( 'admin_menu', 'boot23_remove_admin_pages', 99 );
  70. function boot23_change_menu_order( $menu_order ) {
  71. return array(
  72. 'index.php',
  73. 'separator1',
  74. 'edit.php?post_type=page',
  75. 'edit.php',
  76. 'upload.php',
  77. 'edit.php?post_type=soliloquy',
  78. 'separator2',
  79. 'edit.php?post_type=donation',
  80. 'edit.php?post_type=donor',
  81. 'edit.php?post_type=funds',
  82. 'seamless_donations_tab_main',
  83. 'separator-last',
  84. 'themes.php',
  85. 'plugins.php',
  86. 'users.php',
  87. 'tools.php'
  88. );
  89. }
  90. add_filter( 'custom_menu_order', '__return_true' );
  91. add_filter( 'menu_order', 'boot23_change_menu_order' );
  92. /*************************************************
  93. // ############ Admin footer ############## //
  94. **************************************************/
  95. add_filter('admin_footer_text', '__return_empty_string', 1000);
  96. add_filter('update_footer', '__return_empty_string', 1000);