Created
August 28, 2018 18:13
-
-
Save ryanshoover/685f3a81afeeaf7cdfb0a3d52a707077 to your computer and use it in GitHub Desktop.
WP Plugin - stop removing trailing slash
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 | |
/** | |
* The Bill Wizard Trailing Slash Fix | |
* | |
* @package bill-wizard-trailing-slash | |
* @author wpengine | |
* @license Proprietary | |
* | |
* @wordpress-plugin | |
* Plugin Name: The Bill Wizard Trailing Slash Fix | |
* Description: Stops WordPress from redirecting URLs away from having a trailing slash | |
* Version: 1.0 | |
* Author: wpengine | |
* Author URI: https://wpengine.com | |
* License: Proprietary | |
*/ | |
namespace BillWizardTrailingSlash; | |
add_action( | |
'template_redirect', | |
function() { | |
remove_action( 'template_redirect', 'redirect_canonical', 10 ); | |
}, | |
1 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment