mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-16 05:03:33 +09:00
Merge remote-tracking branch 'remotes/origin/feature/option__Profile_Photo_Uploader'
# Conflicts: # includes/admin/core/class-admin-settings.php
This commit is contained in:
@@ -782,6 +782,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'tooltip' => __('You can change the default cover photo globally here. Please make sure that the default cover is large enough and respects the ratio you are using for cover photos.', 'ultimate-member'),
|
||||
'upload_frame_title'=> __('Select Default Cover Photo', 'ultimate-member'),
|
||||
),
|
||||
array(
|
||||
'id' => 'disable_profile_photo_upload',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Disable Profile Photo Upload', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Switch on/off the profile photo uploader', 'ultimate-member' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'profile_photosize',
|
||||
'type' => 'text',
|
||||
|
||||
@@ -123,45 +123,57 @@
|
||||
'conditional' => array( '_um_profile_cover_enabled', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profile_photosize',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Profile Photo Size', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Set the profile photo size in pixels here', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_photosize', null, UM()->options()->get( 'profile_photosize' ) ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profile_photo_required',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Make Profile Photo Required', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Require user to update a profile photo when updating their profile', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_photo_required' ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
'id' => '_um_profile_disable_photo_upload',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Disable Profile Photo Upload', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Switch on/off the profile photo uploader', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_disable_photo_upload', null, UM()->options()->get( 'disable_profile_photo_upload' ) ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profile_show_name',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Show display name in profile header?', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_show_name', null, 1 ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
'id' => '_um_profile_photosize',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Profile Photo Size', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Set the profile photo size in pixels here', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_photosize', null, UM()->options()->get( 'profile_photosize' ) ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profile_photo_required',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Make Profile Photo Required', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Require user to update a profile photo when updating their profile', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_photo_required' ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profile_show_social_links',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Show social links in profile header?', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_show_social_links', null, UM()->options()->get( 'profile_show_social_links' ) ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
'id' => '_um_profile_show_name',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Show display name in profile header?', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_show_name', null, 1 ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profile_show_social_links',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Show social links in profile header?', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_show_social_links', null, UM()->options()->get( 'profile_show_social_links' ) ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
|
||||
@@ -520,6 +520,7 @@ if ( ! class_exists( 'um\Config' ) ) {
|
||||
'blocked_words' => 'admin' . "\r\n" . 'administrator' . "\r\n" . 'webmaster' . "\r\n" . 'support' . "\r\n" . 'staff',
|
||||
'default_avatar' => '',
|
||||
'default_cover' => '',
|
||||
'disable_profile_photo_upload' => 0,
|
||||
'profile_show_metaicon' => 0,
|
||||
'profile_menu' => 1,
|
||||
'profile_menu_default_tab' => 'main',
|
||||
|
||||
@@ -273,15 +273,15 @@ function um_user_edit_profile( $args ) {
|
||||
$stripslashes = stripslashes( $stripslashes );
|
||||
}
|
||||
if ( in_array( $array['type'], array( 'select' ) ) &&
|
||||
! empty( $array['options'] ) && ! empty( $stripslashes ) &&
|
||||
! in_array( $stripslashes, array_map( 'trim', $array['options'] ) ) && ! $has_custom_source ) {
|
||||
! empty( $array['options'] ) && ! empty( $stripslashes ) &&
|
||||
! in_array( $stripslashes, array_map( 'trim', $array['options'] ) ) && ! $has_custom_source ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//validation of correct values from options in wp-admin
|
||||
//the user cannot set invalid value in the hidden input at the page
|
||||
if ( in_array( $array['type'], array( 'multiselect', 'checkbox', 'radio' ) ) &&
|
||||
! empty( $args['submitted'][ $key ] ) && ! empty( $array['options'] ) ) {
|
||||
! empty( $args['submitted'][ $key ] ) && ! empty( $array['options'] ) ) {
|
||||
$args['submitted'][ $key ] = array_map( 'stripslashes', array_map( 'trim', $args['submitted'][ $key ] ) );
|
||||
$args['submitted'][ $key ] = array_intersect( $args['submitted'][ $key ], array_map( 'trim', $array['options'] ) );
|
||||
}
|
||||
@@ -553,7 +553,7 @@ function um_profile_dynamic_meta_desc() {
|
||||
$user_id = um_user( 'ID' );
|
||||
|
||||
$url = um_user_profile_url();
|
||||
$avatar = um_get_user_avatar_url( $user_id, 'original' );
|
||||
$avatar = um_get_user_avatar_url( $user_id, 'original' );
|
||||
|
||||
um_reset_user(); ?>
|
||||
|
||||
@@ -593,7 +593,7 @@ function um_profile_header_cover_area( $args ) {
|
||||
?>
|
||||
|
||||
<div class="um-cover <?php if ( um_user( 'cover_photo' ) || ( $default_cover && $default_cover['url'] ) ) echo 'has-cover'; ?>"
|
||||
data-user_id="<?php echo um_profile_id(); ?>" data-ratio="<?php echo $args['cover_ratio']; ?>">
|
||||
data-user_id="<?php echo um_profile_id(); ?>" data-ratio="<?php echo $args['cover_ratio']; ?>">
|
||||
|
||||
<?php
|
||||
/**
|
||||
@@ -721,21 +721,26 @@ add_action( 'um_after_profile_header_name_args', 'um_social_links_icons', 50 );
|
||||
function um_profile_header( $args ) {
|
||||
$classes = null;
|
||||
|
||||
if (!$args['cover_enabled']) {
|
||||
if ( ! $args['cover_enabled'] ) {
|
||||
$classes .= ' no-cover';
|
||||
}
|
||||
|
||||
$default_size = str_replace( 'px', '', $args['photosize'] );
|
||||
|
||||
$overlay = '<span class="um-profile-photo-overlay">
|
||||
// Switch on/off the profile photo uploader
|
||||
$disable_photo_uploader = empty( $args['use_custom_settings'] ) ? UM()->options()->get( 'disable_profile_photo_upload' ) : $args['disable_photo_upload'];
|
||||
if ( $disable_photo_uploader ) {
|
||||
$args['disable_photo_upload'] = 1;
|
||||
$overlay = '';
|
||||
} else {
|
||||
$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; ?>">
|
||||
|
||||
@@ -766,9 +771,7 @@ function um_profile_header( $args ) {
|
||||
<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( UM()->user()->cannot_edit ) ) {
|
||||
<?php if ( ! $disable_photo_uploader && empty( UM()->user()->cannot_edit ) ) {
|
||||
|
||||
UM()->fields()->add_hidden_field( 'profile_photo' );
|
||||
|
||||
@@ -839,35 +842,33 @@ function um_profile_header( $args ) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
} ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="um-profile-meta">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type action
|
||||
* @title um_before_profile_main_meta
|
||||
* @description Insert before profile main meta block
|
||||
* @input_vars
|
||||
* [{"var":"$args","type":"array","desc":"Form Arguments"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0.1"]
|
||||
* @usage add_action( 'um_before_profile_main_meta', 'function_name', 10, 1 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_action( 'um_before_profile_main_meta', 'my_before_profile_main_meta', 10, 1 );
|
||||
* function my_before_profile_main_meta( $args ) {
|
||||
* // your code here
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
do_action( 'um_before_profile_main_meta', $args ); ?>
|
||||
<?php
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type action
|
||||
* @title um_before_profile_main_meta
|
||||
* @description Insert before profile main meta block
|
||||
* @input_vars
|
||||
* [{"var":"$args","type":"array","desc":"Form Arguments"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0.1"]
|
||||
* @usage add_action( 'um_before_profile_main_meta', 'function_name', 10, 1 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_action( 'um_before_profile_main_meta', 'my_before_profile_main_meta', 10, 1 );
|
||||
* function my_before_profile_main_meta( $args ) {
|
||||
* // your code here
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
do_action( 'um_before_profile_main_meta', $args ); ?>
|
||||
|
||||
<div class="um-main-meta">
|
||||
|
||||
@@ -971,10 +972,10 @@ function um_profile_header( $args ) {
|
||||
|
||||
<div class="um-meta-text">
|
||||
<textarea id="um-meta-bio"
|
||||
data-character-limit="<?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?>"
|
||||
placeholder="<?php _e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
|
||||
name="<?php echo 'description-' . $args['form_id']; ?>"
|
||||
id="<?php echo 'description-' . $args['form_id']; ?>"><?php echo UM()->fields()->field_value( 'description' ) ?></textarea>
|
||||
data-character-limit="<?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?>"
|
||||
placeholder="<?php _e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
|
||||
name="<?php echo 'description-' . $args['form_id']; ?>"
|
||||
id="<?php echo 'description-' . $args['form_id']; ?>"><?php echo UM()->fields()->field_value( 'description' ) ?></textarea>
|
||||
<span class="um-meta-bio-character um-right"><span
|
||||
class="um-bio-limit"><?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?></span></span>
|
||||
<?php
|
||||
|
||||
@@ -147,6 +147,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
||||
- Fixed Notifications Account tab view
|
||||
- Fixed warnings on validation process
|
||||
- Fixed slashes in some texts from options
|
||||
- Fixed callback functions for select and multiselect fields
|
||||
|
||||
= 2.0.52: July 11, 2019 =
|
||||
|
||||
|
||||
Reference in New Issue
Block a user