Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A plugin to extend the Simple Website Redirect plugin and prevent redirects from happening on the homepage.
<?php
/*
* Plugin Name: Simple Website Redirect - Don't redirect homepage
* Plugin URI: https://gist.github.com/wpscholar/122e6132b7ff58cc67019339283ca25a
* Description: A plugin to extend the Simple Website Redirect plugin and prevent redirects from happening on the homepage.
* Version: 1.0
* Author: Micah Wood
* Author URI: https://wpscholar.com
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
add_filter( 'simple_website_redirect_should_redirect', function ( $should_redirect, $url ) {
if ( '/' === $url->path ) {
$should_redirect = false;
}
return $should_redirect;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.