Ticket #5914: 5914.02.patch
File 5914.02.patch, 8.7 KB (added by , 10 years ago) |
---|
-
src/bp-blogs/bp-blogs-template.php
1223 1223 if ( !is_subdomain_install() ) 1224 1224 echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /><br />'; 1225 1225 else 1226 echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />';1226 echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" ' . bp_get_form_field_attributes( 'blogname' ) . '/> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />'; 1227 1227 1228 1228 if ( !is_user_logged_in() ) { 1229 1229 print '(<strong>' . __( 'Your address will be ' , 'buddypress'); -
src/bp-core/bp-core-template.php
492 492 } 493 493 494 494 /** 495 * Output the attributes for a form field. 496 * 497 * @since BuddyPress (2.2.0) 498 * 499 * @param string $name The field name to output attributes for. 500 * @param array $attributes Array of existing attributes to add. 501 */ 502 function bp_form_field_attributes( $name = '', $attributes = array() ) { 503 echo bp_get_form_field_attributes( $name, $attributes ); 504 } 505 /** 506 * Get the attributes for a form field. 507 * 508 * Primarily to add better support for touchscreen devices, but plugin devs 509 * can use the 'bp_get_form_field_extra_attributes' filter for further 510 * manipulation. 511 * 512 * @since BuddyPress (2.2.0) 513 * 514 * @param string $name The field name to get attributes for. 515 * @param array $attributes Array of existing attributes to add. 516 * @return string 517 */ 518 function bp_get_form_field_attributes( $name = '', $attributes = array() ) { 519 $retval = ''; 520 521 if ( empty( $attributes ) ) { 522 $attributes = array(); 523 } 524 525 $name = strtolower( $name ); 526 527 switch ( $name ) { 528 case 'username' : 529 case 'blogname' : 530 $attributes['autocomplete'] = 'off'; 531 $attributes['autocapitalize'] = 'none'; 532 break; 533 534 case 'email' : 535 if ( wp_is_mobile() ) { 536 $attributes['autocapitalize'] = 'none'; 537 } 538 break; 539 540 case 'password' : 541 $attributes['spellcheck'] = 'false'; 542 $attributes['autocomplete'] = 'off'; 543 544 if ( wp_is_mobile() ) { 545 $attributes['autocorrect'] = 'false'; 546 $attributes['autocapitalize'] = 'none'; 547 } 548 break; 549 } 550 551 /** 552 * Filter the attributes for a field before rendering output. 553 * 554 * @since BuddyPress (2.2.0) 555 * 556 * @param array $attributes The field attributes 557 * @param string $name The field name 558 */ 559 $attributes = (array) apply_filters( 'bp_get_form_field_attributes', $attributes, $name ); 560 561 $attributes = array_unique( $attributes ); 562 563 foreach( $attributes as $attr => $value ) { 564 $retval .= sprintf( ' %s="%s"', sanitize_key( $attr ), esc_attr( $value ) ); 565 } 566 567 return $retval; 568 } 569 570 /** 495 571 * Create and output a button. 496 572 * 497 573 * @see bp_get_button() -
src/bp-templates/bp-legacy/buddypress/members/register.php
31 31 32 32 <label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> 33 33 <?php do_action( 'bp_signup_username_errors' ); ?> 34 <input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" />34 <input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" <?php bp_form_field_attributes( 'username' ); ?>/> 35 35 36 36 <label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> 37 37 <?php do_action( 'bp_signup_email_errors' ); ?> 38 <input type="email" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" />38 <input type="email" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" <?php bp_form_field_attributes( 'email' ); ?>/> 39 39 40 40 <label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> 41 41 <?php do_action( 'bp_signup_password_errors' ); ?> 42 <input type="password" name="signup_password" id="signup_password" value="" class="password-entry" />42 <input type="password" name="signup_password" id="signup_password" value="" class="password-entry" <?php bp_form_field_attributes( 'password' ); ?>/> 43 43 <div id="pass-strength-result"></div> 44 44 45 45 <label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> 46 46 <?php do_action( 'bp_signup_password_confirm_errors' ); ?> 47 <input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" />47 <input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/> 48 48 49 49 <?php do_action( 'bp_account_details_fields' ); ?> 50 50 -
src/bp-templates/bp-legacy/buddypress/members/single/settings/general.php
5 5 <?php if ( !is_super_admin() ) : ?> 6 6 7 7 <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label> 8 <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" /> <a href="<?php echo wp_lostpassword_url(); ?>" title="<?php esc_attr_e( 'Password Lost and Found', 'buddypress' ); ?>"><?php _e( 'Lost your password?', 'buddypress' ); ?></a>8 <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" <?php bp_form_field_attributes( 'password' ); ?>/> <a href="<?php echo wp_lostpassword_url(); ?>" title="<?php esc_attr_e( 'Password Lost and Found', 'buddypress' ); ?>"><?php _e( 'Lost your password?', 'buddypress' ); ?></a> 9 9 10 10 <?php endif; ?> 11 11 12 12 <label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label> 13 <input type="email" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input" />13 <input type="email" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input" <?php bp_form_field_attributes( 'email' ); ?>/> 14 14 15 15 <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ); ?></label> 16 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small password-entry" /> <?php _e( 'New Password', 'buddypress' ); ?><br />16 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small password-entry" <?php bp_form_field_attributes( 'password' ); ?>/> <?php _e( 'New Password', 'buddypress' ); ?><br /> 17 17 <div id="pass-strength-result"></div> 18 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small password-entry-confirm" /> <?php _e( 'Repeat New Password', 'buddypress' ); ?>18 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/> <?php _e( 'Repeat New Password', 'buddypress' ); ?> 19 19 20 20 <?php do_action( 'bp_core_general_settings_before_submit' ); ?> 21 21 -
src/bp-xprofile/bp-xprofile-classes.php
3624 3624 * @param array $r Array of parsed arguments. 3625 3625 * @param string $value Class name for the current class instance. 3626 3626 */ 3627 $r 3627 $r = (array) apply_filters( 'bp_xprofile_field_edit_html_elements', $r, get_class( $this ) ); 3628 3628 3629 foreach ( $r as $name => $value ) { 3630 $html .= sprintf( '%s="%s" ', sanitize_key( $name ), esc_attr( $value ) ); 3631 } 3632 3633 return $html; 3629 return bp_get_form_field_attributes( sanitize_key( bp_get_the_profile_field_name() ), $r ); 3634 3630 } 3635 3631 } 3636 3632