Api_Server::maybe_add_optional_params( mixed $request, mixed $params )

maybe_add_optional_params


Parameters Parameters

$request

(Required)

$params

(Required)


Top ↑

Return Return

(void)


Source Source

File: src/core/classes/class-api-server.php

	public function maybe_add_optional_params( $request, $params ) {

		$optional_params = array( 'method', 'body', 'timeout', 'redirection', 'httpversion', 'blocking', 'headers', 'cookies' );

		foreach ( $optional_params as $optional_param ) {
			if ( ! empty( $params[ $optional_param ] ) ) {
				$request[ $optional_param ] = $params[ $optional_param ];
			}
		}

		return $request;
	}