From 59e46cbb3e44b589f9e5e06e3b4b696a4e17d0c0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 13 Feb 2005 18:26:50 +0000 Subject: [PATCH] /archives/%post_id% permalinks break for post ids over 1000. http://mosquito.wordpress.org/view.php?id=847 git-svn-id: https://develop.svn.wordpress.org/trunk@2296 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/classes.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 034b2430ca..294ba5ee0a 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -854,8 +854,14 @@ class WP_Rewrite { } } + // Do not allow the date tags and %post_id% to overlap in the permalink + // structure. If they do, move the date tags to $front/date/. + $front = $this->front; + if ( false !== strpos($this->permalink_structure, $this->front . '%post_id%') ) + $front = $front . 'date/'; + if (empty($this->date_structure)) { - $this->date_structure = $this->front . '%year%/%monthnum%/%day%'; + $this->date_structure = $front . '%year%/%monthnum%/%day%'; } return $this->date_structure;