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-xprofile/bp-xprofile-classes.php

    r9324 r9329  
    36253625         * @param string $value Class name for the current class instance.
    36263626         */
    3627         $r    = (array) apply_filters( 'bp_xprofile_field_edit_html_elements', $r, get_class( $this ) );
    3628 
    3629         foreach ( $r as $name => $value ) {
    3630             $html .= sprintf( '%s="%s" ', sanitize_key( $name ), esc_attr( $value ) );
    3631         }
    3632 
    3633         return $html;
     3627        $r = (array) apply_filters( 'bp_xprofile_field_edit_html_elements', $r, get_class( $this ) );
     3628
     3629        return bp_get_form_field_attributes( sanitize_key( bp_get_the_profile_field_name() ), $r );
    36343630    }
    36353631}
Note: See TracChangeset for help on using the changeset viewer.