Opened 6 years ago
Closed 6 years ago
#50962 closed defect (bug) (wontfix)
WP_HTTP_Response should have protected properties
| Reported by: | daniel217 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | REST API | Version: | 4.4 |
| Severity: | trivial | Keywords: | close |
| Cc: | Focuses: | rest-api |
Description
I think this is a bug because there is a getter / setter for these properties:
$data - get_data(), set_data( $data )
$status - get_status (), set_status ( $code )
$headers - get_headers(), set_headers( $headers ), header( $key, $value, $replace )
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the ticket @daniel217 and welcome to trac!
From my perspective, I agree that it would be better for these to be protected properties. But unfortunately I don’t think it would be possible to change that at this point without breaking backward compatibility. I’ve seen plenty of plugins that do set those properties manually.
We could change it to protected and implement
__get, but I don’t think we get much benefit at that point.