Created
May 6, 2019 07:08
-
-
Save hslaszlo/4b754e9900007a044bbd60a6987af5ac to your computer and use it in GitHub Desktop.
remove new woocommerce textual search by sku
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 | |
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