Skip to content

Instantly share code, notes, and snippets.

@wpscholar
Last active May 25, 2019 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpscholar/122e6132b7ff58cc67019339283ca25a to your computer and use it in GitHub Desktop.
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.
<?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