Changeset 28930
- Timestamp:
- 06/30/2014 07:47:56 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/customize-controls.css
r28927 r28930 288 288 289 289 .customize-control select, 290 .customize-control input[type="text"],291 290 .customize-control input[type="radio"], 292 291 .customize-control input[type="checkbox"] { … … 294 293 } 295 294 296 .customize-control input[type="text"] { 295 .customize-control input[type="text"], 296 .customize-control input[type="password"], 297 .customize-control input[type="email"], 298 .customize-control input[type="number"], 299 .customize-control input[type="search"], 300 .customize-control input[type="tel"], 301 .customize-control input[type="url"] { 297 302 width: 98%; 298 303 line-height: 18px; 299 304 margin: 0; 305 } 306 307 .customize-control-textarea textarea { 308 width: 100%; 309 resize: vertical; 300 310 } 301 311 -
trunk/src/wp-includes/class-wp-customize-control.php
r28927 r28930 67 67 */ 68 68 public $choices = array(); 69 70 /** 71 * @access public 72 * @var array 73 */ 74 public $input_attrs = array(); 69 75 70 76 /** … … 251 257 } 252 258 259 /** 260 * Render the custom attributes for the control's input element. 261 * 262 * @since 4.0.0 263 */ 264 public function input_attrs() { 265 foreach( $this->input_attrs as $attr => $value ) { 266 echo $attr . '="' . esc_attr( $value ) . '" '; 267 } 268 } 269 253 270 /** 254 271 * Render the control's content. … … 256 273 * Allows the content to be overriden without having to rewrite the wrapper in $this->render(). 257 274 * 258 * Supports basic input types `text`, `checkbox`, `radio`, `select` and `dropdown-pages`. 275 * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`. 276 * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly. 259 277 * 260 278 * @since 3.4.0 … … 262 280 protected function render_content() { 263 281 switch( $this->type ) { 264 case 'text':265 ?>266 <label>267 <?php if ( ! empty( $this->label ) ) : ?>268 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>269 <?php endif;270 if ( ! empty( $this->description ) ) : ?>271 <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>272 <?php endif; ?>273 <input type="text" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); ?> />274 </label>275 <?php276 break;277 282 case 'checkbox': 278 283 ?> … … 330 335 <?php 331 336 break; 337 case 'textarea': 338 ?> 339 <label> 340 <?php if ( ! empty( $this->label ) ) : ?> 341 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 342 <?php endif; 343 if ( ! empty( $this->description ) ) : ?> 344 <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> 345 <?php endif; ?> 346 <textarea rows="5" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea> 347 </label> 348 <?php 349 break; 332 350 case 'dropdown-pages': 333 351 $dropdown = wp_dropdown_pages( … … 349 367 $dropdown 350 368 ); 369 break; 370 default: 371 ?> 372 <label> 373 <?php if ( ! empty( $this->label ) ) : ?> 374 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 375 <?php endif; 376 if ( ! empty( $this->description ) ) : ?> 377 <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> 378 <?php endif; ?> 379 <input type="<?php echo esc_attr( $this->type ); ?>" <?php $this->input_attrs(); ?> value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); ?> /> 380 </label> 381 <?php 351 382 break; 352 383 }
Note: See TracChangeset
for help on using the changeset viewer.