Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Installation paths and URLs, with SSL support: http://codex.wordpress.org/Determining_Plugin_and_Content_Directories
- */
- /* standard solution to populate a selection drop-down */
- <?php $sel = ' selected="selected"'; ?>
- <label for="<?= $this->get_field_id('sortby'); ?>"><?php _e('Sort by:', 'wpdtree'); ?></label>
- <select id="<?= $this->get_field_id('sortby'); ?>" name="<?= $this->get_field_name('sortby'); ?>">
- <option value="post_title" <?php if($conf['sortby'] == 'post_title') echo $sel; ?>>
- Title
- </option>
- <option value="post_date" <?php if($conf['sortby'] == 'post_date') echo $sel; ?>>
- Date
- </option>
- <option value="ID" <?php if($conf['sortby'] == 'ID') echo $sel;? >>
- ID
- </option>
- </select>
- <!-- using WordPress selected(): -->
- <label for="<?= $this->get_field_id('sortby'); ?>"><?php _e('Sort by:', 'wpdtree'); ?></label>
- <select id="<?= $this->get_field_id('sortby'); ?>" name="<?= $this->get_field_name('sortby'); ?>">
- <option value="post_title" <?php selected($conf['sortby'], 'post_title'); ?>>Title</option>
- <option value="post_date" <?php selected($conf['sortby'], 'post_date'); ?>>Date</option>
- <option value="ID" <?php selected($conf['sortby'], 'ID'); ?>>ID</option>
- </select>
- /* similar functions:
- checked() - compares two values and output the checked attribute for radio buttons / checkbox
- disabled() - =||= disables a form input field
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement