-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass-ft-google-fonts.php
executable file
·49 lines (48 loc) · 1.33 KB
/
class-ft-google-fonts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Google Fonts Control for the Customizer
*
* @version 1.0.0
* @package WordPress
* @subpackage Customizer
*/
if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'FT_Google_Fonts_Control' ) ) {
class FT_Google_Fonts_Control extends WP_Customize_Control {
/**
* Control Type
*
* @var string
*/
public $type = 'ft-google-fonts';
/**
* Render the control's content
*/
public function render_content() {
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<textarea
class="large-text"
cols="20"
rows="5"
<?php
$this->input_attrs();
$this->link();
?>
>
<?php echo esc_textarea( $this->value() ); ?>
</textarea>
<span class="description customize-control-description">
<p>
<?php echo wp_sprintf( '<p>%s</p><p>%s</p>', __( 'Enter the font family URL string. List each font on a new line.', 'ft-customizer-controls' ), __( 'For example, https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;700&display=swap', 'ft-customizer-controls' ) ); ?>
</p>
</span>
<?php if ( ! empty( $this->description ) ) : ?>
<br />
<span class="description customize-control-description"><?php echo $this->description; ?></span>
<?php endif; ?>
</label>
<?php
}
}
}