[wp-trac] [WordPress Trac] #29621: Export post title with markup

WordPress Trac noreply at wordpress.org
Thu Sep 11 08:04:26 UTC 2014


#29621: Export post title with markup
--------------------------+-----------------------------
 Reporter:  GaryJ         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Export        |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The Theme Unit Test data includes a post
 [http://wpthemetestdata.wordpress.com/2013/01/05/markup-title-with-markup/
 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
 [https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/export
 un-skipped unit tests] in place for testing the exporter so I've not
 included any here.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29621>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list