Last active
July 25, 2019 20:44
-
-
Save rafaehlers/2182c05594772af245db630047646428 to your computer and use it in GitHub Desktop.
DataTables ignore the Sort option from View Settings. This code fixes it.
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 //this entire line should be removed when copying this code, before pasting it into your functions.php file | |
/** Remove default order from DataTables */ | |
add_filter( 'gravityview_datatables_js_options', function( $dt_config, $view_id, $post ) { | |
$dt_config['order'] = array(); | |
$dt_config['stateSave'] = false; | |
return $dt_config; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment