本文整理汇总了PHP中WP_User::WP_User方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_User::WP_User方法的具体用法?PHP WP_User::WP_User怎么用?PHP WP_User::WP_User使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_User
的用法示例。
在下文中一共展示了WP_User::WP_User方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
function EM_Person($person_id = false, $username = false)
{
if (is_array($person_id)) {
if (array_key_exists('person_id', $person_id)) {
$person_id = $person_id['person_id'];
} elseif (array_key_exists('user_id', $person_id)) {
$person_id = $person_id['user_id'];
} else {
$person_id = $person_id['ID'];
}
} elseif (is_object($person_id) && get_class($person_id) == 'WP_User') {
$person_id = $person_id->ID;
//create new object if passed a wp_user
}
if ($username) {
parent::WP_User($person_id, $username);
} elseif (is_numeric($person_id) && $person_id == 0) {
$this->ID = 0;
$this->display_name = 'Non-Registered User';
$this->user_email = 'n/a';
} else {
parent::WP_User($person_id);
}
$this->phone = get_metadata('user', $this->ID, 'dbem_phone', true);
//extra field for EM
do_action('em_person', $this, $person_id, $username);
}