WordPress.org

Making WordPress.org

Opened 6 years ago

Closed 20 months ago

#233 closed enhancement (invalid)

Documenting data structures that have no class definitions

Reported by: Rarst Owned by:
Milestone: Priority: low
Component: Developer Hub Keywords:
Cc:

Description

As raised in question on WPSE http://wordpress.stackexchange.com/questions/124674/wordpress-objects-class-reference - some of the data being passed around in WordPress has pretty set and extensive formatting, but is not instance of any class and so cannot be parsed as one.

Codex sometimes (rather inconsistently) has it documented in function reference as info about returns. However there doesn't quite seem to be a set place for it in DevHub reference and long term we probably need one.

Change History (3)

#1 @Rarst
6 years ago

  • Priority changed from normal to low

This ticket was mentioned in Slack in #meta-devhub by coffee2code. View the logs.


3 years ago

#3 @coffee2code
20 months ago

  • Resolution set to invalid
  • Status changed from new to closed

This seems more a core documentation issue than one for the Code Reference.

We support a DocBlock syntax for the @return tag that allows for the description and definition of a return array or object and its elements. For example, see WP_Tax_Query::get_sql_for_query(), which returns an array with 'join' and 'where' as keys.

If the intent is to formalize things into actual data structures rather than relying on in-place documentation, then that also seems to be more of a request for core.

Documentation on the Code Reference side of things can be initially made as a user contributed note, which could warrant being added as "More Information" (aka, an explanation).

If I've misunderstood, please reopen and cite some specific examples of what you had in mind.

Note: See TracTickets for help on using tickets.