'Log Out', // Default text for the logout link 'redirect' => '', // Optional redirect URL after logout 'text' => '', // Additional custom text to display before the link 'class' => 'btn-logout', // Custom CSS class for the logout link ), $atts); // Determine the redirect URL $redirect_url = ''; if (!empty($atts['redirect'])) { $redirect_url = esc_url($atts['redirect']); } // Sanitize the CSS class $class_attr = !empty($atts['class']) ? ' class="' . esc_attr($atts['class']) . '"' : ''; // Generate the logout URL $logout_url = wp_logout_url($redirect_url); // Create the logout link $logout_link = '' . esc_html($atts['text']) . ''; // Combine custom text and the logout link return esc_html($atts['custom_text']) . ' ' . $logout_link; } add_shortcode("aio_logout", "aiosc_shortcode_logout");