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

Automattic\WooCommerce\Admin\Notes

WC_Admin_Notes_WooCommerce_Payments::install_on_action() public WC 1.0

Install & activate WooCommerce Payments plugin, and redirect to setup.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$WC_Admin_Notes_WooCommerce_Payments = new WC_Admin_Notes_WooCommerce_Payments();
$WC_Admin_Notes_WooCommerce_Payments->install_on_action();

Код WC_Admin_Notes_WooCommerce_Payments::install_on_action() WC 4.7.0

<?php
public function install_on_action() {
	// TODO: Need to validate this request more strictly since we're taking install actions directly?
	/* phpcs:disable WordPress.Security.NonceVerification */
	if (
		! isset( $_GET['page'] ) ||
		'wc-admin' !== $_GET['page'] ||
		! isset( $_GET['action'] ) ||
		'setup-woocommerce-payments' !== $_GET['action']
	) {
		return;
	}
	/* phpcs:enable */

	if ( ! current_user_can( 'install_plugins' ) ) {
		return;
	}

	$this->install_and_activate_wcpay();

	// WooCommerce Payments is installed at this point, so link straight into the onboarding flow.
	$connect_url = add_query_arg(
		array(
			'wcpay-connect' => '1',
			'_wpnonce'      => wp_create_nonce( 'wcpay-connect' ),
		),
		admin_url()
	);
	wp_safe_redirect( $connect_url );
	exit;
}