Jetpack_Omnisearch_Comments

The Jetpack by WordPress.com Jetpack Omnisearch Comments class.

Defined (1)

The class is defined in the following location(s).

/modules/omnisearch/omnisearch-comments.php  
  1. class Jetpack_Omnisearch_Comments extends WP_Comments_List_Table { 
  2. static $instance; 
  3. public $checkbox = false; 
  4.  
  5. function __construct() { 
  6. self::$instance = $this; 
  7. add_filter( 'omnisearch_results', array( $this, 'search'), 10, 2 ); 
  8.  
  9. function search( $results, $search_term ) { 
  10. $search_url = esc_url( admin_url( sprintf( 'edit-comments.php?s=%s', urlencode( $search_term ) ) ) ); 
  11. $search_link = sprintf( ' <a href="%s" class="add-new-h2">%s</a>', $search_url, esc_html__('Search Comments', 'jetpack') ); 
  12. $html = '<h2>' . esc_html__('Comments', 'jetpack') . $search_link . '</h2>'; 
  13. parent::__construct(); 
  14.  
  15. ob_start(); 
  16. $this->prepare_items(); 
  17. $this->_column_headers = array( $this->get_columns(), array(), array() ); 
  18. $this->display(); 
  19. $html .= ob_get_clean(); 
  20.  
  21. $label = __( 'Comments', 'jetpack' ); 
  22. $results[ $label ] = $html; 
  23. return $results; 
  24.  
  25. function get_per_page( $comment_status = 'all' ) { 
  26. /** This action is documented in modules/omnisearch/omnisearch-core.php */ 
  27. return apply_filters( 'omnisearch_num_results', 5 ); 
  28.  
  29. function get_sortable_columns() { 
  30. return array(); 
  31.  
  32. function get_bulk_actions() { 
  33. return array(); 
  34.  
  35. function pagination( $which ) {} 
  36.  
  37. function extra_tablenav( $which ) {}