Monday, May 16, 2016

Get Logged In user ID in WordPress

To get the currently logged in user ID in WordPress use the following code.

<?php
$current_user_id = get_current_user_id();

echo $current_user_id;
?>


$current_user_id will give you the ID of the currently logged in user.

No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...