Make WordPress Core

Opened 3 years ago

Last modified 7 months ago

#58849 new enhancement

Document supported $args for register_rest_route()

Reported by: danielbachhuber's profile danielbachhuber Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: REST API Keywords: has-patch 2nd-opinion
Focuses: docs Cc:

Description

$args seems awfully sparse for how important it is:

https://github.com/WordPress/gutenberg/assets/36432/3d6f6ef2-3e15-4c0a-9bb9-9c3b4822c118

It would be nice if all of the supported values were documented.

Change History (9)

#1 @swissspidy
3 years ago

  • Focuses docs added

This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.


3 years ago

#3 @johnbillion
3 years ago

  • Keywords good-first-bug removed

I looked at documenting this recently but because the args array can take either an array of args or effectively multiple arrays of those args, I got disheartened trying to write the docs.

#4 @vishalkakadiya
9 months ago

I agreed with @johnbillion, documenting the $args parameter is complex due to its flexibility as it can accept a variety of configurations, including nested arrays for complex parameters, making it challenging to provide exhaustive documentation.

This ticket was mentioned in PR #9287 on WordPress/wordpress-develop by @vladimiraus.


7 months ago
#5

  • Keywords has-patch added; needs-patch removed
  • [ ] Added documentation for register_rest_route() parameter: $args
  • [ ] Improved documentation for register_rest_route() parameter: $route

#6 @vladimiraus
7 months ago

  • Keywords needs-testing added

Added patch. Please review.

#7 @vladimiraus
7 months ago

  • Keywords 2nd-opinion added
  • Version set to trunk

#8 @SirLouen
7 months ago

  • Keywords needs-testing removed
  • Version trunk deleted

@vladimiraus this was opened two years ago, it can't belong to trunk, plus it's an enhancement. So it doesn't need version.

Moreover, given it's a docs, it doesn't need a need-testing tag.

#9 @vladimiraus
7 months ago

Thanks @SirLouen for clarification

Note: See TracTickets for help on using tickets.