class-comment-meta.php
5 months ago
class-comment.php
5 months ago
class-meta.php
5 months ago
class-options.php
5 months ago
class-post-meta.php
5 months ago
class-post.php
5 months ago
class-terms.php
4 months ago
class-user-meta.php
5 months ago
class-user.php
5 months ago
class-comment-meta.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SearchRegex\Source\Core; |
| 4 | |
| 5 | use SearchRegex\Source; |
| 6 | |
| 7 | class Comment_Meta extends Meta { |
| 8 | public function get_table_name() { |
| 9 | global $wpdb; |
| 10 | |
| 11 | return $wpdb->commentmeta; |
| 12 | } |
| 13 | |
| 14 | public function get_meta_object_id() { |
| 15 | return 'comment_id'; |
| 16 | } |
| 17 | |
| 18 | public function get_meta_table() { |
| 19 | return 'comment'; |
| 20 | } |
| 21 | |
| 22 | public function get_meta_name() { |
| 23 | return __( 'Comment Meta', 'search-regex' ); |
| 24 | } |
| 25 | |
| 26 | public function autocomplete( array $column, $value ) { |
| 27 | if ( $column['column'] === $this->get_meta_object_id() ) { |
| 28 | return Source\Autocomplete::get_comment( $value ); |
| 29 | } |
| 30 | |
| 31 | return parent::autocomplete( $column, $value ); |
| 32 | } |
| 33 | } |
| 34 |