Plugin Directory

Changeset 2384876


Ignore:
Timestamp:
09/19/2020 08:51:44 AM (6 years ago)
Author:
haukep
Message:

disable-url-autocorrect-guessing: Changed implementation to use new filter

Location:
disable-url-autocorrect-guessing/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • disable-url-autocorrect-guessing/trunk/disable-url-autocorrect-guessing.php

    r1431699 r2384876  
    33Plugin Name: Disable URL Autocorrect Guessing
    44Description: 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.1
     5Author: Hauke Pribnow
     6Version: 1.2
    77*/
    88
    9 // This code is based on a comment of nacin here: https://core.trac.wordpress.org/ticket/16557
     9// 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/
    1010
    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' );
     11add_filter( 'do_redirect_guess_404_permalink', '__return_false' );
  • disable-url-autocorrect-guessing/trunk/readme.txt

    r2296825 r2384876  
    22Contributors: haukep
    33Tags: redirect, autocorrect, url, canonical
    4 Requires at least: 2.3
    5 Tested up to: 5.4.1
    6 Stable tag: 1.1d
     4Requires at least: 5.5
     5Tested up to: 5.5
     6Stable tag: 2.0
    77License: Public Domain
    88
     
    1515to `http://www.myblog.com/project-2013` anymore.
    1616
    17 This plugin is based on a comment of nacin here: https://core.trac.wordpress.org/ticket/16557
     17This plugin is based on the example here: https://core.trac.wordpress.org/ticket/16557
    1818
    1919== Installation ==
     
    2424== Changelog ==
    2525
     26= 2.0 =
     27Since ticket https://core.trac.wordpress.org/ticket/16557 is solved now, the implementation
     28was changed to use the filter do_redirect_guess_404_permalink as provided in the example here:
     29https://make.wordpress.org/core/2020/06/26/wordpress-5-5-better-fine-grained-control-of-redirect_guess_404_permalink/
     30
    2631= 1.1 =
    2732Added check for `$_GET['p']` to allow `rel=shortlink` according to comment of user esemlabel:
Note: See TracChangeset for help on using the changeset viewer.