[wp-trac] [WordPress Trac] #37156: Multisite: WP-generated permalink for title-less post does not work (Or: numeric post slug that matches existing post ID number generates 404 error)
WordPress Trac
noreply at wordpress.org
Thu Jun 23 00:52:01 UTC 2016
#37156: Multisite: WP-generated permalink for title-less post does not work (Or:
numeric post slug that matches existing post ID number generates 404 error)
--------------------------+-----------------------------
Reporter: raskull | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.4.3
Severity: normal | Keywords:
Focuses: multisite |
--------------------------+-----------------------------
On a Multisite installation, a permalink with a post-name structure
results in a 404 error when its slug is a number and that number matches
an existing post ID number. Example: http://myblog.com/blog/7 where a post
(any post) has an ID of 7.
When WordPress generates a slug for a title-less post, it forms the slug
using the post ID. Since the post ID is (now) in use, the default
permalink for the title-less post is broken.
It appears ticket #5305 resolved the issue for regular installs by
automatically appending -2 to the slug (http://myblog.com/blog/7-2). Can
this be done for Multisite? Or better yet, use some other more elegant
designation that doesn't imply that this is the second of two posts using
7 for the slug?
To replicate:
Use a Multisite installation.
Set permalinks to Post name structure.
Create a post without a title.
Note that the generated slug is the ID number of the post.
Save and then click on the Permalink slug below the title text field.
Arrive at 404 page.
In admin, change the slug to include a character.
Try again.
Arrive at correct page.
You can also see the same behavior by choosing any titled post in admin
and changing its slug to a number that matches its own or any other
existing ID.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37156>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list