Skip to:
Content

BuddyPress.org

Changeset 10305


Ignore:
Timestamp:
10/22/2015 09:04:44 AM (4 years ago)
Author:
djpaul
Message:

xProfile: adjust wp-admin field labels

The admin_field_html method is only used inside wp-admin, so there's
no need to wrap these template bits inside is_admin checks.

Partially reverts the changes in r10298:10302. See #6655

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

Legend:

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

    r10298 r10305  
    181181        $r = bp_parse_args( $raw_properties, array(
    182182            'multiple' => 'multiple'
    183         ) );
    184 
    185         if ( is_admin() ) : ?>
    186 
    187             <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Select', 'buddypress' ); ?></label>
    188             <select <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    189                 <?php bp_the_profile_field_options(); ?>
    190             </select>
    191 
    192         <?php else : ?>
    193 
    194             <select <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    195                 <?php bp_the_profile_field_options(); ?>
    196             </select>
    197 
    198         <?php endif; ?>
     183        ) ); ?>
     184
     185        <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Select', 'buddypress' ); ?></label>
     186        <select <?php echo $this->get_edit_field_html_elements( $r ); ?>>
     187            <?php bp_the_profile_field_options(); ?>
     188        </select>
    199189
    200190        <?php
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-number.php

    r10299 r10305  
    9292        $r = bp_parse_args( $raw_properties, array(
    9393            'type' => 'number'
    94         ) );
     94        ) ); ?>
    9595
    96         if ( is_admin() ) : ?>
    97 
    98             <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Number field', 'buddypress' ); ?></label>
    99             <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    100 
    101         <?php else : ?>
    102 
    103             <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    104 
    105         <?php endif; ?>
    106 
     96        <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Number field', 'buddypress' ); ?></label>
     97        <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    10798    <?php
    10899    }
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php

    r10300 r10305  
    162162     */
    163163    public function admin_field_html( array $raw_properties = array() ) {
     164        ?>
    164165
    165         if ( is_admin() ) : ?>
    166 
    167             <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Select', 'buddypress' ); ?></label>
    168             <select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>>
    169                 <?php bp_the_profile_field_options(); ?>
    170             </select>
    171 
    172         <?php else : ?>
    173 
    174             <select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>>
    175                 <?php bp_the_profile_field_options(); ?>
    176             </select>
    177 
    178         <?php endif; ?>
     166        <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Select', 'buddypress' ); ?></label>
     167        <select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>>
     168            <?php bp_the_profile_field_options(); ?>
     169        </select>
    179170
    180171        <?php
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php

    r10301 r10305  
    9292        $r = bp_parse_args( $raw_properties, array(
    9393            'type' => 'text'
    94         ) );
     94        ) ); ?>
    9595
    96         if ( is_admin() ) : ?>
    97 
    98             <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Textbox', 'buddypress' ); ?></label>
    99             <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    100 
    101         <?php else : ?>
    102 
    103             <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    104 
    105         <?php endif; ?>
     96        <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Textbox', 'buddypress' ); ?></label>
     97        <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    10698
    10799        <?php
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-url.php

    r10302 r10305  
    9494        $r = bp_parse_args( $raw_properties, array(
    9595            'type' => 'url'
    96         ) );
     96        ) ); ?>
    9797
    98         if ( is_admin() ) : ?>
    99 
    100             <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'URL', 'buddypress' ); ?></label>
    101             <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    102 
    103         <?php else : ?>
    104 
    105             <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    106 
    107         <?php endif; ?>
     98        <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'URL', 'buddypress' ); ?></label>
     99        <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
    108100
    109101        <?php
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type.php

    r10254 r10305  
    1919    /**
    2020     * Validation regex rules for field type.
    21 
    2221     * @since 2.0.0
    2322     * @var array Field type validation regexes.
Note: See TracChangeset for help on using the changeset viewer.