Make WordPress Core

Opened 10 years ago

Last modified 5 years ago

#29621 new defect (bug)

Export post title with markup

Reported by: garyj's profile GaryJ Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Export Keywords: has-patch
Focuses: Cc:

Description

The Theme Unit Test data includes a post Title With Markup. However, the current exporter filters the post titles with the_title_rss, which has strip_tags hooked to it, so it always needs fixing up after importing.

The content and excerpt blocks of the export are uniquely filtered with the_content_export and the_excerpt_export, and not the_content_rss and the_excerpt_rss.

Attached is a patch which changes the exporter from using the_title_rss to a new the_title_export filter, and wraps the output in CDATA tags, as per content and export blocks.

Advantages:

  • Unique filter for handling post titles during export.
  • Fixes stripped tags issue.
  • Filter name that is consistent with other filters in that context.
  • Use of wxr_cdata() for consistency with other blocks of output in that context.

Disadvantage:

  • Backwards-incompatibility - applying a filter to the_title_rss thinking it would also apply to exports would no longer work.

There are no un-skipped unit tests in place for testing the exporter so I've not included any here.

Attachments (2)

29621.diff (977 bytes) - added by GaryJ 10 years ago.
Change exporter from the_title_rss filter to the_title_export
29621.2.diff (1.0 KB) - added by GaryJ 10 years ago.
Messy but more backwards-compatible solution

Download all attachments as: .zip

Change History (4)

@GaryJ
10 years ago

Change exporter from the_title_rss filter to the_title_export

@GaryJ
10 years ago

Messy but more backwards-compatible solution

#1 @GaryJ
10 years ago

  • Keywords has-patch added

A messier but more backwards-compatible solution would be to unattach strip_tags, ent2ncr and esc_html from the_title_rss, and attach a call to wxr_cdata(), echo it, then optionally unattach it again afterwards.

Patch attached.

#2 @stevenkword
9 years ago

This directly relates to #9993 in the Feeds component and I think we are leaning towards removing the filter as well.

Last edited 9 years ago by stevenkword (previous) (diff)
Note: See TracTickets for help on using tickets.