Ticket #7391: 7391-new-function-approach.patch
File 7391-new-function-approach.patch, 1.6 KB (added by , 8 years ago) |
---|
-
src/bp-templates/bp-legacy/buddypress/members/register.php
181 181 */ 182 182 do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); 183 183 184 if ( bp_ current_user_can( 'bp_xprofile_change_field_visibility') ) : ?>184 if ( bp_allow_profile_visibility_change() ) : ?> 185 185 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> 186 186 <?php 187 187 printf( -
src/bp-xprofile/bp-xprofile-functions.php
1143 1143 } 1144 1144 1145 1145 /** 1146 * Checks what default visibility level is set for a field in a profile edit loop. 1147 * returns false if the field default does not allow user change. 1148 * 1149 * @since 2.7.4 1150 * 1151 * @return bool 1152 */ 1153 function bp_allow_profile_visibility_change() { 1154 1155 $retval = false; 1156 $field_id = bp_get_the_profile_field_id(); 1157 1158 if( 'disabled' === bp_xprofile_get_meta( $field_id, 'field', 'allow_custom_visibility' ) ) { 1159 $retval = false; 1160 } else { 1161 $retval = true; 1162 } 1163 1164 return $retval; 1165 } 1166 1167 /** 1146 1168 * Get the ids of fields that are hidden for this displayed/loggedin user pair. 1147 1169 * 1148 1170 * This is the function primarily responsible for profile field visibility. It works by determining