[wp-trac] [WordPress Trac] #22435: Export API

WordPress Trac noreply at wordpress.org
Tue Nov 13 18:24:07 UTC 2012


#22435: Export API
--------------------------+------------------------------
 Reporter:  nbachiyski    |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Export        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------------------

Comment (by nbachiyski):

 Replying to [comment:5 scribu]:
 > {{{
 > categories()
 > tags()
 > custom_taxonomies_terms()
 > nav_menu_terms()
 > }}}
 >
 > What's the difference between these 4? Why not have a generic `terms(
 $taxonomy )` method?

 Because they have subtle differences. For example there is a
 {{{get_tags}}} filter, which isn't run if we just run {{{get_terms(
 'post_tag' )}}}. Also for the custom taxonomies, we need to list all the
 taxonomies.

 I don't have a strong opinion on this, though. I just didn't spend any
 time trying to combine them into one method.

 >
 > {{{
 > serve_xml( $file_name ) – outputs the necessary HTTP headers and then
 the export as XML
 > }}}
 >
 > I think this should be split out into a utility function or something.
 It's an operation that you do after the actual export.

 To me it seems totally equal to the rest of the export methods. How is it
 different?

 >
 > {{{
 > export_xml_using_writer_class( $writer_class_name, $writer_args ) –
 exports the XML data, but uses a custom writer, not one of the above
 > export_using_writer( $writer ) – if we want to use a writer, which isn't
 coupled with the XML generator,
 > }}}
 >
 > I think `export_using_writer()` should be enough.

 Sure, it makes sense.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22435#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list