W3cubDocs

/WordPress

wp_logout()

Log the current user out.

Description

Source

File: wp-includes/pluggable.php

function wp_logout() {
		wp_destroy_current_session();
		wp_clear_auth_cookie();

		/**
		 * Fires after a user is logged-out.
		 *
		 * @since 1.5.0
		 */
		do_action( 'wp_logout' );
	}

Changelog

Version Description
2.5.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_logout