Changeset 13658 for trunk/wp-admin/includes/template.php
- Timestamp:
- 03/11/2010 04:34:27 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r13624 r13658 171 171 172 172 return $output; 173 }174 175 /**176 * Outputs the html checked attribute.177 *178 * Compares the first two arguments and if identical marks as checked179 *180 * @since 1.0181 *182 * @param any $checked One of the values to compare183 * @param any $current (true) The other value to compare if not just true184 * @param bool $echo Whether to echo or just return the string185 */186 function checked( $checked, $current = true, $echo = true) {187 return __checked_selected_helper( $checked, $current, $echo, 'checked' );188 }189 190 /**191 * Outputs the html selected attribute.192 *193 * Compares the first two arguments and if identical marks as selected194 *195 * @since 1.0196 *197 * @param any selected One of the values to compare198 * @param any $current (true) The other value to compare if not just true199 * @param bool $echo Whether to echo or just return the string200 */201 function selected( $selected, $current = true, $echo = true) {202 return __checked_selected_helper( $selected, $current, $echo, 'selected' );203 }204 205 /**206 * Private helper function for checked and selected.207 *208 * Compares the first two arguments and if identical marks as $type209 *210 * @since 2.8211 * @access private212 *213 * @param any $helper One of the values to compare214 * @param any $current (true) The other value to compare if not just true215 * @param bool $echo Whether to echo or just return the string216 * @param string $type The type of checked|selected we are doing.217 */218 function __checked_selected_helper( $helper, $current, $echo, $type) {219 if ( (string) $helper === (string) $current)220 $result = " $type='$type'";221 else222 $result = '';223 224 if ($echo)225 echo $result;226 227 return $result;228 173 } 229 174
Note: See TracChangeset
for help on using the changeset viewer.