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 } /** * Render a JS template for the content of the media control. * * @since 3.4.19 * @package Customizr * * @Override * @see WP_Customize_Control::content_template() */ public function content_template() { ?> <# if ( data.title ) { #>

{{{ data.title }}}

<# } #> <# if ( data.notice ) { #> {{{ data.notice }}} <# } #>