cl01/wp-content/themes/hester/inc/customizer/controls/pro/class-hester-customizer-control-pro.php
2025-02-24 12:39:24 +08:00

91 lines
3.0 KiB
PHP
Executable File

<?php
if ( ! class_exists( 'Hester_Customizer_Control_Pro' ) ) :
class Hester_Customizer_Control_Pro extends Hester_Customizer_Control {
/**
* The control type.
*
* @var string
*/
public $type = 'hester-pro';
/**
* Pro features
*
* @since 1.1.1
*/
public $features = array();
/**
* Pro theme screenshot
*
* @since 1.1.1
*/
public $screenshot;
/**
* Enqueue control related scripts/styles.
*
* @access public
*/
public function enqueue() {
// Script debug.
$hester_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
// Control type.
$hester_type = str_replace( 'hester-', '', $this->type );
/**
* Enqueue control stylesheet
*/
wp_enqueue_style(
'hester-' . $hester_type . '-control-style',
HESTER_THEME_URI . '/inc/customizer/controls/' . $hester_type . '/' . $hester_type . $hester_suffix . '.css',
false,
HESTER_THEME_VERSION,
'all'
);
}
public function to_json() {
parent::to_json();
$this->json['features'] = $this->features;
$this->json['screenshot'] = $this->screenshot;
}
/**
* Render the content on the theme customizer page
*/
public function content_template() {
$theme = wp_get_theme();?>
<div class="upsell-btn" style="text-align: center;">
<a style="margin: 0 auto 5px;display: inline-block;" href="https://www.peregrine-themes.com/<?php echo esc_attr( strtolower( $theme->name ) ); ?>/?utm_medium=customizer&utm_source=button&utm_campaign=profeatures" target="blank" class="btn btn-success btn"><?php printf( esc_html__( 'Upgrade to %s Pro', 'hester' ), $theme->name ); ?></a>
</div>
<div class="">
<img class="hester_img_responsive " src="{{{ data.screenshot }}}" alt="<?php echo $theme->name . ' Pro'; ?>">
</div>
<div class="">
<h3 style="margin-top:10px;margin-left:20px;text-decoration:underline;color:#111;font-size:16px;"><?php printf( esc_html__( '%s Pro Features', 'hester' ), $theme->name ); ?></h3>
<ul style="padding-top:10px">
<# _.each(data.features, function(feature){ #>
<li class="upsell-hester"> <div class="dashicons dashicons-yes"></div> {{{ feature }}} </li>
<# }); #>
</ul>
</div>
<div class="upsell-btn upsell-btn-bottom" style="text-align: center;">
<a style="margin: 0 auto 5px;display: inline-block;" href="https://www.peregrine-themes.com/<?php echo esc_attr( strtolower( $theme->name ) ); ?>/?utm_medium=customizer&utm_source=button&utm_campaign=profeatures" target="blank" class="btn btn-success btn"><?php printf( esc_html__( 'Upgrade to %s Pro', 'hester' ), $theme->name ); ?></a>
</div>
<p>
<?php
printf( __( 'If you Like our Products , Please Rate us 5 star on %1$sWordPress.org%2$s. We\'d really appreciate it! </br></br> Thank You', 'hester' ), '<a target="" href="https://wordpress.org/support/view/theme-reviews/' . strtolower( $theme->name ) . '?filter=5">', '</a>' );
?>
</p>
<?php
}
}
endif;