New privacy option for fields

This commit is contained in:
Ultimate Member
2015-12-15 16:22:35 +02:00
parent 9caeeb9a72
commit ab691b3e1f
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -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>
+3
View File
@@ -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;