| 2215 | * Outputs the html value and placeholder attributes. |
| 2216 | * |
| 2217 | * Accepts the value of the input field and an optional placeholder for |
| 2218 | * use when the value is empty. |
| 2219 | * |
| 2220 | * @param string $value The value of the input field |
| 2221 | * @param bool $echo (true) Whether to echo or just return the string |
| 2222 | * @param string $placeholder (false) The placeholder of the input field |
| 2223 | * @return string html attribute or empty string |
| 2224 | */ |
| 2225 | function valued( $value, $echo = true, $placeholder = false ){ |
| 2226 | $data = ''; |
| 2227 | if ( (string) $value ) |
| 2228 | $data = ' value="' . esc_attr( $value ) . '"'; |
| 2229 | |
| 2230 | if ( (string) $placeholder ) |
| 2231 | $data .= ' placeholder="' . esc_attr( $placeholder ) . '"'; |
| 2232 | |
| 2233 | if ( $echo ) |
| 2234 | echo $data; |
| 2235 | else |
| 2236 | return $data; |
| 2237 | } |
| 2238 | |
| 2239 | /** |