true ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Plugin SVG + escaped labels. ?>

display_name ); ?>
user_email ); ?>

%s

', esc_attr( $class ), esc_html( $message ) ); } /** * @param array $providers Enabled provider buttons. * @param bool $password_form Whether the email form is on. */ private static function get_guest_lead_text( array $providers, bool $password_form ): string { if ( $password_form && ! empty( $providers ) ) { return __( 'Sign in with email or a social account to access courses, orders, and saved items.', '4wp-account' ); } if ( $password_form ) { return __( 'Use your email and password to access courses, orders, and saved items.', '4wp-account' ); } $names = array(); foreach ( array_keys( $providers ) as $provider_id ) { $registry = ProviderSettings::get_registry(); if ( isset( $registry[ $provider_id ]['label'] ) ) { $names[] = (string) $registry[ $provider_id ]['label']; } } if ( count( $names ) === 1 ) { return sprintf( /* translators: %s: provider name, e.g. Google */ __( 'Use your %s account to access courses, orders, and saved items.', '4wp-account' ), $names[0] ); } return __( 'Sign in with one of the enabled providers below to access courses, orders, and saved items.', '4wp-account' ); } /** * Header / nav link with icon (guest vs logged-in). * * @param array $atts Shortcode attributes. */ public static function render_nav_link( array $atts = array() ): string { $atts = shortcode_atts( array( 'label' => '', 'label_guest' => __( 'Sign in', '4wp-account' ), 'label_user' => __( 'My account', '4wp-account' ), 'class' => '', ), $atts, 'forwp_account_link' ); $url = AccountMenu::get_account_page_url(); $label = is_user_logged_in() ? ( $atts['label'] !== '' ? $atts['label'] : $atts['label_user'] ) : ( $atts['label'] !== '' ? $atts['label'] : $atts['label_guest'] ); $classes = trim( 'forwp-account-nav-link ' . $atts['class'] ); $icon = self::get_nav_icon_html(); return sprintf( '%s', esc_url( $url ), esc_attr( $classes ), $icon, esc_html( $label ) ); } /** * Inline SVG icons for menu (guest + user states). */ public static function get_nav_icon_html(): string { $guest = ''; $user = ''; return $guest . $user; } /** * Remember ?redirect_to= on the account page until OAuth completes. */ private static function persist_redirect_target_from_request(): void { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Public redirect_to query on account page. if ( ! isset( $_GET['redirect_to'] ) ) { return; } \ForWP\Account\Auth\OAuthRedirect::persist_cookie( (string) wp_unslash( $_GET['redirect_to'] ) ); } }