Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created March 16, 2021 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jchristopher/b600fe61cf34fbdce53f8e78ebdfa1c2 to your computer and use it in GitHub Desktop.
Save jchristopher/b600fe61cf34fbdce53f8e78ebdfa1c2 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