Last active
September 29, 2022 16:16
-
-
Save zackkatz/fa7fadfe869590d85d314bcf5353554c to your computer and use it in GitHub Desktop.
GravityView DataTables - Remove the page length, pagination menus, and search field
This file contains 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 // DO NOT COPY THIS LINE!!!!! | |
add_filter( 'gravityview_datatables_js_options', 'gv_dt_disable_paging_search_and_length_menus', 10, 3 ); | |
/** | |
* Remove the page length, pagination menus, and search field from DataTables | |
* @param array $dt_config DataTables options | |
* @param int $view_id View ID | |
* @param WP_Post $post Current WordPress post object | |
* | |
* @return mixed | |
*/ | |
function gv_dt_disable_paging_search_and_length_menus( $dt_config ) { | |
$dt_config['lengthChange'] = false; | |
$dt_config['paging'] = false; | |
$dt_config['searching'] = false; | |
return $dt_config; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment