Action hook 'set_current_user'

in WP Core File wp-includes/pluggable.php at line 48

View Source

set_current_user

Action Hook
Description
Fires after the current user is set.

Hook Information

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

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into set_current_user
add_action('set_current_user', 'my_custom_function');

function my_custom_function() {
    // Your custom code here
}

Source Code Context

wp-includes/pluggable.php:48 - How this hook is used in WordPress core
<?php
  43  		/**
  44  		 * Fires after the current user is set.
  45  		 *
  46  		 * @since 2.0.1
  47  		 */
  48  		do_action( 'set_current_user' );
  49  
  50  		return $current_user;
  51  	}
  52  endif;
  53  

PHP Documentation

<?php
/**
		 * Fires after the current user is set.
		 *
		 * @since 2.0.1
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.