Created
March 16, 2021 12:54
-
-
Save jchristopher/b600fe61cf34fbdce53f8e78ebdfa1c2 to your computer and use it in GitHub Desktop.
Enable full wpDataTables table Shortcode parsing when SearchWP indexer is running
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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