Completed
Push — update/add-csstidy-config-sett... ( 30eb4b...0a5859 )
by
unknown
19:15 queued 09:40
created

CSS_Nudge_Customize_Control   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render_content() 0 14 1
1
<?php
2
/**
3
 * CSS_Nudge_Customize_Control file.
4
 * CSS Nudge implementation for Atomic and WPCOM.
5
 *
6
 * @package Jetpack
7
 */
8
9
namespace Automattic\Jetpack\Dashboard_Customizations;
10
11
/**
12
 * Class CSS_Nudge_Customize_Control
13
 *
14
 * @package Automattic\Jetpack\Dashboard_Customizations
15
 */
16
class CSS_Nudge_Customize_Control extends \WP_Customize_Control {
17
18
	/**
19
	 * The type of the nudge.
20
	 *
21
	 * @var string
22
	 */
23
	public $type = 'cssNudge';
24
25
	/**
26
	 * The Call to Action URL.
27
	 *
28
	 * @var string
29
	 */
30
	public $cta_url;
31
32
	/**
33
	 * The nudge text displayed.
34
	 *
35
	 * @var string
36
	 */
37
	public $nudge_copy;
38
39
	/**
40
	 * Render the nudge on the page.
41
	 */
42
	public function render_content() {
43
		$cta_url           = $this->cta_url;
44
		$nudge_copy        = $this->nudge_copy;
45
		$nudge_button_copy = __( 'Upgrade Now', 'jetpack' );
46
47
		echo '<div class="nudge-container">
48
				<p>
49
					' . wp_kses( $nudge_copy, array( 'br' => array() ) ) . '
50
				</p>
51
				<div class="button-container">
52
					<button type="button" class="button-primary navigate-to" data-navigate-to-page="' . esc_url( $cta_url ) . '">' . esc_html( $nudge_button_copy ) . '</button>
53
				</div>
54
			</div>';
55
	}
56
}
57