first commit

This commit is contained in:
2023-09-08 01:45:46 -07:00
commit 8cbf53172b
108 changed files with 29005 additions and 0 deletions

View File

@ -0,0 +1,72 @@
<?php
/**
* Customize control upsell class.
*
* @package PressBook
*/
if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'PressBook_Upsell_Control' ) ) {
/**
* Create in-section upsell control.
* Escape URL in the Customizer using esc_url().
*/
class PressBook_Upsell_Control extends WP_Customize_Control {
/**
* The type of customize control being rendered.
*
* @var string
*/
public $type = 'pressbook-addon';
/**
* Custom button URL to output.
*
* @var string
*/
public $url = '';
/**
* Description of control.
*
* @var string
*/
public $description = '';
/**
* Label of control.
*
* @var string
*/
public $label = '';
/**
* Load the CSS.
*/
public function enqueue() {
wp_enqueue_style( 'pressbook-customize-section-button', get_theme_file_uri( 'inc/customize-controls.css' ), array(), PRESSBOOK_VERSION );
}
/**
* Add custom parameters to pass to the JS via JSON.
*/
public function to_json() {
parent::to_json();
$this->json['url'] = esc_url( $this->url );
}
/**
* Outputs the template.
*
* @return void
*/
public function content_template() {
?>
<p class="description">{{{ data.description }}}</p>
<span class="get-addon">
<a href="{{{ data.url }}}" class="button button-primary" target="_blank">{{ data.label }}</a>
</span>
<?php
}
}
}