Automattic\WooCommerce\Internal\Admin\Notes

CouponPageMoved::redirect_to_coupons()publicWC 1.0

Safe redirect to the coupon page to force page refresh.

Method of the class: CouponPageMoved{}

No Hooks.

Return

null. Nothing.

Usage

$CouponPageMoved = new CouponPageMoved();
$CouponPageMoved->redirect_to_coupons();

CouponPageMoved::redirect_to_coupons() code WC 7.1.0

public function redirect_to_coupons() {
	/* phpcs:disable WordPress.Security.NonceVerification */
	if (
		! isset( $_GET['page'] ) ||
		'wc-admin' !== $_GET['page'] ||
		! isset( $_GET['action'] ) ||
		'remove-coupon-menu' !== $_GET['action'] ||
		! defined( 'WC_ADMIN_PLUGIN_FILE' )
	) {
		return;
	}
	/* phpcs:enable */
	$this->display_legacy_menu( false );
	wp_safe_redirect( self::get_management_url( 'coupons' ) );
	exit;
}