choices; $saved_services = $this->value(); //make sure we have new services in list if there were added some new since last save $new_services = array_diff_key($available_services, $saved_services); if(count($new_services) > 0){ foreach($new_services as $id => $name){ $saved_services[$id] = ''; } } $this->json['available_services'] = $available_services; $this->json['saved_services'] = $saved_services; } /** * Don't render any content for this control from PHP. * * @see Barter_A13_Customize_Socials_Control::content_template() */ public function render_content() {} /** * Render a JS template for the content of the socials control. * */ public function content_template() { ?> <# var id_prefix = _.uniqueId( 'el' ) + '-'; #> <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>
<# _.each( data.saved_services, function( value, index ) { if( index === '__last_edit'){ return; } #>
<# } ); #>