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: Trash Redirect | |
Description: 301 Redirect trashed posts to the home page instead of a 404 page | |
*/ | |
add_action('template_redirect', 'trash_redirect'); | |
function trash_redirect(){ | |
if (is_404()){ | |
global $wp_query, $wpdb; |