javascript - Change iDisplayLength in wpDataTables -
on my site using plugin wpdatatables (based on jquery datatables). example, when type hb
search field, 10
results (prices) need 6
.
so want change idisplaylengt
h 10
6
it's not working suggested @ datatables.net
here front-end callbacks via js. possible via these front-end callbacks?
watch video on using filters , actions author of wpdatatables explains how want.
basically need add following code functions.php
of wordpress theme.
please note code affect tables on site. if want target specific table need change idisplaylength
param when $table_id
equals table id.
function mytheme_wpdatatables_filter_table_description($object, $table_id){ $object->datatableparams->idisplaylength = 6; return $object; } add_filter('wpdatatables_filter_table_description', 'mytheme_wpdatatables_filter_table_description', 10, 2);
Comments
Post a Comment