Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions
PaymentGatewaysController::get_post_install_scripts
Get payment gateway scripts for post-install.
Method of the class: PaymentGatewaysController{}
No Hooks.
Returns
Array. Install scripts.
Usage
$result = PaymentGatewaysController::get_post_install_scripts( $gateway );
- $gateway(WC_Payment_Gateway) (required)
- Payment gateway object.
PaymentGatewaysController::get_post_install_scripts() PaymentGatewaysController::get post install scripts code WC 10.5.0
public static function get_post_install_scripts( $gateway ) {
$scripts = array();
$wp_scripts = wp_scripts();
$handles = method_exists( $gateway, 'get_post_install_script_handles' )
? $gateway->get_post_install_script_handles()
: array();
foreach ( $handles as $handle ) {
if ( isset( $wp_scripts->registered[ $handle ] ) ) {
$scripts[] = $wp_scripts->registered[ $handle ];
}
}
return $scripts;
}