| 1 | Index: wp-includes/canonical.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-includes/canonical.php (revision 412) |
|---|
| 4 | +++ wp-includes/canonical.php (working copy) |
|---|
| 5 | @@ -92,8 +92,7 @@ |
|---|
| 6 | } |
|---|
| 7 | } |
|---|
| 8 | |
|---|
| 9 | - if ( ! $redirect_url ) |
|---|
| 10 | - $redirect_url = redirect_guess_404_permalink(); |
|---|
| 11 | + $redirect_url = apply_filters( '404_guess_permalink', $redirect_url ); |
|---|
| 12 | |
|---|
| 13 | } elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) { |
|---|
| 14 | // rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101 |
|---|
| 15 | @@ -409,6 +408,8 @@ |
|---|
| 16 | return get_permalink($post_id); |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | +add_filter( '404_guess_permalink', 'redirect_guess_404_permalink' ); |
|---|
| 20 | + |
|---|
| 21 | add_action('template_redirect', 'redirect_canonical'); |
|---|
| 22 | |
|---|
| 23 | ?> |
|---|