HiddenDeprecated.php
736 Bytes
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
<?php
namespace ACA\ACF\Settings\Column;
use AC;
use AC\View;
class HiddenDeprecated extends AC\Settings\Column {
private $value;
public function __construct( AC\Column $column, $setting_name ) {
$this->name = $setting_name;
parent::__construct( $column );
}
protected function define_options() {
return [ $this->name ];
}
public function create_view() {
return new View( [
'class' => '-hidden',
'label' => $this->name,
'setting' => $this->create_element( 'text' ),
] );
}
public function get_value( $option = null ) {
return $this->value;
}
public function set_values( array $values ) {
if ( array_key_exists( $this->name, $values ) ) {
$this->value = $values[ $this->name ];
}
}
}