HEX
Server: LiteSpeed
System: Linux sg-cp4.cloudnetwork.vn 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64
User: thu28850 (1134)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/thu28850/public_html/wp-content/plugins/kirki/kirki-packages/control-editor/src/control.js
import "./control.scss";

/* global tinyMCE */
wp.customize.controlConstructor[ 'kirki-editor' ] = wp.customize.kirkiDynamicControl.extend( {
	initKirkiControl: function( control ) {
		var element, editor, id, defaultParams;
		control = control || this;
		element = control.container.find( 'textarea' );
		id      = 'kirki-editor-' + control.id.replace( '[', '' ).replace( ']', '' );

		defaultParams = {
			tinymce: {
				wpautop: true
			},
			quicktags: true,
			mediaButtons: true
		};

		// Overwrite the default paramaters if choices is defined.
		if ( wp.editor && wp.editor.initialize ) {
			wp.editor.initialize( id, jQuery.extend( {}, defaultParams, control.params.choices ) );
		}

		editor = tinyMCE.get( id );

		if ( editor ) {
			editor.onChange.add( function( ed ) {
				var content;

				ed.save();
				content = editor.getContent();
				element.val( content ).trigger( 'change' );
				wp.customize.instance( control.id ).set( content );
			} );
		}
	}
} );