* @copyright Copyright (c) 2017 - 2017, Satish Gandham */ add_action( 'customize_register', 'helium_drag_drop_control_register', 1 ); function helium_drag_drop_control_register( $wp_customize ) { $wp_customize->register_control_type( 'Helium_Customize_Control_Drag_Drop' ); class Helium_Customize_Control_Drag_Drop extends WP_Customize_Control { public $type = 'he_drag_drop'; public $booom; public function to_json() { parent::to_json(); $this->json['value'] = $this->value(); } /** * Enqueue scripts/styles. * * @since 3.0.0 * @access public * @return void */ public function enqueue() { wp_enqueue_script( 'jquery-ui-draggable' ); wp_enqueue_script( 'jquery-ui-droppable' ); } public function content_template() { ?> <# if ( data.label ) { #> {{{ data.label }}} <# } #>
" onclick="this.select()"/>
<# for ( index in data.value) { #> <# var key = data.value[index]['key']; var value = data.value[index]['value'] #> <# if ( key == 'text') { #>
<# }else {#> <#if(value) { #>
<# }else {#>
<# } #> <# } #> <#if(value) { #> <# }else {#> <# } #>
<#}#>