Skip to:
Content

BuddyPress.org

Changeset 10855


Ignore:
Timestamp:
06/01/2016 05:17:19 PM (10 years ago)
Author:
dcavins
Message:

Profile inputs: Add wrapper divs around options.

Add a wrapper div around radio button options,
checkbox options, and datebook selects in
extended profile form inputs.

See #7083.

Props dcavins, imath, offereins.

Location:
trunk/src/bp-xprofile/classes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php

    r10713 r10855  
    177177                }
    178178
    179                 echo $html;
     179                printf( '<div id="%1$s" class="input-options checkbox-options">%2$s</div>',
     180                        esc_attr( 'field_' . $this->field_obj->id ),
     181                        $html
     182                );
    180183        }
    181184
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php

    r10828 r10855  
    8686                        </legend>
    8787
    88                         <?php
    89 
    90                         /**
    91                          * Fires after field label and displays associated errors for the field.
    92                          *
    93                          * This is a dynamic hook that is dependent on the associated
    94                          * field ID. The hooks will be similar to `bp_field_12_errors`
    95                          * where the 12 is the field ID. Simply replace the 12 with
    96                          * your needed target ID.
    97                          *
    98                          * @since 1.8.0
    99                          */
    100                         do_action( bp_get_the_profile_field_errors_action() ); ?>
    101 
    102                         <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
    103                                 /* translators: accessibility text */
    104                                 esc_html_e( 'Select day', 'buddypress' );
    105                         ?></label>
    106                         <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
    107                                 <?php bp_the_profile_field_options( array(
    108                                         'type'    => 'day',
    109                                         'user_id' => $user_id
    110                                 ) ); ?>
    111                         </select>
    112 
    113                         <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
    114                                 /* translators: accessibility text */
    115                                 esc_html_e( 'Select month', 'buddypress' );
    116                         ?></label>
    117                         <select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>>
    118                                 <?php bp_the_profile_field_options( array(
    119                                         'type'    => 'month',
    120                                         'user_id' => $user_id
    121                                 ) ); ?>
    122                         </select>
    123 
    124                         <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
    125                                 /* translators: accessibility text */
    126                                 esc_html_e( 'Select year', 'buddypress' );
    127                         ?></label>
    128                         <select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>
    129                                 <?php bp_the_profile_field_options( array(
    130                                         'type'    => 'year',
    131                                         'user_id' => $user_id
    132                                 ) ); ?>
    133                         </select>
     88                        <div class="input-options datebox-selects">
     89
     90                                <?php
     91
     92                                /**
     93                                 * Fires after field label and displays associated errors for the field.
     94                                 *
     95                                 * This is a dynamic hook that is dependent on the associated
     96                                 * field ID. The hooks will be similar to `bp_field_12_errors`
     97                                 * where the 12 is the field ID. Simply replace the 12 with
     98                                 * your needed target ID.
     99                                 *
     100                                 * @since 1.8.0
     101                                 */
     102                                do_action( bp_get_the_profile_field_errors_action() ); ?>
     103
     104                                <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
     105                                        /* translators: accessibility text */
     106                                        esc_html_e( 'Select day', 'buddypress' );
     107                                ?></label>
     108                                <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
     109                                        <?php bp_the_profile_field_options( array(
     110                                                'type'    => 'day',
     111                                                'user_id' => $user_id
     112                                        ) ); ?>
     113                                </select>
     114
     115                                <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
     116                                        /* translators: accessibility text */
     117                                        esc_html_e( 'Select month', 'buddypress' );
     118                                ?></label>
     119                                <select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>>
     120                                        <?php bp_the_profile_field_options( array(
     121                                                'type'    => 'month',
     122                                                'user_id' => $user_id
     123                                        ) ); ?>
     124                                </select>
     125
     126                                <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
     127                                        /* translators: accessibility text */
     128                                        esc_html_e( 'Select year', 'buddypress' );
     129                                ?></label>
     130                                <select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>
     131                                        <?php bp_the_profile_field_options( array(
     132                                                'type'    => 'year',
     133                                                'user_id' => $user_id
     134                                        ) ); ?>
     135                                </select>
     136
     137                        </div>
    134138
    135139                </fieldset>
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php

    r10740 r10855  
    112112                $options      = $this->field_obj->get_children();
    113113
    114                 $html = sprintf( '<div id="%s">', esc_attr( 'field_' . $this->field_obj->id ) );
     114                $html = '';
    115115
    116116                for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
    … …  
    155155                }
    156156
    157                 echo $html . '</div>';
     157                printf( '<div id="%1$s" class="input-options radio-button-options">%2$s</div>',
     158                        esc_attr( 'field_' . $this->field_obj->id ),
     159                        $html
     160                );
    158161        }
    159162
Note: See TracChangeset for help on using the changeset viewer.