Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/09/2015 06:34:41 PM (5 years ago)
Author:
r-a-y
Message:

Core: Introduce bp_form_field_attributes() function.

bp_form_field_attributes() is a helper function to output attributes for
a given field.

The function:

  • Sets some default attributes for the username, email and password input fields to better support touchscreen devices.
  • Allows plugin developers to arbitrarily filter the attributes for the given field.
  • Is used in BP_XProfile_Type::get_edit_field_html_elements() to better filter fields by input name.

Props hnla, standardspace, boonebgorges, johnjamesjacoby.

Fixes #5914.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/general.php

    r9225 r9329  
    66
    77        <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" /> &nbsp;<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' ); ?>/> &nbsp;<a href="<?php echo wp_lostpassword_url(); ?>" title="<?php esc_attr_e( 'Password Lost and Found', 'buddypress' ); ?>"><?php _e( 'Lost your password?', 'buddypress' ); ?></a>
    99
    1010    <?php endif; ?>
    1111
    1212    <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' ); ?>/>
    1414
    1515    <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" /> &nbsp;<?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' ); ?>/> &nbsp;<?php _e( 'New Password', 'buddypress' ); ?><br />
    1717    <div id="pass-strength-result"></div>
    18     <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small password-entry-confirm" /> &nbsp;<?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' ); ?>/> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ); ?>
    1919
    2020    <?php do_action( 'bp_core_general_settings_before_submit' ); ?>
Note: See TracChangeset for help on using the changeset viewer.