-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathclass-button.php
More file actions
48 lines (41 loc) · 1.09 KB
/
class-button.php
File metadata and controls
48 lines (41 loc) · 1.09 KB
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
<?php
/**
* Submit UI Component.
*
* @package Cloudinary
*/
namespace Cloudinary\UI\Component;
use Cloudinary\UI\Component;
/**
* Class Component
*
* @package Cloudinary\UI
*/
class Button extends Component {
/**
* Holds the components build blueprint.
*
* @var string
*/
protected $blueprint = 'wrap|html_button/|settings/|/wrap';
/**
* Filter the link parts structure.
*
* @param array $struct The array structure.
*
* @return array
*/
protected function html_button( $struct ) {
$struct['element'] = 'button';
$struct['content'] = $this->setting->get_param( 'label', __( 'Save Changes', 'cloudinary' ) );
$struct['attributes']['type'] = $this->type;
$struct['attributes']['name'] = 'submitted_setting';
$struct['attributes']['value'] = $this->setting->get_slug();
$struct['attributes']['id'] = $this->setting->get_slug();
$classes = array(
'button',
);
$struct['attributes']['class'] = array_merge( $classes, (array) $this->setting->get_param( 'style', array( 'button-primary' ) ) );
return $struct;
}
}