register_section_type( 'Pet_Animal_Store_Customizer_Upsell_Section' ); parent::__construct( $manager, $id, $args ); } /** * Add custom parameters to pass to the JS via JSON. */ public function json() { $json = parent::json(); $json['button_text'] = esc_html( $this->button_text ); $json['button_url'] = esc_url( $this->button_url ); $json['options'] = $this->options; $json['explained_features'] = $this->explained_features; return $json; } /** * Outputs the Underscore.js template. */ protected function render_template() { ?>
<# if ( data.options.length > 0 ) { #> <# } #> <# if ( data.button_text && data.button_url ) { #> {{ data.button_text }} <# } #> <# if ( data.explained_features.length > 0 ) { #>
<# } #>