本文整理汇总了PHP中um_fetch_user函数的典型用法代码示例。如果您正苦于以下问题:PHP um_fetch_user函数的具体用法?PHP um_fetch_user怎么用?PHP um_fetch_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了um_fetch_user函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: um_get_avatar
function um_get_avatar($avatar = '', $id_or_email = '', $size = '96', $avatar_class = '', $default = '', $alt = '')
{
if (is_numeric($id_or_email)) {
$user_id = (int) $id_or_email;
} elseif (is_string($id_or_email) && ($user = get_user_by('email', $id_or_email))) {
$user_id = $user->ID;
} elseif (is_object($id_or_email) && !empty($id_or_email->user_id)) {
$user_id = (int) $id_or_email->user_id;
}
if (empty($user_id)) {
return $avatar;
}
um_fetch_user($user_id);
$avatar = um_user('profile_photo', $size);
if (!$avatar && um_get_option('use_gravatars')) {
$default = get_option('avatar_default', 'mystery');
if ($default == 'gravatar_default') {
$default = '';
}
$rating = get_option('avatar_rating');
if (!empty($rating)) {
$rating = "&r={$rating}";
}
$avatar_url = um_get_domain_protocol() . 'gravatar.com/avatar/' . um_user('synced_gravatar_hashed_id');
$avatar = '<img src="' . $avatar_url . '?d=' . $default . '&s=' . $size . $rating . '" class="func-um_get_avatar gravatar avatar avatar-' . $size . ' um-avatar" width="' . $size . '" height="' . $size . '" alt="" />';
} else {
if (empty($avatar)) {
$default_avatar_uri = um_get_default_avatar_uri();
$avatar = '<img src="' . $default_avatar_uri . '" class="gravatar avatar avatar-' . $size . ' um-avatar" width="' . $size . '" height="' . $size . '" alt="" />';
}
}
return $avatar;
}
开发者ID:CoolWP,项目名称:ultimatemember,代码行数:33,代码来源:um-filters-avatars.php
示例2: um_get_avatar
function um_get_avatar($avatar = '', $id_or_email = '', $size = '96', $avatar_class = '', $default = '', $alt = '')
{
if (is_numeric($id_or_email)) {
$user_id = (int) $id_or_email;
} elseif (is_string($id_or_email) && ($user = get_user_by('email', $id_or_email))) {
$user_id = $user->ID;
} elseif (is_object($id_or_email) && !empty($id_or_email->user_id)) {
$user_id = (int) $id_or_email->user_id;
}
if (empty($user_id)) {
return $avatar;
}
um_fetch_user($user_id);
$avatar = um_user('profile_photo', $size);
if (!um_profile('profile_photo') && um_get_option('use_gravatars')) {
if (is_ssl()) {
$protocol = 'https://';
} else {
$protocol = 'http://';
}
$default = get_option('avatar_default', 'mystery');
if ($default == 'gravatar_default') {
$default = '';
}
$rating = get_option('avatar_rating');
if (!empty($rating)) {
$rating = "&r={$rating}";
}
$avatar = '<img src="' . $protocol . 'gravatar.com/avatar/' . md5(um_user('user_email')) . '?d=' . $default . '&s=' . $size . $rating . '" class="gravatar avatar avatar-' . $size . ' um-avatar" width="' . $size . '" height="' . $size . '" alt="" />';
}
return $avatar;
}
开发者ID:BurlesonBrad,项目名称:ultimatemember,代码行数:32,代码来源:um-filters-avatars.php
示例3: um_submit_form_errors_hook_logincheck
function um_submit_form_errors_hook_logincheck($args)
{
global $ultimatemember;
// Logout if logged in
if (is_user_logged_in()) {
wp_logout();
}
$user_id = isset($ultimatemember->login->auth_id) ? $ultimatemember->login->auth_id : '';
um_fetch_user($user_id);
$status = um_user('account_status');
// account status
switch ($status) {
// If user can't login to site...
case 'inactive':
case 'awaiting_admin_review':
case 'awaiting_email_confirmation':
case 'rejected':
um_reset_user();
exit(wp_redirect(add_query_arg('err', esc_attr($status), $ultimatemember->permalinks->get_current_url())));
break;
}
if (isset($args['form_id']) && $args['form_id'] == $ultimatemember->shortcodes->core_login_form() && $ultimatemember->form->errors && !isset($_POST[$ultimatemember->honeypot])) {
exit(wp_redirect(um_get_core_page('login')));
}
}
开发者ID:lytranuit,项目名称:wordpress,代码行数:25,代码来源:um-actions-login.php
示例4: um_after_changing_user_password
function um_after_changing_user_password($user_id)
{
global $ultimatemember;
um_fetch_user($user_id);
$ultimatemember->mail->send(um_user('user_email'), 'changedpw_email');
um_reset_user();
}
开发者ID:Ksajikyan,项目名称:poiskuslug,代码行数:7,代码来源:um-actions-password.php
示例5: um_admin_user_actions_hook
function um_admin_user_actions_hook($actions)
{
$actions = null;
if (!um_user('super_admin')) {
if (um_user('account_status') == 'awaiting_admin_review') {
$actions['um_approve_membership'] = array('label' => __('Approve Membership', 'ultimatemember'));
$actions['um_reject_membership'] = array('label' => __('Reject Membership', 'ultimatemember'));
}
if (um_user('account_status') == 'rejected') {
$actions['um_approve_membership'] = array('label' => __('Approve Membership', 'ultimatemember'));
}
if (um_user('account_status') == 'approved') {
$actions['um_put_as_pending'] = array('label' => __('Put as Pending Review', 'ultimatemember'));
}
if (um_user('account_status') == 'awaiting_email_confirmation') {
$actions['um_resend_activation'] = array('label' => __('Resend Activation E-mail', 'ultimatemember'));
}
if (um_user('account_status') != 'inactive') {
$actions['um_deactivate'] = array('label' => __('Deactivate this account', 'ultimatemember'));
}
if (um_user('account_status') == 'inactive') {
$actions['um_reenable'] = array('label' => __('Reactivate this account', 'ultimatemember'));
}
if (um_current_user_can('delete', um_profile_id())) {
$actions['um_delete'] = array('label' => __('Delete this user', 'ultimatemember'));
}
}
if (current_user_can('delete_users')) {
$actions['um_switch_user'] = array('label' => __('Login as this user', 'ultimatemember'));
}
um_fetch_user(um_profile_id());
return $actions;
}
开发者ID:emaxees,项目名称:elpandecadadia,代码行数:33,代码来源:um-filters-user.php
示例6: redirect_author_page
function redirect_author_page()
{
if (um_get_option('author_redirect') && is_author()) {
$id = get_query_var('author');
um_fetch_user($id);
exit(wp_redirect(um_user_profile_url()));
}
}
开发者ID:samuelshih,项目名称:daily-gazette,代码行数:8,代码来源:um-rewrite.php
示例7: um_send_password_change_email
/**
* Overrides password changed notification
*
*/
function um_send_password_change_email($args)
{
global $ultimatemember;
um_fetch_user($user_id);
$ultimatemember->user->password_changed();
um_reset_user();
return false;
}
开发者ID:CoolWP,项目名称:ultimatemember,代码行数:12,代码来源:um-actions-password.php
示例8: check_for_querystrings
function check_for_querystrings()
{
global $ultimatemember;
if (isset($_REQUEST['message'])) {
$ultimatemember->shortcodes->message_mode = true;
}
if (isset($_REQUEST['message']) && isset($_REQUEST['uid'])) {
um_fetch_user($_REQUEST['uid']);
}
}
开发者ID:smithsa,项目名称:daily-job-hunter,代码行数:10,代码来源:um-permalinks.php
示例9: um_display_logout_form
function um_display_logout_form($args)
{
global $ultimatemember;
if (is_user_logged_in() && isset($args['mode']) && $args['mode'] == 'login') {
if (get_current_user_id() != um_user('ID')) {
um_fetch_user(get_current_user_id());
}
$args['template'] = 'logout';
}
return $args;
}
开发者ID:smithsa,项目名称:daily-job-hunter,代码行数:11,代码来源:um-filters-arguments.php
示例10: um_dynamic_user_profile_pagetitle
function um_dynamic_user_profile_pagetitle($title, $sep = '')
{
global $paged, $page, $ultimatemember;
$profile_title = um_get_option('profile_title');
if (um_is_core_page('user') && um_get_requested_user()) {
um_fetch_user(um_get_requested_user());
$profile_title = $ultimatemember->mail->convert_tags($profile_title);
$title = $profile_title;
um_reset_user();
}
return $title;
}
开发者ID:Makenrro,项目名称:repos,代码行数:12,代码来源:um-filters-profile.php
示例11: um_control_admin_bar
function um_control_admin_bar()
{
if (um_user('can_not_see_adminbar')) {
return false;
}
if (!is_admin() && !um_user('can_access_wpadmin')) {
return false;
} else {
um_fetch_user(get_current_user_id());
return true;
}
}
开发者ID:smithsa,项目名称:daily-job-hunter,代码行数:12,代码来源:um-actions-wpadmin.php
示例12: um_add_custom_message_to_menu
function um_add_custom_message_to_menu($items, $args)
{
global $ultimatemember;
// this feature required logged in user
if (!is_user_logged_in()) {
return $items;
}
um_fetch_user(get_current_user_id());
$items = $ultimatemember->shortcodes->convert_user_tags($items);
um_reset_user();
return $items;
}
开发者ID:Zurtr,项目名称:ultimatemember,代码行数:12,代码来源:um-filters-navmenu.php
示例13: listen_to_password_reset_uri
function listen_to_password_reset_uri()
{
global $ultimatemember;
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'reset_password' && isset($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 && isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
um_fetch_user($_REQUEST['user_id']);
if ($_REQUEST['hash'] != um_user('reset_pass_hash')) {
wp_die(__('This is not a valid hash, or it has expired.', 'ultimatemember'));
}
$ultimatemember->user->profile['reset_pass_hash_token'] = current_time('timestamp');
$ultimatemember->user->update_usermeta_info('reset_pass_hash_token');
$this->change_password = true;
um_reset_user();
}
}
开发者ID:smithsa,项目名称:daily-job-hunter,代码行数:14,代码来源:um-password.php
示例14: um_comment_link_to_profile
function um_comment_link_to_profile($return)
{
global $comment, $ultimatemember;
if (isset($comment->user_id) && !empty($comment->user_id)) {
if (isset($ultimatemember->user->cached_user[$comment->user_id]) && $ultimatemember->user->cached_user[$comment->user_id]) {
$return = '<a href="' . $ultimatemember->user->cached_user[$comment->user_id]['url'] . '">' . $ultimatemember->user->cached_user[$comment->user_id]['name'] . '</a>';
} else {
um_fetch_user($comment->user_id);
$ultimatemember->user->cached_user[$comment->user_id] = array('url' => um_user_profile_url(), 'name' => um_user('display_name'));
$return = '<a href="' . $ultimatemember->user->cached_user[$comment->user_id]['url'] . '">' . $ultimatemember->user->cached_user[$comment->user_id]['name'] . '</a>';
um_reset_user();
}
}
return $return;
}
开发者ID:dracudakid,项目名称:WP_TrungTamTinHoc,代码行数:15,代码来源:um-filters-commenting.php
示例15: um_remove_unused_uploads
function um_remove_unused_uploads($user_id)
{
global $ultimatemember;
um_fetch_user($user_id);
$array = $ultimatemember->user->profile;
$files = glob(um_user_uploads_dir() . '*', GLOB_BRACE);
if (file_exists(um_user_uploads_dir()) && $files && isset($array) && is_array($array)) {
foreach ($files as $file) {
$str = basename($file);
if (!strstr($str, 'profile_photo') && !strstr($str, 'cover_photo') && !strstr($str, 'stream_photo') && !preg_grep('/' . $str . '/', $array)) {
unlink($file);
}
}
}
}
开发者ID:jonfalcon,项目名称:ultimatemember,代码行数:15,代码来源:um-actions-user.php
示例16: um_after_new_user_register
function um_after_new_user_register($user_id, $args)
{
global $ultimatemember;
extract($args);
um_fetch_user($user_id);
if (!isset($args['role'])) {
$role = um_get_option('default_role');
}
$ultimatemember->user->is_secure_role($user_id, $role);
$ultimatemember->user->set_role($role);
$ultimatemember->user->set_registration_details($args['submitted']);
$ultimatemember->user->set_plain_password($args['user_password']);
do_action('um_post_registration_save', $user_id, $args);
do_action('um_post_registration_listener', $user_id, $args);
do_action('um_post_registration', $user_id, $args);
}
开发者ID:smithsa,项目名称:daily-job-hunter,代码行数:16,代码来源:um-actions-register.php
示例17: community_role_edit
/**
* Allow changing community role
*/
function community_role_edit($user)
{
global $ultimatemember;
if (current_user_can('edit_users') && current_user_can('edit_user', $user->ID)) {
um_fetch_user($user->ID);
?>
<table class="form-table">
<tbody>
<tr>
<th>
<label for="um_role"><?php
_e('Community Role', 'ultimatemember');
?>
</label>
</th>
<td>
<select name="um_role" id="um_role">
<?php
foreach ($ultimatemember->query->get_roles() as $key => $value) {
?>
<option value="<?php
echo $key;
?>
" <?php
selected(um_user('role'), $key);
?>
><?php
echo $value;
?>
</option>
<?php
}
?>
</select>
<span class="description"><?php
_e('Assign or change the community role for this user', 'ultimatemember');
?>
</span>
</td>
</tr>
</tbody>
</table>
<?php
}
}
开发者ID:CoolWP,项目名称:ultimatemember,代码行数:48,代码来源:um-user.php
示例18: um_shortcode_args_filter
function um_shortcode_args_filter($args)
{
global $ultimatemember;
if ($ultimatemember->shortcodes->message_mode == true) {
$args['template'] = 'message';
um_fetch_user($_REQUEST['uid']);
$ultimatemember->shortcodes->custom_message = um_user(um_user('status') . '_message');
um_reset_user();
}
foreach ($args as $k => $v) {
if ($ultimatemember->validation->is_serialized($args[$k])) {
if (!empty($args[$k])) {
$args[$k] = unserialize($args[$k]);
}
}
}
return $args;
}
开发者ID:Makenrro,项目名称:repos,代码行数:18,代码来源:um-filters-arguments.php
示例19: activate_account_via_email_link
function activate_account_via_email_link()
{
global $ultimatemember;
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 && isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
// valid token
$user_id = absint($_REQUEST['user_id']);
delete_option("um_cache_userdata_{$user_id}");
um_fetch_user($user_id);
if (um_user('account_status') != 'awaiting_email_confirmation') {
wp_die('The activation link you used is invalid or has expired.');
}
if ($_REQUEST['hash'] != um_user('account_secret_hash')) {
wp_die('The secret key provided does not match this one for the user.');
}
$ultimatemember->user->approve();
$redirect = um_user('url_email_activate') ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');
um_reset_user();
exit(wp_redirect($redirect));
}
}
开发者ID:Timfreaky,项目名称:ThinkTax,代码行数:20,代码来源:um-permalinks.php
示例20: um_submit_form_errors_hook_logincheck
function um_submit_form_errors_hook_logincheck($args)
{
global $ultimatemember;
// Logout if logged in
if (is_user_logged_in()) {
wp_logout();
}
$user_id = isset($ultimatemember->login->auth_id) ? $ultimatemember->login->auth_id : '';
um_fetch_user($user_id);
$status = um_user('account_status');
// account status
switch ($status) {
// If user can't login to site...
case 'inactive':
case 'awaiting_admin_review':
case 'awaiting_email_confirmation':
case 'rejected':
um_reset_user();
exit(wp_redirect(add_query_arg('err', $status, $ultimatemember->permalinks->get_current_url())));
break;
}
}
开发者ID:smithsa,项目名称:daily-job-hunter,代码行数:22,代码来源:um-actions-login.php
注:本文中的um_fetch_user函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论