WordPress at a glance

wp_logout() WP 1.0

Log the current user out.

This is a pluggable function, and it can be replaced from plugin. It means that this function is defined (works) only after all plugins are connected (included), but before this moment the function has not yet been defined... Therefore, you cannot call this and all functions depended on this function directly from a plugin code. It must be called via hook plugins_loaded or later, for example on hook init.

Function replacement (override) — in a plugin you can create a function with the same name, then it will replace this function.

Hooks from function:
Return

Nothing (null).

Usage

wp_logout();

Code of wp_logout: wp-includes/pluggable.php VER 4.9.8

<?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' );
}

Related Functions

From category: Login/Logout

No comments
    Hello, !     Log In . Register