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

WordPress Trac noreply at wordpress.org
Wed Oct 14 15:46:51 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 pathartl):

 From a REST API standpoint it seems kind of weird that the array would be
 built as a tree since no other endpoint does it (as far as I know). From a
 PHP theme standpoint it totally makes more sense to build it as a tree. It
 would be much easier to replicate the current `wp_get_archives()` as a
 tree.

 For this, I'm a bit torn. Introducing a new schema to the REST API doesn't
 set a great precedent, but making it harder for developers isn't too nice
 either. Maybe some type of parameter for toggling the hierarchical output?
 Maybe the endpoint in the REST API automatically flattens it for us?

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


More information about the wp-trac mailing list