WC_Helper::_helper_auth_refresh()private staticWC 1.0

User hit the Refresh button, clear all caches.

Method of the class: WC_Helper{}

Return

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

Usage

$result = WC_Helper::_helper_auth_refresh();

WC_Helper::_helper_auth_refresh() code WC 8.3.0

private static function _helper_auth_refresh() {
	if ( empty( $_GET['wc-helper-nonce'] ) || ! wp_verify_nonce( wp_unslash( $_GET['wc-helper-nonce'] ), 'refresh' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
		self::log( 'Could not verify nonce in _helper_auth_refresh' );
		wp_die( 'Could not verify nonce' );
	}

	/**
	 * Fires when Helper subscriptions are refreshed.
	 */
	do_action( 'woocommerce_helper_subscriptions_refresh' );

	$redirect_uri = add_query_arg(
		array(
			'page'             => 'wc-addons',
			'section'          => 'helper',
			'filter'           => self::get_current_filter(),
			'wc-helper-status' => 'helper-refreshed',
		),
		admin_url( 'admin.php' )
	);

	self::_flush_authentication_cache();
	self::_flush_subscriptions_cache();
	self::_flush_updates_cache();

	wp_safe_redirect( $redirect_uri );
	die();
}