WordPress.org

Making WordPress.org

Changeset 3737


Ignore:
Timestamp:
07/29/2016 10:29:12 AM (3 years ago)
Author:
ocean90
Message:

Support, Version Dropdown: Clean up HTML for dropdown.

  • Use correct value for the for attribute of the label.
  • Print description before dropdown.
  • Replace echo esc_html( __( ) ) with esc_html_e().

See #1544.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-version-dropdown/inc/class-plugin.php

    r3704 r3737  
    7676        }
    7777        ?>
    78         <p><label for="<?php echo esc_attr( self::META_KEY ); ?>"><?php echo esc_html( __('Version', 'wporg') ); ?></label><br />
     78        <p>
     79            <label for="wp-version"><?php esc_html_e( 'Version:', 'wporg' ); ?></label><br />
     80            <em><?php esc_html_e( 'Select the version of WordPress you are using.', 'wporg' ); ?></em><br />
    7981
    80         <select name="<?php echo esc_attr( self::META_KEY ); ?>" id="wp-version">
     82            <select name="<?php echo esc_attr( self::META_KEY ); ?>" id="wp-version">
     83                <?php foreach ( $versions as $key => $label ) : ?>
     84                    <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $version ); ?>><?php echo esc_html( $label ); ?></option>
     85                <?php endforeach; ?>
     86            </select>
    8187
    82         <?php foreach ( $versions as $key => $label ) : ?>
    83 
    84             <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $version ); ?>><?php echo esc_html( $label ); ?></option>
    85 
    86         <?php endforeach; ?>
    87 
    88         </select> <?php esc_html( __( 'Select the version of WordPress you are using', 'wporg' ) ); ?>
    89 
    90         <label for="wp-other-version"><?php echo esc_html( __( 'Enter a different WordPress version here:', 'wporg' ) ); ?></label>
    91 
    92         <input type="text" name="wp_other_version" id="wp-other-version" value="<?php echo esc_attr( $other_version ); ?>"></p>
     88            <label for="wp-other-version"><?php esc_html_e( 'Enter a different WordPress version here:', 'wporg' ); ?></label>
     89            <input type="text" name="wp_other_version" id="wp-other-version" value="<?php echo esc_attr( $other_version ); ?>">
     90        </p>
    9391        <?php
    9492    }
Note: See TracChangeset for help on using the changeset viewer.