Created
August 20, 2015 14:23
-
-
Save SirDarcanos/46d8f085258606f4bf27 to your computer and use it in GitHub Desktop.
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
function temporary_fix_product_search( $where ) { | |
global $pagenow, $wpdb, $wp; | |
if ( 'edit.php' != $pagenow || ! is_search() || ! isset( $wp->query_vars['s'] ) || 'product' != $wp->query_vars['post_type'] ) { | |
return $where; | |
} | |
$where = str_replace( "post_type = ' '", "post_type = 'product'", $where ); | |
return $where; | |
} | |
add_filter( 'posts_search', 'temporary_fix_product_search', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment