2
votes
wp_logout action hook is not firing
In your code, get_current_user_id() will return 0 because this hook fires after the logout has happened, ie, there is no current user ID.
If you want the $user_id to be available to your function, you ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
functions × 5710php × 1657
plugins × 524
filters × 312
theme-development × 305
custom-post-types × 297
shortcode × 295
plugin-development × 285
customization × 284
hooks × 247
posts × 241
woocommerce-offtopic × 232
child-theme × 194
ajax × 179
categories × 178
actions × 175
jquery × 167
images × 163
custom-field × 159
wp-query × 158
menus × 153
javascript × 150
themes × 146
css × 139
loop × 122