QueryColumn.php
24 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Meta; |
| 4 | |
| 5 | use AC\Column; |
| 6 | |
| 7 | class QueryColumn extends Query { |
| 8 | |
| 9 | /** |
| 10 | * @param Column $column |
| 11 | */ |
| 12 | public function __construct( Column $column ) { |
| 13 | parent::__construct( $column->get_list_screen()->get_meta_type() ); |
| 14 | |
| 15 | if ( $column instanceof Column\Meta ) { |
| 16 | $this->join_where( 'meta_key', $column->get_meta_key() ); |
| 17 | } |
| 18 | |
| 19 | if ( $column->get_post_type() ) { |
| 20 | $this->where_post_type( $column->get_post_type() ); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | } |