mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-15 12:43:33 +09:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -12,6 +12,8 @@ class UM_Account {
|
||||
|
||||
add_action('template_redirect', array(&$this, 'form_init'), 10002);
|
||||
|
||||
add_filter('um_predefined_fields_hook', array(&$this,'predefined_fields_hook'),1 );
|
||||
|
||||
$this->current_tab = 'general';
|
||||
|
||||
}
|
||||
@@ -304,4 +306,16 @@ class UM_Account {
|
||||
$ultimatemember->shortcodes->load_template( $template );
|
||||
}
|
||||
|
||||
/***
|
||||
** @filter account fields
|
||||
****/
|
||||
function predefined_fields_hook( $predefined_fields ){
|
||||
|
||||
$account_hide_in_directory = um_get_option('account_hide_in_directory');
|
||||
if( ! $account_hide_in_directory ){
|
||||
unset( $predefined_fields['hide_in_members'] );
|
||||
}
|
||||
|
||||
return $predefined_fields;
|
||||
}
|
||||
}
|
||||
+11
-1
@@ -290,6 +290,12 @@ class UM_Files {
|
||||
|
||||
$array['image'] = @getimagesize($file);
|
||||
|
||||
if ( empty( $_FILES['tmp_name'] ) ){
|
||||
$array['invalid_image'] = true;
|
||||
$array['error_type'] = 'too_large';
|
||||
return $array;
|
||||
}
|
||||
|
||||
if ( $array['image'] > 0 ) {
|
||||
|
||||
$array['invalid_image'] = false;
|
||||
@@ -329,7 +335,11 @@ class UM_Files {
|
||||
}
|
||||
|
||||
if ( $fileinfo['invalid_image'] == true ) {
|
||||
$error = sprintf(__('Your image is invalid or too large!','ultimatemember') );
|
||||
if( isset( $fileinfo['error_type'] ) && $fileinfo['error_type'] == 'too_large' ){
|
||||
$error = sprintf(__('The uploaded image was too large. You must upload a file smaller than %s','ultimatemember') , ini_get("upload_max_filesize") );
|
||||
}else{
|
||||
$error = sprintf(__('Your image is invalid or too large!','ultimatemember') );
|
||||
}
|
||||
} elseif ( isset( $data['allowed_types'] ) && !$this->in_array( $fileinfo['extension'], $data['allowed_types'] ) ) {
|
||||
$error = ( isset( $data['extension_error'] ) && !empty( $data['extension_error'] ) ) ? $data['extension_error'] : 'not allowed';
|
||||
} elseif ( isset($data['min_size']) && ( $fileinfo['size'] < $data['min_size'] ) ) {
|
||||
|
||||
@@ -274,6 +274,16 @@ $this->sections[] = array(
|
||||
'off' => __('Off','ultimatemember'),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'account_hide_in_directory',
|
||||
'type' => 'switch',
|
||||
'title' => __( 'Allow users to hide their profiles from directory','ultimatemember' ),
|
||||
'default' => 1,
|
||||
'desc' => __('Whether to allow users changing their profile visibility from member directory in account page.','ultimatemember'),
|
||||
'on' => __('On','ultimatemember'),
|
||||
'off' => __('Off','ultimatemember'),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'account_require_strongpass',
|
||||
'type' => 'switch',
|
||||
|
||||
Reference in New Issue
Block a user