Ticket #5914: 5914.01.patch
File 5914.01.patch, 7.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_extra_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 extra attributes for a form field. 496 * 497 * @since BuddyPress (2.2.0) 498 * 499 * @param string $type The field type to output attributes for. 500 */ 501 function bp_form_field_extra_attributes( $type = '' ) { 502 echo bp_get_form_field_extra_attributes( $type ); 503 } 504 /** 505 * Get the extra attributes for a form field. 506 * 507 * Primarily to add better support for touchscreen devices, but plugin devs 508 * can use the 'bp_get_form_field_extra_attributes' filter for further 509 * manipulation. 510 * 511 * @since BuddyPress (2.2.0) 512 * 513 * @param string $type The field type to get attributes for. 514 */ 515 function bp_get_form_field_extra_attributes( $type = '' ) { 516 $retval = ''; 517 $attributes = array(); 518 519 switch ( $type ) { 520 case 'slug' : 521 case 'username' : 522 case 'blogname' : 523 $attributes['autocomplete'] = 'off'; 524 $attributes['autocapitalize'] = 'none'; 525 break; 526 527 case 'email' : 528 if ( wp_is_mobile() ) { 529 $attributes['autocapitalize'] = 'none'; 530 } 531 break; 532 533 case 'password' : 534 $attributes['spellcheck'] = 'false'; 535 $attributes['autocomplete'] = 'off'; 536 537 if ( wp_is_mobile() ) { 538 $attributes['autocorrect'] = 'false'; 539 $attributes['autocapitalize'] = 'none'; 540 } 541 break; 542 } 543 544 /** 545 * Filter the attributes for a field before rendering output. 546 * 547 * @since BuddyPress (2.2.0) 548 * 549 * @param array $attributes The field attributes 550 * @param string $type The field type 551 */ 552 $attributes = apply_filters( 'bp_get_form_field_extra_attributes', $attributes, $type ); 553 554 foreach( (array) $attributes as $attr => $value ) { 555 $attr = sanitize_title( $attr ); 556 $value = esc_attr( $value ); 557 $retval .= " {$attr}=\"{$value}\""; 558 } 559 560 echo $retval; 561 } 562 563 /** 495 564 * Create and output a button. 496 565 * 497 566 * @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_extra_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_extra_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_extra_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_extra_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_extra_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_extra_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_extra_attributes( 'password' ); ?>/> <?php _e( 'Repeat New Password', 'buddypress' ); ?> 19 19 20 20 <?php do_action( 'bp_core_general_settings_before_submit' ); ?> 21 21