' . esc_html__( 'You are already logged in.', 'forumax' ) . ''; } // Extract shortcode attributes with defaults $atts = shortcode_atts( array( 'redirect' => '', 'submit_label' => esc_html__( 'Sign in', 'forumax' ), 'username_label' => esc_html__( 'Username', 'forumax' ), 'password_label' => esc_html__( 'Password', 'forumax' ), 'error_notice' => esc_html__( 'Invalid username or password. Please try again.', 'forumax' ), 'username_placeholder' => esc_attr__( 'Enter your username', 'forumax' ), 'password_placeholder' => esc_attr__( 'Enter your password', 'forumax' ), 'button_color' => '#1e73be', // Default button background color 'button_text_color' => '#ffffff', // default text color 'button_position' => 'left', // left, center, right 'signup_link' => '', // attribute for signup link ), $atts ); // Set redirect URL $redirect_url = ! empty( $atts['redirect'] ) ? $atts['redirect'] : get_permalink(); // Determine button alignment based on 'button_position' attribute $button_alignment = 'text-align: center;'; // default if ( $atts['button_position'] === 'left' ) { $button_alignment = 'text-align: left;'; } elseif ( $atts['button_position'] === 'right' ) { $button_alignment = 'text-align: right;'; } ob_start(); $form_args = array( 'redirect' => $redirect_url, 'label_username' => $atts['username_label'], 'label_password' => $atts['password_label'], 'label_remember' => esc_html__( 'Remember Me', 'forumax' ), 'label_log_in' => $atts['submit_label'], 'form_id' => 'forumax_login_form', 'remember' => true, '' ); wp_login_form($form_args); if ( ! empty( $atts['signup_link'] ) ) : ?>