Yoast\WP\SEO\AI_HTTP_Request\Domain

Request::get_bodypublicYoast 1.0

Устарела с версии 28.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Get the body of the request.

Returns null for an empty body: an empty PHP array is ambiguous once JSON-encoded ([] vs {}), so an empty body is omitted from the request entirely rather than sent as an empty array, which the AI service rejects.

Метод класса: Request{}

Хуков нет.

Возвращает

array<string>|null. The body of the request, or null when there is no body to send.

Использование

$Request = new Request();
$Request->get_body(): ?array;

Список изменений

Устарела с 28.4

Код Request::get_body() Yoast 28.5

public function get_body(): ?array {
	\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
	return ( $this->body === [] ) ? null : $this->body;
}