mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 06:33:50 +09:00
Update 1.0.69
This commit is contained in:
+2
-2
@@ -33,8 +33,8 @@ class UM_Account {
|
||||
$tabs[400]['notifications']['icon'] = 'um-faicon-bell';
|
||||
$tabs[400]['notifications']['title'] = __('Notifications','ultimatemember');
|
||||
|
||||
$tabs[500]['delete']['icon'] = 'um-faicon-trash-o';
|
||||
$tabs[500]['delete']['title'] = __('Delete Account','ultimatemember');
|
||||
$tabs[9999]['delete']['icon'] = 'um-faicon-trash-o';
|
||||
$tabs[9999]['delete']['title'] = __('Delete Account','ultimatemember');
|
||||
|
||||
return $tabs;
|
||||
}
|
||||
|
||||
@@ -162,11 +162,18 @@
|
||||
|
||||
<?php echo $output; ?>
|
||||
|
||||
<div class="um-col-alt um-col-alt-b"><div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Delete Account','ultimatemember'); ?>" class="um-button" /></div><div class="um-clear"></div></div>
|
||||
<div class="um-col-alt um-col-alt-b">
|
||||
<div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Delete Account','ultimatemember'); ?>" class="um-button" /></div>
|
||||
<?php do_action('um_after_account_delete_button'); ?>
|
||||
<div class="um-clear"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
do_action('um_after_account_delete');
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -185,11 +192,18 @@
|
||||
|
||||
<?php echo $output; ?>
|
||||
|
||||
<div class="um-col-alt um-col-alt-b"><div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Privacy','ultimatemember'); ?>" class="um-button" /></div><div class="um-clear"></div></div>
|
||||
<div class="um-col-alt um-col-alt-b">
|
||||
<div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Privacy','ultimatemember'); ?>" class="um-button" /></div>
|
||||
<?php do_action('um_after_account_privacy_button'); ?>
|
||||
<div class="um-clear"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
do_action('um_after_account_privacy');
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -199,7 +213,7 @@
|
||||
function um_account_tab__general( $info ) {
|
||||
global $ultimatemember;
|
||||
extract( $info );
|
||||
|
||||
|
||||
$output = $ultimatemember->account->get_tab_output('general');
|
||||
|
||||
if ( $output ) { ?>
|
||||
@@ -208,11 +222,18 @@
|
||||
|
||||
<?php echo $output; ?>
|
||||
|
||||
<div class="um-col-alt um-col-alt-b"><div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Account','ultimatemember'); ?>" class="um-button" /></div><div class="um-clear"></div></div>
|
||||
<div class="um-col-alt um-col-alt-b">
|
||||
<div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Account','ultimatemember'); ?>" class="um-button" /></div>
|
||||
<?php do_action('um_after_account_general_button'); ?>
|
||||
<div class="um-clear"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
|
||||
do_action('um_after_account_general');
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -231,11 +252,18 @@
|
||||
|
||||
<?php echo $output; ?>
|
||||
|
||||
<div class="um-col-alt um-col-alt-b"><div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Password','ultimatemember'); ?>" class="um-button" /></div><div class="um-clear"></div></div>
|
||||
<div class="um-col-alt um-col-alt-b">
|
||||
<div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Password','ultimatemember'); ?>" class="um-button" /></div>
|
||||
<?php do_action('um_after_account_password_button'); ?>
|
||||
<div class="um-clear"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
do_action('um_after_account_password');
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -254,11 +282,18 @@
|
||||
|
||||
<?php echo $output; ?>
|
||||
|
||||
<div class="um-col-alt um-col-alt-b"><div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Notifications','ultimatemember'); ?>" class="um-button" /></div><div class="um-clear"></div></div>
|
||||
<div class="um-col-alt um-col-alt-b">
|
||||
<div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Notifications','ultimatemember'); ?>" class="um-button" /></div>
|
||||
<?php do_action('um_after_account_notifications_button'); ?>
|
||||
<div class="um-clear"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
|
||||
do_action('um_after_account_notifications');
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@@ -152,9 +152,13 @@
|
||||
$form_id = $args['form_id'];
|
||||
$mode = $args['mode'];
|
||||
$fields = unserialize( $args['custom_fields'] );
|
||||
|
||||
|
||||
foreach( $fields as $key => $array ) {
|
||||
|
||||
if ( isset( $array['type'] ) && $array['type'] == 'checkbox' && isset( $array['required'] ) && $array['required'] == 1 && !isset( $args[$key] ) ) {
|
||||
$ultimatemember->form->add_error($key, sprintf(__('You must check %s.','ultimatemember'), $array['title'] ) );
|
||||
}
|
||||
|
||||
if ( $key == 'role_select' || $key == 'role_radio' ) {
|
||||
if ( isset($args['role']) && empty($args['role']) && isset( $array['required'] ) && $array['required'] == 1 ) {
|
||||
$ultimatemember->form->add_error($key, __('Please specify account type.','ultimatemember') );
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
|
||||
$ultimatemember->user->auto_login( um_user('ID'), $rememberme );
|
||||
|
||||
// Hook that runs after successful login and before user is redirected
|
||||
do_action('um_on_login_before_redirect', um_user('ID') );
|
||||
|
||||
// Priority redirect
|
||||
if ( isset( $args['redirect_to'] ) ) {
|
||||
exit( wp_redirect( $args['redirect_to'] ) );
|
||||
|
||||
@@ -82,6 +82,10 @@
|
||||
if ( isset( $args['submitted']['role'] ) && !empty( $args['submitted']['role'] ) ) {
|
||||
$to_update['role'] = $args['submitted']['role'];
|
||||
}
|
||||
|
||||
do_action('um_user_pre_updating_profile', $to_update );
|
||||
|
||||
$to_update = apply_filters('um_user_pre_updating_profile_array', $to_update);
|
||||
|
||||
if ( is_array( $to_update ) ) {
|
||||
$ultimatemember->user->update_profile( $to_update );
|
||||
@@ -307,10 +311,17 @@
|
||||
<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></div>
|
||||
<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>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="um-clear"></div>
|
||||
|
||||
<?php do_action('um_after_profile_header_name'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( isset( $args['metafields'] ) && !empty( $args['metafields'] ) ) { ?>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
function um_block_wpadmin_for_guests() {
|
||||
global $pagenow;
|
||||
|
||||
// Logout screen
|
||||
if ( isset( $pagenow ) && $pagenow == 'wp-login.php' && is_user_logged_in() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'logout' ) {
|
||||
$redirect = um_get_core_page('logout');
|
||||
exit( wp_redirect( $redirect ) );
|
||||
}
|
||||
|
||||
// Login screen
|
||||
if ( isset( $pagenow ) && $pagenow == 'wp-login.php' && !is_user_logged_in() && !isset( $_REQUEST['action'] ) ) {
|
||||
|
||||
|
||||
+4
-4
@@ -81,10 +81,10 @@ class UM_Enqueue {
|
||||
|
||||
} else {
|
||||
|
||||
wp_register_script('um_minified', um_url . 'assets/js/um.min.js', array('jquery'), '', true );
|
||||
wp_register_script('um_minified', um_url . 'assets/js/um.min.js', array('jquery'), ultimatemember_version, true );
|
||||
wp_enqueue_script('um_minified');
|
||||
|
||||
wp_register_style('um_minified', um_url . 'assets/css/um.min.css' );
|
||||
wp_register_style('um_minified', um_url . 'assets/css/um.min.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style('um_minified');
|
||||
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class UM_Enqueue {
|
||||
// load a localized version for date/time
|
||||
$locale = get_option('WPLANG');
|
||||
if ( $locale && file_exists( um_path . 'assets/js/pickadate/translations/' . $locale . '.js' ) ) {
|
||||
wp_register_script('um_datetime_locale', um_url . 'assets/js/pickadate/translations/' . $locale . '.js', '', '', true );
|
||||
wp_register_script('um_datetime_locale', um_url . 'assets/js/pickadate/translations/' . $locale . '.js', '', ultimatemember_version, true );
|
||||
wp_enqueue_script('um_datetime_locale');
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ class UM_Enqueue {
|
||||
$this->load_datetimepicker();
|
||||
|
||||
$this->load_raty();
|
||||
|
||||
|
||||
$this->load_imagecrop();
|
||||
|
||||
$this->load_masonry();
|
||||
|
||||
+8
-3
@@ -105,6 +105,11 @@ class UM_Fields {
|
||||
}
|
||||
}
|
||||
|
||||
// custom fields support
|
||||
if ( isset( $ultimatemember->builtin->predefined_fields[$id] ) && isset( $ultimatemember->builtin->predefined_fields[$id]['custom'] ) ) {
|
||||
$args = array_merge( $ultimatemember->builtin->predefined_fields[$id], $args);
|
||||
}
|
||||
|
||||
$fields[$id] = $args;
|
||||
|
||||
// for group field only
|
||||
@@ -370,7 +375,7 @@ class UM_Fields {
|
||||
|
||||
return um_user( $key );
|
||||
|
||||
} else if ( um_user( $key ) && $this->viewing == true ) {
|
||||
} else if ( ( um_user( $key ) || isset($data['show_anyway']) ) && $this->viewing == true ) {
|
||||
|
||||
$value = um_filtered_value( $key, $data );
|
||||
return $value;
|
||||
@@ -1246,7 +1251,7 @@ class UM_Fields {
|
||||
|
||||
$output .= '<div class="um-modal-footer">
|
||||
<div class="um-modal-right">
|
||||
<a href="#" class="um-modal-btn um-finish-upload image disabled" data-key="'.$key.'" data-change="'.__('Change photo').'" data-processing="'.__('Processing...','ultimatemember').'"> ' . __('Apply','ultimatemember') . '</a>
|
||||
<a href="#" class="um-modal-btn um-finish-upload image disabled" data-key="'.$key.'" data-change="'.__('Change photo','ultimatemember').'" data-processing="'.__('Processing...','ultimatemember').'"> ' . __('Apply','ultimatemember') . '</a>
|
||||
<a href="#" class="um-modal-btn alt" data-action="um_remove_modal"> ' . __('Cancel','ultimatemember') . '</a>
|
||||
</div>
|
||||
<div class="um-clear"></div>
|
||||
@@ -1292,7 +1297,7 @@ class UM_Fields {
|
||||
<span class="filename">' . $this->field_value( $key, $default, $data ) . '</span>
|
||||
</a>
|
||||
</div>
|
||||
</div><a href="#" data-modal="um_upload_single" data-modal-size="'.$modal_size.'" data-modal-copy="1" class="um-button um-btn-auto-width">'. __('Change file') . '</a>';
|
||||
</div><a href="#" data-modal="um_upload_single" data-modal-size="'.$modal_size.'" data-modal-copy="1" class="um-button um-btn-auto-width">'. __('Change file','ultimatemember') . '</a>';
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
+6
-2
@@ -18,6 +18,7 @@ class UM_Files {
|
||||
'xlsx' => array('icon' => 'um-faicon-file-excel-o', 'color' => '#51BA6A' ),
|
||||
'zip' => array('icon' => 'um-faicon-file-zip-o' ),
|
||||
'rar' => array('icon' => 'um-faicon-file-zip-o' ),
|
||||
'mp3' => array('icon' => 'um-faicon-file-audio-o' ),
|
||||
);
|
||||
|
||||
$this->default_file_fonticon = 'um-faicon-file-o';
|
||||
@@ -54,6 +55,7 @@ class UM_Files {
|
||||
$array['xlsx'] = 'XLSX';
|
||||
$array['zip'] = 'ZIP';
|
||||
$array['rar'] = 'RAR';
|
||||
$array['mp3'] = 'MP3';
|
||||
|
||||
$array = apply_filters('um_allowed_file_types', $array);
|
||||
return $array;
|
||||
@@ -316,9 +318,9 @@ class UM_Files {
|
||||
} elseif ( isset($data['min_size']) && ( $fileinfo['size'] < $data['min_size'] ) ) {
|
||||
$error = $data['min_size_error'];
|
||||
} elseif ( isset($data['min_width']) && ( $fileinfo['width'] < $data['min_width'] ) ) {
|
||||
$error = sprintf(__('Your photo is too small. It must be at least %spx wide.'), $data['min_width']);
|
||||
$error = sprintf(__('Your photo is too small. It must be at least %spx wide.','ultimatemember'), $data['min_width']);
|
||||
} elseif ( isset($data['min_height']) && ( $fileinfo['height'] < $data['min_height'] ) ) {
|
||||
$error = sprintf(__('Your photo is too small. It must be at least %spx wide.'), $data['min_height']);
|
||||
$error = sprintf(__('Your photo is too small. It must be at least %spx wide.','ultimatemember'), $data['min_height']);
|
||||
}
|
||||
|
||||
return $error;
|
||||
@@ -502,6 +504,8 @@ class UM_Files {
|
||||
rmdir( $dir );
|
||||
|
||||
// update user's meta
|
||||
do_action('um_before_upload_db_meta', $user_id, $key );
|
||||
do_action("um_before_upload_db_meta_{$key}", $user_id );
|
||||
update_user_meta( $user_id, $key, $filename );
|
||||
|
||||
// the url of upload
|
||||
|
||||
+43
-4
@@ -14,12 +14,27 @@ class UM_Mail {
|
||||
function mandrill_nl2br($nl2br, $message = '') {
|
||||
|
||||
// text emails
|
||||
$nl2br = true;
|
||||
if ( !um_get_option('email_html') ) {
|
||||
$nl2br = true;
|
||||
}
|
||||
|
||||
return $nl2br;
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @check If template exists
|
||||
***/
|
||||
function email_template( $template ) {
|
||||
if ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/email/' . $template . '.html' ) ) {
|
||||
return get_stylesheet_directory() . '/ultimate-member/templates/email/' . $template . '.html';
|
||||
}
|
||||
if ( file_exists( um_path . 'templates/email/' . $template . '.html' ) ) {
|
||||
return um_url . 'templates/email/' . $template . '.html';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @sends an email to any user
|
||||
***/
|
||||
@@ -30,17 +45,35 @@ class UM_Mail {
|
||||
if ( !is_email( $email ) ) return;
|
||||
|
||||
$this->attachments = null;
|
||||
|
||||
$this->headers = 'From: '. um_get_option('mail_from') .' <'. um_get_option('mail_from_addr') .'>' . "\r\n";
|
||||
|
||||
$this->subject = um_get_option( $template . '_sub' );
|
||||
$this->subject = $this->convert_tags( $this->subject );
|
||||
|
||||
// HTML e-mail
|
||||
if ( um_get_option('email_html') && $this->email_template( $template ) ) {
|
||||
$this->message = file_get_contents( $this->email_template( $template ) );
|
||||
} else {
|
||||
$this->message = um_get_option( $template );
|
||||
}
|
||||
|
||||
$this->message = um_get_option( $template );
|
||||
// Convert tags in body
|
||||
$this->message = $this->convert_tags( $this->message );
|
||||
|
||||
// Send mail
|
||||
add_filter( 'wp_mail_content_type', array(&$this, 'set_content_type') );
|
||||
wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments );
|
||||
|
||||
remove_filter( 'wp_mail_content_type', array(&$this, 'set_content_type') );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @maybe sending HTML emails
|
||||
***/
|
||||
function set_content_type( $content_type ) {
|
||||
if ( um_get_option('email_html') )
|
||||
return 'text/html';
|
||||
return 'text/plain';
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -58,11 +91,14 @@ class UM_Mail {
|
||||
'{password}',
|
||||
'{login_url}',
|
||||
'{site_name}',
|
||||
'{site_url}',
|
||||
'{account_activation_link}',
|
||||
'{password_reset_link}',
|
||||
'{admin_email}',
|
||||
'{user_profile_link}',
|
||||
'{user_account_link}',
|
||||
'{submitted_registration}',
|
||||
'{user_avatar_url}',
|
||||
);
|
||||
|
||||
$search = apply_filters('um_template_tags_patterns_hook', $search);
|
||||
@@ -77,11 +113,14 @@ class UM_Mail {
|
||||
um_user('_um_cool_but_hard_to_guess_plain_pw'),
|
||||
um_get_core_page('login'),
|
||||
um_get_option('site_name'),
|
||||
get_bloginfo('url'),
|
||||
um_user('account_activation_link'),
|
||||
um_user('password_reset_link'),
|
||||
um_admin_email(),
|
||||
um_user_profile_url(),
|
||||
um_get_core_page('account'),
|
||||
um_user_submitted_registration(),
|
||||
um_get_user_avatar_url(),
|
||||
);
|
||||
|
||||
$replace = apply_filters('um_template_tags_replaces_hook', $replace);
|
||||
|
||||
+3
-1
@@ -49,6 +49,8 @@ class UM_Profile {
|
||||
if ( get_query_var('profiletab') ) {
|
||||
$this->active_tab = get_query_var('profiletab');
|
||||
}
|
||||
|
||||
$this->active_tab = apply_filters( 'um_profile_active_tab', $this->active_tab );
|
||||
|
||||
return $this->active_tab;
|
||||
}
|
||||
@@ -76,7 +78,7 @@ class UM_Profile {
|
||||
|
||||
foreach( $array as $key ) {
|
||||
$data = '';
|
||||
if ( $key && um_user( $key ) ) {
|
||||
if ( $key && um_filtered_value( $key ) ) {
|
||||
|
||||
if ( isset( $ultimatemember->builtin->all_user_fields[$key]['icon'] ) ) {
|
||||
$icon = $ultimatemember->builtin->all_user_fields[$key]['icon'];
|
||||
|
||||
@@ -852,6 +852,18 @@ function um_fetch_user( $user_id ) {
|
||||
return $uri;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @get user avatar url
|
||||
***/
|
||||
function um_get_user_avatar_url() {
|
||||
if ( um_profile('profile_photo') ) {
|
||||
$avatar_uri = um_get_avatar_uri( um_profile('profile_photo'), 32 );
|
||||
} else {
|
||||
$avatar_uri = um_get_default_avatar_uri();
|
||||
}
|
||||
return $avatar_uri;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @default cover
|
||||
***/
|
||||
|
||||
+4
-1
@@ -269,6 +269,9 @@ class UM_User {
|
||||
|
||||
$this->delete_meta('account_secret_hash');
|
||||
$this->delete_meta('_um_cool_but_hard_to_guess_plain_pw');
|
||||
|
||||
do_action('um_after_user_is_approved', um_user('ID') );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -416,7 +419,7 @@ class UM_User {
|
||||
***/
|
||||
function is_private_profile( $user_id ) {
|
||||
$privacy = get_user_meta( $user_id, 'profile_privacy', true );
|
||||
if ( $privacy == __('Only me') ) {
|
||||
if ( $privacy == __('Only me','ultimatemember') ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user