Changeset 2384876
- Timestamp:
- 09/19/2020 08:51:44 AM (6 years ago)
- Location:
- disable-url-autocorrect-guessing/trunk
- Files:
-
- 2 edited
-
disable-url-autocorrect-guessing.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
disable-url-autocorrect-guessing/trunk/disable-url-autocorrect-guessing.php
r1431699 r2384876 3 3 Plugin Name: Disable URL Autocorrect Guessing 4 4 Description: Disables Wordpress' URL autocorrection guessing feature. If you for example enter the URL http://www.myblog.com/proj you won't be redirected to http://www.myblog.com/project-2013 anymore. 5 Author: Hauke Pribnow (based on comment of nacin)6 Version: 1. 15 Author: Hauke Pribnow 6 Version: 1.2 7 7 */ 8 8 9 // This code is based on a comment of nacin here: https://core.trac.wordpress.org/ticket/165579 // This code is based on the example here: https://make.wordpress.org/core/2020/06/26/wordpress-5-5-better-fine-grained-control-of-redirect_guess_404_permalink/ 10 10 11 function remove_redirect_guess_404_permalink( $redirect_url ) { 12 if ( is_404() && !isset($_GET['p']) ) 13 return false; 14 return $redirect_url; 15 } 16 17 add_filter( 'redirect_canonical', 'remove_redirect_guess_404_permalink' ); 11 add_filter( 'do_redirect_guess_404_permalink', '__return_false' ); -
disable-url-autocorrect-guessing/trunk/readme.txt
r2296825 r2384876 2 2 Contributors: haukep 3 3 Tags: redirect, autocorrect, url, canonical 4 Requires at least: 2.35 Tested up to: 5. 4.16 Stable tag: 1.1d4 Requires at least: 5.5 5 Tested up to: 5.5 6 Stable tag: 2.0 7 7 License: Public Domain 8 8 … … 15 15 to `http://www.myblog.com/project-2013` anymore. 16 16 17 This plugin is based on a comment of nacinhere: https://core.trac.wordpress.org/ticket/1655717 This plugin is based on the example here: https://core.trac.wordpress.org/ticket/16557 18 18 19 19 == Installation == … … 24 24 == Changelog == 25 25 26 = 2.0 = 27 Since ticket https://core.trac.wordpress.org/ticket/16557 is solved now, the implementation 28 was changed to use the filter do_redirect_guess_404_permalink as provided in the example here: 29 https://make.wordpress.org/core/2020/06/26/wordpress-5-5-better-fine-grained-control-of-redirect_guess_404_permalink/ 30 26 31 = 1.1 = 27 32 Added check for `$_GET['p']` to allow `rel=shortlink` according to comment of user esemlabel:
Note: See TracChangeset
for help on using the changeset viewer.