public function postmessage() {
		wp_enqueue_script( 'kirki_auto_css_vars', URL::get_from_path( __DIR__ . '/script.js' ), [ 'jquery', 'customize-preview' ], KIRKI_VERSION, true );
		$fields = array_merge( Kirki::$fields, $this->fields );
		$data   = [];
		foreach ( $fields as $field ) {
			if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['css_vars'] ) && ! empty( $field['css_vars'] ) ) {
				$data[] = $field;
			}
		}
		wp_localize_script( 'kirki_auto_css_vars', 'kirkiCssVarFields', $data );
	}
public function postmessage() {
		wp_enqueue_script( 'kirki_auto_css_vars', URL::get_from_path( __DIR__ . '/script.js' ), [ 'jquery', 'customize-preview' ], KIRKI_VERSION, true );
		$fields = array_merge( Kirki::$fields, $this->fields );
		$data   = [];
		foreach ( $fields as $field ) {
			if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['css_vars'] ) && ! empty( $field['css_vars'] ) ) {
				$data[] = $field;
			}
		}
		wp_localize_script( 'kirki_auto_css_vars', 'kirkiCssVarFields', $data );
	}
public function postmessage ( ) { wp_enqueue_script ( 'kirki_auto_css_vars' , URL :: get_from_path ( __DIR__ . '/script.js' ) , [ 'jquery' , 'customize-preview' ] , KIRKI_VERSION , true ) ; $ fields = array_merge ( Kirki :: $ fields , $ this -> fields ) ; $ data = [ ] ; foreach ( $ fields as $ field ) { if ( isset ( $ field [ 'transport' ] ) && 'postMessage' === $ field [ 'transport' ] && isset ( $ field [ 'css_vars' ] ) && ! empty ( $ field [ 'css_vars' ] ) ) { $ data [ ] = $ field ; } } wp_localize_script ( 'kirki_auto_css_vars' , 'kirkiCssVarFields' , $ data ) ; }
Enqueues the script that handles postMessage
and adds variables to it using the wp_localize_script function.
The rest is handled via JS.

@access public
@since 3.0.28
@return void
Enqueues the script that handles postMessage and adds variables to it using the wp_localize_script function . The rest is handled via JS .