Response.php
778 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 AC\Column\Comment;
use AC\Column;
/**
* @since 3.0
*/
class Response extends Column {
public function __construct() {
$this->set_type( 'response' );
$this->set_original( true );
}
public function register_settings() {
$this->get_setting( 'width' )->set_default( 15 );
}
/**
* Response Column should not be displayed when viewing "Comments On".
* The list table does this by checking if $post_id is set globally. We mimic this functionality here.
* @see WP_Comments_List_Table::get_columns() for the WP implementation
*/
public function is_valid() {
global $current_screen, $post_id;
if ( $current_screen && $this->get_list_screen()->is_current_screen( $current_screen ) && $post_id ) {
return false;
}
return true;
}
}