Skip to:
Content

BuddyPress.org

Ticket #6521: 6525.02.patch

File 6525.02.patch, 8.5 KB (added by dcavins, 9 years ago)

Update all '(required)' uses in profile template functions.

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

    diff --git src/bp-xprofile/bp-xprofile-admin.php src/bp-xprofile/bp-xprofile-admin.php
    index 66d5c3f..6c93a0e 100644
    function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) { 
    506506                                <?php bp_the_profile_field_name(); ?>
    507507
    508508                                <?php if ( empty( $field->can_delete )                                    ) : ?><?php esc_html_e( '(Primary)',  'buddypress' ); endif; ?>
    509                                 <?php if ( bp_get_the_profile_field_is_required()                         ) : ?><?php esc_html_e( '(Required)', 'buddypress' ); endif; ?>
     509                                <?php bp_the_profile_field_required_label(); ?>
    510510                                <?php if ( bp_xprofile_get_meta( $field->id, 'field', 'signup_position' ) ) : ?><?php esc_html_e( '(Sign-up)',  'buddypress' ); endif; ?>
    511511                                <?php if ( bp_get_member_types() ) : echo $field->get_member_type_label(); endif; ?>
    512512
  • src/bp-xprofile/bp-xprofile-template.php

    diff --git src/bp-xprofile/bp-xprofile-template.php src/bp-xprofile/bp-xprofile-template.php
    index 7ee7a66..653776f 100644
    function bp_profile_settings_visibility_select( $args = '' ) { 
    13221322                 */
    13231323                return apply_filters( 'bp_profile_settings_visibility_select', $retval, $r, $args );
    13241324        }
     1325
     1326function bp_the_profile_field_required_label(){
     1327        echo bp_get_the_profile_field_required_label();
     1328}
     1329
     1330        function bp_get_the_profile_field_required_label(){
     1331                $retval = '';
     1332
     1333                if ( bp_get_the_profile_field_is_required() ) {
     1334                        $translated_string = __( ' (required)', 'buddypress' );
     1335
     1336                        $retval = '<span class="bp-required-field-label">';
     1337                        $retval .= apply_filters( 'bp_get_the_profile_field_required_label', $translated_string, bp_get_the_profile_field_id() );
     1338                        $retval .= '</span>';
     1339
     1340                }
     1341                return $retval;
     1342        }
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php
    index 37888a6..e50a094 100644
    class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { 
    6666                <div class="checkbox">
    6767                        <label for="<?php bp_the_profile_field_input_name(); ?>">
    6868                                <?php bp_the_profile_field_name(); ?>
    69                                 <?php if ( bp_get_the_profile_field_is_required() ) : ?>
    70                                         <?php esc_html_e( '(required)', 'buddypress' ); ?>
    71                                 <?php endif; ?>
     69                                <?php bp_the_profile_field_required_label(); ?>
    7270                        </label>
    7371
    7472                        <?php
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
    index b71a91f..d328e58 100644
    class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 
    7676
    7777                <div class="datebox">
    7878
    79                         <label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
     79                        <label for="<?php bp_the_profile_field_input_name(); ?>_day">
     80                                <?php bp_the_profile_field_name(); ?>
     81                                <?php bp_the_profile_field_required_label(); ?>
     82                        </label>
     83
    8084                        <?php
    8185
    8286                        /**
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php
    index a95fd86..fb31f64 100644
    class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { 
    6969                        'name'     => bp_get_the_profile_field_input_name() . '[]',
    7070                ) ); ?>
    7171
    72                 <label for="<?php bp_the_profile_field_input_name(); ?>[]"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
     72                <label for="<?php bp_the_profile_field_input_name(); ?>[]">
     73                        <?php bp_the_profile_field_name(); ?>
     74                        <?php bp_the_profile_field_required_label(); ?>
     75                </label>
    7376
    7477                <?php
    7578
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-number.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-number.php src/bp-xprofile/classes/class-bp-xprofile-field-type-number.php
    index 6fac098..5f3ce13 100644
    class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type { 
    6363
    6464                <label for="<?php bp_the_profile_field_input_name(); ?>">
    6565                        <?php bp_the_profile_field_name(); ?>
    66                         <?php if ( bp_get_the_profile_field_is_required() ) : ?>
    67                                 <?php esc_html_e( '(required)', 'buddypress' ); ?>
    68                         <?php endif; ?>
     66                        <?php bp_the_profile_field_required_label(); ?>
    6967                </label>
    7068
    7169                <?php
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php src/bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php
    index d549075..668e6dc 100644
    class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { 
    6565
    6666                        <label for="<?php bp_the_profile_field_input_name(); ?>">
    6767                                <?php bp_the_profile_field_name(); ?>
    68                                 <?php if ( bp_get_the_profile_field_is_required() ) : ?>
    69                                         <?php esc_html_e( '(required)', 'buddypress' ); ?>
    70                                 <?php endif; ?>
     68                                <?php bp_the_profile_field_required_label(); ?>
    7169                        </label>
    7270
    7371                        <?php
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php src/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php
    index 5431381..f2c1ef2 100644
    class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { 
    6363
    6464                <label for="<?php bp_the_profile_field_input_name(); ?>">
    6565                        <?php bp_the_profile_field_name(); ?>
    66                         <?php if ( bp_get_the_profile_field_is_required() ) : ?>
    67                                 <?php esc_html_e( '(required)', 'buddypress' ); ?>
    68                         <?php endif; ?>
     66                        <?php bp_the_profile_field_required_label(); ?>
    6967                </label>
    7068
    7169                <?php
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php src/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php
    index 4b5ffc2..4d1aa7d 100644
    class BP_XProfile_Field_Type_Textarea extends BP_XProfile_Field_Type { 
    6363
    6464                <label for="<?php bp_the_profile_field_input_name(); ?>">
    6565                        <?php bp_the_profile_field_name(); ?>
    66                         <?php if ( bp_get_the_profile_field_is_required() ) : ?>
    67                                 <?php esc_html_e( '(required)', 'buddypress' ); ?>
    68                         <?php endif; ?>
     66                        <?php bp_the_profile_field_required_label(); ?>
    6967                </label>
    7068
    7169                <?php
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php src/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php
    index e8f78c2..a3f229f 100644
    class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type { 
    6363
    6464                <label for="<?php bp_the_profile_field_input_name(); ?>">
    6565                        <?php bp_the_profile_field_name(); ?>
    66                         <?php if ( bp_get_the_profile_field_is_required() ) : ?>
    67                                 <?php esc_html_e( '(required)', 'buddypress' ); ?>
    68                         <?php endif; ?>
     66                        <?php bp_the_profile_field_required_label(); ?>
    6967                </label>
    7068
    7169                <?php
  • src/bp-xprofile/classes/class-bp-xprofile-field-type-url.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-url.php src/bp-xprofile/classes/class-bp-xprofile-field-type-url.php
    index 1a4cb86..bbdcaaf 100644
    class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { 
    6666
    6767                <label for="<?php bp_the_profile_field_input_name(); ?>">
    6868                        <?php bp_the_profile_field_name(); ?>
    69                         <?php if ( bp_get_the_profile_field_is_required() ) : ?>
    70                                 <?php esc_html_e( '(required)', 'buddypress' ); ?>
    71                         <?php endif; ?>
     69                        <?php bp_the_profile_field_required_label(); ?>
    7270                </label>
    7371
    7472                <?php