WC_Shortcode_My_Account::my_account_add_notices()
Add notices to the my account page.
Historically a filter has existed to render a message above the my account page content while the user is logged out. See woocommerce_my_account_message.
Метод класса: WC_Shortcode_My_Account{}
Хуки из метода
Возвращает
null
. Ничего (null).
Использование
$result = WC_Shortcode_My_Account::my_account_add_notices();
Код WC_Shortcode_My_Account::my_account_add_notices() WC Shortcode My Account::my account add notices WC 9.6.1
private static function my_account_add_notices() { global $wp; if ( ! is_user_logged_in() ) { /** * Filters the message shown on the 'my account' page when the user is not logged in. * * @since 2.6.0 */ $message = apply_filters( 'woocommerce_my_account_message', '' ); if ( ! empty( $message ) ) { wc_add_notice( $message ); } } // After password reset, add confirmation message. if ( ! empty( $_GET['password-reset'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended wc_add_notice( __( 'Your password has been reset successfully.', 'woocommerce' ) ); } // After logging out without a nonce, add confirmation message. if ( isset( $wp->query_vars['customer-logout'] ) && is_user_logged_in() ) { /* translators: %s: logout url */ wc_add_notice( sprintf( __( 'Are you sure you want to log out? <a href="%s">Confirm and log out</a>', 'woocommerce' ), wc_logout_url() ) ); } }