Custom Logout

/** Custom Logout Shortcode
 */
 function custom_logout_link_func() {
            $return = wp_logout_url();?>
            <a href="<?php echo $return; ?>" class="btn btn-primary btn-xs btn-block" role="button" style="margin-bottom: 10px;">Logout</a>
            <?php
        }
         
    add_shortcode('logout_link', 'custom_logout_link_func');
/**
 *Used to redirect after logout 
 */
 
function logout_page() {
    $login_page  = home_url();
    wp_redirect( $login_page . "" );
    exit;
}
add_action('wp_logout','logout_page');

https://toolset.com/forums/topic/create-a-logout-link/

Scroll al inicio

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.