Automattic\WooCommerce\Internal\Admin\WCPayPromotion

Init::__construct()publicWC 1.0

Constructor.

Метод класса: Init{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$Init = new Init();
$Init->__construct();

Код Init::__construct() WC 9.1.2

public function __construct() {
	include_once __DIR__ . '/WCPaymentGatewayPreInstallWCPayPromotion.php';

	$is_payments_page = isset( $_GET['page'] ) && $_GET['page'] === 'wc-settings' && isset( $_GET['tab'] ) && $_GET['tab'] === 'checkout'; // phpcs:ignore WordPress.Security.NonceVerification
	if ( ! wp_is_json_request() && ! $is_payments_page ) {
		return;
	}

	add_filter( 'woocommerce_payment_gateways', array( __CLASS__, 'possibly_register_pre_install_wc_pay_promotion_gateway' ) );
	add_filter( 'option_woocommerce_gateway_order', array( __CLASS__, 'set_gateway_top_of_list' ) );
	add_filter( 'default_option_woocommerce_gateway_order', array( __CLASS__, 'set_gateway_top_of_list' ) );
	add_action( 'admin_enqueue_scripts', array( __CLASS__, 'load_payment_method_promotions' ) );
}