Skip to content

Instantly share code, notes, and snippets.

@hslaszlo
Created May 6, 2019 07:08
Show Gist options
  • Save hslaszlo/4b754e9900007a044bbd60a6987af5ac to your computer and use it in GitHub Desktop.
Save hslaszlo/4b754e9900007a044bbd60a6987af5ac to your computer and use it in GitHub Desktop.
remove new woocommerce textual search by sku
<?php
add_filter( 'request', function($query_vars) {
global $wp_filter;
foreach($wp_filter['request']->callbacks as $priority=>$callbacks) {
foreach($callbacks as $unique_id=>$filter_array) {
if ( is_array($filter_array['function']) && is_object( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) == 'WC_Admin_List_Table_Products' && $filter_array['function'][1] == 'request_query' ) {
unset( $wp_filter['request']->callbacks[ $priority ][ $unique_id ] );
}
}
}
return $query_vars;
},9,1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment