Meta.php
657 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
<?php
namespace ACP\Editing\Model;
use AC;
use ACP\Editing\Model;
/**
* @deprecated 5.6
*/
class Meta extends Model {
/**
* @var AC\Column\Meta
*/
protected $column;
public function __construct( AC\Column\Meta $column ) {
parent::__construct( $column );
}
public function get_view_settings() {
return [
'type' => 'text',
'placeholder' => $this->column->get_label(),
];
}
/**
* @param int $id
* @param string|array $value
*
* @return bool
*/
public function save( $id, $value ) {
return false !== update_metadata( $this->column->get_meta_type(), $id, $this->column->get_meta_key(), $value );
}
}