%s', $search_url, esc_html__('Search Plugins', 'jetpack') );
$html = '
' . esc_html__('Plugins', 'jetpack') . $search_link . '
';
$html .= '' . esc_html__('Loading …', 'jetpack') . '
';
$html .= '';
$label = __( 'Plugins', 'jetpack' );
$results[ $label ] = $html;
return $results;
}
function results_html( $search_term, $num_results = null ) {
$_GET['tab'] = 'search';
$GLOBALS['hook_suffix'] = 'foo';
$_REQUEST['s'] = $search_term;
parent::__construct();
ob_start();
$this->prepare_items();
/** This action is documented in modules/omnisearch/omnisearch-core.php */
$num_results = intval( $num_results ) ? intval( $num_results ) : apply_filters( 'omnisearch_num_results', 5 );
$this->items = array_slice( $this->items, 0, $num_results );
remove_action( 'install_plugins_table_header', 'install_search_form' );
$this->display();
$html = ob_get_clean();
return $html;
}
function wp_ajax_omnisearch_plugins() {
$search_term = $_REQUEST['search_term'];
$num_results = isset( $_REQUEST['num_results'] ) ? $_REQUEST['num_results'] : null;
echo $this->results_html( $search_term, $num_results );
exit;
}
function get_bulk_actions() {
return array();
}
function pagination( $which ) {}
}