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

WC_Helper::_helper_auth_connect() private WC 1.0

Initiate a new OAuth connection.

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

Хуки из метода
Возвращает

Null. Ничего.

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

$result = WC_Helper::_helper_auth_connect();

Код WC_Helper::_helper_auth_connect() WC 4.5.2

woocommerce/includes/admin/helper/class-wc-helper.php
<?php
private static function _helper_auth_connect() {
	if ( empty( $_GET['wc-helper-nonce'] ) || ! wp_verify_nonce( wp_unslash( $_GET['wc-helper-nonce'] ), 'connect' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
		self::log( 'Could not verify nonce in _helper_auth_connect' );
		wp_die( 'Could not verify nonce' );
	}

	$redirect_uri = add_query_arg(
		array(
			'page'             => 'wc-addons',
			'section'          => 'helper',
			'wc-helper-return' => 1,
			'wc-helper-nonce'  => wp_create_nonce( 'connect' ),
		),
		admin_url( 'admin.php' )
	);

	$request = WC_Helper_API::post(
		'oauth/request_token',
		array(
			'body' => array(
				'home_url'     => home_url(),
				'redirect_uri' => $redirect_uri,
			),
		)
	);

	$code = wp_remote_retrieve_response_code( $request );

	if ( 200 !== $code ) {
		self::log( sprintf( 'Call to oauth/request_token returned a non-200 response code (%d)', $code ) );
		wp_die( 'Something went wrong' );
	}

	$secret = json_decode( wp_remote_retrieve_body( $request ) );
	if ( empty( $secret ) ) {
		self::log( sprintf( 'Call to oauth/request_token returned an invalid body: %s', wp_remote_retrieve_body( $request ) ) );
		wp_die( 'Something went wrong' );
	}

	/**
	 * Fires when the Helper connection process is initiated.
	 */
	do_action( 'woocommerce_helper_connect_start' );

	$connect_url = add_query_arg(
		array(
			'home_url'     => rawurlencode( home_url() ),
			'redirect_uri' => rawurlencode( $redirect_uri ),
			'secret'       => rawurlencode( $secret ),
		),
		WC_Helper_API::url( 'oauth/authorize' )
	);

	wp_redirect( esc_url_raw( $connect_url ) );
	die();
}