Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_loginout [ WordPress Function ]

wp_loginout ( $redirect = '', $echo = true )
Parameters:
  • (string) $redirect Optional path to redirect to on login/logout.
  • (boolean) $echo Default to echo and not return the link.
Uses:
Defined at:



Display the Log In/Out link.

Displays a link, which allows users to navigate to the Log In page to log in or log out depending on whether they are currently logged in.

Source


<?php
function wp_loginout($redirect ''$echo true) {
    if ( ! 
is_user_logged_in() )
        
$link '<a href="' esc_urlwp_login_url($redirect) ) . '">' __('Log in') . '</a>';
    else
        
$link '<a href="' esc_urlwp_logout_url($redirect) ) . '">' __('Log out') . '</a>';

    if ( 
$echo )
        echo 
apply_filters('loginout'$link);
    else
        return 
apply_filters('loginout'$link);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics