[wp-trac] [WordPress Trac] #34058: Proposal: wp_get_archives_object() function

WordPress Trac noreply at wordpress.org
Tue Oct 13 19:07:04 UTC 2015


#34058: Proposal: wp_get_archives_object() function
------------------------------------------+-----------------------------
 Reporter:  davetgreen                    |       Owner:
     Type:  feature request               |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  General                       |     Version:  4.3.1
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  template
------------------------------------------+-----------------------------

Comment (by boonebgorges):

 Let's take things one step at a time. A big `WP_Archive` API is probably
 overkill for such a specific application, since most (all?) of the
 business logic needed already lives in `wp_get_archives()`.

 We'll let the REST API handle the JSONification, but we can certainly
 return an array.

 Your proposal of returning a flat array with 'parent' properties makes the
 process a bit easier from our point of view, but it puts the onus of
 building a tree onto the consumer of `wp_get_archives()`. If we're going
 to go that route - rather than returning a properly structured array,
 which would have multiple layers of hierarchy - it'd be nice to see a
 proof-of-concept of how the REST API or some other client would parse and
 use the data.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34058#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list