[wp-trac] [WordPress Trac] #5305: permalinks broken when article name is numeric

WordPress Trac noreply at wordpress.org
Fri Jan 23 03:31:21 UTC 2015


#5305: permalinks broken when article name is numeric
--------------------------------------+-----------------------
 Reporter:  thomask                   |       Owner:
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  4.2
Component:  Permalinks                |     Version:  2.3.1
 Severity:  major                     |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:
--------------------------------------+-----------------------
Changes (by valendesigns):

 * keywords:  needs-patch good-first-bug => good-first-bug has-patch


Comment:

 Replying to [comment:46 ericlewis]:
 > Let's just prepend or append the number with an abstract character
 (maybe `-`?) and avoid translations.
 >
 > Bringing it into 4.2 for consideration - needs a patch soon though.

 The problem with prepending a hyphen alone is that it's technically still
 numeric and will run a second time when saving which then prepends a
 double hyphen `--`.

 I've updated the patch to prepend the value of `$post_type` together with
 a hyphen to avoid translations. So you get something like `post-123` or
 `page-123`. As well, I've added proper documentation to the new filter.

 The one caveat is we are going to be changing slugs without any notice to
 the end user. So I created a second patch to allow this feature to be
 filtered off. That way if you want your slugs unmolested because you use a
 compatible permalink structure you're not completely without options.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/5305#comment:47>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list