WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Automattic\WooCommerce\Blocks\Domain\Services

ExtendRestApi::get_payment_requirements() public WC 1.0

Returns the additional payment requirements.

{} Это метод класса: ExtendRestApi{}

Хуков нет.

Возвращает

Массив. Returns a list of payment requirements.

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

$ExtendRestApi = new ExtendRestApi();
$ExtendRestApi->get_payment_requirements( $initial_requirements );
$initial_requirements(массив)
list of requirements that should be added to the collected requirements.
По умолчанию: [ foo ]

Код ExtendRestApi::get_payment_requirements() WC 5.6.0

public function get_payment_requirements( array $initial_requirements = [ 'products' ] ) {
	$requirements = $initial_requirements;
	if ( empty( $this->payment_requirements ) ) {
		return $initial_requirements;
	}

	foreach ( $this->payment_requirements as $callback ) {
		$data = [];

		try {
			$data = $callback();

			if ( ! is_array( $data ) ) {
				throw new Exception( '$data_callback must return an array.' );
			}
		} catch ( Throwable $e ) {
			$this->throw_exception( $e );
			continue;
		}
		$requirements = array_merge( $requirements, $data );
	}

	return array_unique( $requirements );
}