Changeset 21037 for trunk/wp-includes/class-wp-customize-control.php
- Timestamp:
- 06/10/2012 12:32:19 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/class-wp-customize-control.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-customize-control.php
r21014 r21037 12 12 public $id; 13 13 14 // All settings tied to the control. 14 15 public $settings; 15 public $setting; 16 17 // The primary setting for the control (if there is one). 18 public $setting = 'default'; 16 19 17 20 public $priority = 10; … … 456 459 parent::__construct( $manager, 'header_image', array( 457 460 'label' => __( 'Header Image' ), 461 'settings' => array( 462 'default' => 'header_image', 463 'data' => 'header_image_data', 464 ), 458 465 'section' => 'header_image', 459 466 'context' => 'custom-header', … … 471 478 } 472 479 480 public function print_header_image( $choice, $header ) { 481 $header['url'] = set_url_scheme( $header['url'] ); 482 $header['thumbnail_url'] = set_url_scheme( $header['thumbnail_url'] ); 483 484 $header_image_data = array( 'choice' => $choice ); 485 foreach ( array( 'attachment_id', 'width', 'height', 'url', 'thumbnail_url' ) as $key ) { 486 if ( isset( $header[ $key ] ) ) 487 $header_image_data[ $key ] = $header[ $key ]; 488 } 489 490 491 ?> 492 <a href="#" class="thumbnail" 493 data-customize-image-value="<?php echo esc_url( $header['url'] ); ?>" 494 data-customize-header-image-data="<?php echo esc_attr( json_encode( $header_image_data ) ); ?>"> 495 <img src="<?php echo esc_url( $header['thumbnail_url'] ); ?>" /> 496 </a> 497 <?php 498 } 499 473 500 public function tab_uploaded() { 474 501 $headers = get_uploaded_header_images(); … … 476 503 ?><div class="uploaded-target"></div><?php 477 504 478 foreach ( $headers as $ header )479 $this->print_ tab_image( $header['url'], $header['thumbnail_url']);505 foreach ( $headers as $choice => $header ) 506 $this->print_header_image( $choice, $header ); 480 507 } 481 508 … … 484 511 $custom_image_header->process_default_headers(); 485 512 486 foreach ( $custom_image_header->default_headers as $ header )487 $this->print_ tab_image( $header['url'], $header['thumbnail_url']);513 foreach ( $custom_image_header->default_headers as $choice => $header ) 514 $this->print_header_image( $choice, $header ); 488 515 } 489 516 }
Note: See TracChangeset
for help on using the changeset viewer.