add_control( new Beetan_Customize_TinyMCE_Control( $wp_customize, 'id', array( 'label' => esc_html__( 'Label', 'beetan' ), 'description' => esc_html__( 'Description', 'beetan' ), 'section' => 'section', 'required' => array( 'abcd' ) ) ) );*/ if ( ! class_exists( 'Beetan_Customize_TinyMCE_Control' ) ): class Beetan_Customize_TinyMCE_Control extends WP_Customize_Control { public $type = 'tinymce'; private $placeholder; private $extras = array(); private $required = array(); public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); $this->placeholder = isset( $args[ 'placeholder' ] ) ? $args[ 'placeholder' ] : ''; $this->extras = isset( $args[ 'extras' ] ) ? $args[ 'extras' ] : array(); $this->required = isset( $args[ 'required' ] ) ? $args[ 'required' ] : array(); if ( ! isset( $this->extras[ 'id' ] ) ) { $this->extras[ 'id' ] = $id; } } public function to_json() { parent::to_json(); $this->json[ 'placeholder' ] = $this->placeholder; $this->json[ 'extras' ] = $this->extras; $this->json[ 'required' ] = $this->required; } public function enqueue() { $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_media(); wp_enqueue_editor(); wp_enqueue_script( 'customize-tinymce-control', esc_url( get_theme_file_uri( "/assets/js/customize-tinymce-control$suffix.js" ) ), array( 'jquery' ), FALSE, TRUE ); } protected function render_content() { ?>