Action hook 'clean_user_cache'

in WP Core File wp-includes/user.php at line 2034

View Source

clean_user_cache

Action Hook
Description
Fires immediately after the given user's cache is cleaned.

Hook Information

File Location wp-includes/user.php View on GitHub
Hook Type Action
Line Number 2034

Hook Parameters

Type Name Description
int $user_id User ID.
WP_User $user User object.

Usage Examples

Basic Usage
<?php
// Hook into clean_user_cache
add_action('clean_user_cache', 'my_custom_function', 10, 2);

function my_custom_function($user_id, $user) {
    // Your custom code here
}

Source Code Context

wp-includes/user.php:2034 - How this hook is used in WordPress core
<?php
2029  	 * @since 4.4.0
2030  	 *
2031  	 * @param int     $user_id User ID.
2032  	 * @param WP_User $user    User object.
2033  	 */
2034  	do_action( 'clean_user_cache', $user->ID, $user );
2035  }
2036  
2037  /**
2038   * Determines whether the given username exists.
2039   *

PHP Documentation

<?php
/**
	 * Fires immediately after the given user's cache is cleaned.
	 *
	 * @since 4.4.0
	 *
	 * @param int     $user_id User ID.
	 * @param WP_User $user    User object.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.