WP_HTTP_Response::jsonSerialize
Retrieves the response data for JSON serialization.
It is expected that in most implementations, this will return the same as get_data(), however this may be different if you want to do custom JSON data handling.
Метод класса: WP_HTTP_Response{}
Хуков нет.
Возвращает
Разное. Any JSON-serializable value.
Использование
$WP_HTTP_Response = new WP_HTTP_Response(); $WP_HTTP_Response->jsonSerialize();
Список изменений
| С версии 4.4.0 | Введена. |
Код WP_HTTP_Response::jsonSerialize() WP HTTP Response::jsonSerialize WP 7.0.1
public function jsonSerialize() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
return $this->get_data();
}