This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! is_admin() ) { | |
add_action( 'parse_query', function( $query ) { | |
if ( $query->is_search ) { | |
unset( $_GET['s'], $_POST['s'], $_REQUEST['s'] ); | |
$query->set( 's', '' ); | |
$query->is_search = false; | |
$query->set_404(); | |
header( $_SERVER[ 'SERVER_PROTOCOL' ] . ' 404 Not Found' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'do_feed_rdf', function() { wp_redirect( home_url(), 301 ); exit; }, 1); | |
add_action( 'do_feed_rss', function() { wp_redirect( home_url(), 301 ); exit; }, 1); | |
add_action( 'do_feed_rss2', function() { wp_redirect( home_url(), 301 ); exit; }, 1); | |
add_action( 'do_feed_atom', function() { wp_redirect( home_url(), 301 ); exit; }, 1); | |
add_action( 'init', function() { | |
remove_action( 'wp_head', 'feed_links', 2 ); | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'pre_option_image_default_link_type', function() { | |
return 'none'; // 'file', 'post' or 'none' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Disable Developer Plugins | |
Description: Force disables developer plugins in production environments. | |
*/ | |
$dev_plugins = array( | |
'debug-bar/debug-bar.php', | |
'debug-bar-cron/debug-bar-cron.php', | |
'debug-bar-extender/debug-bar-extender.php', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// changes CSS and JavaScript URLs from `css/style.css?ver=1.3.3.7` to `css/style.1.3.3.7.css` | |
if ( ! is_admin() ) { | |
foreach ( array( 'style_loader_src', 'script_loader_src' ) as $filter ) { | |
add_filter( $filter, function( $url ) { | |
// abort if `$url` doesn't start with `WP_CONTENT_URL` |
NewerOlder