Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in"; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915 andand i cannot find what is at fault

but redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The logout link below works very well (no warnings) but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in"; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915 and i cannot find what is at fault

but redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The logout link below works very well (no warnings) but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in"; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915

and i cannot find what is at fault

but redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The logout link below works very well (no warnings) but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

deleted 2 characters in body
Source Link

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in">';in"; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915 and i cannot find what is aatat fault

andbut redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The logout link below works very well (no warnings) but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in">'; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915 and i cannot find what is aat fault

and redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The link below works very well but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in"; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915 and i cannot find what is at fault

but redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The logout link below works very well (no warnings) but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

added 36 characters in body
Source Link

I have added customecustom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in">'; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915 and i cannot find what is aat fault

and redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The link below works very well but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

I have added custome page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in">'; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915

and redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The link below works very well but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired

function render_logout() {
    if ( is_user_logged_in() ){
         wp_logout();
    } else {
        echo "You are not logged-in">'; 
    }
}

the logout works but generates a lot of warnigns of

Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915 and i cannot find what is aat fault

and redirect after logout does not work

    public function redirect_after_logout() {
    $redirect_url = home_url( 'member-login' );
    wp_redirect( $redirect_url );
    exit;
}
add_action( 'wp_logout', 'redirect_after_logout' );

The link below works very well but this is not loaded automaticly.

<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Logout</a>

Any idea how to run this link using wp_redirect or something similar?

Source Link
Loading