Excerpt.php
843 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
<?php
namespace ACP\Column\Taxonomy;
use AC;
use ACP\ConditionalFormat;
use ACP\Editing;
/**
* @since 2.0.0
*/
class Excerpt extends AC\Column
implements Editing\Editable, ConditionalFormat\Formattable {
use ConditionalFormat\ConditionalFormatTrait;
public function __construct() {
$this->set_type( 'column-excerpt' );
$this->set_label( __( 'Excerpt', 'codepress-admin-columns' ) );
}
public function get_raw_value( $term_id ) {
return ac_helper()->taxonomy->get_term_field( 'description', $term_id, $this->get_taxonomy() );
}
public function editing() {
return new Editing\Service\Basic(
new Editing\View\TextArea(),
new Editing\Storage\Taxonomy\Field( $this->get_taxonomy(), 'description' )
);
}
public function register_settings() {
$this->add_setting( new AC\Settings\Column\WordLimit( $this ) );
}
}