Title: determine_current_user
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘determine_current_user’, int|false $user_id )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#wp--skip-link--target)

Filters the current user.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#description)󠁿

The default filters use this to determine the current user from the request’s cookies,
if available.

Returning a value of false will effectively short-circuit setting the current user.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#parameters)󠁿

 `$user_id`int|false

User ID if one has been determined, false otherwise.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#source)󠁿

    ```php
    $user_id = apply_filters( 'determine_current_user', false );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/user.php#L3786)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/user.php#L3786-L3786)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#related)󠁿

| Used by | Description | 
| [_wp_get_current_user()](https://developer.wordpress.org/reference/functions/_wp_get_current_user/)`wp-includes/user.php` |

Retrieves the current user object.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/determine_current_user/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdetermine_current_user%2F)
before being able to contribute a note or feedback.