Automattic\WooCommerce\Blocks

BlockTypesController::redirect_to_field()publicWC 1.0

Adds a redirect field to the login form so blocks can redirect users after login.

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

Хуков нет.

Возвращает

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

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

$BlockTypesController = new BlockTypesController();
$BlockTypesController->redirect_to_field();

Код BlockTypesController::redirect_to_field() WC 8.7.0

public function redirect_to_field() {
	// phpcs:ignore WordPress.Security.NonceVerification
	if ( empty( $_GET['redirect_to'] ) ) {
		return;
	}
	echo '<input type="hidden" name="redirect" value="' . esc_attr( esc_url_raw( wp_unslash( $_GET['redirect_to'] ) ) ) . '" />'; // phpcs:ignore WordPress.Security.NonceVerification
}