mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
New privacy option for fields
This commit is contained in:
@@ -1396,10 +1396,11 @@ class UM_Admin_Metabox {
|
||||
?>
|
||||
|
||||
<p><label for="_public">Privacy <?php $this->tooltip('Field privacy allows you to select who can view this field on the front-end. The site admin can view all fields regardless of the option set here.'); ?></label>
|
||||
<select name="_public" id="_public" class="umaf-selectjs um-adm-conditional" data-cond1='-2' data-cond1-show='_roles' style="width: 100%">
|
||||
<select name="_public" id="_public" class="umaf-selectjs um-adm-conditional" data-cond1='-2' data-cond1-show='_roles' data-cond2='-3' data-cond2-show='_roles' style="width: 100%">
|
||||
<option value="1" <?php selected( 1, $this->edit_mode_value ); ?>>Everyone</option>
|
||||
<option value="2" <?php selected( 2, $this->edit_mode_value ); ?>>Members</option>
|
||||
<option value="-1" <?php selected( -1, $this->edit_mode_value ); ?>>Only visible to profile owner and admins</option>
|
||||
<option value="-3" <?php selected( -3, $this->edit_mode_value ); ?>>Only visible to profile owner and specific roles</option>
|
||||
<option value="-2" <?php selected( -2, $this->edit_mode_value ); ?>>Only specific member roles</option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
@@ -695,6 +695,9 @@ function um_reset_user() {
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
|
||||
if ( $data['public'] == '-3' && !um_is_user_himself() && !in_array( $ultimatemember->query->get_role_by_userid( get_current_user_id() ), $data['roles'] ) )
|
||||
return false;
|
||||
|
||||
if ( !um_is_user_himself() && $data['public'] == '-1' && !um_user_can('can_edit_everyone') )
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user