Forked from jchristopher/searchwp-customizations.php
Created
August 23, 2022 11:08
-
-
Save BrElio/31a2410b9bdff4f8117a525e0c154158 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