Ticket #4747: 4747-4.patch
File 4747-4.patch, 12.5 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..8393834d3 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 <?php189 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 );194 ?>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() ?>">211 <?php212 printf(213 __( 'This field can be seen by: %s', 'buddypress' ),214 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'215 );216 ?>217 < /p>218 <?php endif ?> 219 220 <?php186 if ( 'checkbox_acceptance' !== bp_get_the_profile_field_type() ) { 187 188 if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : 189 ?> 190 <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"> 191 <?php 192 printf( 193 /* translators: %s: level of visibility */ 194 __( 'This field can be seen by: %s', 'buddypress' ), 195 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 196 ); 197 ?> 198 </span> 199 <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> 200 </p> 201 <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id(); ?>"> 202 <fieldset> 203 <legend><?php _e( 'Who can see this field?', 'buddypress' ); ?></legend> 204 <?php bp_profile_visibility_radio_buttons(); ?> 205 </fieldset> 206 <button type="button" class="field-visibility-settings-close"><?php _e( 'Close', 'buddypress' ); ?></button> 207 </div> 208 <?php else : ?> 209 <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id(); ?>"> 210 <?php 211 printf( 212 __( 'This field can be seen by: %s', 'buddypress' ), 213 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 214 ); 215 ?> 216 </p> 217 <?php endif ?> 218 219 <?php 220 } 221 221 222 222 /** 223 223 * Fires after the display of the visibility options for xprofile fields. -
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..71e8c2a4a 100644
if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) 56 56 * @since 1.7.0 57 57 */ 58 58 do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); 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 <?php64 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 <?php85 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 ?>92 59 93 <?php 60 if ( 'checkbox_acceptance' !== bp_get_the_profile_field_type() ) { 61 62 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 ?> 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..1523481b7 100644
17 17 <?php 18 18 while ( bp_profile_groups() ) : 19 19 bp_the_profile_group(); 20 ?>20 ?> 21 21 22 22 <?php if ( bp_profile_group_has_fields() ) : ?> 23 23 … … 34 34 <?php 35 35 while ( bp_profile_fields() ) : 36 36 bp_the_profile_field(); 37 ?> 37 38 if ( 'checkbox_acceptance' === bp_get_the_profile_field_type() ) { 39 continue; 40 } 41 ?> 38 42 39 43 <?php if ( bp_field_has_data() ) : ?> 40 44 -
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..47b8c0a7c 100644
function xprofile_update_field_group_position( $field_group_id = 0, $position = 149 149 */ 150 150 function bp_xprofile_get_field_types() { 151 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', 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', 164 165 ); 165 166 166 167 /** -
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.