Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Enable full wpDataTables table Shortcode parsing when SearchWP indexer is running
// 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