WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#13555 closed defect (bug) (fixed)

GUID and feed issues with custom post types

Reported by: nacin Owned by:
Milestone: 3.0 Priority: lowest
Severity: trivial Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

  1. With rewrite => true, all posts of a custom post type will get the same guid. Aside from being a Bad Thing, this breaks feeds in particular (looks like Safari cares deeply).
  1. With ugly permalinks, the feed won't validate. Seems to be annoyed with the underscore, or something: <link>http://localhost/commit/?post_type=manager&p=45</link>

Attachments (1)

13555.patch (391 bytes) - added by hakre 4 years ago.
MINOR: some whitespace

Download all attachments as: .zip

Change History (13)

comment:1 follow-up: beaulebens4 years ago

In your example for 2), I imagine it's unhappy about "&" which needs to be encoded in XML.

comment:2 in reply to: ↑ 1 westi4 years ago

Replying to beaulebens:

In your example for 2), I imagine it's unhappy about "&" which needs to be encoded in XML.

That would make perfect sense.

comment:3 nacin4 years ago

Yep. We've never previously had & there, even ugly links.

Currently tracking down the first issue. Looks like get_permalink() is returning just http://localhost/commit/manager/ when generating an auto-draft.

comment:4 westi4 years ago

(In [14947]) Escape the guid urls when placing them in feeds and other xml locations. See #13555.

comment:5 follow-up: wmrom4 years ago

Why can't we omit the post type altogether? using just ?p=<post_ID> in the url gives you the right page, and the post_ID is, de facto, unique.

comment:6 in reply to: ↑ 5 nacin4 years ago

Replying to wmrom:

Why can't we omit the post type altogether? using just ?p=<post_ID> in the url gives you the right page, and the post_ID is, de facto, unique.

Hrm. It doesn't on my install, though it should. There should be a canonical redirect, the same way p=2 goes to page_id=2.

comment:7 nacin4 years ago

(In [14948]) Consider 'auto-draft' a draft in get_post_permalink(). prevents custom post types from getting borked GUIDs. see #13555

comment:8 westi4 years ago

(In [14949]) Move the escaping into get_guid() so we don't have to repeat ourselves. See #13555.

comment:9 westi4 years ago

(In [14950]) Some more url escaping in feeds. See #13555.

comment:10 nacin4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14952]) Final bit of escaping in feeds. fixes #13555

hakre4 years ago

MINOR: some whitespace

comment:11 hakre4 years ago

  • Keywords has-patch added
  • Priority changed from normal to lowest
  • Resolution fixed deleted
  • Severity changed from blocker to trivial
  • Status changed from closed to reopened

MINOR: Little cleaning up behind. Reopen for that, close if you see unfit or just commit.

comment:12 nacin4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [15264]) Two birds with one stone. fixes #13902, props ocean90, wahgnube. fixes #13555, props hakre.

Note: See TracTickets for help on using tickets.