wp_logout_url example

'title'  => __( 'Edit Profile' ),
                'href'   => $profile_url,
            )
        );
    }

    $wp_admin_bar->add_node(
        array(
            'parent' => 'user-actions',
            'id'     => 'logout',
            'title'  => __( 'Log Out' ),
            'href'   => wp_logout_url(),
        )
    );
}

/** * Adds the "Site Name" menu. * * @since 3.3.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */
wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id )$post_id ) )
            )
        ),
        'logged_in_as'         => sprintf(
            '<p class="logged-in-as">%s%s</p>',
            sprintf(
                /* translators: 1: User name, 2: Edit user link, 3: Logout URL. */
                __( 'Logged in as %1$s. <a href="%2$s">Edit your profile</a>. <a href="%3$s">Log out?</a>' ),
                $user_identity,
                get_edit_user_link(),
                /** This filter is documented in wp-includes/link-template.php */
                wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id )$post_id ) )
            ),
            $required_text
        ),
        'comment_notes_before' => sprintf(
            '<p class="comment-notes">%s%s</p>',
            sprintf(
                '<span id="email-notes">%s</span>',
                __( 'Your email address will not be published.' )
            ),
            $required_text
        ),
        
__( 'You are attempting to log out of %s' ),
            get_bloginfo( 'name' )
        );

        $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';

        $html  = $title;
        $html .= '</p><p>';
        $html .= sprintf(
            /* translators: %s: Logout URL. */
            __( 'Do you really want to <a href="%s">log out</a>?' ),
            wp_logout_url( $redirect_to )
        );
    } else {
        $html = __( 'The link you followed has expired.' );

        if ( wp_get_referer() ) {
            $wp_http_referer = remove_query_arg( 'updated', wp_get_referer() );
            $wp_http_referer = wp_validate_redirect( esc_url_raw( $wp_http_referer ) );

            $html .= '</p><p>';
            $html .= sprintf(
                '<a href="%s">%s</a>',
                
<?php if ( ! is_admin() && ! did_action( 'wp_body_open' ) ) { ?> <a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1"><?php _e( 'Skip to toolbar' ); ?></a> <?php } ?> <div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e( 'Toolbar' ); ?>"> <?php                 foreach ( $root->children as $group ) {
                    $this->_render_group( $group );
                }
                ?> </div> <?php if ( is_user_logged_in() ) : ?> <a class="screen-reader-shortcut" href="<?php echo esc_url( wp_logout_url() ); ?>"><?php _e( 'Log Out' ); ?></a> <?php endif; ?> </div> <?php     }

    /** * @since 3.3.0 * * @param object $node */
    

function wp_loginout( $redirect = '', $display = true ) {
    if ( ! is_user_logged_in() ) {
        $link = '<a href="' . esc_url( wp_login_url( $redirect ) ) . '">' . __( 'Log in' ) . '</a>';
    } else {
        $link = '<a href="' . esc_url( wp_logout_url( $redirect ) ) . '">' . __( 'Log out' ) . '</a>';
    }

    if ( $display ) {
        /** * Filters the HTML output for the Log In/Log Out link. * * @since 1.5.0 * * @param string $link The HTML link content. */
        echo apply_filters( 'loginout', $link );
    }
Home | Imprint | This part of the site doesn't use cookies.