mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Add option to Switch on/off the profile photo uploader
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -123,11 +123,23 @@
|
||||
'conditional' => array( '_um_profile_cover_enabled', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profile_photosize',
|
||||
'id' => '_um_profile_photo_uploader',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Profile Photo Uploader','ultimate-member' ),
|
||||
'tooltip' => __('Switch on/off the profile photo uploader','ultimate-member'),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_photo_uploader', null, UM()->options()->get( 'profile_photo_uploader' ) ),
|
||||
'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
),
|
||||
),
|
||||
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' ) ),
|
||||
'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(
|
||||
|
||||
@@ -710,6 +710,12 @@ function um_profile_header( $args ) {
|
||||
</span>
|
||||
</span>';
|
||||
|
||||
// Switch on/off the profile photo uploader
|
||||
$photo_uploader = empty( $args['use_custom_settings'] ) ? UM()->options()->get( 'profile_photo_uploader' ) : $args['photo_uploader'];
|
||||
if( !$photo_uploader ){
|
||||
$args['photo_uploader'] = 0;
|
||||
$overlay = '';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="um-header<?php echo $classes; ?>">
|
||||
@@ -743,7 +749,7 @@ function um_profile_header( $args ) {
|
||||
|
||||
<?php
|
||||
|
||||
if ( ! isset( UM()->user()->cannot_edit ) ) {
|
||||
if ( $photo_uploader && empty( UM()->user()->cannot_edit ) ) {
|
||||
|
||||
UM()->fields()->add_hidden_field( 'profile_photo' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user