PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.2.0
Kirki – Freeform Page Builder, Website Builder & Customizer v6.2.0
6.2.2 6.2.1 6.2.0 6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / customizer / packages / controls / headline-divider / src / Control / Divider.php
kirki / customizer / packages / controls / headline-divider / src / Control Last commit date
Divider.php 6 months ago Headline.php 4 months ago HeadlineToggle.php 6 months ago
Divider.php
79 lines
1 <?php
2 /**
3 * Customizer Control: kirki-divider.
4 *
5 * @package kirki-divider
6 * @since 1.0
7 */
8
9 namespace Kirki\Control;
10
11 use Kirki\Control\Base;
12
13 // Exit if accessed directly.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 /**
19 * Divider control
20 */
21 class Divider extends Base {
22
23 /**
24 * The control type.
25 *
26 * @since 1.0
27 * @var string
28 */
29 public $type = 'kirki-divider';
30
31 /**
32 * The version. Used in scripts & styles for cache-busting.
33 *
34 * @since 1.0
35 * @var string
36 */
37 public static $control_ver = '1.0';
38
39 /**
40 * Refresh the parameters passed to the JavaScript via JSON.
41 *
42 * @access public
43 * @since 1.0
44 * @see WP_Customize_Control::to_json()
45 * @return void
46 */
47 public function to_json() {
48
49 // Get the basics from the parent class.
50 parent::to_json();
51
52 $border_top_color = isset( $this->choices ) && isset( $this->choices['color'] ) ? esc_attr( $this->choices['color'] ) : '#ccc';
53 $border_bottom_color = '#f8f8f8';
54
55 $this->json['choices']['borderTopColor'] = $border_top_color;
56 $this->json['choices']['borderBottomColor'] = $border_bottom_color;
57
58 }
59
60 /**
61 * An Underscore (JS) template for this control's content (but not its container).
62 *
63 * Class variables for this control class are available in the `data` JS object;
64 * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
65 *
66 * @see WP_Customize_Control::print_template()
67 * @since 1.0
68 */
69 protected function content_template() {
70 ?>
71
72 <hr style="border-top: 1px solid {{ data.choices.borderTopColor }}; border-bottom: 1px solid {{ data.choices.borderBottomColor }}" />
73
74 <?php
75
76 }
77
78 }
79