wp-cleaner.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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_admin_styles(){
  63. echo '<style>
  64. #adminmenu,#adminmenuback,#adminmenuwrap{background-color:#325363}
  65. #adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{background-color:#263E4A}
  66. #adminmenu .wp-submenu{background-color:#325363}
  67. #adminmenu li:hover{background-color:#263E4A}
  68. #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu {background-color:#1c2f38}
  69. #adminmenu li.wp-has-current-submenu .wp-submenu {background-color:#263E4A}
  70. #wpadminbar,#wpadminbar .menupop .ab-sub-wrapper {background-color:#325363}
  71. #wpadminbar a.ab-item:hover,#wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item{background-color:#263E4A}
  72. </style>';
  73. }
  74. add_action('admin_head', 'boot23_admin_styles');
  75. remove_action("admin_color_scheme_picker", "admin_color_scheme_picker");
  76. add_action( 'login_enqueue_scripts', 'boot23_login_logo' );
  77. function boot23_login_logo() { ?>
  78. <style type="text/css">
  79. #login h1 a, .login h1 a {
  80. background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/img/dove.png);
  81. height:130px;
  82. width:320px;
  83. background-size: 100px 100px;
  84. background-repeat: no-repeat;
  85. padding-bottom: 10px;
  86. }
  87. </style>
  88. <?php }
  89. add_filter( 'login_headerurl', 'boot23_login_url' );
  90. function boot23_login_url() { return home_url(); }
  91. add_filter( 'login_headertext', 'boot23_login_title' );
  92. function boot23_login_title() { return get_option( 'blogname' ); }
  93. function boot23_remove_admin_pages() {
  94. remove_menu_page( 'edit-comments.php' );
  95. remove_menu_page( 'link-manager.php' );
  96. //remove_menu_page( 'edit.php?post_type=donor' );
  97. //remove_menu_page( 'edit.php?post_type=funds' );
  98. //remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=post_tag');
  99. }
  100. add_action( 'admin_menu', 'boot23_remove_admin_pages', 99 );
  101. function boot23_change_menu_order( $menu_order ) {
  102. return array(
  103. 'index.php',
  104. 'separator1',
  105. 'edit.php?post_type=page',
  106. 'edit.php',
  107. 'upload.php',
  108. 'edit.php?post_type=soliloquy',
  109. 'separator2',
  110. 'edit.php?post_type=donation',
  111. 'edit.php?post_type=donor',
  112. 'edit.php?post_type=funds',
  113. 'seamless_donations_tab_main',
  114. 'separator-last',
  115. 'themes.php',
  116. 'plugins.php',
  117. 'users.php',
  118. 'tools.php'
  119. );
  120. }
  121. add_filter( 'custom_menu_order', '__return_true' );
  122. add_filter( 'menu_order', 'boot23_change_menu_order' );
  123. /*************************************************
  124. // ############ Admin footer ############## //
  125. **************************************************/
  126. add_filter('admin_footer_text', '__return_empty_string', 1000);
  127. add_filter('update_footer', '__return_empty_string', 1000);