Make WordPress Core

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)

#1 @TimothyBlynJacobs
6 years ago

  • Component HTTP API → REST API
  • Focuses privacy coding-standards removed
  • Keywords close added
  • Version 5.5 → 4.4

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.

#2 @TimothyBlynJacobs
6 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed

I'm going to go ahead and close this @daniel217. Like I explained in my previous comment, I would've preferred it to have that format but I think it is too late to do so without introducing BC concerns.

Note: See TracTickets for help on using tickets.