Skip to:
Content

BuddyPress.org

Ticket #7364: 7364-01.patch

File 7364-01.patch, 2.6 KB (added by hnla, 8 years ago)

Update line indents, add notoggle class arg

  • src/bp-xprofile/bp-xprofile-template.php

     
    13581358         *
    13591359         *    @type int    $field_id ID of the field to render.
    13601360         *    @type string $before   Markup to render before the field.
     1361         *    @type string $before_controls  markup before form controls.
    13611362         *    @type string $after    Markup to render after the field.
     1363         *    @type string $after_controls Markup after the form controls.
    13621364         *    @type string $class    Class to apply to the field markup.
     1365         *    @type string $label_class Class to apply for the label element.
     1366         *    @type string $notoggle_tag Markup element to use for notoggle tag.
     1367         *    @type string $notoggle_class Class to apply to the notoggle element.
    13631368         * }
    13641369         * @return string $retval
    13651370         */
     
    13671372
    13681373                // Parse optional arguments.
    13691374                $r = bp_parse_args( $args, array(
    1370                         'field_id' => bp_get_the_profile_field_id(),
    1371                         'before'   => '',
    1372                         'after'    => '',
    1373                         'class'    => 'bp-xprofile-visibility'
     1375                        'field_id'         => bp_get_the_profile_field_id(),
     1376                        'before'           => '',
     1377                        'before_controls'  => '',
     1378                        'after'            => '',
     1379                        'after_controls'   => '',
     1380                        'class'            => 'bp-xprofile-visibility',
     1381                        'label_class'      => 'bp-screen-reader-text',
     1382                        'notoggle_tag'     => 'span',
     1383                        'notoggle_class'   => 'field-visibility-settings-notoggle',
    13741384                ), 'xprofile_settings_visibility_select' );
    13751385
    13761386                // Empty return value, filled in below if a valid field ID is found.
     
    13871397
    13881398                        <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
    13891399
    1390                                 <label for="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility" class="bp-screen-reader-text"><?php
     1400                        <?php echo $r['before_controls']; ?>
     1401
     1402                                <label for="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility" class="<?php echo esc_attr( $r['label_class'] ); ?>"><?php
    13911403                                        /* translators: accessibility text */
    13921404                                        _e( 'Select visibility', 'buddypress' );
    13931405                                ?></label>
     
    14011413
    14021414                                </select>
    14031415
     1416                        <?php echo $r['after_controls']; ?>
     1417
    14041418                        <?php else : ?>
    14051419
    1406                                 <span class="field-visibility-settings-notoggle"><?php bp_the_profile_field_visibility_level_label(); ?></span>
     1420                                <<?php echo esc_html( $r['notoggle_tag'] ); ?> class="<?php echo esc_attr( $r['notoggle_class'] ); ?>"><?php bp_the_profile_field_visibility_level_label(); ?></<?php echo esc_html( $r['notoggle_tag'] ); ?>>
    14071421
    14081422                        <?php endif;
    14091423