Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/09/2015 06:34:41 PM (10 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/register.php

    r9308 r9329  
    3232                <label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    3333                <?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' ); ?>/>
    3535
    3636                <label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    3737                <?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' ); ?>/>
    3939
    4040                <label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    4141                <?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' ); ?>/>
    4343                <div id="pass-strength-result"></div>
    4444
    4545                <label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
    4646                <?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' ); ?>/>
    4848
    4949                <?php do_action( 'bp_account_details_fields' ); ?>
Note: See TracChangeset for help on using the changeset viewer.