Jetpack_Omnisearch_Media

The Jetpack by WordPress.com Jetpack Omnisearch Media class.

Defined (1)

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

/modules/omnisearch/omnisearch-media.php  
  1. class Jetpack_Omnisearch_Media extends WP_Media_List_Table { 
  2. static $instance; 
  3.  
  4. function __construct() { 
  5. self::$instance = $this; 
  6. add_filter( 'omnisearch_results', array( $this, 'search' ), 10, 2 ); 
  7.  
  8. function search( $results, $search_term ) { 
  9. $search_url = esc_url( add_query_arg( 's', $search_term, admin_url( 'upload.php' ) ) ); 
  10. $search_link = sprintf( ' <a href="%s" class="add-new-h2">%s</a>', $search_url, esc_html__( 'Search Media', 'jetpack' ) ); 
  11. $html = '<h2>' . esc_html__( 'Media', 'jetpack' ) . $search_link . '</h2>'; 
  12. parent::__construct(); 
  13.  
  14. ob_start(); 
  15. $this->prepare_items(); 
  16. $columns = $this->get_columns(); 
  17. unset( $columns['cb'] ); 
  18. $this->_column_headers = array( $columns, array(), array() ); 
  19. $this->display(); 
  20. $html .= ob_get_clean(); 
  21.  
  22. $label = __( 'Media', 'jetpack' ); 
  23. $results[ $label ] = $html; 
  24. return $results; 
  25.  
  26. function get_sortable_columns() { 
  27. return array(); 
  28.  
  29. function get_bulk_actions() { 
  30. return array(); 
  31.  
  32. function pagination( $which ) {} 
  33.  
  34. function extra_tablenav( $which ) {}