Opened 6 years ago
Closed 5 years ago
#45169 closed defect (bug) (fixed)
Clarify the discrepancy between the default $scheme values in rest_url() and get_rest_url()
Reported by: | DrewAPicture | Owned by: | kadamwhite |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | REST API | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
As pointed out by a user on the code reference, rest_url()
and get_rest_url()
both define different defaults for the $scheme
parameters. rest_url()
defaults to 'json', and get_rest_url()
to 'rest', respectively.
It would be good to provide notices in both DocBlocks explaining the discrepancy.
Attachments (1)
Change History (9)
This ticket was mentioned in Slack in #core-restapi by timothybjacobs. View the logs.
5 years ago
This ticket was mentioned in Slack in #core-restapi by timothybjacobs. View the logs.
5 years ago
This ticket was mentioned in Slack in #core-restapi by kadamwhite. View the logs.
5 years ago
#5
@
5 years ago
- Keywords has-patch added; needs-patch removed
- Owner set to kadamwhite
- Status changed from new to accepted
Update on the previous update: after further investigation it turns out this occurrence of json
was missed in #34300, and rest
is the "correct" term. Some digging through the plugin directory did not immediately highlight anywhere this would introduce backwards compatibility issues, so I'm uploading a patch which changes the 'json'
string to 'rest'
.
Update on out-of-band discussion: @rmccue has advocated we standardize on
json
asrest_url
is called in more places. This would make this a functional change in addition to a docs change; while this has a small chance of introducing breaking behavior if somebody is hooking into filters and expecting the other value, our existing inconsistency makes it unlikely this is being used many places. I'll attempt to validate that to make sure we're not ignoring a real potential concern.