b0y-101 Mini Shell


Current Path : E:/wordpress/wp-content/themes/spacious/inc/customizer/
File Upload :
Current File : E:/wordpress/wp-content/themes/spacious/inc/customizer/class-spacious-upsell-section.php

<?php

/**
 * Class to include upsell link for theme.
 *
 * Class SPACIOUS_Upsell_Section
 */
class SPACIOUS_Upsell_Section extends WP_Customize_Section {
	public $type = 'spacious-upsell-section';
	public $url = '';
	public $id = '';

	/**
	 * Gather the parameters passed to client JavaScript via JSON.
	 *
	 * @return array The array to be exported to the client as JSON.
	 */
	public function json() {
		$json        = parent::json();
		$json['url'] = esc_url( $this->url );
		$json['id']  = $this->id;

		return $json;
	}

	/**
	 * An Underscore (JS) template for rendering this section.
	 */
	protected function render_template() {
		?>
		<li id="accordion-section-{{ data.id }}"
		    class="spacious-upsell-accordion-section control-section-{{ data.type }} cannot-expand accordion-section">
			<h3 class="accordion-section-title"><a href="{{{ data.url }}}" target="_blank">{{ data.title }}</a></h3>
		</li>
		<?php
	}
}

Copyright © 2019 by b0y-101