Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save BrElio/31a2410b9bdff4f8117a525e0c154158 to your computer and use it in GitHub Desktop.

Select an option

Save BrElio/31a2410b9bdff4f8117a525e0c154158 to your computer and use it in GitHub Desktop.
Enable full wpDataTables table Shortcode parsing when SearchWP indexer is running
<?php
// wpDataTables compatibility with SearchWP. Retrieve entire data table
// if the indexer is running (regardless of wpDataTables settings) to ensure
// all wpDataTables Shortcode content is indexed when parsing Shortcodes.
add_filter( 'wpdatatables_filter_table_metadata', function( $data, $table_id ) {
if ( did_action( 'searchwp\indexer\batch' ) ) {
$data->pagination = false;
$data->showAllRows = true;
$data->server_side = false;
$data->editable = false;
}
return $data;
}, 9999, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment