Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save codersaiful/88e16ea4b24d97413b592f8d1f9ac1ec to your computer and use it in GitHub Desktop.
Save codersaiful/88e16ea4b24d97413b592f8d1f9ac1ec to your computer and use it in GitHub Desktop.
/**
* Add following Code at your functions.php file of your child theme
* OR
* Add following code using code snippet
* OR
* Add code in your custom plugin.
*
* This is specially for Woo Product Table Mini Filter
* Search option. Actually here
* need select to plugin. But in our poduct table, We had to disable select2 for mini filter.
* because it was making an error when enable casecade filter.
*
* So we should decided to remove for mini filter.
* Specially for Miodrag I have fixed it
* using following filter hook
* I added custom javascript code at the footer
*
* @author Saiful Islam <[email protected]>
* @website https://codeastrology.com
* @link https://fb.com/codersaiful
* @WhatsApp +8801724025412
*/
add_action('wp_footer','wpt_custom_enable_select_for_minifilter');
function wpt_custom_enable_select_for_minifilter(){
?>
<script>
jQuery(function($) {
'use strict';
$(document).ready(function() {
setTimeout(function(){
if(typeof $('select.filter_select.filter').select2 !== 'function') return;
$('select.filter_select.filter').select2();
},1000);
});
});
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment