@@ -369,7 +542,7 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
tabs as $id => $tab ): ?>
- -
+
-
@@ -388,6 +561,15 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
tabs[ $id ] = array(
'label' => $label,
@@ -395,10 +577,20 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
);
}
+ /**
+ * Remove a tab from the control.
+ *
+ * @since 3.4.0
+ *
+ * @param string $id
+ */
public function remove_tab( $id ) {
unset( $this->tabs[ $id ] );
}
+ /**
+ * @since 3.4.0
+ */
public function tab_upload_new() {
if ( ! _device_can_upload() ) {
?>
@@ -416,12 +608,21 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
}
}
+ /**
+ * @since 3.4.0
+ */
public function tab_uploaded() {
?>
__( 'Background Image' ),
@@ -446,6 +663,9 @@ class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control {
$this->add_tab( 'default', __('Default'), array( $this, 'tab_default_background' ) );
}
+ /**
+ * @since 3.4.0
+ */
public function tab_uploaded() {
$backgrounds = get_posts( array(
'post_type' => 'attachment',
@@ -464,11 +684,22 @@ class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control {
$this->print_tab_image( esc_url_raw( $background->guid ) );
}
+ /**
+ * @since 3.4.0
+ * @uses WP_Customize_Image_Control::print_tab_image()
+ */
public function tab_default_background() {
$this->print_tab_image( $this->setting->default );
}
}
+/**
+ * Customize Header Image Control Class
+ *
+ * @package WordPress
+ * @subpackage Customize
+ * @since 3.4.0
+ */
class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
/**
* The processed default headers.
@@ -484,6 +715,15 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
*/
protected $uploaded_headers;
+ /**
+ * Constructor.
+ *
+ * @since 3.4.0
+ * @uses WP_Customize_Image_Control::__construct()
+ * @uses WP_Customize_Image_Control::add_tab()
+ *
+ * @param WP_Customize_Manager $manager
+ */
public function __construct( $manager ) {
parent::__construct( $manager, 'header_image', array(
'label' => __( 'Header Image' ),
@@ -533,6 +773,12 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
return parent::prepare_control();
}
+ /**
+ * @since 3.4.0
+ *
+ * @param mixed $choice Which header image to select. (@see Custom_Image_Header::get_header_image() )
+ * @param array $header
+ */
public function print_header_image( $choice, $header ) {
$header['url'] = set_url_scheme( $header['url'] );
$header['thumbnail_url'] = set_url_scheme( $header['thumbnail_url'] );
@@ -553,6 +799,9 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
print_header_image( $choice, $header );
}
+ /**
+ * @since 3.4.0
+ */
public function tab_default_headers() {
foreach ( $this->default_headers as $choice => $header )
$this->print_header_image( $choice, $header );