laipower/wp-content/plugins/gp-premium/library/customizer/controls/class-information-control.php

43 lines
930 B
PHP
Raw Normal View History

2020-04-07 13:03:04 +00:00
<?php
// No direct access, please
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'GeneratePress_Information_Customize_Control' ) ) :
/**
* Add a control to display simple text
*/
class GeneratePress_Information_Customize_Control extends WP_Customize_Control {
public $type = 'gp_information_control';
2020-04-07 13:03:04 +00:00
public $description = '';
public $notice = '';
2020-04-07 13:03:04 +00:00
public function to_json() {
parent::to_json();
$this->json['description'] = $this->description;
$this->json['notice'] = $this->notice;
2020-04-07 13:03:04 +00:00
}
2020-04-07 13:03:04 +00:00
public function content_template() {
?>
<# if ( data.notice ) { #>
<div class="notice notice-info">
<# } #>
2020-04-07 13:03:04 +00:00
<# if ( data.label ) { #>
<span class="customize-control-title">{{ data.label }}</span>
<# } #>
<# if ( data.description ) { #>
<p>{{{ data.description }}}</p>
<# } #>
<# if ( data.notice ) { #>
</div>
<# } #>
2020-04-07 13:03:04 +00:00
<?php
}
}
endif;