Last active
May 25, 2019 14:49
-
-
Save wpscholar/122e6132b7ff58cc67019339283ca25a to your computer and use it in GitHub Desktop.
A plugin to extend the Simple Website Redirect plugin and prevent redirects from happening on the homepage.
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: 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