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

Automattic\WooCommerce\Admin\Features

Onboarding::finish_square_connect() public WC 1.0

Finishes the Square connection process by saving the correct settings.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$Onboarding = new Onboarding();
$Onboarding->finish_square_connect();

Код Onboarding::finish_square_connect() WC 4.7.1

<?php
public function finish_square_connect() {
	if (
		! Loader::is_admin_page() ||
		! isset( $_GET['square-connect-finish'] ) // phpcs:ignore CSRF ok.
	) {
		return;
	}

	if ( ! class_exists( '\WooCommerce\Square\Plugin' ) ) {
		return false;
	}

	$square = \WooCommerce\Square\Plugin::instance();

	// @todo This is a bit hacky but works. Ideally, woocommerce-square would contain a filter for us.
	add_filter( 'wp_redirect', array( $this, 'overwrite_square_redirect' ), 10, 2 );
	$square->get_connection_handler()->handle_connected();
	remove_filter( 'wp_redirect', array( $this, 'overwrite_square_redirect' ) );
}