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

WordPress Trac noreply at wordpress.org
Sun Jan 3 21:02:09 UTC 2016


#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 davetgreen):

 Apologies for the delay in following up!

 @boonebgorges @pathartl  I think whilst my need for an archives object
 came about as a result of working with the REST API, I don't think we
 should be specifically catering for the RAPI itself. As long as the
 resulting object can be consumed via either PHP in the theme or via the
 RAPI without '''too much''' hassle then I think we should be ok.

 So just to summarise, we're looking at creating a new function called
 something along the lines of `wp_get_archives_object` that returns an
 object containing a hierarchical array of objects containing the
 properties I mentioned earlier in the thread. The function also needs to
 have a $flat parameter that switches the output from hierarchical to flat.

 Does that sound like a decent foundation for a patch moving forward? If
 so, I'd love to give this a shot this month.

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


More information about the wp-trac mailing list