mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Version 1.0.25
This commit is contained in:
@@ -1,29 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Mobile Detect Library
|
||||
* =====================
|
||||
*
|
||||
* Motto: "Every business should have a mobile detection script to detect mobile readers"
|
||||
*
|
||||
* Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets).
|
||||
* It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
|
||||
*
|
||||
* @author Current authors: Serban Ghita <serbanghita@gmail.com>
|
||||
* Nick Ilyin <nick.ilyin@gmail.com>
|
||||
*
|
||||
* Original author: Victor Stanciu <vic.stanciu@gmail.com>
|
||||
*
|
||||
* @license Code and contributions have 'MIT License'
|
||||
* More details: https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt
|
||||
*
|
||||
* @link Homepage: http://mobiledetect.net
|
||||
* GitHub Repo: https://github.com/serbanghita/Mobile-Detect
|
||||
* Google Code: http://code.google.com/p/php-mobile-detect/
|
||||
* README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md
|
||||
* HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
|
||||
*
|
||||
* @version 2.8.11
|
||||
*/
|
||||
|
||||
if ( !class_exists('Mobile_Detect') ) {
|
||||
|
||||
class Mobile_Detect
|
||||
{
|
||||
@@ -1339,3 +1316,5 @@ class Mobile_Detect
|
||||
return self::MOBILE_GRADE_C;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,19 +61,34 @@
|
||||
|
||||
$post_id = get_option('woocommerce_shop_page_id');
|
||||
|
||||
} else if ( is_archive() ) {
|
||||
|
||||
return;
|
||||
|
||||
} else {
|
||||
|
||||
if ( !get_post_type() || !isset($post->ID) ) return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( !isset( $post_id ) )
|
||||
$post_id = $post->ID;
|
||||
|
||||
$args = $ultimatemember->access->get_meta( $post_id );
|
||||
extract($args);
|
||||
|
||||
if ( !isset( $args['custom_access_settings'] ) || $args['custom_access_settings'] == 0 ) return;
|
||||
if ( !isset( $args['custom_access_settings'] ) || $args['custom_access_settings'] == 0 ) {
|
||||
|
||||
$post_id = apply_filters('um_access_control_for_parent_posts', $post_id );
|
||||
|
||||
$args = $ultimatemember->access->get_meta( $post_id );
|
||||
extract($args);
|
||||
|
||||
if ( !isset( $args['custom_access_settings'] ) || $args['custom_access_settings'] == 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$redirect_to = null;
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
}
|
||||
|
||||
if ( !$ultimatemember->validation->strong_pass( $_POST['user_password'] ) ) {
|
||||
$ultimatemember->form->add_error('user_password', 'Your password must contain at least one capital letter and one number');
|
||||
$ultimatemember->form->add_error('user_password', __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') );
|
||||
$ultimatemember->account->current_tab = 'password';
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
|
||||
<div class="um-account-meta radius-<?php echo um_get_option('profile_photocorner'); ?> uimob340-show uimob500-show">
|
||||
|
||||
<div class="um-account-meta-img"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('profile_photo', 120); ?></a></div>
|
||||
<div class="um-account-meta-img"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), 120); ?></a></div>
|
||||
|
||||
<div class="um-account-name"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('display_name'); ?></a></div>
|
||||
|
||||
@@ -250,15 +250,15 @@
|
||||
|
||||
<div class="um-account-meta radius-<?php echo um_get_option('profile_photocorner'); ?>">
|
||||
|
||||
<div class="um-account-meta-img uimob800-hide"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('profile_photo', 120); ?></a></div>
|
||||
<div class="um-account-meta-img uimob800-hide"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), 120); ?></a></div>
|
||||
|
||||
<?php if ( $ultimatemember->mobile->isMobile() ) { ?>
|
||||
|
||||
<div class="um-account-meta-img-b uimob800-show" title="<?php echo um_user('display_name'); ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('profile_photo', 120); ?></a></div>
|
||||
<div class="um-account-meta-img-b uimob800-show" title="<?php echo um_user('display_name'); ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), 120); ?></a></div>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="um-account-meta-img-b uimob800-show um-tip-w" title="<?php echo um_user('display_name'); ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('profile_photo', 120); ?></a></div>
|
||||
<div class="um-account-meta-img-b uimob800-show um-tip-w" title="<?php echo um_user('display_name'); ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), 120); ?></a></div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
|
||||
if ( isset( $array['force_good_pass'] ) && $array['force_good_pass'] == 1 ) {
|
||||
if ( !$ultimatemember->validation->strong_pass( $args[$key] ) ) {
|
||||
$ultimatemember->form->add_error($key, __('Your password must contain at least one capital letter and one number') );
|
||||
$ultimatemember->form->add_error($key, __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
$default_size = str_replace( 'px', '', um_get_option('profile_photosize') );
|
||||
$corner = um_get_option('profile_photocorner');
|
||||
?>
|
||||
<div class="um-member-photo radius-<?php echo $corner; ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo um_user('profile_photo', $default_size ); ?></a></div>
|
||||
<div class="um-member-photo radius-<?php echo $corner; ?>"><a href="<?php echo um_user_profile_url(); ?>"><?php echo get_avatar( um_user('ID'), $default_size ); ?></a></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-member-card <?php if (!$profile_photo) { echo 'no-photo'; } ?>">
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
}
|
||||
|
||||
if ( !$ultimatemember->validation->strong_pass( $args['user_password'] ) ) {
|
||||
$ultimatemember->form->add_error('user_password', 'Your password must contain at least one capital letter and one number');
|
||||
$ultimatemember->form->add_error('user_password', __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') );
|
||||
}
|
||||
|
||||
if ( !$args['confirm_user_password'] ) {
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
<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"><?php echo $overlay . um_user('profile_photo', $default_size ); ?></a>
|
||||
<a href="<?php echo um_user_profile_url(); ?>" class="um-profile-photo-img"><?php echo $overlay . get_avatar( um_user('ID'), $default_size ); ?></a>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+68
-68
@@ -442,10 +442,10 @@ class UM_Builtin {
|
||||
$this->predefined_fields = array(
|
||||
|
||||
'user_login' => array(
|
||||
'title' => 'Username',
|
||||
'title' => __('Username','ultimatemember'),
|
||||
'metakey' => 'user_login',
|
||||
'type' => 'text',
|
||||
'label' => 'Username',
|
||||
'label' => __('Username','ultimatemember'),
|
||||
'required' => 1,
|
||||
'public' => 1,
|
||||
'editable' => 0,
|
||||
@@ -455,10 +455,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'username' => array(
|
||||
'title' => 'Username or E-mail',
|
||||
'title' => __('Username or E-mail','ultimatemember'),
|
||||
'metakey' => 'username',
|
||||
'type' => 'text',
|
||||
'label' => 'Username or E-mail',
|
||||
'label' => __('Username or E-mail','ultimatemember'),
|
||||
'required' => 1,
|
||||
'public' => 1,
|
||||
'editable' => 0,
|
||||
@@ -466,10 +466,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'user_password' => array(
|
||||
'title' => 'Password',
|
||||
'title' => __('Password','ultimatemember'),
|
||||
'metakey' => 'user_password',
|
||||
'type' => 'password',
|
||||
'label' => 'Password',
|
||||
'label' => __('Password','ultimatemember'),
|
||||
'required' => 1,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -480,40 +480,40 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'first_name' => array(
|
||||
'title' => 'First Name',
|
||||
'title' => __('First Name','ultimatemember'),
|
||||
'metakey' => 'first_name',
|
||||
'type' => 'text',
|
||||
'label' => 'First Name',
|
||||
'label' => __('First Name','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
),
|
||||
|
||||
'last_name' => array(
|
||||
'title' => 'Last Name',
|
||||
'title' => __('Last Name','ultimatemember'),
|
||||
'metakey' => 'last_name',
|
||||
'type' => 'text',
|
||||
'label' => 'Last Name',
|
||||
'label' => __('Last Name','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
),
|
||||
|
||||
'display_name' => array(
|
||||
'title' => 'Display Name',
|
||||
'title' => __('Display Name','ultimatemember'),
|
||||
'metakey' => 'display_name',
|
||||
'type' => 'text',
|
||||
'label' => 'Display Name',
|
||||
'label' => __('Display Name','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
),
|
||||
|
||||
'user_email' => array(
|
||||
'title' => 'E-mail Address',
|
||||
'title' => __('E-mail Address','ultimatemember'),
|
||||
'metakey' => 'user_email',
|
||||
'type' => 'text',
|
||||
'label' => 'E-mail Address',
|
||||
'label' => __('E-mail Address','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -521,10 +521,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'description' => array(
|
||||
'title' => 'Biography',
|
||||
'title' => __('Biography','ultimatemember'),
|
||||
'metakey' => 'description',
|
||||
'type' => 'textarea',
|
||||
'label' => 'Biography',
|
||||
'label' => __('Biography','ultimatemember'),
|
||||
'html' => 0,
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
@@ -534,10 +534,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'birth_date' => array(
|
||||
'title' => 'Birth Date',
|
||||
'title' => __('Birth Date','ultimatemember'),
|
||||
'metakey' => 'birth_date',
|
||||
'type' => 'date',
|
||||
'label' => 'Birth Date',
|
||||
'label' => __('Birth Date','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -548,10 +548,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'gender' => array(
|
||||
'title' => 'Gender',
|
||||
'title' => __('Gender','ultimatemember'),
|
||||
'metakey' => 'gender',
|
||||
'type' => 'radio',
|
||||
'label' => 'Gender',
|
||||
'label' => __('Gender','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -559,10 +559,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'country' => array(
|
||||
'title' => 'Countries',
|
||||
'title' => __('Countries','ultimatemember'),
|
||||
'metakey' => 'country',
|
||||
'type' => 'select',
|
||||
'label' => 'Country',
|
||||
'label' => __('Country','ultimatemember'),
|
||||
'placeholder' => 'Choose a Country',
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
@@ -571,10 +571,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'facebook' => array(
|
||||
'title' => 'Facebook',
|
||||
'title' => __('Facebook','ultimatemember'),
|
||||
'metakey' => 'facebook',
|
||||
'type' => 'url',
|
||||
'label' => 'Facebook',
|
||||
'label' => __('Facebook','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -589,10 +589,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'twitter' => array(
|
||||
'title' => 'Twitter',
|
||||
'title' => __('Twitter','ultimatemember'),
|
||||
'metakey' => 'twitter',
|
||||
'type' => 'url',
|
||||
'label' => 'Twitter',
|
||||
'label' => __('Twitter','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -607,10 +607,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'linkedin' => array(
|
||||
'title' => 'LinkedIn',
|
||||
'title' => __('LinkedIn','ultimatemember'),
|
||||
'metakey' => 'linkedin',
|
||||
'type' => 'url',
|
||||
'label' => 'LinkedIn',
|
||||
'label' => __('LinkedIn','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -625,10 +625,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'googleplus' => array(
|
||||
'title' => 'Google+',
|
||||
'title' => __('Google+','ultimatemember'),
|
||||
'metakey' => 'googleplus',
|
||||
'type' => 'url',
|
||||
'label' => 'Google+',
|
||||
'label' => __('Google+','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -643,10 +643,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'instagram' => array(
|
||||
'title' => 'Instagram',
|
||||
'title' => __('Instagram','ultimatemember'),
|
||||
'metakey' => 'instagram',
|
||||
'type' => 'url',
|
||||
'label' => 'Instagram',
|
||||
'label' => __('Instagram','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -661,10 +661,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'skype' => array(
|
||||
'title' => 'Skype ID',
|
||||
'title' => __('Skype ID','ultimatemember'),
|
||||
'metakey' => 'skype',
|
||||
'type' => 'url',
|
||||
'label' => 'Skype ID',
|
||||
'label' => __('Skype ID','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -676,10 +676,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'role_select' => array(
|
||||
'title' => 'Roles (Dropdown)',
|
||||
'title' => __('Roles (Dropdown)','ultimatemember'),
|
||||
'metakey' => 'role_select',
|
||||
'type' => 'select',
|
||||
'label' => 'Account Type',
|
||||
'label' => __('Account Type','ultimatemember'),
|
||||
'placeholder' => 'Choose account type',
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
@@ -688,10 +688,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'role_radio' => array(
|
||||
'title' => 'Roles (Radio)',
|
||||
'title' => __('Roles (Radio)','ultimatemember'),
|
||||
'metakey' => 'role_radio',
|
||||
'type' => 'radio',
|
||||
'label' => 'Account Type',
|
||||
'label' => __('Account Type','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -699,11 +699,11 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'languages' => array(
|
||||
'title' => 'Languages',
|
||||
'title' => __('Languages','ultimatemember'),
|
||||
'metakey' => 'languages',
|
||||
'type' => 'multiselect',
|
||||
'label' => 'Languages Spoken',
|
||||
'placeholder' => 'Select languages',
|
||||
'label' => __('Languages Spoken','ultimatemember'),
|
||||
'placeholder' => __('Select languages','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -711,10 +711,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'phone_number' => array(
|
||||
'title' => 'Phone Number',
|
||||
'title' => __('Phone Number','ultimatemember'),
|
||||
'metakey' => 'phone_number',
|
||||
'type' => 'text',
|
||||
'label' => 'Phone Number',
|
||||
'label' => __('Phone Number','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -723,10 +723,10 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'mobile_number' => array(
|
||||
'title' => 'Mobile Number',
|
||||
'title' => __('Mobile Number','ultimatemember'),
|
||||
'metakey' => 'mobile_number',
|
||||
'type' => 'text',
|
||||
'label' => 'Mobile Number',
|
||||
'label' => __('Mobile Number','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
@@ -737,11 +737,11 @@ class UM_Builtin {
|
||||
// private use ( not public list )
|
||||
|
||||
'profile_photo' => array(
|
||||
'title' => 'Profile Photo',
|
||||
'title' => __('Profile Photo','ultimatemember'),
|
||||
'metakey' => 'profile_photo',
|
||||
'type' => 'image',
|
||||
'label' => 'Change your profile photo',
|
||||
'upload_text' => 'Upload your photo here',
|
||||
'label' => __('Change your profile photo','ultimatemember'),
|
||||
'upload_text' => __('Upload your photo here','ultimatemember'),
|
||||
'icon' => 'um-faicon-camera',
|
||||
'crop' => 1,
|
||||
'min_width' => str_replace('px','',um_get_option('profile_photosize')),
|
||||
@@ -750,11 +750,11 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'cover_photo' => array(
|
||||
'title' => 'Cover Photo',
|
||||
'title' => __('Cover Photo','ultimatemember'),
|
||||
'metakey' => 'cover_photo',
|
||||
'type' => 'image',
|
||||
'label' => 'Change your cover photo',
|
||||
'upload_text' => 'Upload profile cover here',
|
||||
'label' => __('Change your cover photo','ultimatemember'),
|
||||
'upload_text' => __('Upload profile cover here','ultimatemember'),
|
||||
'icon' => 'um-faicon-picture-o',
|
||||
'crop' => 2,
|
||||
'modal_size' => 'large',
|
||||
@@ -764,14 +764,14 @@ class UM_Builtin {
|
||||
),
|
||||
|
||||
'password_reset_text' => array(
|
||||
'title' => 'Password Reset',
|
||||
'title' => __('Password Reset','ultimatemember'),
|
||||
'type' => 'block',
|
||||
'content' => '<div style="text-align:center">To reset your password, please enter your email address or username below</div>',
|
||||
'content' => '<div style="text-align:center">' . __('To reset your password, please enter your email address or username below','ultimatemember'). '</div>',
|
||||
'private_use' => true,
|
||||
),
|
||||
|
||||
'username_b' => array(
|
||||
'title' => 'Username or E-mail',
|
||||
'title' => __('Username or E-mail','ultimatemember'),
|
||||
'metakey' => 'username_b',
|
||||
'type' => 'text',
|
||||
'placeholder' => __('Enter your username or email','ultimatemember'),
|
||||
@@ -784,16 +784,16 @@ class UM_Builtin {
|
||||
// account page use ( not public )
|
||||
|
||||
'profile_privacy' => array(
|
||||
'title' => 'Profile Privacy',
|
||||
'title' => __('Profile Privacy','ultimatemember'),
|
||||
'metakey' => 'profile_privacy',
|
||||
'type' => 'select',
|
||||
'label' => 'Profile Privacy',
|
||||
'help' => 'Who can see your public profile?',
|
||||
'label' => __('Profile Privacy','ultimatemember'),
|
||||
'help' => __('Who can see your public profile?','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
'default' => __('Everyone'),
|
||||
'options' => array( __('Everyone'), __('Only me') ),
|
||||
'default' => __('Everyone','ultimatemember'),
|
||||
'options' => array( __('Everyone','ultimatemember'), __('Only me','ultimatemember') ),
|
||||
'allowclear' => 0,
|
||||
'account_only' => true,
|
||||
'required_perm' => 'can_make_private_profile',
|
||||
@@ -808,31 +808,31 @@ class UM_Builtin {
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
'default' => 'No',
|
||||
'options' => array('No','Yes'),
|
||||
'default' => __('No','ultimatemember'),
|
||||
'options' => array( __('No','ultimatemember'), __('Yes','ultimatemember') ),
|
||||
'account_only' => true,
|
||||
'required_opt' => array( 'members_page', 1 ),
|
||||
),
|
||||
|
||||
'delete_account' => array(
|
||||
'title' => 'Delete Account',
|
||||
'title' => __('Delete Account','ultimatemember'),
|
||||
'metakey' => 'delete_account',
|
||||
'type' => 'radio',
|
||||
'label' => 'Delete Account',
|
||||
'help' => 'If you confirm, everything related to your profile will be deleted permanently from the site',
|
||||
'label' => __('Delete Account','ultimatemember'),
|
||||
'help' => __('If you confirm, everything related to your profile will be deleted permanently from the site','ultimatemember'),
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
'default' => 'No',
|
||||
'options' => array('Yes','No'),
|
||||
'default' => __('No','ultimatemember'),
|
||||
'options' => array( __('Yes','ultimatemember') , __('No','ultimatemember') ),
|
||||
'account_only' => true,
|
||||
),
|
||||
|
||||
'single_user_password' => array(
|
||||
'title' => 'Password',
|
||||
'title' => __('Password','ultimatemember'),
|
||||
'metakey' => 'single_user_password',
|
||||
'type' => 'password',
|
||||
'label' => 'Password',
|
||||
'label' => __('Password','ultimatemember'),
|
||||
'required' => 1,
|
||||
'public' => 1,
|
||||
'editable' => 1,
|
||||
|
||||
@@ -1,18 +1,51 @@
|
||||
<?php
|
||||
|
||||
/***
|
||||
*** @Do not apply to backend default avatars
|
||||
***/
|
||||
add_filter('avatar_defaults', 'um_avatar_defaults', 99999 );
|
||||
function um_avatar_defaults($avatar_defaults) {
|
||||
remove_filter('get_avatar', 'um_get_avatar', 99999, 5);
|
||||
return $avatar_defaults;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Override avatars with a high priority
|
||||
***/
|
||||
function um_get_avatar($content, $id='', $size = '96', $avatar_class = '', $default = '', $alt = '') {
|
||||
add_filter('get_avatar', 'um_get_avatar', 99999, 5);
|
||||
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 );
|
||||
|
||||
if ( is_email( $id ) )
|
||||
$id = email_exists( $id );
|
||||
|
||||
um_fetch_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 = '';
|
||||
}
|
||||
|
||||
$avatar = '<img src="' . $protocol . 'gravatar.com/avatar/' . md5( um_user('user_email') ) .
|
||||
'?d='. $default . '&s=' . $size . '" class="gravatar avatar avatar-'.$size.' um-avatar" width="'.$size.'" height="'.$size.'" alt="" />';
|
||||
|
||||
}
|
||||
|
||||
um_reset_user();
|
||||
return $avatar;
|
||||
|
||||
}
|
||||
|
||||
add_filter('get_avatar', 'um_get_avatar', 10000000, 5);
|
||||
}
|
||||
@@ -134,6 +134,8 @@ class UM_User {
|
||||
// add permissions
|
||||
$user_role = $this->get_role();
|
||||
$this->role_meta = $ultimatemember->query->role_data( $user_role );
|
||||
$this->role_meta = apply_filters('um_user_permissions_filter', $this->role_meta, $this->id);
|
||||
|
||||
$this->profile = array_merge( $this->profile, (array)$this->role_meta);
|
||||
|
||||
$this->profile['super_admin'] = ( is_super_admin( $this->id ) ) ? 1 : 0;
|
||||
|
||||
Reference in New Issue
Block a user