How to get admin user ID

Share This Post

How to get admin User ID?

It’s been really difficult for many to get back the admin user ID but it’s so simple because this code snippet will help to get it to the way you are waiting for.

Let’s check how it is working…

				
					/** 
  * Return admin user id
  * 
  * @return int
  */
public function get_admin_user_id() {
	$admin_email = get_option('admin_email');
    $admin_user = get_user_by( 'email', $admin_email );
    return $admin_user->ID;
}
				
			

Conclusion

So, All you need to add this code snippet to your theme functions.php file to know admin user ID easily. Enjoy!

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

How to get admin user ID

Share This Post How to get admin User ID? It’s been really difficult for many to get back the admin user ID but it’s so

Award GamiPress on RCPro Membership Renewal

Share This Post Award GamiPress on RCPro Membership Renewal Do you think users can also be awarded points/badges/ranks while RCPro Membership renewal? Yes, you can

Custom Message with myCRED Transfer

Share This Post Custom Message with myCRED Transfer MyCred assigns different points to the users but it’s been sometime noticed that the users want to

Want To Know About Our Services?

small_c_popup-300x296

Let’s Talk To Us With Your Concerns

    Once you send the details, we will be shortly back to you. Thanks!

    small_c_popup-300x296

    Become a valuable part of Team LDninjas

    small_c_popup-300x296

    Be updated with new release by LDninjas!