Site icon Hip-Hop Website Design and Development

Utilizing WP_List_Table and search_box(): Paginate the Discovered Search Outcomes When Sending by Technique «Publish»?

I’m utilizing a customized WP_List_Table-Class with a view to show a customized desk with motels within the dashboard. I can skip by the pages with the pagination on the highest proper as anticipated.

The search type can also be added with

$my_list_table_instance->search_box( 'Search', 'search_id' );

and it’s working high-quality, however just for the primary web page.

Inside the shape, I’ve the 2 hidden fields for the pagination:

// Record and type output
$web page  = filter_input( INPUT_GET, 'web page', FILTER_SANITIZE_STRIPPED );
$paged = filter_input( INPUT_GET, 'paged', FILTER_SANITIZE_NUMBER_INT );
echo '<type methodology="put up" id="list-hotels-form">';
printf( '<enter sort="hidden" title="web page" worth="%s" />', $web page );
printf( '<enter sort="hidden" title="paged" worth="%d" />', $paged );
$hotel_table->prepare_items();
$hotel_table->search_box( __( 'Search Resorts', 'uruk' ), 'search_id' );
$hotel_table->show();
echo '</type>';
// ...

The Downside

When sending the search type by put up methodology, I don’t get a (unaesthetically) lengthy question string. The search phrases are inserted into the search type once more, however they aren’t appended to the pagination hyperlinks. So when skipping to the next web page of outcomes, I lose the search phrases.

My Query(s)