Ticket #4747: 4747-3.patch
File 4747-3.patch, 12.1 KB (added by , 3 years ago) |
---|
-
src/bp-templates/bp-legacy/buddypress/members/register.php
diff --git src/bp-templates/bp-legacy/buddypress/members/register.php src/bp-templates/bp-legacy/buddypress/members/register.php index 4e8418e7f..622f14cab 100644
183 183 */ 184 184 do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); 185 185 186 if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 187 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"><span id="<?php bp_the_profile_field_input_name(); ?>-2"> 188 <?php 189 printf( 190 /* translators: %s: level of visibility */ 191 __( 'This field can be seen by: %s', 'buddypress' ), 192 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 193 ); 186 if ( 'checkbox_acceptance' !== bp_get_the_profile_field_type() ) { 187 if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : 194 188 ?> 195 </span> 196 <button type="button" class="visibility-toggle-link" aria-describedby="<?php bp_the_profile_field_input_name(); ?>-2" aria-expanded="false"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button> 197 </p> 198 199 <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> 200 <fieldset> 201 <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend> 202 203 <?php bp_profile_visibility_radio_buttons() ?> 204 205 </fieldset> 206 <button type="button" class="field-visibility-settings-close"><?php _e( 'Close', 'buddypress' ) ?></button> 207 208 </div> 209 <?php else : ?> 210 <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> 189 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id(); ?>"><span id="<?php bp_the_profile_field_input_name(); ?>-2"> 190 <?php 191 printf( 192 /* translators: %s: level of visibility */ 193 __( 'This field can be seen by: %s', 'buddypress' ), 194 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 195 ); 196 ?> 197 </span> 198 <button type="button" class="visibility-toggle-link" aria-describedby="<?php bp_the_profile_field_input_name(); ?>-2" aria-expanded="false"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button> 199 </p> 200 <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id(); ?>"> 201 <fieldset> 202 <legend><?php _e( 'Who can see this field?', 'buddypress' ); ?></legend> 203 <?php bp_profile_visibility_radio_buttons(); ?> 204 </fieldset> 205 <button type="button" class="field-visibility-settings-close"><?php _e( 'Close', 'buddypress' ); ?></button> 206 </div> 207 <?php else : ?> 208 <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id(); ?>"> 211 209 <?php 212 210 printf( 213 211 __( 'This field can be seen by: %s', 'buddypress' ), 214 212 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 215 213 ); 216 214 ?> 217 </p> 218 <?php endif ?> 215 </p> 216 <?php endif ?> 217 218 <?php 219 } 219 220 220 221 <?php 221 222 -
src/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php
diff --git src/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php src/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php index 6353cccb0..6254a324c 100644
if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) 57 57 */ 58 58 do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); 59 59 ?> 60 61 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 62 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"><span id="<?php bp_the_profile_field_input_name(); ?>-2"> 63 <?php 64 printf( 65 __( 'This field can be seen by: %s', 'buddypress' ), 66 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 67 ); 68 ?> 69 </span> 70 <button type="button" class="visibility-toggle-link" aria-describedby="<?php bp_the_profile_field_input_name(); ?>-2" aria-expanded="false"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button> 71 </p> 72 73 <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> 74 <fieldset> 75 <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend> 76 77 <?php bp_profile_visibility_radio_buttons() ?> 78 79 </fieldset> 80 <button type="button" class="field-visibility-settings-close"><?php _e( 'Close', 'buddypress' ) ?></button> 81 </div> 82 <?php else : ?> 83 <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> 84 <?php 85 printf( 86 __( 'This field can be seen by: %s', 'buddypress' ), 87 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 88 ); 89 ?> 90 </div> 91 <?php endif ?> 60 <?php if ( 'checkbox_acceptance' !== bp_get_the_profile_field_type() ) { 61 ?> 62 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 63 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"><span id="<?php bp_the_profile_field_input_name(); ?>-2"> 64 <?php 65 printf( 66 __( 'This field can be seen by: %s', 'buddypress' ), 67 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 68 ); 69 ?> 70 </span> 71 <button type="button" class="visibility-toggle-link" aria-describedby="<?php bp_the_profile_field_input_name(); ?>-2" aria-expanded="false"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button> 72 </p> 73 74 <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> 75 <fieldset> 76 <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend> 77 78 <?php bp_profile_visibility_radio_buttons() ?> 79 80 </fieldset> 81 <button type="button" class="field-visibility-settings-close"><?php _e( 'Close', 'buddypress' ) ?></button> 82 </div> 83 <?php else : ?> 84 <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> 85 <?php 86 printf( 87 __( 'This field can be seen by: %s', 'buddypress' ), 88 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 89 ); 90 ?> 91 </div> 92 <?php endif ?> 92 93 93 94 <?php 95 } 94 96 95 97 /** 96 98 * Fires after the visibility options for a field. -
src/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
diff --git src/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php src/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php index 4f2185051..eb25a3c85 100644
do_action( 'bp_before_profile_loop_content' ); ?> 27 27 28 28 <table class="profile-fields"> 29 29 30 <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> 30 <?php while ( bp_profile_fields() ) : bp_the_profile_field(); 31 32 if ( 'checkbox_acceptance' === bp_get_the_profile_field_type() ) { 33 continue; 34 } 35 ?> 31 36 32 37 <?php if ( bp_field_has_data() ) : ?> 33 38 -
src/bp-templates/bp-nouveau/buddypress/members/single/parts/profile-visibility.php
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/parts/profile-visibility.php src/bp-templates/bp-nouveau/buddypress/members/single/parts/profile-visibility.php index 24d9b43db..bba640059 100644
9 9 if ( empty( $GLOBALS['profile_template'] ) ) { 10 10 return; 11 11 } 12 13 if ( 'checkbox_acceptance' === bp_get_the_profile_field_type() ) { 14 return; 15 } 16 12 17 ?> 13 18 14 19 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> -
src/bp-templates/bp-nouveau/buddypress/members/single/profile/profile-loop.php
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/profile/profile-loop.php src/bp-templates/bp-nouveau/buddypress/members/single/profile/profile-loop.php index 2edf47815..22f2f20fd 100644
34 34 <?php 35 35 while ( bp_profile_fields() ) : 36 36 bp_the_profile_field(); 37 ?> 37 if ( 'checkbox_acceptance' === bp_get_the_profile_field_type() ) { 38 continue; 39 } 40 ?> 38 41 39 42 <?php if ( bp_field_has_data() ) : ?> 40 43 -
src/bp-xprofile/bp-xprofile-functions.php
diff --git src/bp-xprofile/bp-xprofile-functions.php src/bp-xprofile/bp-xprofile-functions.php index 9764102f4..ba9159252 100644
function xprofile_update_field_group_position( $field_group_id = 0, $position = 147 147 * 148 148 * @return array Key/value pairs (field type => class name). 149 149 */ 150 function bp_xprofile_get_field_types() { 151 $fields = array( 152 'checkbox' => 'BP_XProfile_Field_Type_Checkbox', 153 'datebox' => 'BP_XProfile_Field_Type_Datebox', 154 'multiselectbox' => 'BP_XProfile_Field_Type_Multiselectbox', 155 'number' => 'BP_XProfile_Field_Type_Number', 156 'url' => 'BP_XProfile_Field_Type_URL', 157 'radio' => 'BP_XProfile_Field_Type_Radiobutton', 158 'selectbox' => 'BP_XProfile_Field_Type_Selectbox', 159 'textarea' => 'BP_XProfile_Field_Type_Textarea', 160 'textbox' => 'BP_XProfile_Field_Type_Textbox', 161 'telephone' => 'BP_XProfile_Field_Type_Telephone', 162 'wp-biography' => 'BP_XProfile_Field_Type_WordPress_Biography', 163 'wp-textbox' => 'BP_XProfile_Field_Type_WordPress_Textbox', 164 ); 150 function bp_xprofile_get_field_types() { 151 $fields = array( 152 'checkbox' => 'BP_XProfile_Field_Type_Checkbox', 153 'datebox' => 'BP_XProfile_Field_Type_Datebox', 154 'multiselectbox' => 'BP_XProfile_Field_Type_Multiselectbox', 155 'number' => 'BP_XProfile_Field_Type_Number', 156 'url' => 'BP_XProfile_Field_Type_URL', 157 'radio' => 'BP_XProfile_Field_Type_Radiobutton', 158 'selectbox' => 'BP_XProfile_Field_Type_Selectbox', 159 'textarea' => 'BP_XProfile_Field_Type_Textarea', 160 'textbox' => 'BP_XProfile_Field_Type_Textbox', 161 'telephone' => 'BP_XProfile_Field_Type_Telephone', 162 'wp-biography' => 'BP_XProfile_Field_Type_WordPress_Biography', 163 'wp-textbox' => 'BP_XProfile_Field_Type_WordPress_Textbox', 164 'checkbox_acceptance' => 'BP_XProfile_Field_Type_Checkbox_Acceptance', 165 ); 165 166 166 167 /** 167 168 * Filters the list of all xprofile field types. -
src/bp-xprofile/classes/class-bp-xprofile-user-admin.php
diff --git src/bp-xprofile/classes/class-bp-xprofile-user-admin.php src/bp-xprofile/classes/class-bp-xprofile-user-admin.php index ef71072c5..7eff5f446 100644
class BP_XProfile_User_Admin { 273 273 $r = bp_parse_args( $args['args'], array( 274 274 'profile_group_id' => 0, 275 275 'user_id' => $user->ID, 276 'hide_field_types' => array( 'wp-textbox', 'wp-biography' ),276 'hide_field_types' => array( 'wp-textbox', 'wp-biography', 'checkbox_acceptance' ), 277 277 ), 'bp_xprofile_user_admin_profile_loop_args' ); 278 278 279 279 // We really need these args.