Yoast\WP\SEO\AI_HTTP_Request\Domain
Request::__construct
Устарела с версии 28.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.
Constructor for the Request class.
Метод класса: Request{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Request = new Request(); $Request->__construct( $action_path, $body, $headers, $http_method );
- $action_path(строка) (обязательный)
- The action path for the request.
- $body(array
) - The body of the request.
По умолчанию:[] - $headers(array
) - The headers for the request.
По умолчанию:[] - $http_method(строка)
- The HTTP method for the request. One of the METHOD_ constants.
По умолчанию:POST*
Список изменений
| Устарела с | 28.4 |
Код Request::__construct() Request:: construct Yoast 28.7
public function __construct( string $action_path, array $body = [], array $headers = [], string $http_method = self::METHOD_POST ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
if ( ! \in_array( $http_method, self::ALLOWED_METHODS, true ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- false positive.
throw new InvalidArgumentException( "Unsupported HTTP method: $http_method" );
}
$this->action_path = $action_path;
$this->body = $body;
$this->headers = $headers;
$this->http_method = $http_method;
}