/**
  * Refresh the parameters passed to the JavaScript via JSON.
  *
  *
  * @Override
  * @see WP_Customize_Control::to_json()
  */
 public function to_json()
 {
     parent::to_json();
     $this->json['title'] = !empty($this->title) ? esc_html($this->title) : '';
     $this->json['notice'] = !empty($this->notice) ? $this->notice : '';
     $this->json['dst_width'] = isset($this->dst_width) ? $this->dst_width : $this->width;
     $this->json['dst_height'] = isset($this->dst_height) ? $this->dst_height : $this->height;
     //overload WP_Customize_Upload_Control
     //we need to re-build the absolute url of the logo src set in old Customizr
     $value = $this->value();
     if ($value) {
         //re-build the absolute url if the value isn't an attachment id before retrieving the id
         if ((int) esc_attr($value) < 1) {
             $upload_dir = wp_upload_dir();
             $value = false !== strpos($value, '/wp-content/') ? $value : $upload_dir['baseurl'] . $value;
         }
         // Get the attachment model for the existing file.
         $attachment_id = attachment_url_to_postid($value);
         if ($attachment_id) {
             $this->json['attachment'] = wp_prepare_attachment_for_js($attachment_id);
         }
     }
     //end overload
 }