WordPress.org

Make WordPress Core

Changeset 5535


Ignore:
Timestamp:
05/24/2007 12:29:51 AM (11 years ago)
Author:
rob1n
Message:

Use selected() to clean that up. Thanks Mark. fixes #4291

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-includes/widgets.php

    r5519 r5535  
    374374            <p><label for="pages-sortby"><?php _e( 'Sort by:' ); ?>
    375375                <select name="pages-sortby" id="pages-sortby">
    376                     <option value="post_title"<?php if ( $options['sortby'] == 'post_title' ) { ?> selected="selected"<?php } ?>><?php _e('Page title'); ?></option>
    377                     <option value="menu_order"<?php if ( $options['sortby'] == 'menu_order' ) { ?> selected="selected"<?php } ?>><?php _e('Menu order'); ?></option>
    378                     <option value="ID"<?php if ( $options['sortby'] == 'ID' ) { ?> selected="selected"<?php } ?>><?php _e( 'Page ID' ); ?></option>
     376                    <option value="post_title"<?php selected( $options['sortby'], 'post_title' ); ?>><?php _e('Page title'); ?></option>
     377                    <option value="menu_order"<?php selected( $options['sortby'], 'menu_order' ); ?>><?php _e('Menu order'); ?></option>
     378                    <option value="ID"<?php selected( $options['sortby'], 'ID' ); ?>><?php _e( 'Page ID' ); ?></option>
    379379                </select></label></p>
    380380            <input type="hidden" id="pages-submit" name="pages-submit" value="1" />
  • trunk/wp-includes/widgets.php

    r5519 r5535  
    374374            <p><label for="pages-sortby"><?php _e( 'Sort by:' ); ?>
    375375                <select name="pages-sortby" id="pages-sortby">
    376                     <option value="post_title"<?php if ( $options['sortby'] == 'post_title' ) { ?> selected="selected"<?php } ?>><?php _e('Page title'); ?></option>
    377                     <option value="menu_order"<?php if ( $options['sortby'] == 'menu_order' ) { ?> selected="selected"<?php } ?>><?php _e('Menu order'); ?></option>
    378                     <option value="ID"<?php if ( $options['sortby'] == 'ID' ) { ?> selected="selected"<?php } ?>><?php _e( 'Page ID' ); ?></option>
     376                    <option value="post_title"<?php selected( $options['sortby'], 'post_title' ); ?>><?php _e('Page title'); ?></option>
     377                    <option value="menu_order"<?php selected( $options['sortby'], 'menu_order' ); ?>><?php _e('Menu order'); ?></option>
     378                    <option value="ID"<?php selected( $options['sortby'], 'ID' ); ?>><?php _e( 'Page ID' ); ?></option>
    379379                </select></label></p>
    380380            <input type="hidden" id="pages-submit" name="pages-submit" value="1" />
Note: See TracChangeset for help on using the changeset viewer.