get_current_user_id 获取当前用户 ID

Posted in:
Update time:2020-10-27

函数描述

返回当前用户 ID,需要在 Init 或之后的 Action 中调用此函数,否则可能获取不到正确的用户 ID.

Usage

$user_ID = get_current_user_id();

return value

返回 int 类型的用户 ID,如果获取不到,返回 0。

We offer WordPress Themes and Plugins Custom Development Services

This site has long undertaken WordPress themes, plugins, WooCommerce-based store mall development business. We have 10 years of experience in WordPress development, if you want to Developing Websites with WordPress, please contact WeChat: iwillhappy1314 or email: amos@wpcio.com for inquiries.

发表回复

Your email address will not be published. 必填项已用 * 标注

*