Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** CUSTOM OPTIM CODE : by Christopher Simmons - REV 8.17.16 */
- // Remove jQuery Migrate Script from header and Load jQuery from Google API
- function simmonsbunny_remove_jquery_migrate_load_google_hosted_jquery() {
- if (!is_admin()) {
- wp_deregister_script('jquery');
- wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', false, null);
- wp_enqueue_script('jquery');
- }
- }
- add_action('init', 'simmonsbunny_remove_jquery_migrate_load_google_hosted_jquery');
- /** functions for headcleaner */
- function rm_generator_filter() { return ''; }
- add_filter('the_generator', 'rm_generator_filter');
- remove_action('wp_head','wlwmanifest_link');
- remove_action('wp_head','rsd_link');
- remove_action('wp_head','feed_links', 2);
- remove_action('wp_head','feed_links_extra', 3);
- remove_action('wp_head','start_post_rel_link', 10, 0);
- remove_action('wp_head','adjacent_posts_rel_link_wp_head', 10, 0);
- remove_action('wp_head','print_emoji_detection_script',7);
- remove_action('wp_print_styles','print_emoji_styles');
- function remove_cssjs_ver( $src ) {
- if( strpos( $src, '?ver=' ) )
- $src = remove_query_arg( 'ver', $src );
- return $src;
- }
- add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
- add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
- function remove_pingback_url( $output, $show ) {
- if ( $show == 'pingback_url' ) $output = '';
- return $output;
- }
- add_filter( 'bloginfo_url', 'remove_pingback_url', 10, 2 );
- /** functions for security */
- function no_errors_please(){
- return 'You appear to be up to no good. Your IP logged and will be blocked.';
- }
- add_filter( 'login_errors', 'no_errors_please' );
- function disable_reset_lost_password()
- {
- return false;
- }
- add_filter( 'allow_password_reset', 'disable_reset_lost_password');
- function remove_lost_your_password($text)
- {
- return str_replace( array('Lost your password?', 'Lost your password'), '', trim($text, '?') );
- }
- add_filter( 'gettext', 'remove_lost_your_password' );
- add_filter( 'send_email_change_email', '__return_false' );
- /** functions for admin bar */
- function mytheme_admin_bar_render() {
- global $wp_admin_bar;
- $wp_admin_bar->remove_menu('wpseo-menu');
- }
- add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
- add_filter( 'wpseo_use_page_analysis', '__return_false' );
- function my_custom_css() {
- echo '<style>
- .misc-pub-section.yoast-seo-score.content-score { display: none; }
- .misc-pub-section.yoast-seo-score.keyword-score { display: none; }
- </style>';
- }
- add_action( 'admin_head', 'my_custom_css' );
- function dequeue_yoast_css() {
- wp_dequeue_style('yoast-seo-adminbar');
- wp_deregister_style('yoast-seo-adminbar');
- }
- add_action('wp_enqueue_scripts','dequeue_yoast_css');
- /*remove embeds */
- function disable_embeds_init() {
- remove_action('rest_api_init', 'wp_oembed_register_route');
- remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);
- remove_action('wp_head', 'wp_oembed_add_discovery_links');
- remove_action('wp_head', 'wp_oembed_add_host_js');
- }
- add_action('init', 'disable_embeds_init', 9999);
- function project_dequeue_unnecessary_scripts() {
- wp_dequeue_script( 'comment-reply' );
- wp_deregister_script( 'comment-reply' );
- }
- add_action( 'wp_print_scripts', 'project_dequeue_unnecessary_scripts',100 );
- // Remove comment-reply.min.js from footer
- function chrisbunny_clean_header_hook(){
- wp_deregister_script( 'comment-reply' );
- }
- add_action('init','chrisbunny_clean_header_hook');
- /** End Christopher's magic bunny code; Copr. (c) 2013-2016 CLS */
Add Comment
Please, Sign In to add comment