wp_logout WordPress Action Hook

The wp_logout hook is an action hook that is called when a user logs out of the site. It allows for custom code to be run when a user logs out.

do_action( 'wp_logout', int $user_id ) #

Fires after a user is logged out.


Parameters

$user_id

(int)ID of the user that was logged out.


Top ↑

More Information

The wp_logout action hook is triggered when a user logs out using the wp_logout() function. The action is executed after the wp_clear_auth_cookie() function call.


Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.5.0Added the $user_id parameter.
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More