Automattic\WooCommerce\Internal\StockNotifications\Frontend
MyAccountEndpoint::redirect_with_error
Queue an error notice and redirect back to the stock notifications endpoint.
Метод класса: MyAccountEndpoint{}
Хуков нет.
Возвращает
never.
Использование
// private - только в коде основоного (родительского) класса $result = $this->redirect_with_error( $message, $page );
- $message(строка) (обязательный)
- The error to show the customer.
- $page(int)
- 1-indexed page to return the customer to.
По умолчанию:1
Код MyAccountEndpoint::redirect_with_error() MyAccountEndpoint::redirect with error WC 11.2.2
private function redirect_with_error( string $message, int $page = 1 ) {
\wc_add_notice( esc_html( $message ), 'error' );
wp_safe_redirect( self::get_endpoint_url( $page ) );
exit;
}