本文整理汇总了PHP中um_get_default_avatar_uri函数的典型用法代码示例。如果您正苦于以下问题:PHP um_get_default_avatar_uri函数的具体用法?PHP um_get_default_avatar_uri怎么用?PHP um_get_default_avatar_uri使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了um_get_default_avatar_uri函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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_user
//.........这里部分代码省略.........
}
}
if ($op == 'sur_name') {
if (um_user('first_name') && um_user('last_name')) {
$name = um_user('last_name') . ' ' . um_user('first_name');
} else {
$name = um_profile($data);
}
}
if ($op == 'first_name') {
if (um_user('first_name')) {
$name = um_user('first_name');
} else {
$name = um_profile($data);
}
}
if ($op == 'username') {
$name = um_user('user_login');
}
if ($op == 'initial_name') {
if (um_user('first_name') && um_user('last_name')) {
$initial = um_user('last_name');
$name = um_user('first_name') . ' ' . $initial[0];
} else {
$name = um_profile($data);
}
}
if ($op == 'initial_name_f') {
if (um_user('first_name') && um_user('last_name')) {
$initial = um_user('first_name');
$name = $initial[0] . ' ' . um_user('last_name');
} else {
$name = um_profile($data);
}
}
if ($op == 'field' && um_get_option('display_name_field') != '') {
$fields = array_filter(preg_split('/[,\\s]+/', um_get_option('display_name_field')));
$name = '';
foreach ($fields as $field) {
$name .= um_profile($field) . ' ';
}
}
return apply_filters('um_user_display_name_filter', $name, um_user('ID'), $attrs == 'html' ? 1 : 0);
break;
case 'role_select':
case 'role_radio':
return $ultimatemember->user->get_role_name(um_user('role'));
break;
case 'submitted':
$array = um_profile($data);
if (empty($array)) {
return '';
}
$array = unserialize($array);
return $array;
break;
case 'password_reset_link':
return $ultimatemember->password->reset_url();
break;
case 'account_activation_link':
return $ultimatemember->permalinks->activate_url();
break;
case 'profile_photo':
$has_profile_photo = false;
if (um_profile('profile_photo')) {
$avatar_uri = um_get_avatar_uri(um_profile('profile_photo'), $attrs);
$has_profile_photo = true;
} else {
$avatar_uri = um_get_default_avatar_uri(um_user('ID'));
}
$avatar_uri = apply_filters('um_user_avatar_url_filter', $avatar_uri, um_user('ID'));
if ($avatar_uri) {
if (um_get_option('use_gravatars') && !um_user('synced_profile_photo') && !$has_profile_photo) {
$avatar_uri = um_get_domain_protocol() . 'gravatar.com/avatar/' . um_user('synced_gravatar_hashed_id');
$avatar_uri = add_query_arg('s', 400, $avatar_uri);
if (um_get_option('use_um_gravatar_default_image')) {
$avatar_uri = add_query_arg('d', um_get_default_avatar_uri(), $avatar_uri);
}
}
}
return '<img src="' . $avatar_uri . '" class="func-um_user gravatar avatar avatar-' . $attrs . ' um-avatar" width="' . $attrs . '" height="' . $attrs . '" alt="" />';
if (!$avatar_uri) {
return '';
}
break;
case 'cover_photo':
if (um_profile('cover_photo')) {
$cover_uri = um_get_cover_uri(um_profile('cover_photo'), $attrs);
} else {
$cover_uri = um_get_default_cover_uri();
}
if ($cover_uri) {
return '<img src="' . $cover_uri . '" alt="" />';
}
if (!$cover_uri) {
return '';
}
break;
}
}
开发者ID:lytranuit,项目名称:wordpress,代码行数:101,代码来源:um-short-functions.php
示例3: um_user
//.........这里部分代码省略.........
$op = um_get_option('display_name');
if ($op == 'full_name') {
if (um_user('first_name') && um_user('last_name')) {
$name = um_user('first_name') . ' ' . um_user('last_name');
} else {
$name = um_profile($data);
}
}
if ($op == 'sur_name') {
if (um_user('first_name') && um_user('last_name')) {
$name = um_user('last_name') . ', ' . um_user('first_name');
} else {
$name = um_profile($data);
}
}
if ($op == 'first_name') {
if (um_user('first_name')) {
$name = um_user('first_name');
} else {
$name = um_profile($data);
}
}
if ($op == 'username') {
$name = um_user('user_login');
}
if ($op == 'initial_name') {
if (um_user('first_name') && um_user('last_name')) {
$initial = um_user('last_name');
$name = um_user('first_name') . ' ' . $initial[0];
} else {
$name = um_profile($data);
}
}
if ($op == 'initial_name_f') {
if (um_user('first_name') && um_user('last_name')) {
$initial = um_user('first_name');
$name = $initial[0] . ' ' . um_user('last_name');
} else {
$name = um_profile($data);
}
}
if ($op == 'public_name') {
$name = um_profile($data);
}
if ($op == 'field' && um_get_option('display_name_field') != '') {
$fields = array_filter(preg_split('/[,\\s]+/', um_get_option('display_name_field')));
$name = '';
foreach ($fields as $field) {
$name .= um_profile($field) . ' ';
}
}
return apply_filters('um_user_display_name_filter', $name, um_user('ID'), $attrs == 'html' ? 1 : 0);
break;
case 'role_select':
case 'role_radio':
return $ultimatemember->user->get_role_name(um_user('role'));
break;
case 'submitted':
$array = um_profile($data);
if (empty($array)) {
return '';
}
$array = unserialize($array);
return $array;
break;
case 'password_reset_link':
return $ultimatemember->password->reset_url();
break;
case 'account_activation_link':
return $ultimatemember->permalinks->activate_url();
break;
case 'profile_photo':
if (um_profile('profile_photo')) {
$avatar_uri = um_get_avatar_uri(um_profile('profile_photo'), $attrs);
} else {
$avatar_uri = um_get_default_avatar_uri();
}
$avatar_uri = apply_filters('um_user_avatar_url_filter', $avatar_uri, um_user('ID'));
if ($avatar_uri) {
return '<img src="' . $avatar_uri . '" class="gravatar avatar avatar-' . $attrs . ' um-avatar" width="' . $attrs . '" height="' . $attrs . '" alt="" />';
}
if (!$avatar_uri) {
return '';
}
break;
case 'cover_photo':
if (um_profile('cover_photo')) {
$cover_uri = um_get_cover_uri(um_profile('cover_photo'), $attrs);
} else {
$cover_uri = um_get_default_cover_uri();
}
if ($cover_uri) {
return '<img src="' . $cover_uri . '" alt="" />';
}
if (!$cover_uri) {
return '';
}
break;
}
}
开发者ID:blogfor,项目名称:king,代码行数:101,代码来源:um-short-functions.php
示例4: um_profile_header
function um_profile_header($args)
{
global $ultimatemember;
$classes = null;
if (!$args['cover_enabled']) {
$classes .= ' no-cover';
}
$default_size = str_replace('px', '', $args['photosize']);
$overlay = '<span class="um-profile-photo-overlay">
<span class="um-profile-photo-overlay-s">
<ins>
<i class="um-faicon-camera"></i>
</ins>
</span>
</span>';
?>
<div class="um-header<?php
echo $classes;
?>
">
<?php
do_action('um_pre_header_editprofile', $args);
?>
<div class="um-profile-photo" data-user_id="<?php
echo um_profile_id();
?>
">
<a href="<?php
echo um_user_profile_url();
?>
" class="um-profile-photo-img" title="<?php
echo um_user('display_name');
?>
"><?php
echo $overlay . get_avatar(um_user('ID'), $default_size);
?>
</a>
<?php
if (!isset($ultimatemember->user->cannot_edit)) {
$ultimatemember->fields->add_hidden_field('profile_photo');
if (!um_profile('profile_photo')) {
// has profile photo
$items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Upload photo', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Cancel', 'ultimatemember') . '</a>');
$items = apply_filters('um_user_photo_menu_view', $items);
echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
} else {
if ($ultimatemember->fields->editing == true) {
$items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Change photo', 'ultimatemember') . '</a>', '<a href="#" class="um-reset-profile-photo" data-user_id="' . um_profile_id() . '" data-default_src="' . um_get_default_avatar_uri() . '">' . __('Remove photo', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Cancel', 'ultimatemember') . '</a>');
$items = apply_filters('um_user_photo_menu_edit', $items);
echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
}
}
}
?>
</div>
<div class="um-profile-meta">
<div class="um-main-meta">
<?php
if ($args['show_name']) {
?>
<div class="um-name">
<a href="<?php
echo um_user_profile_url();
?>
" title="<?php
echo um_user('display_name');
?>
"><?php
echo um_user('display_name', 'html');
?>
</a>
<?php
do_action('um_after_profile_name_inline', $args);
?>
</div>
<?php
}
?>
<div class="um-clear"></div>
<?php
do_action('um_after_profile_header_name_args', $args);
?>
<?php
do_action('um_after_profile_header_name');
?>
//.........这里部分代码省略.........
开发者ID:TeamSubjectMatter,项目名称:juddfoundation,代码行数:101,代码来源:um-actions-profile.php
示例5: um_profile_header
function um_profile_header($args)
{
global $ultimatemember;
$classes = null;
if (!$args['cover_enabled']) {
$classes .= ' no-cover';
}
$default_size = str_replace('px', '', $args['photosize']);
$overlay = '<span class="um-profile-photo-overlay">
<span class="um-profile-photo-overlay-s">
<ins>
<i class="um-faicon-camera"></i>
</ins>
</span>
</span>';
?>
<div class="um-header<?php
echo $classes;
?>
">
<?php
do_action('um_pre_header_editprofile', $args);
?>
<div class="um-profile-photo" data-user_id="<?php
echo um_profile_id();
?>
">
<a href="<?php
echo um_user_profile_url();
?>
" class="um-profile-photo-img" title="<?php
echo um_user('display_name');
?>
"><?php
echo $overlay . get_avatar(um_user('ID'), $default_size);
?>
</a>
<?php
if (!isset($ultimatemember->user->cannot_edit)) {
$ultimatemember->fields->add_hidden_field('profile_photo');
if (!um_profile('profile_photo')) {
// has profile photo
$items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Загрузить фото', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Отменить', 'ultimatemember') . '</a>');
echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
} else {
if ($ultimatemember->fields->editing == true) {
$items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Изменить фотографию', 'ultimatemember') . '</a>', '<a href="#" class="um-reset-profile-photo" data-user_id="' . um_profile_id() . '" data-default_src="' . um_get_default_avatar_uri() . '">' . __('Удалить фото', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Отменить', 'ultimatemember') . '</a>');
echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
}
}
}
?>
</div>
<div class="um-profile-meta">
<div class="um-main-meta">
<?php
if ($args['show_name']) {
?>
<div class="um-name">
<a href="<?php
echo um_user_profile_url();
?>
" title="<?php
echo um_user('display_name');
?>
"><?php
echo um_user('display_name', 'html');
?>
</a>
<?php
do_action('um_after_profile_name_inline', $args);
?>
</div>
<?php
}
?>
<div class="um-clear"></div>
<?php
do_action('um_after_profile_header_name_args', $args);
?>
<?php
do_action('um_after_profile_header_name');
?>
</div>
//.........这里部分代码省略.........
开发者ID:Ksajikyan,项目名称:poiskuslug,代码行数:101,代码来源:um-actions-profile.php
示例6: custom_um_profile_header
function custom_um_profile_header($args)
{
global $ultimatemember;
$user_id = get_current_user_id();
$userrole = get_user_meta($user_id, 'role', true);
$classes = null;
if (!$args['cover_enabled']) {
$classes .= ' no-cover';
}
$default_size = str_replace('px', '', $args['photosize']);
$overlay = '<span class="um-profile-photo-overlay">
<span class="um-profile-photo-overlay-s">
<ins>
<i class="um-faicon-camera"></i>
</ins>
</span>
</span>';
?>
<div class="um-header<?php
echo $classes;
?>
">
<?php
do_action('um_pre_header_editprofile', $args);
?>
<div class="um-profile-photo" data-user_id="<?php
echo um_profile_id();
?>
">
<a href="<?php
echo um_user_profile_url();
?>
" class="um-profile-photo-img" title="<?php
echo um_user('display_name');
?>
"><?php
echo $overlay . get_avatar(um_user('ID'), $default_size);
?>
</a>
<?php
if (!isset($ultimatemember->user->cannot_edit)) {
$ultimatemember->fields->add_hidden_field('profile_photo');
if (!um_profile('profile_photo')) {
// has profile photo
$items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Upload photo', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Cancel', 'ultimatemember') . '</a>');
echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
} else {
if ($ultimatemember->fields->editing == true) {
$items = array('<a href="#" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __('Change photo', 'ultimatemember') . '</a>', '<a href="#" class="um-reset-profile-photo" data-user_id="' . um_profile_id() . '" data-default_src="' . um_get_default_avatar_uri() . '">' . __('Remove photo', 'ultimatemember') . '</a>', '<a href="#" class="um-dropdown-hide">' . __('Cancel', 'ultimatemember') . '</a>');
echo $ultimatemember->menu->new_ui('bc', 'div.um-profile-photo', 'click', $items);
}
}
}
?>
</div>
<div class="um-profile-meta">
<div class="um-main-meta">
<?php
if ($args['show_name']) {
?>
<div class="um-name">
<a href="<?php
echo um_user_profile_url();
?>
" title="<?php
echo um_user('display_name');
?>
"><?php
echo um_user('display_name');
?>
</a>
<?php
do_action('um_after_profile_name_inline', $args);
?>
<?php
if ($ultimatemember->fields->editing == true) {
?>
<?php
if ($userrole == 'advisee') {
?>
<a href="javascript:void(0);" class="hb-button" id="um-upgrade">Upgrade to become an Advisor</a>
<?php
}
?>
<?php
}
?>
</div>
//.........这里部分代码省略.........
开发者ID:KKRTEAM,项目名称:cis_admq,代码行数:101,代码来源:functions.php
注:本文中的um_get_default_avatar_uri函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论