Automattic\WooCommerce\Blocks\Payments

PaymentMethodRegistry::get_all_active_payment_method_script_dependencies()publicWC 1.0

Gets an array of all registered payment method script handles, but only for active payment methods.

Method of the class: PaymentMethodRegistry{}

No Hooks.

Return

String[].

Usage

$PaymentMethodRegistry = new PaymentMethodRegistry();
$PaymentMethodRegistry->get_all_active_payment_method_script_dependencies();

PaymentMethodRegistry::get_all_active_payment_method_script_dependencies() code WC 8.7.0

public function get_all_active_payment_method_script_dependencies() {
	$script_handles  = [];
	$payment_methods = $this->get_all_active_registered();

	foreach ( $payment_methods as $payment_method ) {
		$script_handles = array_merge(
			$script_handles,
			is_admin() ? $payment_method->get_payment_method_script_handles_for_admin() : $payment_method->get_payment_method_script_handles()
		);
	}

	return array_unique( array_filter( $script_handles ) );
}